Commit a30a686c by 杨北旺

修复属性重复问题

1 parent 515662be
...@@ -1399,7 +1399,7 @@ export default { ...@@ -1399,7 +1399,7 @@ export default {
let targetItem = productArrData.find(k => k.packageCode == item.packageCode) let targetItem = productArrData.find(k => k.packageCode == item.packageCode)
const defalutAttr = this.handleDefaultValue(targetItem, item.attributeDTOList) const defalutAttr = this.handleDefaultValue(targetItem, item.attributeDTOList)
if (defalutAttr.length) { if (defalutAttr.length) {
item.attributeDTOList = [...defalutAttr,...item.attributeDTOList] item.attributeDTOList = this.handlerAttrSetValue(this.unique(defalutAttr),item.attributeDTOList)
} }
if (targetItem.packageType == 1) { if (targetItem.packageType == 1) {
this.equityRadio = 2 this.equityRadio = 2
...@@ -1519,6 +1519,22 @@ export default { ...@@ -1519,6 +1519,22 @@ export default {
this.checkCodeList = packCode this.checkCodeList = packCode
this.handleProductArrParam(attrList, packCode) this.handleProductArrParam(attrList, packCode)
}, },
// 处理详情属性值赋值
handlerAttrSetValue(defaultList,targetList){
let arr = [],nameList = [],result = []
targetList.forEach(el=>{
nameList.push(el.attributeName)
})
defaultList.forEach(el=>{
if(nameList.includes(el.attributeName)){
}else{
arr.push(el)
}
})
result = [...arr,...targetList]
return result
},
// 处理默认值赋值 // 处理默认值赋值
handleDefaultValue(targetItem, attributeDTOList) { handleDefaultValue(targetItem, attributeDTOList) {
const currentPackageValue = this.productModal[targetItem.idName] const currentPackageValue = this.productModal[targetItem.idName]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!