Merge branch 'release/0416' into 0416/GFRS-765【0423】电投自核规则前端进行转译提示

# Conflicts:
#	src/assets/js/utils/validator.js
#	src/views/ebiz/sale/AddBeneficiaryInfo.vue
#	src/views/ebiz/sale/AttachmentManagement.vue
#	src/views/ebiz/sale/InsuredPerson.vue
This commit is contained in:
tian.guangyuan
2020-04-16 10:39:09 +08:00
147 changed files with 11834 additions and 3625 deletions

View File

@@ -77,7 +77,7 @@
:show-minus="false"
class="ml10 mr10"
@focus="focusStep"
@blur="blurStep(dutyItem)"
@blur="blurStep(dutyItem, index)"
@change="
dutyStepperChange(
item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt,
@@ -163,7 +163,7 @@
:show-minus="false"
class="ml10 mr10"
@focus="focusStep"
@blur="blurStep(dutyItem)"
@blur="blurStep(dutyItem, index)"
@change="
dutyStepperChange(
item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt,
@@ -216,7 +216,7 @@
class="ml10 mr10"
:disabled="dutyItem.changeWithMainRisk === true ? 'disabled' : ''"
@focus="focusStep"
@blur="blurStep(dutyItem)"
@blur="blurStep(dutyItem, index)"
@change="
dutyStepperChange(
item.calFactorLst[riskFactorIndex].rules[dutyItemIndex].defaultDutyAmt,
@@ -246,7 +246,16 @@
<!-- 只有万能险且只有建议书才展示 -->
<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
v-model="policyNo"
clearable
label="关联保单"
name="关联保单号"
maxlength="380"
type="textarea"
autosize
placeholder="请录入保单号或者投保单号,如果关联多个保单,请用\隔开"
/>
</div>
<div class="flex justify-content-s pv10 border-bottom prem">
<span
@@ -255,7 +264,7 @@
>首期保费</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].showPrem.toFixed(2) | moneyFormat }}</span>
</div>
</div>
<div class="bottom-btn bg-white">
@@ -307,6 +316,20 @@ const dutyRules = {
msg: '意外住院津贴日额最低基本保险金额为10元/天超过最低基本保险金额为10元/天整数倍最高不得超过200元/天'
}
}
const dutyGFRS_A0004Rules = {
320205: {
mainRisk: 'GFRS_M0005',
msg: '住院医疗提示金额只能是0.5、1、1.5、2',
msg_1: '附加到国富人寿国富民惠医疗保险2020版最高基本保额不超过1万元。',
msg_2: '住院医疗提示金额只能是0.5、1',
},
320206: {
msg: '住院津贴提示:投保可选责任时,可选责任最低投保 50 元,且应为 10 元的整数倍'
},
320207: {
msg: '恶性肿瘤提示:投保可选责任时,可选责任最低投保 50 元,且应为 10 元的整数倍'
}
}
const DUTY_DEFAULT_MUTIPLE = 1000
const DUTY_DEFAULT_MIN = 10000
@@ -377,7 +400,7 @@ export default {
if (localStorage.saleInsuredInfo) {
this.saleInsuredInfo = JSON.parse(localStorage.saleInsuredInfo)
}
//获取被保人信息
//获取被保人信息
if (localStorage.saleInsuredPersonInfo) {
this.saleInsuredPersonInfo = JSON.parse(localStorage.saleInsuredPersonInfo)
}
@@ -407,54 +430,48 @@ export default {
// }
// })
// }
//保存险种编号
this.mainRiskCode = item.mainRiskCode
//保存主险险种编号
if (item.isMainRisk == 0) {
this.mainRiskCode = item.mainRiskCode
}
})
if(this.mainRiskCode == 'GFRS_M0005'){
this.chooseProducts.map(item => {
if(item.productCode == 'GFRS_A0004'){
item.calFactorLst.map( item2 => {
if(item2.code == 'dutyGroup'){
item2.rules.map(item3 => {
console.log(item3);
if(item3.duty == '320205'){
item3.maxDutyAmt = "1"
}
})
}
})
}
})
}
//GFRS_M0016需要展示免赔额和赔付比例并需要根据是否有社保调整数值
// let mainRiskCode = chooseProducts[0].mainRiskCode
this.chooseProducts.map(item => {
if (item.mainRiskCode === 'GFRS_M0016') {
const orderNo = localStorage.getItem('orderNo')
let detailPromise = this.isFrom === 'proposal' ? new Promise(r => r(localStorage.getItem('proposalMedical'))) : getOrderDetail({ orderNo })
detailPromise.then(res => {
let isMedical = null
if (this.isFrom === 'proposal') {
isMedical = res === '1'
} else {
isMedical = res.orderDTO.insuredDTOs[0].medical === '0'
}
//根据社保写死两个字段 赔付比例和免赔额
item.calFactorLst.map(i => {
//免赔额
if (i.code === 'getLimit') {
const text = isMedical ? '0元意外医疗' : '100元意外医疗'
const value = isMedical ? '0' : '100'
//保存数据
this.medicalInfo = this.medicalInfo || {}
this.medicalInfo.getLimit = text
i.showContent = text
i.getLimit = value
i.columns = [{ text, value }]
}
//赔付比例
if (i.code === 'getRate') {
const text = isMedical ? '80%(意外医疗)' : '70%(意外医疗)'
const value = isMedical ? '0.8' : '0.7'
//保存数据
this.medicalInfo = this.medicalInfo || {}
this.medicalInfo.getRate = text
i.showContent = text
i.getRate = value
i.columns = [{ text, value }]
}
})
this.$forceUpdate()
// eslint-disable-next-line no-unused-vars
this.dogetLimitAndGetRate().then(res => {
if (this.chooseProducts[0].influences && this.chooseProducts[0].influences.length > 0) {
this.influences = this.chooseProducts[0].influences
this.chooseProducts[0].influences.forEach(item => {
this.influenceAddRiskCodes.push(item.productCode)
})
} else {
}
this.mainRiskInfluenceAddRisk()
//初始化数据试算
this.getTrial()
})
},
//特殊处理 GFRS_M0016 GFRS_A0004 GFRS_A0005 赔付比例处理
async dogetLimitAndGetRate() {
const orderNo = localStorage.getItem('orderNo')
let detailPromise = this.isFrom === 'proposal' ? localStorage.proposalMedical : await getOrderDetail({ orderNo })
this.chooseProducts.map(item => {
if (!(item.mainRiskCode === 'GFRS_M0016' || item.productCode === 'GFRS_A0004' || item.productCode === 'GFRS_A0005')) {
//其他产品删掉两个字段
let calFactorLst = item.calFactorLst
for (let i = calFactorLst.length - 1; i >= 0; i--) {
@@ -463,42 +480,68 @@ export default {
calFactorLst.splice(i, 1)
}
}
return
}
if (item.mainRiskCode === 'GFRS_M0016' || item.productCode === 'GFRS_A0004' || item.productCode === 'GFRS_A0005' ) {
let isMedical = null
if (this.isFrom === 'proposal') {
isMedical = detailPromise == '1'
} else {
isMedical = detailPromise.orderDTO.insuredDTOs[0].medical == '0'
}
// 赔付比例和免赔额
item.calFactorLst.map(i => {
if (i.code === 'getLimit') {
let tempColumns = i.columns.filter(itemC => {
return itemC.medical == Math.abs(isMedical - 1).toString()
})
if (tempColumns.length !== 0) {
i.columns = tempColumns
}
i.getLimit = i.columns[0].value
i.showContent = i.columns[0].text
}
//赔付比例
if (i.code === 'getRate') {
let tempColumns = i.columns.filter(itemC => {
return itemC.medical == Math.abs(isMedical - 1).toString()
})
if (tempColumns.length !== 0) {
i.columns = tempColumns
}
i.getRate = i.columns[0].value
i.showContent = i.columns[0].text
}
})
this.$forceUpdate()
} else if(item.productCode === 'GFRS_A0005'){
// GFRS_A0005 未处理
}
})
// this.influenceAddRiskCodes
if (this.chooseProducts[0].influences && this.chooseProducts[0].influences.length > 0) {
this.influences = this.chooseProducts[0].influences
this.chooseProducts[0].influences.forEach(item => {
this.influenceAddRiskCodes.push(item.productCode)
})
}
this.mainRiskInfluenceAddRisk()
//初始化数据试算
this.getTrial()
},
// 责任保额份数变化
dutyStepperChange(value, productIndex, calFactorIndex, dutyItemIndex, isChecked, min, max) {
//这个险种使用其他验证方式
if (this.mainRiskCode === 'GFRS_M0016') return
if (this.chooseProducts[productIndex].productCode === 'GFRS_M0016') return
// 004险种其他验证方式
if (this.chooseProducts[productIndex].productCode === 'GFRS_A0004') return
if (this.chooseProducts[productIndex].productCode === 'GFRS_A0003') {
this.getTrial()
return
}
let currentEle = this.chooseProducts[productIndex].calFactorLst[calFactorIndex].rules[dutyItemIndex]
let showHint = this.chooseProducts[productIndex].hint
if (value < min || value > max) {
this.$toast(localStorage.hint)
this.$toast(showHint)
} else {
if ((Number(value) * 10000) % (Number(currentEle.limit) * 10000) != 0) {
Dialog.alert({
message: localStorage.hint
message: showHint
}).then(() => {
currentEle.defaultDutyAmt = currentEle.minDutyAmt
})
// this.$toast(localStorage.hint)
// this.$toast(showHint)
} else {
// this.mainRiskInfluenceAddRisk()
// currentEle['amt'] = Number(defalutValue) * Number(currentEle.moneyUnit)
@@ -593,15 +636,20 @@ export default {
].rules[dutyItemIndex]['necess']
return false
}
this.valiAndSend(dutyItem)
this.valiAndSend(dutyItem, productIndex)
},
valiAndSend(dutyItem) {
valiAndSend(dutyItem, productIndex) {
//验证责任
let validateRiskCode = this.chooseProducts[productIndex].productCode
let showHint = this.chooseProducts[productIndex].hint
let inputValue = dutyItem.defaultDutyAmt,
duty = dutyItem.duty
if (this.mainRiskCode === 'GFRS_M0016' && !this.valiDuty(inputValue, duty)) {
if (validateRiskCode === 'GFRS_M0016' && !this.valiDuty(inputValue, duty)) {
//验证不通过
return
} else if (validateRiskCode === 'GFRS_A0004' && !this.valiA0004Duty(inputValue, showHint, dutyItem)) {
//验证不通过 险种为GFRS_A0004 责任编码为320205
return
} else {
this.mainRiskInfluenceAddRisk()
this.getTrial()
@@ -611,13 +659,13 @@ export default {
focusStep() {
this.nextStepFlag = true
},
blurStep(dutyItem) {
blurStep(dutyItem, productIndex) {
this.nextStepFlag = false
//失去焦点时做验证
if (dutyItem.necess) {
//勾选时才做验证
this.valiAndSend(dutyItem)
this.valiAndSend(dutyItem, productIndex)
}
},
//险种GFRS_M0016的责任的验证规则
@@ -637,6 +685,50 @@ export default {
}
}
},
//险种 GFRS_A0004 险种验证规则
valiA0004Duty(value, showHint, currentEle) {
/* if (!(currentEle.necess == true)) {
this.nextStepFlag = false
return true
}*/
// 验证其他 最小50 其他为50 10 倍数
if (currentEle.duty == '320206' || currentEle.duty == '320207') {
let numberValue = Number(value) * 10000
if (numberValue % 10 != 0 || numberValue < 50) {
this.$toast(dutyGFRS_A0004Rules[currentEle.duty].msg)
this.nextStepFlag = true
return false
}
}
// 保额只能为5000 10000 15000 200000
if (currentEle.duty == '320205') {
if (this.mainRiskCode === dutyGFRS_A0004Rules[currentEle.duty]['mainRisk']) {
if (!(value == '0.5' || value == '1')) {
this.$toast(dutyGFRS_A0004Rules[currentEle.duty].msg_2)
this.nextStepFlag = true
return false
} else if(value-0 > 1){
this.$toast(dutyGFRS_A0004Rules[currentEle.duty].msg_1)
this.nextStepFlag = true
return false
}
} else {
if (!(value == '0.5' || value == '1' || value == '1.5' || value == '2')) {
this.$toast(dutyGFRS_A0004Rules[currentEle.duty].msg)
this.nextStepFlag = true
return false
}
}
this.nextStepFlag = false
return true
}
this.nextStepFlag = false
return true
},
/********start 通用规则、特殊规则处理 start******/
//通用规则1交费方式为一次交情无交费期限
hiddenPayEndYear(currentEle) {
@@ -676,7 +768,7 @@ export default {
let age = Number(this.saleInsuredPersonInfo.age)
for (let i = 0; i < currentEle.rules.length; i++) {
if (currentEle.rules[i].payEndYear == value && age > currentEle.rules[i].maxAge) {
this.$toast('被保人年龄不适合该交费期间!')
this.$toast('被保人年龄不适合该交费期间!')
return true
}
}
@@ -687,7 +779,7 @@ export default {
let age = Number(this.saleInsuredPersonInfo.age)
for (let i = 0; i < currentEle.rules.length; i++) {
if (currentEle.rules[i].insuYear == value && age > currentEle.rules[i].maxAge) {
this.$toast('被保人年龄不适合该保险期间!')
this.$toast('被保人年龄不适合该保险期间!')
return true
}
}
@@ -1013,15 +1105,27 @@ export default {
// trialInfo.duty = [{ dutyCode: trialInfo.duty }]
// }
//获取投被保生日、性别
let birthday, sex
let birthday, sex, occupationCode, occupationName
if (item.isRemit == '0' && item.remitType == '0') {
;[birthday, sex] = [this.saleInsuredInfo.birthday, this.saleInsuredInfo.sex]
;[birthday, sex, occupationCode, occupationName] = [
this.saleInsuredInfo.birthday,
this.saleInsuredInfo.sex,
this.saleInsuredInfo.occupationCode,
this.saleInsuredInfo.occupationName
]
} else {
;[birthday, sex] = [this.saleInsuredPersonInfo.birthday, this.saleInsuredPersonInfo.sex]
;[birthday, sex, occupationCode, occupationName] = [
this.saleInsuredPersonInfo.birthday,
this.saleInsuredPersonInfo.sex,
this.saleInsuredPersonInfo.occupationCode,
this.saleInsuredPersonInfo.occupationName
]
}
trialInfo = Object.assign(trialInfo, {
birthday,
sex,
occupationCode,
occupationName,
platformType: 'app',
productCode: item.productCode,
medical: JSON.parse(localStorage.getItem('saleInsuredPersonInfo')).medical
@@ -1071,18 +1175,19 @@ export default {
: this.chooseProducts[productIndex].calFactorLst[calFactorIndex]
//改动原因:孝心保产品有对年龄的特殊要求
//添加判断,是否是孝心保产品
let showHint = this.chooseProducts[productIndex].hint
let productCode = localStorage.trialList == '' ? '' : JSON.parse(localStorage.trialList)[0].productCode
if (productCode == 'GFRS_M0014') {
//被保人年龄如果在50-65区间
//被保人年龄如果在50-65区间
if (this.saleInsuredPersonInfo.age >= 50 && this.saleInsuredPersonInfo.age <= 65) {
//使用rules规则里的第二条控制保额份数
if (Number(defalutValue) < Number(riskFactor.rules[1].minPrem) || Number(defalutValue) > Number(riskFactor.rules[1].maxPrem)) {
this.$toast(localStorage.hint)
this.$toast(showHint)
this.nextStepFlag = true
} else {
if ((Number(defalutValue) * 10000) % (Number(currentEle.limit) * 10000) != 0) {
// this.defalutAmt = currentEle.rules[productIndex].displayAmount
this.$toast(localStorage.hint)
this.$toast(showHint)
this.nextStepFlag = true
} else {
this.mainRiskInfluenceAddRisk()
@@ -1090,16 +1195,16 @@ export default {
this.getTrial()
}
}
//被保人年龄如果在66-75之间
//被保人年龄如果在66-75之间
} else if (this.saleInsuredPersonInfo.age >= 66 && this.saleInsuredPersonInfo.age <= 75) {
//使用rules规则里的第一条控制保额份数
if (Number(defalutValue) < Number(riskFactor.rules[0].minPrem) || Number(defalutValue) > Number(riskFactor.rules[0].maxPrem)) {
this.$toast(localStorage.hint)
this.$toast(showHint)
this.nextStepFlag = true
} else {
if ((Number(defalutValue) * 10000) % (Number(currentEle.limit) * 10000) != 0) {
// this.defalutAmt = currentEle.rules[productIndex].displayAmount
this.$toast(localStorage.hint)
this.$toast(showHint)
this.nextStepFlag = true
} else {
this.mainRiskInfluenceAddRisk()
@@ -1144,12 +1249,12 @@ export default {
}
} else {
if (Number(defalutValue) < Number(min) || Number(defalutValue) > Number(max)) {
this.$toast(localStorage.hint)
this.$toast(showHint)
this.nextStepFlag = true
} else {
if ((Number(defalutValue) * 10000) % (Number(currentEle.limit) * 10000) != 0) {
// defalutValue = currentEle.rules[productIndex].displayAmount
this.$toast(localStorage.hint)
this.$toast(showHint)
this.nextStepFlag = true
} else {
this.mainRiskInfluenceAddRisk()
@@ -1181,6 +1286,32 @@ export default {
}
}
//GFRS_A0004需要验证责任
for (let m = 0; m < this.chooseProducts.length; m++) {
if (this.chooseProducts[m].productCode == 'GFRS_A0004') {
let showHint = this.chooseProducts[m].hint
let calFactorLst = this.chooseProducts[m].calFactorLst
for (let i = 0; i < calFactorLst.length; i++) {
if (calFactorLst[i].code === 'dutyGroup') {
let duties = calFactorLst[i].rules
for (let j = 0; j < duties.length; j++) {
let item = duties[j]
if (!this.valiA0004Duty(item.defaultDutyAmt, showHint, item)) {
return
}
}
}
}
}
}
// 验证格式
if (this.isRelated && this.isFrom != 'proposal' && this.policyNo) {
let vl = /^[0-9\\]+$/.test(this.policyNo)
if (!vl) {
return this.$toast('关联保单的格式不正确')
}
}
//组装险种提交数据
let [mainRiskCode, riskDTOLst] = ['', []]
let rollInResult = '' //校验预计转入保费结果
@@ -1276,6 +1407,10 @@ export default {
}
if (resultData.result == 0) {
//电投
if (localStorage.isFrom == 'sale' && resultData.deleteFlag == '0') {
localStorage.salePageFlag = '4'
}
//建议书
if (localStorage.isFrom == 'proposal' && resultData.content.id) {
this.saleInsuredPersonInfo.insuredId = resultData.content.id