From 163b8dae298d7d5c9ea005318b7f9b5f18eebcd1 Mon Sep 17 00:00:00 2001
From: lyt
Date: Thu, 20 Apr 2023 18:20:51 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=BB=BA=E8=AE=AE=E4=B9=A6=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=E9=9C=80=E6=B1=82=E3=80=91=E5=BB=BA=E8=AE=AE=E4=B9=A6?=
=?UTF-8?q?=E6=8B=B7=E8=B4=9D=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/assets/js/business-common.js | 4 +-
src/views/ebiz/common/CalculatePremium.vue | 65 ++++++++++++-------
src/views/ebiz/common/MainRiskList.vue | 3 +-
src/views/ebiz/common/SelectedProduct.vue | 10 +--
src/views/ebiz/common/risk-rules.js | 4 +-
.../ebiz/proposal/ChooseInsuredPerson.vue | 2 +-
src/views/ebiz/proposal/InsuredPerson.vue | 2 +-
src/views/ebiz/proposal/ProposalInfo.vue | 2 +-
8 files changed, 57 insertions(+), 35 deletions(-)
diff --git a/src/assets/js/business-common.js b/src/assets/js/business-common.js
index 088fc69b1..e9e688f72 100644
--- a/src/assets/js/business-common.js
+++ b/src/assets/js/business-common.js
@@ -559,14 +559,14 @@ export default {
)
if (insuredDTO) {
- let insuredPersonAge = utilsAge.getAge(insuredDTO.birthday, new Date())
+ let insuredPersonAge = insuredDTO.birthday?utilsAge.getAge(insuredDTO.birthday, new Date()):insuredDTO.insuredAge
CacheUtils.setLocItem('saleInsuredPersonInfo',
JSON.stringify({
birthday: insuredDTO.birthday,
name: insuredDTO.name,
sex: insuredDTO.sex,
idType: insuredDTO.idType,
- age: insuredPersonAge,
+ insuredAge: insuredPersonAge,
// marriage: insuredDTO.marriage,
relationToAppnt: insuredDTO.relationToAppnt,
medical: insuredDTO.medical,
diff --git a/src/views/ebiz/common/CalculatePremium.vue b/src/views/ebiz/common/CalculatePremium.vue
index 727906d2d..d5883c171 100644
--- a/src/views/ebiz/common/CalculatePremium.vue
+++ b/src/views/ebiz/common/CalculatePremium.vue
@@ -362,7 +362,7 @@
import { Tag, Icon, Dialog, ActionSheet, Popup, Picker, Stepper, Field, Checkbox, RadioGroup, Radio } from 'vant'
import { trial } from '@/api/ebiz/common/common'
import { saveOrUpdateOrderInfo, getOrderDetail,orderTrial } from '@/api/ebiz/sale/sale'
-import { saveProposal,saveOrUpdateTrialRecordInfo } from '@/api/ebiz/proposal/proposal.js'
+import { saveProposal,saveOrUpdateTrialRecordInfo,getTrialRecordInfo } from '@/api/ebiz/proposal/proposal.js'
import { getAgentInfo } from '@/api/ebiz/my/my.js'
//险种GFRS_M0016的责任的验证规则
@@ -627,7 +627,19 @@ export default {
this.cvalidateFlag = this.activeType && this.isFrom != 'proposal'
//构建提交数据、渲染险种
- this.chooseProducts = JSON.parse(localStorage.chooseProducts)
+ if(this.$route.query.insuanceId){
+ // 获取试算记录详情
+ getTrialRecordInfo({
+ serialNo:this.$CacheUtils.getLocItem('proposalNo'),
+ mainRiskId:this.$route.query.insuanceId
+ }).then(res => {
+ if (res.result == '0') {
+ this.chooseProducts = JSON.parse(res.content.trialJsonStr)
+ }
+ })
+ }else{
+ this.chooseProducts = JSON.parse(localStorage.chooseProducts)
+ }
this.chooseProducts.forEach((item, index) => {
if (item.isCrossChannel == '1') {
this.isCrossChannel = item.isCrossChannel
@@ -2758,12 +2770,38 @@ export default {
}
})
}else if (localStorage.isFrom == 'proposal'){
- let proposalOrderNo = this.$CacheUtils.getLocItem('proposalNo') || ''
- let url = `/common/selectedProduct?proposalOrderNo=${proposalOrderNo}`
if (resultData.content.id) {
this.saleInsuredPersonInfo.insuredId = resultData.content.id;
this.$CacheUtils.setLocItem('saleInsuredPersonInfo', JSON.stringify(this.saleInsuredPersonInfo))
}
+ //试算记录保存更新--编辑
+ this.saveOrUpdateTrialRecordInfoFunc(resultData.content.riskDTO)
+ }else if (isFrom == 'orderTrial' && localStorage.isFrom == 'sale') {
+ this.$toast.clear()
+ this.trialResultsShow = true
+ this.verifyResultList = resultData.content.data.verifyResultList
+ }
+ } else {
+ this.$toast(resultData.resultMessage)
+ }
+ },
+ //试算记录保存更新--编辑功能
+ saveOrUpdateTrialRecordInfoFunc(riskDTO){
+ let insuanceId
+ riskDTO.forEach(item => {
+ if (item.isMainRisk == '0') {
+ insuanceId = item.insuanceId
+ }
+ })
+ let data ={
+ serialNo:this.$CacheUtils.getLocItem('proposalNo'),
+ mainRiskId:insuanceId+'',
+ trialJsonStr:localStorage.chooseProducts
+ }
+ saveOrUpdateTrialRecordInfo(data).then(res => {
+ if (res.result == '0') {
+ let proposalOrderNo = this.$CacheUtils.getLocItem('proposalNo') || ''
+ let url = `/common/selectedProduct?proposalOrderNo=${proposalOrderNo}`
this.$jump({
flag: 'goBack',
extra: {
@@ -2776,25 +2814,8 @@ export default {
path: url
}
})
- //试算记录保存更新--编辑
- this.saveOrUpdateTrialRecordInfoFunc()
- }else if (isFrom == 'orderTrial' && localStorage.isFrom == 'sale') {
- this.$toast.clear()
- this.trialResultsShow = true
- this.verifyResultList = resultData.content.data.verifyResultList
}
- } else {
- this.$toast(resultData.resultMessage)
- }
- },
- //试算记录保存更新--编辑功能
- saveOrUpdateTrialRecordInfoFunc(){
- // let data ={
- // }
- // saveOrUpdateTrialRecordInfo(JSON.parse(localStorage.chooseProducts)).then(res => {
- // // if (res.result == '0') {
- // // }
- // })
+ })
},
rollInCheck(value) {
let regExp = /^[1-9]+[0-9]*$/
diff --git a/src/views/ebiz/common/MainRiskList.vue b/src/views/ebiz/common/MainRiskList.vue
index a4c23d9ef..4191921d3 100644
--- a/src/views/ebiz/common/MainRiskList.vue
+++ b/src/views/ebiz/common/MainRiskList.vue
@@ -498,7 +498,8 @@ export default {
if (productTrialInfoDTO[item.code] != null) {
productTrialInfoDTO[item.code].forEach(factor => {
// item = Object.assign(item, factor)
- if(JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).age >= Number(factor.minAge) && JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).age <= Number(factor.maxAge)){
+ if(JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).insuredAge >= Number(factor.minAge) && JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).insuredAge <= Number(factor.maxAge)){
+ // if(JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).age >= Number(factor.minAge) && JSON.parse(this.$CacheUtils.getLocItem('saleInsuredPersonInfo')).age <= Number(factor.maxAge)){
item = Object.assign(item, factor)
}
})
diff --git a/src/views/ebiz/common/SelectedProduct.vue b/src/views/ebiz/common/SelectedProduct.vue
index cbcde7a84..bcb00e9a8 100644
--- a/src/views/ebiz/common/SelectedProduct.vue
+++ b/src/views/ebiz/common/SelectedProduct.vue
@@ -23,7 +23,7 @@
- 编辑
+ 编辑
删除
@@ -387,16 +387,16 @@ export default {
}
},
//编辑
- editInsure(index){
+ editInsure(index,insuanceId){
let isProposal = localStorage.isFrom == 'proposal' ? true : false
if (isProposal) {
this.$jump({
flag: 'h5',
extra: {
- url: location.origin + '/#/common/calculatePremium?orderNo='+this.$CacheUtils.getLocItem('proposalNo')+'&insuanceId='+this.chooseProducts[index].insuanceId
+ url: location.origin + '/#/common/calculatePremium?orderNo='+this.$CacheUtils.getLocItem('proposalNo')+'&insuanceId='+insuanceId
},
routerInfo: {
- path: '/common/calculatePremium?orderNo='+this.$CacheUtils.getLocItem('proposalNo')+'&insuanceId='+this.chooseProducts[index].insuanceId
+ path: '/common/calculatePremium?orderNo='+this.$CacheUtils.getLocItem('proposalNo')+'&insuanceId='+insuanceId
}
})
}
@@ -595,7 +595,7 @@ export default {
showTipForDoubleRecord() {
//判断投保人年龄是否大于等于60岁
let showFlag = false
- let age = utilsAge.getAge(this.appntDTO.birthday, new Date())
+ let age = this.appntDTO.birthday?utilsAge.getAge(this.appntDTO.birthday, new Date()):this.appntDTO.age
if (age >= 60) {
this.chooseProducts.map(item => {
if (item.insuYearFlag == 'A' || (item.insuYearFlag == 'Y' && item.insuYear != '1')) {
diff --git a/src/views/ebiz/common/risk-rules.js b/src/views/ebiz/common/risk-rules.js
index 24648f94c..d6e62725f 100644
--- a/src/views/ebiz/common/risk-rules.js
+++ b/src/views/ebiz/common/risk-rules.js
@@ -49,9 +49,9 @@ export default {
tips = '投保人年龄不适合此款险种,请选择其他险种!'
} else {
if(riskProductCode == 'GFRS_M0061'){
- age = utilsAge.getAge29(this.getSaleInsuredPersonInfo().birthday, new Date())
+ age = this.getSaleInsuredPersonInfo().birthday?utilsAge.getAge29(this.getSaleInsuredPersonInfo().birthday, new Date()):this.getSaleInsuredPersonInfo().insuredAge
}else{
- age = utilsAge.getAgeByValue(this.getSaleInsuredPersonInfo().birthday, new Date())
+ age = this.getSaleInsuredPersonInfo().birthday?utilsAge.getAgeByValue(this.getSaleInsuredPersonInfo().birthday, new Date()):this.getSaleInsuredPersonInfo().insuredAge
}
tips = '被保险人年龄不适合此款险种,请选择其他险种!'
}
diff --git a/src/views/ebiz/proposal/ChooseInsuredPerson.vue b/src/views/ebiz/proposal/ChooseInsuredPerson.vue
index 2f660eade..e8b989e39 100644
--- a/src/views/ebiz/proposal/ChooseInsuredPerson.vue
+++ b/src/views/ebiz/proposal/ChooseInsuredPerson.vue
@@ -402,7 +402,7 @@ export default {
//编辑被保险人
edit(item) {
item.birthday = item.birthdayLabel
- item.age = item.insuredAge
+ // item.age = item.insuredAge
this.$CacheUtils.setLocItem('saleInsuredPersonInfo', JSON.stringify(item)) //存储被保险人信息
localStorage.isFrom = 'proposal'
let url = `/common/selectedProduct?proposalEdit=1&proposalOrderNo=${item.orderNo}`
diff --git a/src/views/ebiz/proposal/InsuredPerson.vue b/src/views/ebiz/proposal/InsuredPerson.vue
index 62a1f127b..7ebc33494 100644
--- a/src/views/ebiz/proposal/InsuredPerson.vue
+++ b/src/views/ebiz/proposal/InsuredPerson.vue
@@ -151,7 +151,7 @@ export default {
//如果是投被同人 就将投保人信息存入被保险人信息
this.disabled = true
this.insured = Object.assign(this.insured, JSON.parse(this.$CacheUtils.getLocItem('proposalAppnt')))
- this.insured.insuredAge = getAge.getAge(this.insured.birthday, new Date())
+ this.insured.insuredAge = this.insured.birthday?getAge.getAge(this.insured.birthday, new Date()):this.insured.age
this.insured.medical = localStorage.orderNoSocialSecurity === '1' ? '1' : '0'
// 建议书投保人/被保人姓名不必填, 填写姓名时展示姓名(落库),不填写姓名时展示性别+年龄,如:男30岁(不落库)
if(!this.insured.name){
diff --git a/src/views/ebiz/proposal/ProposalInfo.vue b/src/views/ebiz/proposal/ProposalInfo.vue
index 7ee7c264a..c84c94d7a 100644
--- a/src/views/ebiz/proposal/ProposalInfo.vue
+++ b/src/views/ebiz/proposal/ProposalInfo.vue
@@ -698,7 +698,7 @@ export default {
this.pageShowInfo.insuredDTOs = res.content.orderDTO.insuredDTOs
this.pageShowInfo.showInsuredDTO = this.pageShowInfo.insuredDTOs[0]
//投保人年龄
- this.pageShowInfo.appntDTO.age = getAge.getAge(this.pageShowInfo.appntDTO.birthdayLabel, new Date())
+ // this.pageShowInfo.appntDTO.age = getAge.getAge(this.pageShowInfo.appntDTO.birthdayLabel, new Date())
let { insuredLabelResult, insuredResult, insuredInfoResult } = res.content.calculusResDTO
orderDTO.insuredDTOs.forEach(v => {
//根据数据字典 获取当前值