Commit ba0bb9ae by zhangquan

修复bug

1 parent c488188b
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<!-- 自选权益 --> <!-- 自选权益 -->
<div v-if="equityRadio == '1'" class="auto_widget"> <div v-if="equityRadio == '1'" class="auto_widget">
<el-checkbox-group v-model="curSelectPro" :disabled="disabled || dataSourceDisable"> <el-checkbox-group v-model="curSelectPro" :disabled="disabled || (dataSourceDisable && curSelectPro.length)">
<div v-for="(item, index) in productList" :key="index" class="product_wrapper"> <div v-for="(item, index) in productList" :key="index" class="product_wrapper">
<div> <div>
<!-- <el-checkbox @change="changeCheckBox($event, item, index)" :disabled="item.disabled" :label="errGlassName&&item.idName=='glass'?item.packageName+`(${errGlassName})`:item.packageName"> --> <!-- <el-checkbox @change="changeCheckBox($event, item, index)" :disabled="item.disabled" :label="errGlassName&&item.idName=='glass'?item.packageName+`(${errGlassName})`:item.packageName"> -->
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
<!-- 定制权益 --> <!-- 定制权益 -->
<div v-if="equityRadio == '2'" class="auto_widget"> <div v-if="equityRadio == '2'" class="auto_widget">
<el-checkbox-group v-model="curSelectCustomPro" :disabled="disabled || dataSourceDisable"> <el-checkbox-group v-model="curSelectCustomPro" :disabled="disabled || (dataSourceDisable && curSelectCustomPro.length)">
<div v-for="(item, index) in customProductList" :key="index" class="product_wrapper"> <div v-for="(item, index) in customProductList" :key="index" class="product_wrapper">
<div> <div>
<el-checkbox @change="changeRaido($event, item)" :label="item.packageCode" :disabled="item.disabled"> <el-checkbox @change="changeRaido($event, item)" :label="item.packageCode" :disabled="item.disabled">
...@@ -1715,6 +1715,9 @@ export default { ...@@ -1715,6 +1715,9 @@ export default {
this.editForm.effectiveDate = new Date(new Date().setDate(new Date().getDate() + 1)) this.editForm.effectiveDate = new Date(new Date().setDate(new Date().getDate() + 1))
} }
this.dataSourceDisable = res.dataSource == 'car' this.dataSourceDisable = res.dataSource == 'car'
if (res?.vehicle?.invoicePrice && this.editForm.orderStatus != 2) {
productArrData = this.packageToPrice(res.vehicle.invoicePrice, true)
}
this.editForm.packageCode && this.packageAttr(true, productArrData, res) this.editForm.packageCode && this.packageAttr(true, productArrData, res)
const spaItem = this.baseData.agreeList.find(item => item.id == this.editForm.specialAppointId) const spaItem = this.baseData.agreeList.find(item => item.id == this.editForm.specialAppointId)
if (spaItem) { if (spaItem) {
...@@ -1772,8 +1775,8 @@ export default { ...@@ -1772,8 +1775,8 @@ export default {
}) })
}, },
// 改建议价,实际销售价 // 改建议价,实际销售价
packageToPrice(e) { packageToPrice(e, formDetail) {
let _price = e?.target?.value || '' let _price = formDetail ? e : e?.target?.value || ''
if (_price && this.editForm.orderStatus != 2) { if (_price && this.editForm.orderStatus != 2) {
let _list = [] let _list = []
this.copyCustomProductList.forEach(item => { this.copyCustomProductList.forEach(item => {
...@@ -1784,6 +1787,7 @@ export default { ...@@ -1784,6 +1787,7 @@ export default {
this.changeRaido(false, item, true) this.changeRaido(false, item, true)
} }
} }
if (formDetail) return _list
}) })
this.customProductList = _list this.customProductList = _list
} }
...@@ -1806,131 +1810,134 @@ export default { ...@@ -1806,131 +1810,134 @@ 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)
if (targetItem && item.parentId) { if(targetItem){
targetItem.parentId = item.parentId if (targetItem && item.parentId) {
targetItem.parentName = item.parentName targetItem.parentId = item.parentId
} targetItem.parentName = item.parentName
const defalutAttr = this.handleDefaultValue(targetItem, item.attributeDTOList)
if (defalutAttr.length) {
item.attributeDTOList = this.handlerAttrSetValue(this.unique(defalutAttr), item.attributeDTOList)
}
if (targetItem.packageType == 1) {
this.equityRadio = 2
this.curSelectCustomPro.push(targetItem.packageCode)
this.curSelectCustomPro = Array.from(new Set(this.curSelectCustomPro))
item.attributeDTOList.forEach(a => {
if (a.attributeName.includes('price')) {
a.attributeValue = a.attributeValue / 100
}
if (a.attributeName == 'tireScale' && a.sort == 1) {
a.attributeName = 'afterTireScale'
}
if (a.attributeName == 'buy_car_type' && a.attributeValue == 1) {
this.compensationNameDisable = true
}
this.productModal[`vip${item.packageCode}`][a.attributeName] = a.attributeValue
})
if (this.routeInfo.addOrEdit == 3 || this.routeInfo.addOrEdit == 4) {
this.leftDisable = true
this.customProductList.map(c => {
if (this.editForm.dataSource != 'car' && this.editForm.orderStatus == 4) {
this.dataSourceDisable = false
} else {
c.disabled = true
}
c.groupAttributeList.map(ele => {
if (ele.attributeName == 'service_period' && this.routeInfo.addOrEdit > 2) {
ele.disabled = true
}
if (ele.attributeName == 'card') {
ele.disabled = true
}
if (ele.attributeName == 'effective_date' && this.routeInfo.addOrEdit == 3) {
ele.disabled = true
}
})
return c
})
} }
if (this.routeInfo.addOrEdit == 2) { const defalutAttr = this.handleDefaultValue(targetItem, item.attributeDTOList)
this.customProductList.map(c => { if (defalutAttr.length) {
if (this.editForm.dataSource == 'car') { item.attributeDTOList = this.handlerAttrSetValue(this.unique(defalutAttr), item.attributeDTOList)
c.disabled = true }
} else { if (targetItem.packageType == 1) {
this.dataSourceDisable = false this.equityRadio = 2
this.curSelectCustomPro.push(targetItem.packageCode)
this.curSelectCustomPro = Array.from(new Set(this.curSelectCustomPro))
item.attributeDTOList.forEach(a => {
if (a.attributeName.includes('price')) {
a.attributeValue = a.attributeValue / 100
}
if (a.attributeName == 'tireScale' && a.sort == 1) {
a.attributeName = 'afterTireScale'
} }
c.groupAttributeList.map(ele => { if (a.attributeName == 'buy_car_type' && a.attributeValue == 1) {
if (ele.attributeName == 'service_period' && this.dataSourceDisable) { this.compensationNameDisable = true
ele.disabled = true }
this.leftDisable = true this.productModal[`vip${item.packageCode}`][a.attributeName] = a.attributeValue
})
if (this.routeInfo.addOrEdit == 3 || this.routeInfo.addOrEdit == 4) {
this.leftDisable = true
this.customProductList.map(c => {
if (this.editForm.dataSource != 'car' && this.editForm.orderStatus == 4) {
this.dataSourceDisable = false
} else {
c.disabled = true
} }
c.groupAttributeList.map(ele => {
if (ele.attributeName == 'service_period' && this.routeInfo.addOrEdit > 2) {
ele.disabled = true
}
if (ele.attributeName == 'card') {
ele.disabled = true
}
if (ele.attributeName == 'effective_date' && this.routeInfo.addOrEdit == 3) {
ele.disabled = true
}
})
return c
}) })
return c
})
}
} else {
this.equityRadio = 1
this.curSelectPro.push(targetItem.packageCode)
this.curSelectPro = Array.from(new Set(this.curSelectPro))
item.attributeDTOList.forEach(b => {
if (b.attributeName.includes('price')) {
b.attributeValue = b.attributeValue / 100
} else if (b.attributeName == 'planId') {
this.getCase(parseInt(b.attributeValue))
} }
if (b.attributeName == 'tireScale' && b.sort == 1) { if (this.routeInfo.addOrEdit == 2) {
b.attributeName = 'afterTireScale' this.customProductList.map(c => {
} if (this.editForm.dataSource == 'car') {
if (b.attributeName == 'buy_car_type' && b.attributeValue == 1) { c.disabled = true
this.compensationNameDisable = true } else {
this.dataSourceDisable = false
}
c.groupAttributeList.map(ele => {
if (ele.attributeName == 'service_period' && this.dataSourceDisable) {
ele.disabled = true
this.leftDisable = true
}
})
return c
})
} }
this.productModal[targetItem.idName][b.attributeName] = b.attributeValue } else {
}) this.equityRadio = 1
if (this.routeInfo.addOrEdit == 3 || this.routeInfo.addOrEdit == 4) { this.curSelectPro.push(targetItem.packageCode)
this.rightDisable = true this.curSelectPro = Array.from(new Set(this.curSelectPro))
this.productList.map(d => { item.attributeDTOList.forEach(b => {
if (this.editForm.dataSource != 'car' && this.editForm.orderStatus == 4) { if (b.attributeName.includes('price')) {
this.dataSourceDisable = false b.attributeValue = b.attributeValue / 100
} else { } else if (b.attributeName == 'planId') {
d.disabled = true this.getCase(parseInt(b.attributeValue))
} }
d.groupAttributeList.map(elee => { if (b.attributeName == 'tireScale' && b.sort == 1) {
if (elee.attributeName == 'service_period' && this.routeInfo.addOrEdit > 2) { b.attributeName = 'afterTireScale'
elee.disabled = true }
} if (b.attributeName == 'buy_car_type' && b.attributeValue == 1) {
if (elee.attributeName == 'card') { this.compensationNameDisable = true
elee.disabled = true }
} this.productModal[targetItem.idName][b.attributeName] = b.attributeValue
if (elee.attributeName == 'effective_date' && this.routeInfo.addOrEdit == 3) { })
elee.disabled = true if (this.routeInfo.addOrEdit == 3 || this.routeInfo.addOrEdit == 4) {
} this.rightDisable = true
if (elee.attributeName == 'buy_car_type' && elee.attributeValue == 1) { this.productList.map(d => {
elee.disabled = true if (this.editForm.dataSource != 'car' && this.editForm.orderStatus == 4) {
this.dataSourceDisable = false
} else {
d.disabled = true
} }
d.groupAttributeList.map(elee => {
if (elee.attributeName == 'service_period' && this.routeInfo.addOrEdit > 2) {
elee.disabled = true
}
if (elee.attributeName == 'card') {
elee.disabled = true
}
if (elee.attributeName == 'effective_date' && this.routeInfo.addOrEdit == 3) {
elee.disabled = true
}
if (elee.attributeName == 'buy_car_type' && elee.attributeValue == 1) {
elee.disabled = true
}
})
return d
}) })
return d }
}) if (this.routeInfo.addOrEdit == 2) {
} this.productList.map(c => {
if (this.routeInfo.addOrEdit == 2) { if (this.editForm.dataSource == 'car') {
this.productList.map(c => { c.disabled = true
if (this.editForm.dataSource == 'car') { } else {
c.disabled = true this.dataSourceDisable = false
} else {
this.dataSourceDisable = false
}
c.groupAttributeList.map(ele => {
if (ele.attributeName == 'service_period' && this.dataSourceDisable) {
ele.disabled = true
this.rightDisable = true
} }
c.groupAttributeList.map(ele => {
if (ele.attributeName == 'service_period' && this.dataSourceDisable) {
ele.disabled = true
this.rightDisable = true
}
})
return c
}) })
return c }
}) }
if (targetItem.printType == 2) {
this.showUploadInfo = true
} }
} }
if (targetItem.printType == 2) {
this.showUploadInfo = true
}
packCode.push(item.packageCode) packCode.push(item.packageCode)
const _curProdTarget = this.allProdList.find(el => el.packageCode == item.packageCode) const _curProdTarget = this.allProdList.find(el => el.packageCode == item.packageCode)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!