Commit aaadcf6e by chenwq

商品编辑

1 parent e87c51f0
......@@ -99,8 +99,8 @@
</div>
</div>
</template>
<template slot="proSpecsBtn">
<el-button :disabled="isDisabled" type="default" @click="handleSpecsEdit(1)">+添加规格项目</el-button>
<template slot="proSpecsBtn" slot-scope="scope">
<el-button :disabled="scope.scope.isDisabled || isDisabled" type="default" @click="handleSpecsEdit(1)">+添加规格项目</el-button>
</template>
<div slot="proSpecs" :style="{ 'margin-left': labelWidth }">
<div class="sepce-box" v-for="(subItem, subIndex) in specificationDetailList" :key="subIndex">
......@@ -666,7 +666,8 @@ export default {
editFormData: [
{
label: '商品规格',
name: '',
name: 'proSpecsBtn',
isDisabled: false,
addHtml: 'proSpecsBtn'
},
{
......@@ -854,6 +855,10 @@ export default {
},
deep: true
},
// 规格
specificationDetailList(newValue, oldValue) {
console.log(newValue, '规格--')
},
// 零售价
'editForm.retailPrice'(newValue, oldValue) {
this.editForm.retailPrice = limitPrice(newValue, oldValue, 5, 2)
......@@ -882,23 +887,23 @@ export default {
'editForm.expressFee'(newValue, oldValue) {
this.editForm.expressFee = limitPrice(newValue, oldValue, 5, 2, 0, 100000)
},
// 关联优惠券radio,判断配送发货状态
// 关联优惠券radio,判断配送发货状态,商品规格
'editForm.relatedCouponId'(newValue, oldValue) {
let inx = this.externalFormList[2].editFormData.findIndex(val => val.name == 'deliveryType')
this.externalFormList[2].editFormData[inx].optionList.find(k => k.confId == 2).isDisabled = !!newValue
// console.log(this.associationList)
if (newValue) {
let inx = this.externalFormList[2].editFormData.findIndex(val => val.name == 'deliveryType')
this.externalFormList[2].editFormData[inx].optionList.map(val => {
if (val.confId == 2) return (val.isDisabled = true)
})
this.editForm.deliveryType = 1
this.handleTypeChange(this.editForm.deliveryType)
} else {
let inx = this.externalFormList[2].editFormData.findIndex(val => val.name == 'deliveryType')
this.externalFormList[2].editFormData[inx].optionList.map(val => {
if (val.confId == 2) return (val.isDisabled = false)
})
this.handleTypeChange(this.editForm.deliveryType)
this.editForm.goodsStock = this.associationList[0].residueAmount + ''
}
this.handleTypeChange(this.editForm.deliveryType)
this.associationRadio = newValue
// 商品规格
let specsIdx = this.externalFormList[1].editFormData.findIndex(val => val.name == 'proSpecsBtn')
this.externalFormList[1].editFormData[specsIdx].isDisabled = !!newValue
// 库存
let goodsStockIdx = this.externalFormList[1].editFormData.findIndex(val => val.name == 'goodsStock')
this.externalFormList[1].editFormData[goodsStockIdx].isDisabled = !!newValue
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!