feat: 针对保费计算做出修改

This commit is contained in:
hz
2025-10-23 09:16:33 +08:00
parent e03a874ff9
commit dbca72e773
4 changed files with 379 additions and 304 deletions

View File

@@ -11,8 +11,7 @@
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>
</van-radio-group> </van-radio-group>
<van-button class="bottom-btn" type="danger" @click="nextStep" v-if="showNext">完成</van-button>
<van-button class="bottom-btn" type="danger" @click="nextStep">完成</van-button>
</div> </div>
</template> </template>
<script> <script>
@@ -39,12 +38,18 @@ export default {
mainRiskCode: '' mainRiskCode: ''
} }
}, },
props: {
showNext: {
type: Boolean,
default: true
}
},
mounted() { mounted() {
this.$jump({ this.$jump({
flag: 'navigation', flag: 'navigation',
extra: { extra: {
title: '附加险选择列表' title: '附加险选择列表'
}, }
}) })
//获取投保人信息 //获取投保人信息
if (this.$CacheUtils.getLocItem('saleInsuredPersonInfo')) { if (this.$CacheUtils.getLocItem('saleInsuredPersonInfo')) {
@@ -52,7 +57,7 @@ export default {
} }
getAgentInfo({}).then(res => { getAgentInfo({}).then(res => {
// branchType N1、1代表个险渠道 和 N5、5 代表中介渠道N代表内勤 // branchType N1、1代表个险渠道 和 N5、5 代表中介渠道N代表内勤
if (res.branchType == 'N1' || res.branchType == '1') { if (res.branchType === 'N1' || res.branchType == '1') {
this.branchTypeVal = 'G' this.branchTypeVal = 'G'
} else if (res.branchType == 'N5' || res.branchType == '5') { } else if (res.branchType == 'N5' || res.branchType == '5') {
this.branchTypeVal = 'Z' this.branchTypeVal = 'Z'
@@ -78,8 +83,13 @@ export default {
if ( if (
currentMainRiskInfo.mainRiskPayEndYearFlag == 'Y' && currentMainRiskInfo.mainRiskPayEndYearFlag == 'Y' &&
currentMainRiskInfo.mainRiskPayEndYear == '1000' && currentMainRiskInfo.mainRiskPayEndYear == '1000' &&
(item.productCode == 'GFRS_A0007' || item.productCode == 'GFRS_A0009'|| item.productCode == 'GFRS_A0010'|| item.productCode == 'GFRS_A0013' || item.productCode == 'GFRS_A0014' (item.productCode == 'GFRS_A0007' ||
|| item.productCode == 'GFRS_A0015' || item.productCode == 'GFRS_A0016') item.productCode == 'GFRS_A0009' ||
item.productCode == 'GFRS_A0010' ||
item.productCode == 'GFRS_A0013' ||
item.productCode == 'GFRS_A0014' ||
item.productCode == 'GFRS_A0015' ||
item.productCode == 'GFRS_A0016')
) { ) {
item.isHidden = 1 item.isHidden = 1
} }
@@ -96,14 +106,13 @@ export default {
} }
//添加附加险 //添加附加险
this.addAddtionRisk() this.addAdditionRisk()
}, },
//储存附加险 //储存附加险
async addAddtionRisk() { async addAdditionRisk() {
let riskProductCode = this.result.productCode let riskProductCode = this.result.productCode
let resultData = await calculatePremium({ productCodes: [riskProductCode], platform: 'app', type: '1' }) let resultData = await calculatePremium({ productCodes: [riskProductCode], platform: 'app', type: '1' })
if (resultData.result === '0') { if (resultData.result === '0') {
resultData = resultData.trialDTOS[0] resultData = resultData.trialDTOS[0]
localStorage.isAutoPay = localStorage.isAutoPay === '0' ? '0' : resultData.isAutoPay //自动垫交 localStorage.isAutoPay = localStorage.isAutoPay === '0' ? '0' : resultData.isAutoPay //自动垫交
localStorage.isRenew = localStorage.isRenew === '0' ? '0' : resultData.isRenew //自动续保 localStorage.isRenew = localStorage.isRenew === '0' ? '0' : resultData.isRenew //自动续保
@@ -305,7 +314,7 @@ export default {
} }
productsData = this.$utils.unrepeatObj(productsData, 'productCode') //产品数组去重,跳转试算页面未成功重复添加同一产品的情况 productsData = this.$utils.unrepeatObj(productsData, 'productCode') //产品数组去重,跳转试算页面未成功重复添加同一产品的情况
localStorage.chooseProducts = JSON.stringify(productsData) localStorage.chooseProducts = JSON.stringify(productsData)
this.jumpTo() // this.jumpTo()
} else { } else {
this.$toast(resultData.resultMessage) this.$toast(resultData.resultMessage)
} }
@@ -390,7 +399,14 @@ export default {
//国富人寿附加豁免保险费重大疾病保险B款 GFRS_A0009 //国富人寿附加豁免保险费重大疾病保险B款 GFRS_A0009
//国富人寿鑫享年年终身寿险--只针对这款产品 //国富人寿鑫享年年终身寿险--只针对这款产品
if (this.mainRiskCode == 'GFRS_M0036') { if (this.mainRiskCode == 'GFRS_M0036') {
if (this.branchTypeVal == 'Z' && (productCode == 'GFRS_A0007' || productCode == 'GFRS_A0009'|| productCode == 'GFRS_A0010'||productCode == 'GFRS_A0013'|| productCode == 'GFRS_A0014')) { if (
this.branchTypeVal == 'Z' &&
(productCode == 'GFRS_A0007' ||
productCode == 'GFRS_A0009' ||
productCode == 'GFRS_A0010' ||
productCode == 'GFRS_A0013' ||
productCode == 'GFRS_A0014')
) {
if (relationToAppnt == 1) { if (relationToAppnt == 1) {
this.$toast('投被同人不能选取此款险种!') this.$toast('投被同人不能选取此款险种!')
return true return true

View File

@@ -48,22 +48,25 @@ export default {
age = this.getSaleInsuredInfo().age age = this.getSaleInsuredInfo().age
tips = '投保人年龄不适合此款险种,请选择其他险种!' tips = '投保人年龄不适合此款险种,请选择其他险种!'
} else { } else {
if (['GFRS_M0061', 'GFRS_M0102', 'GFRS_M0101'].includes(riskProductCode)) { if (riskProductCode === 'GFRS_M0061' || riskProductCode === 'GFRS_M0102' || riskProductCode === 'GFRS_M0101') {
age = this.getSaleInsuredPersonInfo().birthday?utilsAge.getAge29(this.getSaleInsuredPersonInfo().birthday, new Date()):this.getSaleInsuredPersonInfo().insuredAge age = this.getSaleInsuredPersonInfo().birthday
? utilsAge.getAge29(this.getSaleInsuredPersonInfo().birthday, new Date())
: this.getSaleInsuredPersonInfo().insuredAge
} else { } else {
age = this.getSaleInsuredPersonInfo().birthday
age = this.getSaleInsuredPersonInfo().birthday?utilsAge.getAgeByValue(this.getSaleInsuredPersonInfo().birthday, new Date()):this.getSaleInsuredPersonInfo().insuredAge ? utilsAge.getAgeByValue(this.getSaleInsuredPersonInfo().birthday, new Date())
: this.getSaleInsuredPersonInfo().insuredAge
} }
tips = '被保险人年龄不适合此款险种,请选择其他险种!' tips = '被保险人年龄不适合此款险种,请选择其他险种!'
} }
let minAge = resultData.productTrialInfoDTO.ageRange && resultData.productTrialInfoDTO.ageRange.minAge let minAge = resultData.productTrialInfoDTO.ageRange && resultData.productTrialInfoDTO.ageRange.minAge
if(riskProductCode == 'GFRS_M0111'){ if (riskProductCode === 'GFRS_M0111') {
if (this.getSaleInsuredPersonInfo().sex == 0) { if (this.getSaleInsuredPersonInfo().sex == 0) {
maxAge = 70 maxAge = 70
} else { } else {
maxAge = 73 maxAge = 73
} }
}else if(riskProductCode == 'GFRS_M0110'){ } else if (riskProductCode === 'GFRS_M0110') {
if (this.getSaleInsuredPersonInfo().sex == 0) { if (this.getSaleInsuredPersonInfo().sex == 0) {
maxAge = 68 maxAge = 68
} else { } else {
@@ -139,7 +142,11 @@ export default {
}, },
//获取被保险人信息 //获取被保险人信息
getSaleInsuredPersonInfo() { getSaleInsuredPersonInfo() {
return CacheUtils.getLocItem('saleInsuredPersonInfo') && JSON.parse(CacheUtils.getLocItem('saleInsuredPersonInfo')) const saleInsuredPersonInfo = CacheUtils.getLocItem('saleInsuredPersonInfo')
if (saleInsuredPersonInfo !== null && saleInsuredPersonInfo) {
return JSON.parse(CacheUtils.getLocItem('saleInsuredPersonInfo'))
}
return ""
}, },
//获取投保人信息 //获取投保人信息
getSaleInsuredInfo() { getSaleInsuredInfo() {

View File

@@ -1,3 +1,4 @@
# 获取内容详情
POST https://iagentsales-test2.e-guofu.com:5200/api/v1/sale/product/getDetail HTTP/1.1 POST https://iagentsales-test2.e-guofu.com:5200/api/v1/sale/product/getDetail HTTP/1.1
Accept: application/json, text/plain, */* Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br, zstd Accept-Encoding: gzip, deflate, br, zstd
@@ -28,3 +29,39 @@ token: {{token}}
"type": "1" "type": "1"
} }
###
# 进行试算
POST https://iagentsales-test2.e-guofu.com:5200/api/v1/sale/insure/trial HTTP/1.1
Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: zh,zh-CN;q=0.9
Connection: keep-alive
Content-Type: application/json;charset=UTF-8
DNT: 1
Host: iagentsales-test2.e-guofu.com:5200
Origin: http://localhost:8082
Referer: http://localhost:8082/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
timeStr: 1761117811135
token: cc4674542fa541ca830bfc2042da4917
{
"trialInfos": [
{
"payIntv": "12",
"insuYear": "106",
"insuYearFlag": "A",
"payEndYear": "5",
"payEndYearFlag": "Y",
"amt": 1,
"birthday": "1995-10-22",
"sex": "0",
"platformType": "app",
"productCode": "GFRS_M0035",
"medical": "",
"isCrossChannel": "0"
}
]
}