提交 bea24f63 authored 作者: 王天霸's avatar 王天霸

Merge branch 'dev_hxz' into test

...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
tagOptions: [ tagOptions: [
{id: 2, tag: "假一赔十"}, {id: 2, tag: "假一赔十"},
{id: 3, tag: "7天退换"}, {id: 3, tag: "7天退换"},
{id: 4, tag: "不可退"}, {id: 4, tag: "不可退"},
{id: 5, tag: "厂家直供"}, {id: 5, tag: "厂家直供"},
{id: 6, tag: "售后无忧"} {id: 6, tag: "售后无忧"}
], ],
...@@ -79,8 +79,10 @@ ...@@ -79,8 +79,10 @@
}, },
mounted() { mounted() {
this.getFreightData(); this.getFreightData();
console.log('售后数据:',this.goodsaftersale); //console.log('售后数据:',this.goodsaftersale);
if(this.goodsaftersale && this.goodsaftersale.stags.length > 0) {
this.goodsAfterSaleForm = this.goodsaftersale; this.goodsAfterSaleForm = this.goodsaftersale;
}
}, },
methods: { methods: {
// 运费模板 // 运费模板
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<el-form-item label='商品关键词:' prop="goods_des"> <el-form-item label='商品关键词:' prop="goods_des">
<el-input v-model="goodsInfoForm.goods_des" placeholder="请输入商品关键词" style="width:420px;"></el-input> <el-input v-model="goodsInfoForm.goods_des" placeholder="请输入商品关键词" style="width:420px;"></el-input>
<span class="tip-span ml20">关键词之间 <strong>英文</strong> 用逗号分开,最多可以添加5个</span> <span class="tip-span ml20">关键词之间<strong>英文逗号</strong> 分开,最多可以添加5个</span>
</el-form-item> </el-form-item>
<el-form-item label="商品产地:" prop="producing_area"> <el-form-item label="商品产地:" prop="producing_area">
...@@ -132,6 +132,27 @@ ...@@ -132,6 +132,27 @@
callback(); callback();
} }
}; };
let goodsDecCheck = (rule, value, callback) => {
if(!value) {
callback(new Error("商品关键词,不能为空"));
} else {
if( value.indexOf(',') > -1 ) {
callback(new Error("商品关键词,不能有中文状态下的逗号,请再次检查"));
}
// 如果包含了,英文逗号,说明有多个,就校验个数
if( value.indexOf(',') > -1 ) {
let arrLength = value.split(',').length;
console.log(value.split(','));
if(arrLength > 5) {
callback(new Error("商品关键词,不能超过5个"));
}else {
callback();
}
}else {
callback();
}
}
}
return { return {
//loading: false, //loading: false,
// categoryStr: '', // categoryStr: '',
...@@ -159,7 +180,7 @@ ...@@ -159,7 +180,7 @@
{required: true, message: '请输入商品名称', trigger: 'blur'}, {required: true, message: '请输入商品名称', trigger: 'blur'},
{min: 3, max: 30, message: '商品标题限制在3字符以上,30个字符以下', trigger: 'blur'} {min: 3, max: 30, message: '商品标题限制在3字符以上,30个字符以下', trigger: 'blur'}
], ],
goods_des: [{required: true, message: '商品关键词不能为空', trigger: 'blur'}], goods_des: [{required: true, validator: goodsDecCheck, trigger: 'blur'}],
producing_area:[{required: true, message: '请选择商品产地', trigger: 'change'}], producing_area:[{required: true, message: '请选择商品产地', trigger: 'change'}],
deliver_area: [{required: true, message: '请选择商品发货地', trigger: 'change'}], deliver_area: [{required: true, message: '请选择商品发货地', trigger: 'change'}],
unit: [{required: true, message: '商品单位不能为空', trigger: 'blur'}], unit: [{required: true, message: '商品单位不能为空', trigger: 'blur'}],
...@@ -231,9 +252,6 @@ ...@@ -231,9 +252,6 @@
this.goodsInfoForm.categoryStr = this.goodsinfodata.categoryStr; this.goodsInfoForm.categoryStr = this.goodsinfodata.categoryStr;
this.goodsInfoForm.categoryList = this.goodsinfodata.categoryList; this.goodsInfoForm.categoryList = this.goodsinfodata.categoryList;
} }
//console.log("tup",this.goodsImgFileList) //console.log("tup",this.goodsImgFileList)
// 获取 省 // 获取 省
this.getArea(); this.getArea();
...@@ -336,7 +354,7 @@ ...@@ -336,7 +354,7 @@
}, },
// 上传 商品图片,限制 9 // 上传 商品图片,限制 5
limitImg5() { limitImg5() {
this.$message({ message: '最多上传5张图片', type: 'warning' }) this.$message({ message: '最多上传5张图片', type: 'warning' })
}, },
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<el-table-column align="center" prop="sl_price" label="结算价"> <el-table-column align="center" prop="sl_price" label="结算价">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-input size="mini" style="width:90%" v-model="scope.row.sl_price" :disabled="true" placeholder="根据结算价自动计算"></el-input>--> <!-- <el-input size="mini" style="width:90%" v-model="scope.row.sl_price" :disabled="true" placeholder="根据结算价自动计算"></el-input>-->
<span>{{ scope.row.sl_price = scope.row.js_price ? scope.row.js_price : '' }}</span> <span class="sl-price-span-input">{{ scope.row.sl_price = scope.row.js_price ? scope.row.js_price : '' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="price" label="指导价"> <el-table-column align="center" prop="price" label="指导价">
...@@ -44,22 +44,23 @@ ...@@ -44,22 +44,23 @@
<el-input size="mini" style="width:90%" v-model="scope.row.weight" placeholder="请输入重量"></el-input> <el-input size="mini" style="width:90%" v-model="scope.row.weight" placeholder="请输入重量"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="imgs9" label="图片">
<template slot-scope="scope"> <!-- <el-table-column align="center" prop="imgs9" label="图片">-->
<!--------------> <!-- <template slot-scope="scope">-->
<el-upload <!-- &lt;!&ndash;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&ndash;&gt;-->
action="/" <!-- <el-upload-->
class="uploadData50" <!-- action="/"-->
list-type="picture-card" <!-- class="uploadData50"-->
:limit="5" <!-- list-type="picture-card"-->
:on-exceed="limit5" <!-- :limit="5"-->
:file-list="singleSpecImgList" <!-- :on-exceed="limit5"-->
:http-request="(file)=> { return upLoadSingleSpecImg(file,scope.row) }" <!-- :file-list="singleSpecImgList"-->
:on-remove=" (file) => { return removeSingleSpeImg(file,scope.row)}" <!-- :http-request="(file)=> { return upLoadSingleSpecImg(file,scope.row) }"-->
></el-upload> <!-- :on-remove=" (file) => { return removeSingleSpeImg(file,scope.row)}"-->
<!--------------> <!-- ></el-upload>-->
</template> <!-- &lt;!&ndash;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&ndash;&gt;-->
</el-table-column> <!-- </template>-->
<!-- </el-table-column>-->
</el-table> </el-table>
</div> </div>
...@@ -88,7 +89,7 @@ ...@@ -88,7 +89,7 @@
<el-table-column align="center" prop="sl_price" label="结算价"> <el-table-column align="center" prop="sl_price" label="结算价">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <el-input size="mini" style="width:90%" v-model="scope.row.hh2" :disabled="true" placeholder="根据结算价自动计算"></el-input>--> <!-- <el-input size="mini" style="width:90%" v-model="scope.row.hh2" :disabled="true" placeholder="根据结算价自动计算"></el-input>-->
<span>{{ scope.row.sl_price = scope.row.js_price ? scope.row.js_price : '' }}</span> <span class="sl-price-span-input">{{ scope.row.sl_price = scope.row.js_price ? scope.row.js_price : '' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="price" label="指导价"> <el-table-column align="center" prop="price" label="指导价">
...@@ -152,23 +153,6 @@ export default { ...@@ -152,23 +153,6 @@ export default {
orgGoodsPam: {}, orgGoodsPam: {},
preTableTitle: [], preTableTitle: [],
isHoverSpeImg: false, isHoverSpeImg: false,
// goodsPam:[
// {
// speNameList:[ '颜色','尺码' ],
// goodsParametersList: [],
// goodsPamPreTable: [{
// hh1: '',
// hh2: '',
// hh3: '',
// hh4: '',
// hh5: '',
// hh6: '',
// hh7: '',
// }],
// },
// ],
// goodsPamPreTable: [],
// goodsPamPreObj:
/** 无规格 数据 */ /** 无规格 数据 */
singleSpecTable: [ singleSpecTable: [
{ {
...@@ -178,7 +162,6 @@ export default { ...@@ -178,7 +162,6 @@ export default {
sc_price: '', // 市场价 sc_price: '', // 市场价
stock: '', // 库存 stock: '', // 库存
weight: '', // 重量 g weight: '', // 重量 g
imgs9: [], // 图片
} }
], ],
singleSpecImgList: [], singleSpecImgList: [],
...@@ -188,16 +171,17 @@ export default { ...@@ -188,16 +171,17 @@ export default {
'parameterdata': function(val) { 'parameterdata': function(val) {
//debugger //debugger
this.orgGoodsPam = val; this.orgGoodsPam = val;
console.log("监听",this.orgGoodsPam);
// this.orgGoodsPam
//console.log(175,this.orgGoodsPam);
}, },
}, },
created() { created() {
//this.orgGoodsPam = this.parameterdata; //this.orgGoodsPam = this.parameterdata;
}, },
mounted() { mounted() {
//console.log("9999",this.goodsPamPreList); console.log("加载后,",this.parameterdata);
if(this.parameterdata.singleSpecTable && this.parameterdata.singleSpecTable.length > 0) {
this.singleSpecTable = this.parameterdata.singleSpecTable;
}
}, },
methods: { methods: {
// ------ 无规格,上传图片相关 ------ // ------ 无规格,上传图片相关 ------
...@@ -405,6 +389,17 @@ p { ...@@ -405,6 +389,17 @@ p {
margin: 25px 0; margin: 25px 0;
} }
.sl-price-span-input {
display: inline-block;
width: 90%;
height: 28px;
padding: 0 15px;
line-height : 28px;
border-radius : 4px;
border : 1px solid #DCDFE6;
vertical-align : bottom;
}
/* 一般提示性文字 */ /* 一般提示性文字 */
.tip-span { .tip-span {
color: #909399; color: #909399;
......
...@@ -110,18 +110,21 @@ export default { ...@@ -110,18 +110,21 @@ export default {
}; };
}, },
created() { created() {
this.$set(this.specsGroup.spec_value,this.specsGroup.spec_value.length,this.speParamName);
this.speData = [];
this.$set(this.speData,this.speData.length,this.specsGroup);
}, },
mounted() { mounted() {
/** 先获取 本地存储的localStorage **/ /** 先获取 本地存储的localStorage **/
this.getLocalSpecNameOption(); this.getLocalSpecNameOption();
// this.speData = []; // 先判断是新增还是修改
// this.$set(this.speData,this.speData.length,this.specsGroup); //console.log(123,this.specificationsdata)
// console.log(123,this.specificationsdata) if(this.specificationsdata.length === 0) {
this.$set(this.specsGroup.spec_value,this.specsGroup.spec_value.length,this.speParamName);
this.speData = [];
this.$set(this.speData,this.speData.length,this.specsGroup);
}else {
this.speData = this.specificationsdata; this.speData = this.specificationsdata;
this.$forceUpdate() this.$forceUpdate()
}
}, },
watch:{ watch:{
// "speData.specsGroup": { // "speData.specsGroup": {
......
...@@ -133,7 +133,10 @@ ...@@ -133,7 +133,10 @@
specificationsdata: [], specificationsdata: [],
/* 商品售价 */ /* 商品售价 */
parameterdata: { parameterdata: {
pamDataList: [],
pamNameList: [],
pamTableList: [],
singleSpecTable: []
}, },
/* 商品详情 */ /* 商品详情 */
imgdata: { imgdata: {
...@@ -159,7 +162,7 @@ ...@@ -159,7 +162,7 @@
if( this.option && this.option !== 0 ) { if( this.option && this.option !== 0 ) {
let data = { goodsId: this.option}; let data = { goodsId: this.option};
getGoodsNew(data).then(res => { getGoodsNew(data).then(res => {
console.log("编辑接口返回", res); //console.log("编辑接口返回", res);
if(res.data) { if(res.data) {
this.isShowGoodsDetails = true; this.isShowGoodsDetails = true;
// 商品信息 // 商品信息
...@@ -189,6 +192,40 @@ ...@@ -189,6 +192,40 @@
if(res.data.specs && res.data.specs.length > 0) { if(res.data.specs && res.data.specs.length > 0) {
this.specificationsdata = res.data.specs; this.specificationsdata = res.data.specs;
} }
// 商品售价
if(res.data.specs_group && res.data.specs_group.length > 0) {
//this.parameterdata
let prePriceArr = [];
this.parameterdata.pamTableList = [];
res.data.specs_group.forEach((item,index)=> {
prePriceArr = [];
prePriceArr.push(item);
this.parameterdata.pamTableList[index] = prePriceArr.push(item);
})
}else {
this.parameterdata.pamTableList = [];
let singleSpecObj = {
js_price:'',
sl_price:'',
price:'',
sc_price:'',
stock:'',
weight:'',
}
this.parameterdata.singleSpecTable = [];
singleSpecObj.js_price = res.data.js_price * 100;
singleSpecObj.sl_price = res.data.js_price * 100;
singleSpecObj.price = res.data.price * 100;
singleSpecObj.sc_price = res.data.sc_price * 100;
singleSpecObj.stock = res.data.stock;
singleSpecObj.weight = res.data.weight;
this.parameterdata.singleSpecTable.push(singleSpecObj);
}
// 商品详情 // 商品详情
this.imgdata.description = res.data.description; this.imgdata.description = res.data.description;
//this.goodsinfodata = res.data; //this.goodsinfodata = res.data;
...@@ -204,6 +241,8 @@ ...@@ -204,6 +241,8 @@
this.goodsaftersale.delay_compensate = res.data.delay_compensate; this.goodsaftersale.delay_compensate = res.data.delay_compensate;
this.goodsaftersale.aftersale_time = res.data.aftersale_time; this.goodsaftersale.aftersale_time = res.data.aftersale_time;
let stagArr = []; let stagArr = [];
if( res.data.stags && !Array.isArray(res.data.stags)) {
if( res.data.stags.indexOf(',') > -1 ) { if( res.data.stags.indexOf(',') > -1 ) {
stagArr = res.data.stags.split(','); stagArr = res.data.stags.split(',');
stagArr.forEach(item => { stagArr.forEach(item => {
...@@ -211,6 +250,12 @@ ...@@ -211,6 +250,12 @@
this.goodsaftersale.stags.push(Number(item)); this.goodsaftersale.stags.push(Number(item));
} }
}) })
}else {
stagArr.push( Number(res.data.stags) )
}
}else {
this.goodsaftersale.stags = [];
} }
} }
......
...@@ -90,49 +90,56 @@ export default { ...@@ -90,49 +90,56 @@ export default {
}) })
}, },
onSubmit() { onSubmit() {
let urlarr if (this.collect_num <= 0) {
if(this.form.desc){ this.$message({type: 'warning', message: '您好,您的导入次数已用完,请您联系我们的工作人员操作充值'});
urlarr= this.form.desc.split(',') return;
debugger }
if(urlarr.length>0&&urlarr.length<=10){
}else if(urlarr.length>10){ let urlarr
if (this.form.desc) {
urlarr = this.form.desc.split(',')
//debugger
if (urlarr.length > 0 && urlarr.length <= 10) {
if( Number(urlarr) > Number(this.collect_num)) {
this.$message({type: 'warning',message:'您好,准备导入的商品条数过多,当前剩余次数不足,请重新输入'});
return;
}
} else if (urlarr.length > 10) {
this.$message({ this.$message({
message: '您单次输入的链接数量超过10条!', message: '您单次输入的链接数量超过10条!',
type: 'warning' type: 'warning'
}); });
return false return false
}else{ } else {
this.$message.error('请填写需要导入的商品链接!'); this.$message.error('请填写需要导入的商品链接!');
return false return false
} }
}else{ } else {
this.$message.error('请填写需要导入的商品链接!'); this.$message.error('请填写需要导入的商品链接!');
return false return false
} }
if (this.el_value.length == 3) {
if(this.el_value.length==3){
// this.$message.error('商品分类!'); // this.$message.error('商品分类!');
}else{ } else {
this.$message.error('请选择商品分类!'); this.$message.error('请选择商品分类!');
return false return false
} }
console.log(this.el_value) console.log(this.el_value)
let data = { let data = {
category_id:this.el_value[2], category_id: this.el_value[2],
third_url:urlarr third_url: urlarr
} }
goodsimport(data).then(res=>{ goodsimport(data).then(res => {
if(res.code==1){ if (res.code == 1) {
this.$message({ this.$message({
message: res.message, message: res.message,
type: 'success' type: 'success'
}); });
this.el_value = [] this.el_value = []
this.form.desc='' this.form.desc = ''
this.info() this.info()
} }
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论