diff --git a/src/views/product/productExamine/editAttr.vue b/src/views/product/productExamine/editAttr.vue index 0f18489..c33e58d 100644 --- a/src/views/product/productExamine/editAttr.vue +++ b/src/views/product/productExamine/editAttr.vue @@ -197,6 +197,23 @@ + 提交 @@ -431,8 +448,8 @@ export default { ], tableIndex: 0, attrInfo: {}, - fatAttrValue:[], detailStatus:true, + attrList:[], oneFormBatch: [ { image: '', @@ -474,15 +491,10 @@ export default { }, methods: { handleMany(row,i,val){ - // row.detail[val] = row[i] - // console.log('row',row); - // console.log('i',i); - // console.log(val); if(row[i]){ this.detailStatus = false - this.fatAttrValue.map((res,key)=>{ - console.log(row.detail[val]) - if(row.detail[val] == res.detail[val] && key!=0){ + this.ManyAttrValue.map((res,key)=>{ + if(row.detail[val] == res.detail[val] && res.unique!==row.unique){ //值 res[i] = row[i] // detail的值 @@ -495,7 +507,6 @@ export default { res['sku'] = skuValue } }) - this.ManyAttrValue = this.fatAttrValue row.detail[val] = row[i] row.detail[val] = row[i] let skuValue = '' @@ -650,22 +661,21 @@ export default { watCh(val) { const tmp = {} const tmpTab = {} + const temAttr = [] this.formValidate.attr.forEach((o, i) => { tmp['value' + i] = { title: o.value } tmpTab['value' + i] = '' + temAttr.push({title:o.value,detail:o.detail.map((v, g) => { + return { value: v } + })}) }) + this.attrList = temAttr this.ManyAttrValue = this.attrFormat(val) - this.fatAttrValue = this.attrFormat(val) this.ManyAttrValue.forEach((val, index) => { const key = Object.values(val.detail).sort().join('/') if (this.attrInfo[key]) this.ManyAttrValue[index] = this.attrInfo[key] val.image = this.formValidate.image }) - this.fatAttrValue.forEach((val, index) => { - const key = Object.values(val.detail).sort().join('/') - if (this.attrInfo[key]) this.fatAttrValue[index] = this.attrInfo[key] - val.image = this.formValidate.image - }) this.attrInfo = {} this.ManyAttrValue.forEach((val) => { if (val.detail !== 'undefined' && val.detail !== null) { @@ -788,7 +798,6 @@ export default { this.OneattrValue = info.attrValue } else { this.ManyAttrValue = info.attrValue - this.fatAttrValue = info.attrValue this.ManyAttrValue.forEach(val => { if (val.detail !== 'undefined' && val.detail !== null) { this.attrInfo[