Commit 69fe14e3 by 李伟康

Merge branch 'feature/584/lwk' into 'SAAS+V5.8.4'

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

See merge request !864
2 parents 487bdb90 06950660
......@@ -168,7 +168,6 @@ export default {
},
metricName(item) {
let { metricConfigs } = this
console.log(metricConfigs)
if (metricConfigs && metricConfigs.length) return metricConfigs.find(e => e.metricCode == item.guaranteeIndex)?.metricName || '-'
return '-'
},
......@@ -176,7 +175,6 @@ export default {
return JSON.parse(data)
},
formatGuaranteeItem(i, item) {
console.log(i)
let unit = i.unit || ''
return `满足${i.startValue}${unit} ≤ ${this.metricName(item)}<${i.endValue}${unit}时,差距订单数每单赔付${i.compensationAmount}元`
}
......
......@@ -23,7 +23,8 @@
</el-select>
</template>
<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">
<el-radio :key="r.value" :label="r.value">{{ r.label }}</el-radio>
</template>
......@@ -145,6 +146,7 @@ export default {
this.selectionChange(val.guaranteeIndex, false)
if (val.ladderConditions) this.ladderConditions = JSON.parse(val.ladderConditions)
}
this.formRef && this.formRef.clearValidate()
},
deep: true,
immediate: true
......@@ -164,22 +166,6 @@ export default {
},
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: {
......@@ -206,7 +192,20 @@ export default {
},
mounted() { },
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) {
let item = this.conditionForm[1],
{ conditionStartConfig, conditionEndConfig } = this,
......
......@@ -133,7 +133,6 @@ export default {
data: {
handler(newVal) {
this.componentData = deepClone(newVal)
console.log(JSON.parse(JSON.stringify(newVal)))
this.$nextTick(() => {
this.formRef.clearValidate()
})
......
......@@ -224,7 +224,6 @@ export default {
})
}
if (item.hasGuarantee == 1) {
console.log('item.guaranteeConfigs', item.guaranteeConfigs)
if (item.guaranteeConfigs && item.guaranteeConfigs.length) {
item.guaranteeConfigs.forEach((c, num) => {
if (c.guaranteeStandard == null || c.guaranteeIndex == '') {
......@@ -256,7 +255,6 @@ export default {
params.trafficPartyDetails = i.trafficPartyDetails
sceneConfigs.push(params)
})
console.log(sceneConfigs)
if (flag) callback(true, { sceneConfigs })
else callback(false, message)
} else callback(false)
......
......@@ -25,6 +25,7 @@
<template v-if="pageComplete">
<el-button v-if="pageType == 'audit' && step == 4" type="primary" @click="rejectDialogVisible = true"
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>
</template>
......@@ -208,10 +209,15 @@ export default {
}
},
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 }),
{ basicApproveInfo, trafficPartyConfigs, operateLogs, shelfType, updStep } = data,
step = updStep ? updStep + 1 : 2
// step = 2
step = isPrevStep ? STEP - 1 : (updStep ? updStep + 1 : 2)
this.basicinformationData = data
let basicinformationFormList = JSON.parse(basicApproveInfo)
if (pageType != 'reapply') {
......@@ -363,7 +369,6 @@ export default {
}
} else throw message
} catch (error) {
console.log(error)
this.dialogVisible = false
this.buttonLoading = false
setTimeout(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!