Commit 9380eb66 by zhangxw

权益提单兼容套餐开发

1 parent 89bdb3e8
...@@ -1172,57 +1172,81 @@ export default { ...@@ -1172,57 +1172,81 @@ export default {
this.vailGlassPackage(item, index) this.vailGlassPackage(item, index)
// 套餐商品包含的权益商品数据 // 套餐商品包含的权益商品数据
const parentArr = this.productList.concat(this.productList)?.filter(v => v.parentId && v.parentId == item.parentId) const parentArr = this.productList.concat(this.productList)?.filter(v => v.parentId && v.parentId == item.parentId)
if (e) { const customAttr = {
const _haveTableTarget = item?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数') attributeGroup: 'planId',
if (_haveTableTarget && !this.TDOTableData[item.idName]) { attributeName: 'planId'
this.$set(this.TDOTableData, item.packageCode, JSON.parse(JSON.stringify(TDO_OBJ))) }
} if (parentArr.length) {
this.checkCodeList.push(item.packageCode) if (e) {
this.packageCodeList.push(item.packageCode)
if (parentArr?.length) {
const parentCodes = parentArr.map(v => v.packageCode) const parentCodes = parentArr.map(v => v.packageCode)
this.checkCodeList.push(...parentCodes) this.checkCodeList.push(...parentCodes)
this.packageCodeList.push(...parentCodes) this.packageCodeList.push(...parentCodes)
this.curSelectPro.push(...parentCodes) this.curSelectPro.push(...parentCodes)
parentArr.forEach(v => { parentArr.forEach(v => {
const _haveTableTarget = v?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数')
if (_haveTableTarget && !this.TDOTableData[v.idName]) { if (_haveTableTarget && !this.TDOTableData[v.idName]) {
this.$set(this.TDOTableData, v.packageCode, JSON.parse(JSON.stringify(TDO_OBJ))) this.$set(this.TDOTableData, v.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
} }
}) for (let key in this.productModal[v.idName]) {
} v.groupAttributeList.forEach(attr => {
this.checkCodeList = Array.from(new Set(this.checkCodeList)) if (attr.attributeName == key) {
this.packageCodeList = Array.from(new Set(this.packageCodeList)) this.commonPart(this.productModal[v.idName][key], v, attr)
this.curSelectPro = Array.from(new Set(this.curSelectPro)) }
for (let key in this.productModal[item.idName]) { })
item.groupAttributeList.forEach(attr => { }
if (attr.attributeName == key) { if (v.idName == 'crash') {
this.commonPart(this.productModal[item.idName][key], item, attr) this.commonPart(this.productModal[item.idName]['planId'], item, customAttr)
} }
}) })
} this.checkCodeList = Array.from(new Set(this.checkCodeList))
if (item.idName == 'crash') { this.packageCodeList = Array.from(new Set(this.packageCodeList))
const customAttr = { this.curSelectPro = Array.from(new Set(this.curSelectPro))
attributeGroup: 'planId', } else {
attributeName: 'planId'
}
this.commonPart(this.productModal[item.idName]['planId'], item, customAttr)
}
} else {
this.checkCodeList = this.checkCodeList.filter(t => t != item.packageCode)
this.packageCodeList = this.packageCodeList.filter(t => t != item.packageCode)
if (parentArr?.length) {
const codesToRemove = new Set(parentArr.map(v => v.packageCode)) const codesToRemove = new Set(parentArr.map(v => v.packageCode))
this.checkCodeList = this.checkCodeList.filter(t => !codesToRemove.has(t)) this.checkCodeList = this.checkCodeList.filter(t => !codesToRemove.has(t))
this.packageCodeList = this.packageCodeList.filter(t => !codesToRemove.has(t)) this.packageCodeList = this.packageCodeList.filter(t => !codesToRemove.has(t))
this.curSelectPro = this.curSelectPro.filter(t => !codesToRemove.has(t)) this.curSelectPro = this.curSelectPro.filter(t => !codesToRemove.has(t))
} parentArr.forEach(v => {
for (let key in this.productModal[item.idName]) { for (let key in this.productModal[v.idName]) {
item.groupAttributeList.forEach(attr => { v.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) { if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr) this.commonPart(this.productModal[v.idName][key], v, attr)
}
})
} }
}) })
} }
} else {
if (e) {
const _haveTableTarget = item?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数')
if (_haveTableTarget && !this.TDOTableData[item.idName]) {
this.$set(this.TDOTableData, item.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
this.checkCodeList.push(item.packageCode)
this.packageCodeList.push(item.packageCode)
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.packageCodeList = Array.from(new Set(this.packageCodeList))
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
}
})
}
if (item.idName == 'crash') {
this.commonPart(this.productModal[item.idName]['planId'], item, customAttr)
}
} else {
this.checkCodeList = this.checkCodeList.filter(t => t != item.packageCode)
this.packageCodeList = this.packageCodeList.filter(t => t != item.packageCode)
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
}
})
}
}
} }
let hasRefitFlagList = this.allProdList.filter(item => this.packageCodeList.includes(item.packageCode)) let hasRefitFlagList = this.allProdList.filter(item => this.packageCodeList.includes(item.packageCode))
this.refitFormObj.autoFlag = !!hasRefitFlagList?.find(item => item.qsFlag) this.refitFormObj.autoFlag = !!hasRefitFlagList?.find(item => item.qsFlag)
...@@ -1231,65 +1255,96 @@ export default { ...@@ -1231,65 +1255,96 @@ export default {
// isDel 删除选中的 // isDel 删除选中的
// 套餐商品包含的权益商品数据 // 套餐商品包含的权益商品数据
const parentArr = this.customProductList.concat(this.productList)?.filter(v => v.parentId && v.parentId == item.parentId) const parentArr = this.customProductList.concat(this.productList)?.filter(v => v.parentId && v.parentId == item.parentId)
if (e) { const customAttr = {
// this.checkCodeList = [] attributeGroup: 'planId',
// this.autoPackageCodeList = [] attributeName: 'planId'
const _haveTableTarget = item?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数') }
if (_haveTableTarget && !this.TDOTableData[item.idName]) { if (parentArr?.length) {
this.$set(this.TDOTableData, item.packageCode, JSON.parse(JSON.stringify(TDO_OBJ))) if (e) {
}
this.checkCodeList.push(item.packageCode)
this.autoPackageCodeList.push(item.packageCode)
if (parentArr?.length) {
const parentCodes = parentArr.map(v => v.packageCode) const parentCodes = parentArr.map(v => v.packageCode)
this.checkCodeList.push(...parentCodes) this.checkCodeList.push(...parentCodes)
this.autoPackageCodeList.push(...parentCodes) this.autoPackageCodeList.push(...parentCodes)
this.curSelectCustomPro.push(...parentCodes) this.curSelectCustomPro.push(...parentCodes)
parentArr.forEach(v => { parentArr.forEach(v => {
const _haveTableTarget = v?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数')
if (_haveTableTarget && !this.TDOTableData[v.idName]) { if (_haveTableTarget && !this.TDOTableData[v.idName]) {
this.$set(this.TDOTableData, v.packageCode, JSON.parse(JSON.stringify(TDO_OBJ))) this.$set(this.TDOTableData, v.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
} }
}) for (let key in this.productModal[v.idName]) {
} v.groupAttributeList.forEach(attr => {
this.checkCodeList = Array.from(new Set(this.checkCodeList)) if (attr.attributeName == key) {
this.autoPackageCodeList = Array.from(new Set(this.autoPackageCodeList)) this.commonPart(this.productModal[v.idName][key], v, attr)
this.curSelectCustomPro = Array.from(new Set(this.curSelectCustomPro)) }
for (let key in this.productModal[item.idName]) { })
item.groupAttributeList.forEach(attr => { }
if (attr.attributeName == key) { this.commonPart(this.productModal[`vip${v.packageCode}`]['planId'], v, customAttr)
this.commonPart(this.productModal[item.idName][key], item, attr) if (v.printType == 2) {
this.showUploadInfo = true
} }
}) })
} this.checkCodeList = Array.from(new Set(this.checkCodeList))
const customAttr = { this.autoPackageCodeList = Array.from(new Set(this.autoPackageCodeList))
attributeGroup: 'planId', this.curSelectCustomPro = Array.from(new Set(this.curSelectCustomPro))
attributeName: 'planId' } else {
}
this.commonPart(this.productModal[`vip${item.packageCode}`]['planId'], item, customAttr)
if (item.printType == 2) {
this.showUploadInfo = true
}
} else {
this.checkCodeList = this.checkCodeList.filter(t => t != item.packageCode)
this.autoPackageCodeList = this.autoPackageCodeList.filter(t => t != item.packageCode)
if (isDel) {
this.curSelectCustomPro = this.curSelectCustomPro.filter(t => t != item.packageCode)
}
if (parentArr?.length) {
const codesToRemove = new Set(parentArr.map(v => v.packageCode)) const codesToRemove = new Set(parentArr.map(v => v.packageCode))
this.checkCodeList = this.checkCodeList.filter(t => !codesToRemove.has(t)) this.checkCodeList = this.checkCodeList.filter(t => !codesToRemove.has(t))
this.autoPackageCodeList = this.autoPackageCodeList.filter(t => !codesToRemove.has(t)) this.autoPackageCodeList = this.autoPackageCodeList.filter(t => !codesToRemove.has(t))
this.curSelectCustomPro = this.curSelectCustomPro.filter(t => !codesToRemove.has(t)) this.curSelectCustomPro = this.curSelectCustomPro.filter(t => !codesToRemove.has(t))
} parentArr.forEach(v => {
for (let key in this.productModal[item.idName]) { if (isDel) {
item.groupAttributeList.forEach(attr => { this.curSelectCustomPro = this.curSelectCustomPro.filter(t => t != v.packageCode)
if (attr.attributeName == key) { }
this.commonPart(this.productModal[item.idName][key], item, attr) for (let key in this.productModal[v.idName]) {
v.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[v.idName][key], v, attr)
}
})
}
if (v.printType == 2) {
this.showUploadInfo = false
} }
}) })
} }
if (item.printType == 2) { } else {
this.showUploadInfo = false if (e) {
// this.checkCodeList = []
// this.autoPackageCodeList = []
const _haveTableTarget = item?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数')
if (_haveTableTarget && !this.TDOTableData[item.idName]) {
this.$set(this.TDOTableData, item.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
this.checkCodeList.push(item.packageCode)
this.autoPackageCodeList.push(item.packageCode)
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.autoPackageCodeList = Array.from(new Set(this.autoPackageCodeList))
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
}
})
}
this.commonPart(this.productModal[`vip${item.packageCode}`]['planId'], item, customAttr)
if (item.printType == 2) {
this.showUploadInfo = true
}
} else {
this.checkCodeList = this.checkCodeList.filter(t => t != item.packageCode)
this.autoPackageCodeList = this.autoPackageCodeList.filter(t => t != item.packageCode)
if (isDel) {
this.curSelectCustomPro = this.curSelectCustomPro.filter(t => t != item.packageCode)
}
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
}
})
}
if (item.printType == 2) {
this.showUploadInfo = false
}
} }
} }
let hasRefitFlagList = this.allProdList.filter(item => this.autoPackageCodeList.includes(item.packageCode)) let hasRefitFlagList = this.allProdList.filter(item => this.autoPackageCodeList.includes(item.packageCode))
...@@ -1995,7 +2050,9 @@ export default { ...@@ -1995,7 +2050,9 @@ export default {
...el, ...el,
packageCode: item.packageCode, packageCode: item.packageCode,
contractNo: item.contractNo, contractNo: item.contractNo,
printType: item.printType printType: item.printType,
parentId: item.parentId,
parentName: item.parentName
}) })
}) })
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!