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

Merge branch 'dev_hxz' of http://120.27.146.32:8888/wangfulong/shop-new into dev_hxz

......@@ -70,7 +70,7 @@
tagOptions: [
{id: 2, tag: "假一赔十"},
{id: 3, tag: "7天退换"},
{id: 4, tag: "不可退"},
{id: 4, tag: "不可退"},
{id: 5, tag: "厂家直供"},
{id: 6, tag: "售后无忧"}
],
......@@ -79,8 +79,10 @@
},
mounted() {
this.getFreightData();
console.log('售后数据:',this.goodsaftersale);
this.goodsAfterSaleForm = this.goodsaftersale;
//console.log('售后数据:',this.goodsaftersale);
if(this.goodsaftersale && this.goodsaftersale.stags.length > 0) {
this.goodsAfterSaleForm = this.goodsaftersale;
}
},
methods: {
// 运费模板
......
......@@ -15,7 +15,7 @@
<el-form-item label='商品关键词:' prop="goods_des">
<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 label="商品产地:" prop="producing_area">
......@@ -132,6 +132,27 @@
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 {
//loading: false,
// categoryStr: '',
......@@ -159,7 +180,7 @@
{required: true, message: '请输入商品名称', 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'}],
deliver_area: [{required: true, message: '请选择商品发货地', trigger: 'change'}],
unit: [{required: true, message: '商品单位不能为空', trigger: 'blur'}],
......@@ -231,9 +252,6 @@
this.goodsInfoForm.categoryStr = this.goodsinfodata.categoryStr;
this.goodsInfoForm.categoryList = this.goodsinfodata.categoryList;
}
//console.log("tup",this.goodsImgFileList)
// 获取 省
this.getArea();
......@@ -336,7 +354,7 @@
},
// 上传 商品图片,限制 9
// 上传 商品图片,限制 5
limitImg5() {
this.$message({ message: '最多上传5张图片', type: 'warning' })
},
......
......@@ -20,7 +20,7 @@
<el-table-column align="center" prop="sl_price" label="结算价">
<template slot-scope="scope">
<!-- <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>
</el-table-column>
<el-table-column align="center" prop="price" label="指导价">
......@@ -44,22 +44,23 @@
<el-input size="mini" style="width:90%" v-model="scope.row.weight" placeholder="请输入重量"></el-input>
</template>
</el-table-column>
<el-table-column align="center" prop="imgs9" label="图片">
<template slot-scope="scope">
<!-------------->
<el-upload
action="/"
class="uploadData50"
list-type="picture-card"
:limit="5"
:on-exceed="limit5"
:file-list="singleSpecImgList"
:http-request="(file)=> { return upLoadSingleSpecImg(file,scope.row) }"
:on-remove=" (file) => { return removeSingleSpeImg(file,scope.row)}"
></el-upload>
<!-------------->
</template>
</el-table-column>
<!-- <el-table-column align="center" prop="imgs9" label="图片">-->
<!-- <template slot-scope="scope">-->
<!-- &lt;!&ndash;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&ndash;&gt;-->
<!-- <el-upload-->
<!-- action="/"-->
<!-- class="uploadData50"-->
<!-- list-type="picture-card"-->
<!-- :limit="5"-->
<!-- :on-exceed="limit5"-->
<!-- :file-list="singleSpecImgList"-->
<!-- :http-request="(file)=> { return upLoadSingleSpecImg(file,scope.row) }"-->
<!-- :on-remove=" (file) => { return removeSingleSpeImg(file,scope.row)}"-->
<!-- ></el-upload>-->
<!-- &lt;!&ndash;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&ndash;&gt;-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</div>
......@@ -88,7 +89,7 @@
<el-table-column align="center" prop="sl_price" label="结算价">
<template slot-scope="scope">
<!-- <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>
</el-table-column>
<el-table-column align="center" prop="price" label="指导价">
......@@ -152,23 +153,6 @@ export default {
orgGoodsPam: {},
preTableTitle: [],
isHoverSpeImg: false,
// goodsPam:[
// {
// speNameList:[ '颜色','尺码' ],
// goodsParametersList: [],
// goodsPamPreTable: [{
// hh1: '',
// hh2: '',
// hh3: '',
// hh4: '',
// hh5: '',
// hh6: '',
// hh7: '',
// }],
// },
// ],
// goodsPamPreTable: [],
// goodsPamPreObj:
/** 无规格 数据 */
singleSpecTable: [
{
......@@ -178,7 +162,6 @@ export default {
sc_price: '', // 市场价
stock: '', // 库存
weight: '', // 重量 g
imgs9: [], // 图片
}
],
singleSpecImgList: [],
......@@ -188,16 +171,17 @@ export default {
'parameterdata': function(val) {
//debugger
this.orgGoodsPam = val;
// this.orgGoodsPam
//console.log(175,this.orgGoodsPam);
console.log("监听",this.orgGoodsPam);
},
},
created() {
//this.orgGoodsPam = this.parameterdata;
},
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: {
// ------ 无规格,上传图片相关 ------
......@@ -405,6 +389,17 @@ p {
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 {
color: #909399;
......
......@@ -110,18 +110,21 @@ export default {
};
},
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() {
/** 先获取 本地存储的localStorage **/
this.getLocalSpecNameOption();
// this.speData = [];
// this.$set(this.speData,this.speData.length,this.specsGroup);
// console.log(123,this.specificationsdata)
this.speData = this.specificationsdata;
this.$forceUpdate()
// 先判断是新增还是修改
//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.$forceUpdate()
}
},
watch:{
// "speData.specsGroup": {
......
......@@ -133,7 +133,10 @@
specificationsdata: [],
/* 商品售价 */
parameterdata: {
pamDataList: [],
pamNameList: [],
pamTableList: [],
singleSpecTable: []
},
/* 商品详情 */
imgdata: {
......@@ -159,7 +162,7 @@
if( this.option && this.option !== 0 ) {
let data = { goodsId: this.option};
getGoodsNew(data).then(res => {
console.log("编辑接口返回", res);
//console.log("编辑接口返回", res);
if(res.data) {
this.isShowGoodsDetails = true;
// 商品信息
......@@ -189,6 +192,40 @@
if(res.data.specs && res.data.specs.length > 0) {
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.goodsinfodata = res.data;
......@@ -204,13 +241,21 @@
this.goodsaftersale.delay_compensate = res.data.delay_compensate;
this.goodsaftersale.aftersale_time = res.data.aftersale_time;
let stagArr = [];
if( res.data.stags.indexOf(',') > -1 ) {
stagArr = res.data.stags.split(',');
stagArr.forEach(item => {
if (item) {
this.goodsaftersale.stags.push(Number(item));
}
})
if( res.data.stags && !Array.isArray(res.data.stags)) {
if( res.data.stags.indexOf(',') > -1 ) {
stagArr = res.data.stags.split(',');
stagArr.forEach(item => {
if (item) {
this.goodsaftersale.stags.push(Number(item));
}
})
}else {
stagArr.push( Number(res.data.stags) )
}
}else {
this.goodsaftersale.stags = [];
}
}
......
......@@ -90,51 +90,58 @@ export default {
})
},
onSubmit() {
let urlarr
if(this.form.desc){
urlarr= this.form.desc.split(',')
debugger
if(urlarr.length>0&&urlarr.length<=10){
if (this.collect_num <= 0) {
this.$message({type: 'warning', message: '您好,您的导入次数已用完,请您联系我们的工作人员操作充值'});
return;
}
}else if(urlarr.length>10){
this.$message({
message: '您单次输入的链接数量超过10条!',
type: 'warning'
});
return false
}else{
this.$message.error('请填写需要导入的商品链接!');
return false
}
}else{
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({
message: '您单次输入的链接数量超过10条!',
type: 'warning'
});
return false
} else {
this.$message.error('请填写需要导入的商品链接!');
return false
return false
}
} else {
this.$message.error('请填写需要导入的商品链接!');
return false
}
if (this.el_value.length == 3) {
// this.$message.error('商品分类!');
} else {
this.$message.error('请选择商品分类!');
return false
}
if(this.el_value.length==3){
// this.$message.error('商品分类!');
}else{
this.$message.error('请选择商品分类!');
return false
}
console.log(this.el_value)
let data = {
category_id:this.el_value[2],
third_url:urlarr
console.log(this.el_value)
let data = {
category_id: this.el_value[2],
third_url: urlarr
}
goodsimport(data).then(res => {
if (res.code == 1) {
this.$message({
message: res.message,
type: 'success'
});
this.el_value = []
this.form.desc = ''
this.info()
}
goodsimport(data).then(res=>{
if(res.code==1){
this.$message({
message: res.message,
type: 'success'
});
this.el_value = []
this.form.desc=''
this.info()
}
})
},
elvalueclick() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论