mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-10 16:16:45 +08:00
[FIX]富娃娃主险+附加险 页面显示项渲染
This commit is contained in:
@@ -13,31 +13,16 @@
|
||||
<van-tag type="primary" v-if="item.isMainRisk == 0" class="mr5 green" plain>主险</van-tag>
|
||||
<van-tag type="primary" v-else class="mr5 green" plain>附加险</van-tag>
|
||||
<span class="ml5 center fs13 flex1">{{ item.riskName }}</span>
|
||||
<van-tag
|
||||
type="primary"
|
||||
v-if="item.isMainRisk == 0 && item.hasAddtionRisk"
|
||||
plain
|
||||
@click="selectAddtionRisk"
|
||||
class="green mr8"
|
||||
>附</van-tag>
|
||||
<van-icon
|
||||
name="search"
|
||||
size="20"
|
||||
v-if="item.documentDTOS && item.documentDTOS.length > 0"
|
||||
@click="seeDocument(index)"
|
||||
class="green mr5"
|
||||
/>
|
||||
<van-tag type="primary" v-if="item.isMainRisk == 0 && item.hasAddtionRisk" plain @click="selectAddtionRisk" class="green mr8">附</van-tag>
|
||||
<van-icon name="search" size="20" v-if="item.documentDTOS && item.documentDTOS.length > 0" @click="seeDocument(index)" class="green mr5" />
|
||||
<van-icon name="delete" size="22" @click="deleteRisk(index)" class="green" />
|
||||
</div>
|
||||
<!-- 险种条件-->
|
||||
<div v-if="item.isRemit == 1">
|
||||
<div v-if="(item.isRemit == 1 && isTrial === '') || (item.isRemit == 1 && (isTrial !== '' && item.isMainRisk == 1))">
|
||||
<div v-for="(riskFactor, riskFactorIndex) in item.calFactorLst" :key="riskFactorIndex">
|
||||
<div class="flex justify-content-s pv10 border-bottom" v-if="riskFactor.type == 1">
|
||||
<div class="flex align-items-c">
|
||||
<span
|
||||
v-if="riskFactor.suffix"
|
||||
class="fs14"
|
||||
>{{ riskFactor.name + '(' + riskFactor.suffix + ')' }}</span>
|
||||
<span v-if="riskFactor.suffix" class="fs14">{{ riskFactor.name + '(' + riskFactor.suffix + ')' }}</span>
|
||||
<span v-else class="fs14">{{ riskFactor.name }} </span>
|
||||
<!-- {{riskFactorIndex}} -->
|
||||
<van-stepper
|
||||
@@ -47,7 +32,16 @@
|
||||
:show-plus="false"
|
||||
:show-minus="false"
|
||||
class="ml30"
|
||||
@change="stepperChange(item.calFactorLst[riskFactorIndex].defaultValue, index, riskFactorIndex, (riskFactor.minAmt || riskFactor.minPrem), (riskFactor.maxAmt || riskFactor.maxPrem),riskFactor )"
|
||||
@change="
|
||||
stepperChange(
|
||||
item.calFactorLst[riskFactorIndex].defaultValue,
|
||||
index,
|
||||
riskFactorIndex,
|
||||
riskFactor.minAmt || riskFactor.minPrem,
|
||||
riskFactor.maxAmt || riskFactor.maxPrem,
|
||||
riskFactor
|
||||
)
|
||||
"
|
||||
input-width="100"
|
||||
:integer="false"
|
||||
/>
|
||||
@@ -70,17 +64,13 @@
|
||||
<div class="border-bottom" v-if="riskFactor.type == 3">
|
||||
<div class="pv12 border-bd">{{ riskFactor.name }}</div>
|
||||
<div class="duty">
|
||||
<div
|
||||
class="flex justify-content-s border-bd pv10 align-items-c"
|
||||
v-for="(dutyItem, dutyItemIndex) in riskFactor.rules"
|
||||
:key="dutyItemIndex"
|
||||
>
|
||||
<div class="flex justify-content-s border-bd pv10 align-items-c" v-for="(dutyItem, dutyItemIndex) in riskFactor.rules" :key="dutyItemIndex">
|
||||
<span class="fs14 w100">{{ dutyItem.dutyName }}({{ dutyItem.suffix }})</span>
|
||||
<div class="flex">
|
||||
<van-stepper
|
||||
v-model="dutyItem.defaultDutyAmt"
|
||||
:min="dutyItem.minDutyAmt"
|
||||
:max=" dutyItem.maxDutyAmt"
|
||||
:max="dutyItem.maxDutyAmt"
|
||||
:show-plus="false"
|
||||
:show-minus="false"
|
||||
class="ml10 mr10"
|
||||
@@ -112,68 +102,121 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="item.isRemit == 1 && isTrial !== '' && item.isMainRisk == 0">
|
||||
<div v-for="(riskFactor, riskFactorIndex) in item.calFactorLst" :key="riskFactorIndex">
|
||||
<div class="flex justify-content-s pv10 border-bottom" v-if="riskFactor.type == 1">
|
||||
<div class="flex align-items-c">
|
||||
<span v-if="riskFactor.suffix" class="fs14">{{ riskFactor.name + '(' + riskFactor.suffix + ')' }}</span>
|
||||
<span v-else class="fs14">{{ riskFactor.name }} </span>
|
||||
<!-- {{riskFactorIndex}} -->
|
||||
<van-stepper
|
||||
v-model="defalutAmt"
|
||||
:min="item.productTrialYearDTOS[riskFactorIndex].minAmt || item.productTrialYearDTOS[riskFactorIndex].minPrem"
|
||||
:max="item.productTrialYearDTOS[riskFactorIndex].maxAmt || item.productTrialYearDTOS[riskFactorIndex].maxPrem"
|
||||
:show-plus="false"
|
||||
:show-minus="false"
|
||||
class="ml30"
|
||||
@change="
|
||||
stepperChange(
|
||||
item.productTrialYearDTOS[riskFactorIndex].defaultValue,
|
||||
index,
|
||||
riskFactorIndex,
|
||||
item.productTrialYearDTOS[riskFactorIndex].minAmt || item.productTrialYearDTOS[riskFactorIndex].minPrem,
|
||||
item.productTrialYearDTOS[riskFactorIndex].maxAmt || item.productTrialYearDTOS[riskFactorIndex].maxPrem,
|
||||
item.productTrialYearDTOS[riskFactorIndex]
|
||||
)
|
||||
"
|
||||
input-width="100"
|
||||
:integer="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="flex justify-content-s pv10 border-bottom"
|
||||
v-if="riskFactor.type == 0"
|
||||
:class="{ hidden: riskFactor.code == 'payEndYear' && item.isHidden }"
|
||||
>
|
||||
<van-field
|
||||
v-model="riskFactor.showContent"
|
||||
readonly
|
||||
:label="riskFactor.name"
|
||||
right-icon="arrow"
|
||||
placeholder="请选择"
|
||||
@click="toSelect(index, riskFactorIndex, riskFactor.columns)"
|
||||
/>
|
||||
</div>
|
||||
<div class="border-bottom" v-if="riskFactor.type == 3">
|
||||
<div class="pv12 border-bd">{{ riskFactor.name }}</div>
|
||||
<div class="duty">
|
||||
<div class="flex justify-content-s border-bd pv10 align-items-c" v-for="(dutyItem, dutyItemIndex) in riskFactor.rules" :key="dutyItemIndex">
|
||||
<span class="fs14 w100">{{ dutyItem.dutyName }}({{ dutyItem.suffix }})</span>
|
||||
<div class="flex">
|
||||
<van-stepper
|
||||
v-model="dutyItem.defaultDutyAmt"
|
||||
:min="dutyItem.minDutyAmt"
|
||||
:max="dutyItem.maxDutyAmt"
|
||||
:show-plus="false"
|
||||
:show-minus="false"
|
||||
class="ml10 mr10"
|
||||
@focus="focusStep"
|
||||
@blur="blurStep"
|
||||
@change="
|
||||
dutyStepperChange(
|
||||
item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt,
|
||||
index,
|
||||
riskFactorIndex,
|
||||
dutyItemIndex,
|
||||
dutyItem.necess,
|
||||
dutyItem.minDutyAmt,
|
||||
dutyItem.maxDutyAmt
|
||||
)
|
||||
"
|
||||
input-width="200"
|
||||
:integer="false"
|
||||
/>
|
||||
<van-checkbox
|
||||
v-model="dutyItem.necess"
|
||||
:disabled="dutyItem.defaultValue == '0'"
|
||||
shape="square"
|
||||
@change="changeChecked(index, riskFactorIndex, dutyItemIndex)"
|
||||
></van-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 豁免险条件 -->
|
||||
<div v-if="item.isRemit == 0">
|
||||
<div v-for="(riskFactor, riskFactorIndex) in item.calFactorLst" :key="riskFactorIndex">
|
||||
<div class="flex justify-content-s pv10 border-bottom">
|
||||
<div class="flex">
|
||||
<van-field
|
||||
v-if="riskFactor.type == 0"
|
||||
v-model="riskFactor.showContent"
|
||||
readonly
|
||||
:label="riskFactor.name"
|
||||
/>
|
||||
<van-field
|
||||
v-if="riskFactor.type == 1"
|
||||
v-model="riskFactor.defaultValue"
|
||||
readonly
|
||||
:label="riskFactor.name + '(' + riskFactor.suffix + ')'"
|
||||
/>
|
||||
<van-field v-if="riskFactor.type == 0" v-model="riskFactor.showContent" readonly :label="riskFactor.name" />
|
||||
<van-field v-if="riskFactor.type == 1" v-model="riskFactor.defaultValue" readonly :label="riskFactor.name + '(' + riskFactor.suffix + ')'" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 只有万能险且只有建议书才展示 -->
|
||||
<van-field
|
||||
class="pv10"
|
||||
v-if="item.hasPredictTransferPrem === '0'"
|
||||
v-model="item.predictTransferPrem"
|
||||
label="预计转入保费"
|
||||
placeholder="请输入"
|
||||
/>
|
||||
<div
|
||||
class="flex justify-content-s pv10 border-bottom"
|
||||
v-if="isRelated && isFrom != 'proposal'"
|
||||
>
|
||||
<van-field
|
||||
v-model="policyNo"
|
||||
clearable
|
||||
label="关联保单"
|
||||
name="关联保单号"
|
||||
maxlength="20"
|
||||
placeholder="请输入保单号/投保单号"
|
||||
/>
|
||||
<van-field class="pv10" v-if="item.hasPredictTransferPrem === '0'" v-model="item.predictTransferPrem" label="预计转入保费" placeholder="请输入" />
|
||||
<div class="flex justify-content-s pv10 border-bottom" v-if="isRelated && isFrom != 'proposal'">
|
||||
<van-field v-model="policyNo" clearable label="关联保单" name="关联保单号" maxlength="20" placeholder="请输入保单号/投保单号" />
|
||||
</div>
|
||||
<div class="flex justify-content-s pv10 border-bottom prem">
|
||||
<span
|
||||
style="font-weight:bold"
|
||||
v-if="(trialList.length > 0 && trialList[index].trialType == 0) || (trialList.length > 0 && trialList[index].trialType == 2)"
|
||||
>首期保费(元):</span>
|
||||
v-if="(trialList.length > 0 && trialList[index].trialType == 0) || (trialList.length > 0 && trialList[index].trialType == 2) || isTrial === '0'"
|
||||
>首期保费(元):</span
|
||||
>
|
||||
<span style="font-weight:bold" v-else>保额(元):</span>
|
||||
<span
|
||||
class="fee red"
|
||||
v-if="trialList && trialList.length > 0"
|
||||
>{{ trialList[index].prem.toFixed(2) | moneyFormat }}</span>
|
||||
<span class="fee red" v-if="trialList && trialList.length > 0">{{ trialList[index].prem.toFixed(2) | moneyFormat }}</span>
|
||||
<span class="fee red" v-if="isTrial === '0' && item.isMainRisk == '1'">0.00</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom-btn bg-white">
|
||||
<van-button
|
||||
type="danger"
|
||||
size="large"
|
||||
@click="nextStep"
|
||||
:disabled="nextStepFlag"
|
||||
v-no-more-click="1000"
|
||||
>完成</van-button>
|
||||
<van-button type="danger" size="large" @click="nextStep" :disabled="nextStepFlag" v-no-more-click="1000">完成</van-button>
|
||||
</div>
|
||||
<van-action-sheet v-model="show" cancel-text="取消" :actions="policyInfo" @select="openDocument" />
|
||||
|
||||
@@ -226,7 +269,9 @@ export default {
|
||||
mult: '',
|
||||
isFrom: '',
|
||||
// 默认钱数
|
||||
defalutAmt: ''
|
||||
defalutAmt: '',
|
||||
//是否需要调试算接口标志 0-不需要调取
|
||||
isTrial: localStorage.isTrial
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -281,8 +326,10 @@ export default {
|
||||
}
|
||||
|
||||
this.mainRiskInfluenceAddRisk()
|
||||
//初始化数据试算
|
||||
this.getTrial()
|
||||
//初始化数据试算 isTrial是否调后端保费试算 /sale/ insure/trial 接口标志,0-不调取
|
||||
if (localStorage.isTrial === '') {
|
||||
this.getTrial()
|
||||
}
|
||||
},
|
||||
// 责任保额份数变化
|
||||
dutyStepperChange(value, productIndex, calFactorIndex, dutyItemIndex, isChecked, min, max) {
|
||||
@@ -309,7 +356,9 @@ export default {
|
||||
item.amt = Number(item.minDutyAmt) * Number(item.moneyUnit)
|
||||
})
|
||||
this.mainRiskInfluenceAddRisk()
|
||||
this.getTrial()
|
||||
if (localStorage.isTrial === '') {
|
||||
this.getTrial()
|
||||
}
|
||||
} else {
|
||||
;[this.productIndex, this.calFactorIndex] = [productIndex, calFactorIndex]
|
||||
let currentEle = this.chooseProducts[productIndex].calFactorLst[calFactorIndex].rules
|
||||
@@ -362,7 +411,9 @@ export default {
|
||||
}
|
||||
this.hiddenPayEndYear(currentEle)
|
||||
//特殊规则:设置豁免险
|
||||
this.getTrial()
|
||||
if (localStorage.isTrial === '') {
|
||||
this.getTrial()
|
||||
}
|
||||
}
|
||||
|
||||
this.popupShow = false
|
||||
@@ -379,7 +430,9 @@ export default {
|
||||
return false
|
||||
}
|
||||
this.mainRiskInfluenceAddRisk()
|
||||
this.getTrial()
|
||||
if (localStorage.isTrial === '') {
|
||||
this.getTrial()
|
||||
}
|
||||
},
|
||||
// 计步器聚焦
|
||||
focusStep() {
|
||||
@@ -652,7 +705,9 @@ export default {
|
||||
}
|
||||
|
||||
localStorage.chooseProducts = JSON.stringify(this.chooseProducts)
|
||||
this.getTrial()
|
||||
if (localStorage.isTrial === '') {
|
||||
this.getTrial()
|
||||
}
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
@@ -804,10 +859,12 @@ export default {
|
||||
} else {
|
||||
this.mainRiskInfluenceAddRisk()
|
||||
currentEle['amt'] = Number(this.defalutAmt) * Number(currentEle.moneyUnit)
|
||||
this.getTrial()
|
||||
if (localStorage.isTrial === '') {
|
||||
this.getTrial()
|
||||
}
|
||||
}
|
||||
}
|
||||
//被保人年龄如果在66-75之间
|
||||
//被保人年龄如果在66-75之间
|
||||
} else if (this.saleInsuredPersonInfo.age >= 66 && this.saleInsuredPersonInfo.age <= 75) {
|
||||
//使用rules规则里的第一条控制保额份数
|
||||
if (Number(this.defalutAmt) < Number(riskFactor.rules[0].minPrem) || Number(this.defalutAmt) > Number(riskFactor.rules[0].maxPrem)) {
|
||||
@@ -821,11 +878,32 @@ export default {
|
||||
} else {
|
||||
this.mainRiskInfluenceAddRisk()
|
||||
currentEle['amt'] = Number(this.defalutAmt) * Number(currentEle.moneyUnit)
|
||||
if (localStorage.isTrial === '') {
|
||||
this.getTrial()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//isTrial为0 ---暂时为富娃娃两全保险(万能型专配)输入保费校验
|
||||
} else if (this.isTrial === '0' && this.chooseProducts[productIndex].isMainRisk == '0') {
|
||||
if (Number(this.defalutAmt) < Number(min) || Number(this.defalutAmt) > Number(max)) {
|
||||
// this.$toast(localStorage.hint)
|
||||
this.$toast(4444444)
|
||||
this.nextStepFlag = true
|
||||
} else {
|
||||
if ((Number(this.defalutAmt) * 10000) % (Number(currentEle.limit) * 10000) != 0) {
|
||||
// this.defalutAmt = currentEle.rules[productIndex].displayAmount
|
||||
this.$toast(localStorage.hint)
|
||||
this.nextStepFlag = true
|
||||
} else {
|
||||
this.mainRiskInfluenceAddRisk()
|
||||
currentEle['amt'] = Number(this.defalutAmt) * Number(currentEle.moneyUnit)
|
||||
if (localStorage.isTrial === '') {
|
||||
this.getTrial()
|
||||
}
|
||||
}
|
||||
}
|
||||
//其他产品按照原先的逻辑判断
|
||||
//其他产品按照原先的逻辑判断
|
||||
} else {
|
||||
if (Number(this.defalutAmt) < Number(min) || Number(this.defalutAmt) > Number(max)) {
|
||||
this.$toast(localStorage.hint)
|
||||
@@ -838,7 +916,9 @@ export default {
|
||||
} else {
|
||||
this.mainRiskInfluenceAddRisk()
|
||||
currentEle['amt'] = Number(this.defalutAmt) * Number(currentEle.moneyUnit)
|
||||
this.getTrial()
|
||||
if (localStorage.isTrial === '') {
|
||||
this.getTrial()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -897,7 +977,7 @@ export default {
|
||||
//万能型产品保费赋值给保额
|
||||
//增加判断是否是从建议书跳转过来了的
|
||||
if (localStorage.isFrom != 'proposal') {
|
||||
if (this.trialList[index].productCode == 'GFRS_M0003') {
|
||||
if (this.trialList[index].productCode == 'GFRS_M0003' || 'GFRS_M0015') {
|
||||
// console.log('2222222222')
|
||||
riskItem['amt'] = this.trialList[index].prem
|
||||
}
|
||||
|
||||
@@ -94,11 +94,13 @@ export default {
|
||||
},
|
||||
//储存主险
|
||||
async addMainRisk() {
|
||||
localStorage.setItem('isTrial', '')
|
||||
let riskProductCode = this.result.riskProductCode
|
||||
let resultData = await calculatePremium({ productCodes: [riskProductCode], platform: 'app', type: '1' })
|
||||
if (resultData.result == 0) {
|
||||
resultData = resultData.trialDTOS[0]
|
||||
localStorage.hint = resultData.hint
|
||||
localStorage.isTrial = resultData.productTrialInfoDTO.isTrial
|
||||
if (resultData.productTrialInfoDTO.dutyGroup != null) {
|
||||
resultData.productTrialInfoDTO.dutyGroup.map(item => {
|
||||
if (item.dutyName == '意外身故/伤残保险金') {
|
||||
@@ -132,26 +134,43 @@ export default {
|
||||
|
||||
//保存附加险
|
||||
localStorage.addtionRiskLst = JSON.stringify(resultData.productTrialInfoDTO.addtionRiskLst)
|
||||
// console.log('resultData', resultData)
|
||||
localStorage.isAutoPay = resultData.isAutoPay
|
||||
localStorage.isRenew = resultData.isRenew
|
||||
localStorage.isRelated = resultData.isRelated
|
||||
let calFactorLst = this.getFactorList(resultData)
|
||||
let productTrialYearDTOS = localStorage.isTrial === '' ? null : resultData.productTrialInfoDTO.productTrialYearDTOS
|
||||
let hasAddtionRisk = resultData.productTrialInfoDTO.addtionRiskLst ? true : false
|
||||
let currentProductInfo = {
|
||||
calFactorLst,
|
||||
hasAddtionRisk,
|
||||
isMainRisk: 0,
|
||||
riskType: resultData.riskType,
|
||||
riskName: this.result.riskName,
|
||||
productCode: this.result.riskProductCode,
|
||||
mainRiskCode: this.result.riskProductCode,
|
||||
documentDTOS: resultData.productTrialInfoDTO.documentDTOS,
|
||||
influences: resultData.productTrialInfoDTO.influences,
|
||||
isRemit: resultData.productTrialInfoDTO.isRemit,
|
||||
hasPredictTransferPrem: resultData.productTrialInfoDTO.hasPredictTransferPrem, //建议书使用 是否展示预计转入保费
|
||||
predictTransferPrem: null //建议书使用 预计转入保费字段
|
||||
}
|
||||
let currentProductInfo =
|
||||
localStorage.isTrial === ''
|
||||
? {
|
||||
calFactorLst,
|
||||
hasAddtionRisk,
|
||||
isMainRisk: 0,
|
||||
riskType: resultData.riskType,
|
||||
riskName: this.result.riskName,
|
||||
productCode: this.result.riskProductCode,
|
||||
mainRiskCode: this.result.riskProductCode,
|
||||
documentDTOS: resultData.productTrialInfoDTO.documentDTOS,
|
||||
influences: resultData.productTrialInfoDTO.influences,
|
||||
isRemit: resultData.productTrialInfoDTO.isRemit,
|
||||
hasPredictTransferPrem: resultData.productTrialInfoDTO.hasPredictTransferPrem, //建议书使用 是否展示预计转入保费
|
||||
predictTransferPrem: null //建议书使用 预计转入保费字段
|
||||
}
|
||||
: {
|
||||
productTrialYearDTOS,
|
||||
calFactorLst,
|
||||
hasAddtionRisk,
|
||||
isMainRisk: 0,
|
||||
riskType: resultData.riskType,
|
||||
riskName: this.result.riskName,
|
||||
productCode: this.result.riskProductCode,
|
||||
mainRiskCode: this.result.riskProductCode,
|
||||
documentDTOS: resultData.productTrialInfoDTO.documentDTOS,
|
||||
influences: resultData.productTrialInfoDTO.influences,
|
||||
isRemit: resultData.productTrialInfoDTO.isRemit,
|
||||
hasPredictTransferPrem: resultData.productTrialInfoDTO.hasPredictTransferPrem, //建议书使用 是否展示预计转入保费
|
||||
predictTransferPrem: null //建议书使用 预计转入保费字段
|
||||
}
|
||||
|
||||
//构建险种数组
|
||||
let productsData
|
||||
|
||||
Reference in New Issue
Block a user