|
|
|
@ -192,22 +192,6 @@ |
|
|
|
|
<el-form-item label="排序:"> |
|
|
|
|
<el-input-number v-model="formValidate.rank" size="small" placeholder="请输入排序序号" style="width: 200px;" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="价格:"> |
|
|
|
|
<div> |
|
|
|
|
<div class="attrItem" v-for="(item,index) in attrValue" :key="index"> |
|
|
|
|
<div>{{item.desc}}</div> |
|
|
|
|
<div class="priceContainer"> |
|
|
|
|
<span>成本价</span> |
|
|
|
|
<el-input-number v-model="item.cost" size="small" placeholder="请输入成本价" style="width: 150px;" /> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<span>价格</span> |
|
|
|
|
<el-input-number v-model="item.price" size="small" placeholder="请输入价格" style="width: 150px;" /> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!-- <el-input-number v-model="formValidate.rank" size="small" placeholder="请输入排序序号" style="width: 200px;" /> --> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="商品详情:"> |
|
|
|
|
<ueditor-from v-model="formValidate.content" :content="formValidate.content" /> |
|
|
|
@ -333,7 +317,6 @@ export default { |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
attrValue:[], |
|
|
|
|
props: { |
|
|
|
|
emitPath: false |
|
|
|
|
}, |
|
|
|
@ -384,8 +367,7 @@ export default { |
|
|
|
|
store_name: '', |
|
|
|
|
rank: '', |
|
|
|
|
us_status: '', |
|
|
|
|
star: '', |
|
|
|
|
attrValue:[] |
|
|
|
|
star: '' |
|
|
|
|
}, |
|
|
|
|
productStatusList: [ |
|
|
|
|
{ label: "上架显示", value: 1 }, |
|
|
|
@ -553,23 +535,6 @@ export default { |
|
|
|
|
this.checkboxGroup = []; |
|
|
|
|
productDetailApi(id).then(res => { |
|
|
|
|
const info = res.data |
|
|
|
|
this.attrValue = [] |
|
|
|
|
info.attrValue.forEach(item=>{ |
|
|
|
|
let obj = { |
|
|
|
|
desc:'', |
|
|
|
|
value_id:item.value_id, |
|
|
|
|
cost:item.cost, |
|
|
|
|
price:item.price |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
if(item.detail instanceof Object){ |
|
|
|
|
Object.keys(item.detail).forEach(i=>{ |
|
|
|
|
obj.desc += i+item.detail[i]+";" |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.attrValue.push(obj) |
|
|
|
|
}) |
|
|
|
|
this.formValidate = { |
|
|
|
|
is_hot: info.is_hot, |
|
|
|
|
is_best: info.is_best, |
|
|
|
@ -580,8 +545,7 @@ export default { |
|
|
|
|
content: info.content, |
|
|
|
|
store_name: info.store_name, |
|
|
|
|
rank: info.rank, |
|
|
|
|
star: info.star, |
|
|
|
|
attrValue:this.attrValue |
|
|
|
|
star: info.star |
|
|
|
|
} |
|
|
|
|
if(info.is_benefit === 1) this.checkboxGroup.push('is_benefit') |
|
|
|
|
if(info.is_hot === 1) this.checkboxGroup.push('is_hot') |
|
|
|
@ -604,15 +568,10 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 提交 |
|
|
|
|
handleSubmit(name) { |
|
|
|
|
|
|
|
|
|
let formParams=JSON.parse(JSON.stringify(this.formValidate)) |
|
|
|
|
formParams.attrValue.forEach(item=>{ |
|
|
|
|
this.$delete(item,'desc') |
|
|
|
|
}) |
|
|
|
|
console.log(formParams) |
|
|
|
|
console.log(this.formValidate) |
|
|
|
|
this.$refs[name].validate((valid) => { |
|
|
|
|
if(valid) { |
|
|
|
|
productUpdateApi(this.productId, formParams).then(async res => { |
|
|
|
|
productUpdateApi(this.productId, this.formValidate).then(async res => { |
|
|
|
|
this.fullscreenLoading = false |
|
|
|
|
this.$message.success(res.message) |
|
|
|
|
this.dialogVisible = false |
|
|
|
@ -835,12 +794,5 @@ table .el-image { |
|
|
|
|
.el-icon-arrow-down { |
|
|
|
|
font-size: 12px; |
|
|
|
|
} |
|
|
|
|
.attrItem{ |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
margin:5px 0; |
|
|
|
|
.priceContainer{ |
|
|
|
|
margin:0 20px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
</style> |
|
|
|
|