Commit 2ceaec2a by 杨北旺

修复提单默认值问题

1 parent ec2e72a8
...@@ -1315,6 +1315,10 @@ export default { ...@@ -1315,6 +1315,10 @@ export default {
packCode = [] packCode = []
detailInfo.attributes.forEach(item => { detailInfo.attributes.forEach(item => {
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)
if (defalutAttr.length) {
item.attributeDTOList = [...item.attributeDTOList, ...defalutAttr]
}
if (targetItem.packageType == 1) { if (targetItem.packageType == 1) {
this.equityRadio = 2 this.equityRadio = 2
this.curSelectCustomPro.push(targetItem.packageName) this.curSelectCustomPro.push(targetItem.packageName)
...@@ -1474,6 +1478,34 @@ export default { ...@@ -1474,6 +1478,34 @@ export default {
this.$set(this.editFormPro, hashObj[item.attributeName] != 1 ? item.attributeName + item.sort : item.attributeName, item.attributeValue) this.$set(this.editFormPro, hashObj[item.attributeName] != 1 ? item.attributeName + item.sort : item.attributeName, item.attributeValue)
}) })
}, },
// 处理默认值赋值
handleDefaultValue(targetItem, attributeDTOList) {
const currentPackageValue = this.productModal[targetItem.idName]
const groupAttributeList = targetItem.groupAttributeList
let tempArr = [],
result = []
for (let key in currentPackageValue) {
for (let i = 0; i < groupAttributeList.length; i++) {
if (key === groupAttributeList[i].attributeName) {
let obj = {
attributeGroup: key,
attributeName: key,
attributeValue: currentPackageValue[key],
sort: 0
}
tempArr.push(obj)
}
}
}
tempArr.forEach(el => {
attributeDTOList.forEach(item => {
if (item.attributeName !== el.attributeName) {
result.push(el)
}
})
})
return result
},
autoGenerate(arr1, arr2) { autoGenerate(arr1, arr2) {
const tempList = arr1.concat(arr2) const tempList = arr1.concat(arr2)
if (this.reset) { if (this.reset) {
...@@ -1710,6 +1742,9 @@ export default { ...@@ -1710,6 +1742,9 @@ export default {
} }
params.isOss = 1 params.isOss = 1
params.dataSource = this.editForm.dataSource || '' params.dataSource = this.editForm.dataSource || ''
setTimeout(() => {
this.submit = false
}, 3000);
this.$apis.beforeSale.updateEquityApi(params).then(res => { this.$apis.beforeSale.updateEquityApi(params).then(res => {
this.submit = false this.submit = false
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!