|
@@ -351,6 +351,17 @@ export default {
|
|
|
},
|
|
|
'form.skuList': {
|
|
|
handler(newVal, oldVal) {
|
|
|
+ // console.log(newVal)
|
|
|
+ // console.log(oldVal)
|
|
|
+ // 修复因为添加规格导致的价格归零的问题
|
|
|
+ oldVal.forEach((item, index) => {
|
|
|
+ for (const key in newVal[index]) {
|
|
|
+ if (item[key]) {
|
|
|
+ newVal[index][key] = item[key]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(newVal)
|
|
|
},
|
|
|
deep: true
|
|
|
}
|
|
@@ -414,6 +425,7 @@ export default {
|
|
|
needImg: 0,
|
|
|
sortOrder: 0
|
|
|
})
|
|
|
+ // console.log(this.form.skuAttrList)
|
|
|
},
|
|
|
// 删除规格值
|
|
|
delValue(index, index1) {
|
|
@@ -515,6 +527,7 @@ export default {
|
|
|
if (values.length) {
|
|
|
doExchange(values, 0)
|
|
|
}
|
|
|
+ // console.log(this.form.skuList)
|
|
|
// eslint-disable-next-line vue/no-mutating-props
|
|
|
this.form.skuList = skuListArray.map((sku1) => {
|
|
|
const { skuAttrList, skuAttrCodeDTOList } = sku1
|