Commit 06950660 by 李伟康

fix(sales): 修复编辑页面步骤导航和表单验证问题

- 添加了编辑模式下第三步的上一步按钮功能
- 修改getDetail方法支持步骤回退逻辑
- 移除多余的console.log调试代码
- 修复单选框变化时阶梯条件的重置逻辑
- 添加表单验证清除确保数据一致性
- 优化数据监听器避免不必要的副作用
1 parent 388c653e
...@@ -168,7 +168,6 @@ export default { ...@@ -168,7 +168,6 @@ export default {
}, },
metricName(item) { metricName(item) {
let { metricConfigs } = this let { metricConfigs } = this
console.log(metricConfigs)
if (metricConfigs && metricConfigs.length) return metricConfigs.find(e => e.metricCode == item.guaranteeIndex)?.metricName || '-' if (metricConfigs && metricConfigs.length) return metricConfigs.find(e => e.metricCode == item.guaranteeIndex)?.metricName || '-'
return '-' return '-'
}, },
...@@ -176,7 +175,6 @@ export default { ...@@ -176,7 +175,6 @@ export default {
return JSON.parse(data) return JSON.parse(data)
}, },
formatGuaranteeItem(i, item) { formatGuaranteeItem(i, item) {
console.log(i)
let unit = i.unit || '' let unit = i.unit || ''
return `满足${i.startValue}${unit} ≤ ${this.metricName(item)}<${i.endValue}${unit}时,差距订单数每单赔付${i.compensationAmount}元` return `满足${i.startValue}${unit} ≤ ${this.metricName(item)}<${i.endValue}${unit}时,差距订单数每单赔付${i.compensationAmount}元`
} }
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
</el-select> </el-select>
</template> </template>
<template v-else-if="i.type == 'radio'"> <template v-else-if="i.type == 'radio'">
<el-radio-group v-model="componentData[i.key]" :disabled="disabled(componentData.guaranteeIndex)"> <el-radio-group v-model="componentData[i.key]" :disabled="disabled(componentData.guaranteeIndex)"
@change="radioChange">
<template v-for="r in i.options"> <template v-for="r in i.options">
<el-radio :key="r.value" :label="r.value">{{ r.label }}</el-radio> <el-radio :key="r.value" :label="r.value">{{ r.label }}</el-radio>
</template> </template>
...@@ -145,6 +146,7 @@ export default { ...@@ -145,6 +146,7 @@ export default {
this.selectionChange(val.guaranteeIndex, false) this.selectionChange(val.guaranteeIndex, false)
if (val.ladderConditions) this.ladderConditions = JSON.parse(val.ladderConditions) if (val.ladderConditions) this.ladderConditions = JSON.parse(val.ladderConditions)
} }
this.formRef && this.formRef.clearValidate()
}, },
deep: true, deep: true,
immediate: true immediate: true
...@@ -164,22 +166,6 @@ export default { ...@@ -164,22 +166,6 @@ export default {
}, },
deep: true deep: true
}, },
'componentData.compensationMode': {
handler(val) {
if (val == 2) {
this.ladderConditions = [{
startValue: '',
endValue: '',
compensationAmount: ''
}, {
startValue: '',
endValue: '',
compensationAmount: ''
}]
} else this.ladderConditions = []
if (val == 1 && this.componentData.fixedCompensation) this.componentData.fixedCompensation = ''
}
},
}, },
computed: { computed: {
...@@ -206,7 +192,20 @@ export default { ...@@ -206,7 +192,20 @@ export default {
}, },
mounted() { }, mounted() { },
methods: { methods: {
radioChange(val) {
if (val == 2) {
this.ladderConditions = [{
startValue: '',
endValue: '',
compensationAmount: ''
}, {
startValue: '',
endValue: '',
compensationAmount: ''
}]
} else this.ladderConditions = []
if (val == 1 && this.componentData.fixedCompensation) this.componentData.fixedCompensation = ''
},
selectionChange(val, clear = true) { selectionChange(val, clear = true) {
let item = this.conditionForm[1], let item = this.conditionForm[1],
{ conditionStartConfig, conditionEndConfig } = this, { conditionStartConfig, conditionEndConfig } = this,
......
...@@ -133,7 +133,6 @@ export default { ...@@ -133,7 +133,6 @@ export default {
data: { data: {
handler(newVal) { handler(newVal) {
this.componentData = deepClone(newVal) this.componentData = deepClone(newVal)
console.log(JSON.parse(JSON.stringify(newVal)))
this.$nextTick(() => { this.$nextTick(() => {
this.formRef.clearValidate() this.formRef.clearValidate()
}) })
......
...@@ -224,7 +224,6 @@ export default { ...@@ -224,7 +224,6 @@ export default {
}) })
} }
if (item.hasGuarantee == 1) { if (item.hasGuarantee == 1) {
console.log('item.guaranteeConfigs', item.guaranteeConfigs)
if (item.guaranteeConfigs && item.guaranteeConfigs.length) { if (item.guaranteeConfigs && item.guaranteeConfigs.length) {
item.guaranteeConfigs.forEach((c, num) => { item.guaranteeConfigs.forEach((c, num) => {
if (c.guaranteeStandard == null || c.guaranteeIndex == '') { if (c.guaranteeStandard == null || c.guaranteeIndex == '') {
...@@ -256,7 +255,6 @@ export default { ...@@ -256,7 +255,6 @@ export default {
params.trafficPartyDetails = i.trafficPartyDetails params.trafficPartyDetails = i.trafficPartyDetails
sceneConfigs.push(params) sceneConfigs.push(params)
}) })
console.log(sceneConfigs)
if (flag) callback(true, { sceneConfigs }) if (flag) callback(true, { sceneConfigs })
else callback(false, message) else callback(false, message)
} else callback(false) } else callback(false)
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<template v-if="pageComplete"> <template v-if="pageComplete">
<el-button v-if="pageType == 'audit' && step == 4" type="primary" @click="rejectDialogVisible = true" <el-button v-if="pageType == 'audit' && step == 4" type="primary" @click="rejectDialogVisible = true"
plain>驳回</el-button> plain>驳回</el-button>
<el-button v-if="pageType == 'edit' && step == 3" type="primary" @click="prevStep" plain>上一步</el-button>
<el-button v-if="pageType != 'view'" @click="submit" :loading="buttonLoading" type="primary">{{ submitText <el-button v-if="pageType != 'view'" @click="submit" :loading="buttonLoading" type="primary">{{ submitText
}}</el-button> }}</el-button>
</template> </template>
...@@ -208,10 +209,15 @@ export default { ...@@ -208,10 +209,15 @@ export default {
} }
}, },
methods: { methods: {
async getDetail(businessCode, pageType) { prevStep() {
let { businessCode, pageType, step } = this
this.getDetail(businessCode, pageType, true, step)
},
async getDetail(businessCode, pageType, isPrevStep, STEP) {
const data = await storeApproveQueryDetail({ businessCode }), const data = await storeApproveQueryDetail({ businessCode }),
{ basicApproveInfo, trafficPartyConfigs, operateLogs, shelfType, updStep } = data, { basicApproveInfo, trafficPartyConfigs, operateLogs, shelfType, updStep } = data,
step = updStep ? updStep + 1 : 2 // step = 2
step = isPrevStep ? STEP - 1 : (updStep ? updStep + 1 : 2)
this.basicinformationData = data this.basicinformationData = data
let basicinformationFormList = JSON.parse(basicApproveInfo) let basicinformationFormList = JSON.parse(basicApproveInfo)
if (pageType != 'reapply') { if (pageType != 'reapply') {
...@@ -363,7 +369,6 @@ export default { ...@@ -363,7 +369,6 @@ export default {
} }
} else throw message } else throw message
} catch (error) { } catch (error) {
console.log(error)
this.dialogVisible = false this.dialogVisible = false
this.buttonLoading = false this.buttonLoading = false
setTimeout(() => { setTimeout(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!