Commit e0a8eb34 by 李伟康

```

refactor(equity): 移除不必要的视图更新和优化对象赋值

- 移除多处 `this.viewKey = Date.now()` 触发的不必要的视图更新
- 将 `Object.assign` 替换为 `utils.deepClone` 以确保对象深拷贝
- 优化附加数据的合并逻辑,使用展开运算符保持数据完整性
```
1 parent 22348911
...@@ -233,7 +233,6 @@ export default { ...@@ -233,7 +233,6 @@ export default {
if (i.value == val.value) i.current = e.detail.value if (i.value == val.value) i.current = e.detail.value
}) })
}) })
// this.viewKey = Date.now()
}, },
handleCell (val) { handleCell (val) {
if (['calendar', 'futureCalendar'].includes(val.key)) return this.$refs[val.key]?.open() if (['calendar', 'futureCalendar'].includes(val.key)) return this.$refs[val.key]?.open()
...@@ -247,16 +246,13 @@ export default { ...@@ -247,16 +246,13 @@ export default {
Object.assign(this.orderObj, chooseContent) Object.assign(this.orderObj, chooseContent)
this.$set(this.orderObj, 'carBrandText', this.$set(this.orderObj, 'carBrandText',
`${chooseContent.vehicleBrandName}/${chooseContent.vehicleSubBrandName}/${chooseContent.vehicleSeriesName}/${chooseContent.vehicleShapeName}`) `${chooseContent.vehicleBrandName}/${chooseContent.vehicleSubBrandName}/${chooseContent.vehicleSeriesName}/${chooseContent.vehicleShapeName}`)
this.viewKey = Date.now()
return return
} else if (_typeValue.options) { } else if (_typeValue.options) {
this.$set(this.orderObj, _typeValue.targetIdKey, chooseContent[_typeValue.sourceIdKey || 'optionId']) this.$set(this.orderObj, _typeValue.targetIdKey, chooseContent[_typeValue.sourceIdKey || 'optionId'])
this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey || 'optionLabel']) this.$set(this.orderObj, _typeValue.targetNameKey, chooseContent[_typeValue.sourceNameKey || 'optionLabel'])
this.viewKey = Date.now()
return return
} }
this.$set(this.orderObj, _typeValue.value, chooseContent) this.$set(this.orderObj, _typeValue.value, chooseContent)
this.viewKey = Date.now()
}, },
inputBlur (e, val) { inputBlur (e, val) {
this.orderObj[val.value] = this.orderObj[val.value] this.orderObj[val.value] = this.orderObj[val.value]
...@@ -368,7 +364,8 @@ export default { ...@@ -368,7 +364,8 @@ export default {
}) })
} }
let inclueType = data.addOnsFlag == 0 ? 2 : 1 let inclueType = data.addOnsFlag == 0 ? 2 : 1
Object.assign(this.orderObj, { this.orderObj = utils.deepClone({
...this.orderObj,
...data, ...data,
vin: data.vin, vin: data.vin,
invoicePrice: NP.divide(Number(data.invoicePrice || 0), 100).toFixed(2), invoicePrice: NP.divide(Number(data.invoicePrice || 0), 100).toFixed(2),
...@@ -415,7 +412,6 @@ export default { ...@@ -415,7 +412,6 @@ export default {
}, },
confirmCalendar (e, key) { confirmCalendar (e, key) {
this.orderObj[key] = e.fulldate this.orderObj[key] = e.fulldate
this.viewKey = Date.now()
}, },
async submit (operationType) { async submit (operationType) {
// VIN车架号-动态校验 // VIN车架号-动态校验
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!