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 //自动续保
@@ -194,7 +203,7 @@ export default {
/********start 附加险选择限制 start******/ /********start 附加险选择限制 start******/
//判断被保 八桂D //判断被保 八桂D
/* let mainRisk = JSON.parse(this.$CacheUtils.getLocItem('chooseProducts'))[0]; /* let mainRisk = JSON.parse(this.$CacheUtils.getLocItem('chooseProducts'))[0];
let mainRiskCode = mainRisk.productCode; let mainRiskCode = mainRisk.productCode;
let addRiskCodes = localStorage.addRiskCodes && JSON.parse(localStorage.addRiskCodes) let addRiskCodes = localStorage.addRiskCodes && JSON.parse(localStorage.addRiskCodes)
if(mainRiskCode =='GFRS_M0044'||mainRiskCode =='GFRS_M0051'){ if(mainRiskCode =='GFRS_M0044'||mainRiskCode =='GFRS_M0051'){
@@ -280,7 +289,7 @@ export default {
// } // }
// } // }
// } // }
/*"let risks = JSON.parse(localStorage.chooseProducts);", /*"let risks = JSON.parse(localStorage.chooseProducts);",
"let checkRisk = true;", "let checkRisk = true;",
"for (let i = 1; i < risks.length; i++) {", "for (let i = 1; i < risks.length; i++) {",
"for(let j = 0; j < risks.calFactorLst.length; j++){", "for(let j = 0; j < risks.calFactorLst.length; j++){",
@@ -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

@@ -42,34 +42,37 @@ export default {
return false return false
}, },
//投、被保险人年龄对险种的限制 //投、被保险人年龄对险种的限制
ageLimit(resultData, vm, isApplicant,riskProductCode) { ageLimit(resultData, vm, isApplicant, riskProductCode) {
let age, tips,maxAge let age, tips, maxAge
if (isApplicant) { if (isApplicant) {
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
}else{ ? utilsAge.getAge29(this.getSaleInsuredPersonInfo().birthday, new Date())
: this.getSaleInsuredPersonInfo().insuredAge
age = this.getSaleInsuredPersonInfo().birthday?utilsAge.getAgeByValue(this.getSaleInsuredPersonInfo().birthday, new Date()):this.getSaleInsuredPersonInfo().insuredAge } else {
age = this.getSaleInsuredPersonInfo().birthday
? 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 {
maxAge=70 maxAge = 70
} }
}else{ } else {
maxAge = resultData.productTrialInfoDTO.ageRange && resultData.productTrialInfoDTO.ageRange.maxAge maxAge = resultData.productTrialInfoDTO.ageRange && resultData.productTrialInfoDTO.ageRange.maxAge
} }
@@ -117,7 +120,7 @@ export default {
return false return false
}, },
//寿险等级对附加险的影响 标识--卡单 //寿险等级对附加险的影响 标识--卡单
lifeGradeLimitCard(resultData, vm ,cuttentLifeGrade) { lifeGradeLimitCard(resultData, vm, cuttentLifeGrade) {
let lifeGrade = resultData.productInsuredDTO.lifeGrade let lifeGrade = resultData.productInsuredDTO.lifeGrade
if (lifeGrade == 0) return false if (lifeGrade == 0) return false
if (Number(cuttentLifeGrade) > Number(lifeGrade)) { if (Number(cuttentLifeGrade) > Number(lifeGrade)) {
@@ -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() {
@@ -149,10 +156,10 @@ export default {
//获取产品售卖权限列表 //获取产品售卖权限列表
getProductSellPermissionList(val, that, isCrossChannel) { getProductSellPermissionList(val, that, isCrossChannel) {
let resultData = { let resultData = {
flag:true, flag: true,
resultMessage:'' resultMessage: ''
} }
const data = { productCodes: [val] ,isCrossChannel: isCrossChannel} const data = { productCodes: [val], isCrossChannel: isCrossChannel }
if (Object.prototype.toString.call(val) === '[object Array]') data.productCodes = [...val] if (Object.prototype.toString.call(val) === '[object Array]') data.productCodes = [...val]
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
productCheck(data).then( productCheck(data).then(
@@ -178,7 +185,7 @@ export default {
}, },
//校验投保人工作单位是否有权限投保该产品 //校验投保人工作单位是否有权限投保该产品
//isAsync 是否协同工作单位 0否 1是 //isAsync 是否协同工作单位 0否 1是
checkCompany(val, workcompany,isAsync, that) { checkCompany(val, workcompany, isAsync, that) {
let flag = true let flag = true
let columns = [] let columns = []
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
@@ -213,7 +220,7 @@ export default {
flag.manageComCode = res.manageComCode ? res.manageComCode.substring(2, 4) : '' flag.manageComCode = res.manageComCode ? res.manageComCode.substring(2, 4) : ''
flag.jobNo = res.jobNo flag.jobNo = res.jobNo
flag.branchType = res.branchType flag.branchType = res.branchType
// 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') {
flag.branchTypeVal = 'G' flag.branchTypeVal = 'G'
} else if (res.branchType == 'N5' || res.branchType == '5') { } else if (res.branchType == 'N5' || res.branchType == '5') {

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"
}
]
}