From 1d9cd1b8329fb3e2ed4f66d24d5e228eec2cfd47 Mon Sep 17 00:00:00 2001 From: hz Date: Fri, 14 Nov 2025 15:09:37 +0800 Subject: [PATCH] =?UTF-8?q?style(product):=20=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=B9=B6=E4=BC=98=E5=8C=96=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 统一空格和缩进格式,提升代码可读性 - 注释掉未使用的缓存工具函数调用- 简化条件判断逻辑,移除冗余注释 - 修复字符串引号风格一致性问题 - 移除无用的 TODO 注释 - 调整 class 属性绑定顺序和条件表达式写法 - 清理重复且不必要的代码分支- 优化 localStorage 判断条件中的引号使用- 规范对象解构和变量命名方式 - 删除不再需要的状态标志位 nextStepFlag --- .../components/CalculatePremium.vue | 65 ++++++++++--------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/src/views/ebiz/productFlowImprove/components/CalculatePremium.vue b/src/views/ebiz/productFlowImprove/components/CalculatePremium.vue index dee76756b..93fb7ab4e 100644 --- a/src/views/ebiz/productFlowImprove/components/CalculatePremium.vue +++ b/src/views/ebiz/productFlowImprove/components/CalculatePremium.vue @@ -71,7 +71,7 @@ @@ -227,20 +227,20 @@ class="ml30" input-width="100" @change=" - stepperChange( - item.productTrialYearDTOS[payEndYearColumnsIndex].displayAmount, - index, - riskFactorIndex, - item.productTrialYearDTOS[payEndYearColumnsIndex].minAmt || item.productTrialYearDTOS[payEndYearColumnsIndex].minPrem, - item.productTrialYearDTOS[payEndYearColumnsIndex].maxAmt || item.productTrialYearDTOS[payEndYearColumnsIndex].maxPrem, - item.productTrialYearDTOS[payEndYearColumnsIndex] - ) - " + stepperChange( + item.productTrialYearDTOS[payEndYearColumnsIndex].displayAmount, + index, + riskFactorIndex, + item.productTrialYearDTOS[payEndYearColumnsIndex].minAmt || item.productTrialYearDTOS[payEndYearColumnsIndex].minPrem, + item.productTrialYearDTOS[payEndYearColumnsIndex].maxAmt || item.productTrialYearDTOS[payEndYearColumnsIndex].maxPrem, + item.productTrialYearDTOS[payEndYearColumnsIndex] + ) + " /> @@ -253,9 +253,9 @@ @@ -387,7 +387,8 @@ item.productCode != 'GFRS_M0085' && trialList[index] " - class="flex pv10 border-bottom prem" :class="refer==='detail' ? 'justify-content-s':'' " + :class="refer === 'detail' ? 'justify-content-s' : ''" + class="flex pv10 border-bottom prem" > @@ -563,7 +564,6 @@ export default { trialInfos: [], influenceAddRiskCodes: [], influences: [], - // todo: 可以到时候改成计算属性,防止出现状态异常的问题 nextStepFlag: false, isRelated: localStorage.isRelated === '0', //关联保单号 policyNo: '', // 保单号 @@ -681,25 +681,26 @@ export default { /** 初始化用户详情信息 */ initPersonInfo() { if (this.personMessageInfo) return - const { getLocItem, setLocItem } = cacheUtils - const saleInsuredInfo = getLocItem('saleInsuredInfo') - const saleInsuredPersonInfo = getLocItem('saleInsuredPersonInfo') + // const { getLocItem, setLocItem } = cacheUtils + // const saleInsuredInfo = getLocItem('saleInsuredInfo') + // const saleInsuredPersonInfo = getLocItem('saleInsuredPersonInfo') // 如果本地存在之前编辑过的数据, 优先采用这个,如果没有数据,就从网络获取 - if (!(saleInsuredInfo && saleInsuredPersonInfo)) { - this.saleInsuredInfo = JSON.parse(saleInsuredInfo) - this.saleInsuredPersonInfo = JSON.parse(saleInsuredPersonInfo) - } else { - const orderNo = this.$route.query.orderNo + // if (!(saleInsuredInfo && saleInsuredPersonInfo)) { + // if (false){ + // this.saleInsuredInfo = JSON.parse(saleInsuredInfo) + // this.saleInsuredPersonInfo = JSON.parse(saleInsuredPersonInfo) + // } else { + const orderNo = this.$route.query.orderNo - getOrderDetail({ orderNo }).then(({ orderDTO }) => { - const { appntDTO, insuredDTOs } = orderDTO - const [insuredPersonInfo] = insuredDTOs - this.saleInsuredInfo = { ...this.saleInsuredInfo, ...appntDTO } - setLocItem('saleInsuredInfo', JSON.stringify(appntDTO)) - this.saleInsuredPersonInfo = { ...this.saleInsuredPersonInfo, ...insuredPersonInfo } - setLocItem('saleInsuredPersonInfo', JSON.stringify(insuredPersonInfo)) - }) - } + getOrderDetail({ orderNo }).then(({ orderDTO }) => { + const { appntDTO, insuredDTOs } = orderDTO + const [insuredPersonInfo] = insuredDTOs + this.saleInsuredInfo = { ...this.saleInsuredInfo, ...appntDTO } + // setLocItem('saleInsuredInfo', JSON.stringify(appntDTO)) + this.saleInsuredPersonInfo = { ...this.saleInsuredPersonInfo, ...insuredPersonInfo } + // setLocItem('saleInsuredPersonInfo', JSON.stringify(insuredPersonInfo)) + }) + // } }, appCallBack(data) { if (data.trigger === 'right_button_click' && localStorage.isFrom === 'proposal') { @@ -979,7 +980,7 @@ export default { //构建险种数组 let productsData /**在不添加 this.refer !== "flow" 之前, 会意外的出现显示两个主险。此只针对当处于流程录入的时候 ,不处理额外信息*/ - if (localStorage.chooseProducts && this.refer !== "flow") { + if (localStorage.chooseProducts && this.refer !== 'flow') { productsData = JSON.parse(localStorage.chooseProducts) productsData.push(currentProductInfo) } else {