Commit 89bdb3e8 by zhangxw

紧急版本需求开发

1 parent 512abd27
......@@ -1170,6 +1170,8 @@ export default {
// 切换套餐---赋默认值
changeCheckBox(e, item, index) {
this.vailGlassPackage(item, index)
// 套餐商品包含的权益商品数据
const parentArr = this.productList.concat(this.productList)?.filter(v => v.parentId && v.parentId == item.parentId)
if (e) {
const _haveTableTarget = item?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数')
if (_haveTableTarget && !this.TDOTableData[item.idName]) {
......@@ -1177,8 +1179,20 @@ export default {
}
this.checkCodeList.push(item.packageCode)
this.packageCodeList.push(item.packageCode)
if (parentArr?.length) {
const parentCodes = parentArr.map(v => v.packageCode)
this.checkCodeList.push(...parentCodes)
this.packageCodeList.push(...parentCodes)
this.curSelectPro.push(...parentCodes)
parentArr.forEach(v => {
if (_haveTableTarget && !this.TDOTableData[v.idName]) {
this.$set(this.TDOTableData, v.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
})
}
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.packageCodeList = Array.from(new Set(this.packageCodeList))
this.curSelectPro = Array.from(new Set(this.curSelectPro))
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
......@@ -1196,6 +1210,12 @@ export default {
} 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))
this.checkCodeList = this.checkCodeList.filter(t => !codesToRemove.has(t))
this.packageCodeList = this.packageCodeList.filter(t => !codesToRemove.has(t))
this.curSelectPro = this.curSelectPro.filter(t => !codesToRemove.has(t))
}
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
......@@ -1209,6 +1229,8 @@ export default {
},
changeRaido(e, item, isDel) {
// isDel 删除选中的
// 套餐商品包含的权益商品数据
const parentArr = this.customProductList.concat(this.productList)?.filter(v => v.parentId && v.parentId == item.parentId)
if (e) {
// this.checkCodeList = []
// this.autoPackageCodeList = []
......@@ -1218,8 +1240,20 @@ export default {
}
this.checkCodeList.push(item.packageCode)
this.autoPackageCodeList.push(item.packageCode)
if (parentArr?.length) {
const parentCodes = parentArr.map(v => v.packageCode)
this.checkCodeList.push(...parentCodes)
this.autoPackageCodeList.push(...parentCodes)
this.curSelectCustomPro.push(...parentCodes)
parentArr.forEach(v => {
if (_haveTableTarget && !this.TDOTableData[v.idName]) {
this.$set(this.TDOTableData, v.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
})
}
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.autoPackageCodeList = Array.from(new Set(this.autoPackageCodeList))
this.curSelectCustomPro = Array.from(new Set(this.curSelectCustomPro))
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
......@@ -1241,6 +1275,12 @@ export default {
if (isDel) {
this.curSelectCustomPro = this.curSelectCustomPro.filter(t => t != item.packageCode)
}
if (parentArr?.length) {
const codesToRemove = new Set(parentArr.map(v => v.packageCode))
this.checkCodeList = this.checkCodeList.filter(t => !codesToRemove.has(t))
this.autoPackageCodeList = this.autoPackageCodeList.filter(t => !codesToRemove.has(t))
this.curSelectCustomPro = this.curSelectCustomPro.filter(t => !codesToRemove.has(t))
}
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
......
......@@ -453,6 +453,14 @@ export default {
}
},
{
label: '套餐名称',
prop: 'parentName',
width: '200px',
formatter: cellValue => {
return cellValue.parentName || '-'
}
},
{
label: '产品名称',
prop: 'packageName',
width: '200px',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!