|
@@ -127,6 +127,7 @@ export default {
|
|
|
watch: {
|
|
|
value: {
|
|
|
handler(n) {
|
|
|
+ this.changeLoading(true)
|
|
|
this.onValueChange(n) // 用于监听哪些字段做了变动,然后进行一些操作
|
|
|
}
|
|
|
},
|
|
@@ -453,10 +454,15 @@ export default {
|
|
|
} else {
|
|
|
// 修改某些字段时候才会更新schema
|
|
|
const { needChange, changedFieldsArr } = this.needChangeSchema(value)
|
|
|
- this.onChangedFields(changedFieldsArr)
|
|
|
- if (!needChange) return
|
|
|
- this.dynamicChangeSchema(value)
|
|
|
+ this.onChangedFieldsBeforeRefresh(changedFieldsArr)
|
|
|
+ if (needChange) {
|
|
|
+ this.dynamicChangeSchema(value)
|
|
|
+ sleep(10).then(() => {
|
|
|
+ this.onChangedFieldsAfterSchemaRefresh(changedFieldsArr)
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
+ this.changeLoading(false)
|
|
|
}, 100),
|
|
|
async getPrice(p) {
|
|
|
if (this.readonly) return
|
|
@@ -1387,7 +1393,7 @@ export default {
|
|
|
},
|
|
|
// 当form.value数据变更, 对form.value自己其他属性有影响的方法写在此处
|
|
|
// 比如, 一些数据变更需要清空某些数据
|
|
|
- onChangedFields(changedArr) {
|
|
|
+ onChangedFieldsBeforeRefresh(changedArr) {
|
|
|
if (this.readonly) return
|
|
|
|
|
|
if (this.checkNeedRefreshPrice(changedArr)) {
|
|
@@ -1450,8 +1456,21 @@ export default {
|
|
|
objPayment.serviceList = ma.defaultValue
|
|
|
}
|
|
|
}
|
|
|
+ this.refreshValue(objPayment)
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log(`以下字段变更了:${this.productType}`, changedArr)
|
|
|
+ },
|
|
|
+ onChangedFieldsAfterSchemaRefresh(changedArr) {
|
|
|
+ if (this.readonly) return
|
|
|
+
|
|
|
+ if (this.activityCard) return
|
|
|
+
|
|
|
+ const { isUpgrade } = this.utilsGetPaymentType()
|
|
|
+
|
|
|
+ if (changedArr.includes(schemaKeyMap.payment)) {
|
|
|
+ const objPayment = {}
|
|
|
// 升级内容
|
|
|
- const { isUpgrade } = this.utilsGetPaymentType()
|
|
|
if (isUpgrade) {
|
|
|
const uc = this.getSchemaItemWithKey(schemaKeyMap.upgradeContent)
|
|
|
if (uc) {
|
|
@@ -1459,7 +1478,7 @@ export default {
|
|
|
// 如果可选项小于等于1个,则默认值为第一个可选
|
|
|
const enableValue = uc.props.options.filter(c => !c.disabled)
|
|
|
if (enableValue.length <= 1) {
|
|
|
- objPayment[schemaKeyMap.upgradeContent] = enableValue[0].value
|
|
|
+ objPayment[schemaKeyMap.upgradeContent] = [enableValue[0].value]
|
|
|
} else {
|
|
|
objPayment[schemaKeyMap.upgradeContent] = []
|
|
|
}
|
|
@@ -1467,8 +1486,6 @@ export default {
|
|
|
}
|
|
|
this.refreshValue(objPayment)
|
|
|
}
|
|
|
-
|
|
|
- console.log(`以下字段变更了:${this.productType}`, changedArr)
|
|
|
},
|
|
|
checkNeedRefreshPrice(changedArr) {
|
|
|
const commonPassField = [
|