[FIX]【保全】受益人-初始信息页面、新增/编辑受益人页面;保单列表页

This commit is contained in:
yuweiqi
2020-06-03 17:59:05 +08:00
parent 19c240d882
commit 02dfc2fee7
5 changed files with 114 additions and 89 deletions

View File

@@ -101,7 +101,7 @@ export default [
} }
}, },
{ {
path: '/preserve/imageUpload', path: '/preserve/bc/imageUpload',
name: 'bcImageUpload', name: 'bcImageUpload',
component: bcImageUpload, component: bcImageUpload,
meta: { meta: {

View File

@@ -18,8 +18,8 @@
<!-- 受益人列表 --> <!-- 受益人列表 -->
<div class="fs14 beneficiary-list" v-if="type == 2"> <div class="fs14 beneficiary-list" v-if="type == 2">
<ul> <ul>
<li class="pv20 ph15 item" v-for="(item, index) in beneficiaries" :key="index"> <li class="ph15 item" v-for="(item, index) in beneficiaries" :key="index">
<div class="bg-white p15"> <div class="bg-white p15" v-if="item.name">
<div class="flex justify-content-s c-gray-darker"> <div class="flex justify-content-s c-gray-darker">
<div> <div>
<img src="@/assets/images/bnf_avatar.png" width="40" height="40" class="radius50 v-middle" /> <img src="@/assets/images/bnf_avatar.png" width="40" height="40" class="radius50 v-middle" />
@@ -69,19 +69,30 @@ export default {
beneficiaries: [] // 指定受益人列表 beneficiaries: [] // 指定受益人列表
} }
}, },
created() { async created() {
// 获取保单列表存储的数据 // 获取保单列表存储的数据
this.policy = JSON.parse(localStorage['preserve-policy'])
this.customerInfo = JSON.parse(localStorage['preserve-customerInfo']) //客户详情 this.customerInfo = JSON.parse(localStorage['preserve-customerInfo']) //客户详情
this.policy = JSON.parse(localStorage['preserve-policy'])
if (localStorage.fromAddBC) {
this.beneficiaries = this.policy.bnfDTOs
this.type = this.beneficiaries.some(i => {
//isLegal:法定标记 1-是法定受益人 0-是指定受益人
return i.isNewInfo == '0' && i.isLegal == '0' //新增受益人存在指定受益人
})
? '2'
: '1'
} else {
await this.getPolicyInfo()
this.type = this.beneficiaries.some(i => {
return i.isNewInfo == '1' && i.isLegal == '0' //初始化受益人存在指定受益人
})
? '2'
: '1'
}
this.insuredName = this.policy.insuredName this.insuredName = this.policy.insuredName
this.getPolicyInfo()
/*this.type = this.policy.bnfDTOs[0].bnfType
if (this.type == 2) { if (this.type == 2) {
this.isDisType = true this.isDisType = true
} }
this.beneficiaries = this.policy.bnfDTOs
*/
}, },
mounted() {}, mounted() {},
methods: { methods: {
@@ -95,16 +106,24 @@ export default {
mobile: this.customerInfo.mobile, mobile: this.customerInfo.mobile,
name: this.customerInfo.name name: this.customerInfo.name
} }
policyInfo(data).then(res => { return new Promise((resolve, reject) => {
if (res.result == '0') { policyInfo(data).then(
this.beneficiaries = res.content.cont.bcBnfList res => {
this.type = this.beneficiaries[0].isLegal == '1' ? '1' : '2' //isLegal:法定标记 1-是法定受益人 0-是指定受益人 if (res.result == '0') {
if (this.type == 2) { this.beneficiaries = res.content.cont.bcBnfList
this.isDisType = true //isNewInfo 是否新信息 0-是 1-否
this.beneficiaries.forEach(item => {
item.isNewInfo = '1'
})
resolve()
} else {
reject(this.$toast(res.resultMessage))
}
},
error => {
reject(console.log(error))
} }
} else { )
this.$toast(res.resultMessage)
}
}) })
}, },
//下一步 //下一步
@@ -113,6 +132,13 @@ export default {
this.$toast('受益人列表不能为空') this.$toast('受益人列表不能为空')
return return
} }
let beneRatio = 0
this.beneficiaries.forEach(item => {
beneRatio += Number(item.bnfLot)
})
if (beneRatio != 100 && !(this.beneficiaries.length == 1 && this.beneficiaries[0].isLegal == '1')) {
return this.$toast('受益人受益比例不合法')
}
let feachData = { let feachData = {
platformType: 'APP', platformType: 'APP',
edorType: 'BC', edorType: 'BC',
@@ -124,6 +150,7 @@ export default {
if (res.result == 0) { if (res.result == 0) {
this.policy.bnfDTOs = this.beneficiaries this.policy.bnfDTOs = this.beneficiaries
localStorage['preserve-policy'] = JSON.stringify(this.policy) localStorage['preserve-policy'] = JSON.stringify(this.policy)
localStorage.removeItem('fromAddBC')
let path = '' let path = ''
if (this.type != 2) { if (this.type != 2) {
path = '/preserve/common/HandleResult?entry=BC' path = '/preserve/common/HandleResult?entry=BC'
@@ -188,7 +215,7 @@ export default {
editBeneficiary(index) { editBeneficiary(index) {
this.policy.bnfDTOs = this.beneficiaries this.policy.bnfDTOs = this.beneficiaries
localStorage['preserve-policy'] = JSON.stringify(this.policy) localStorage['preserve-policy'] = JSON.stringify(this.policy)
let path = '/preserve/BeneficiaryInfoAdd?edit=' + index let path = '/preserve/bc/BeneficiaryInfoAdd?edit=' + index
this.$jump({ this.$jump({
flag: 'h5', flag: 'h5',
extra: { extra: {

View File

@@ -66,7 +66,7 @@
name="证件截止日期" name="证件截止日期"
:required="isRequired" :required="isRequired"
:defaultDate="new Date()" :defaultDate="new Date()"
:value.sync="userInfo.effectiveDate" :value.sync="userInfo.idExpDate"
type="date" type="date"
@confirm="onDateConfirm($event, '1')" @confirm="onDateConfirm($event, '1')"
ref="effectiveDate" ref="effectiveDate"
@@ -104,7 +104,7 @@
name="受益比例" name="受益比例"
placeholder="请输入" placeholder="请输入"
required required
v-validate="'required|onlyNumber'" v-validate="'required|onlyInteger'"
maxlength="3" maxlength="3"
clearable clearable
/> />
@@ -225,29 +225,33 @@ export default {
marriage: '', marriage: '',
isRequired: '', //长期前是否有* isRequired: '', //长期前是否有*
userInfo: { userInfo: {
bnfId: '', bnfType: '1', //受益人类别 0-生存受益人 1-身故受益人
bnfType: '2', isLegal: '0', //1-法定受益人 0-指定受益人
bnfNo: '1',
relationToInsured: '', //受益人和被保人关系
bnfOrder: 1,
bnfGrade: '', bnfGrade: '',
name: '', name: '',
sex: '0', sex: '0',
nationality: '1', isNewInfo: '0', //是否是新信息 0-是 1-否
birthday: '',
idType: '1', idType: '1',
idNo: '', idNo: '',
certificateValidate: '', idExpDate: '', //证件截止日期
effectiveDate: '',
effectiveDateType: false, //是否长期
bnfNo: '1',
bnfOrder: 1,
bnfLot: '',
phone: '', phone: '',
birthday: '',
nationality: '1',
email: '',
province: '', province: '',
city: '', city: '',
area: '', postalAddress: '', //详细地址
postalAddress: '',
email: '',
occupationCode: '', occupationCode: '',
occupationName: '' // 职业中文 occupationType: '',
occupationName: '',
area: '',
bnfLot: '', //受益比例
// certificateValidate: '',
effectiveDateType: false //是否长期
}, },
areaList: areaList, areaList: areaList,
occupationShowPicker: false, occupationShowPicker: false,
@@ -260,6 +264,11 @@ export default {
created() { created() {
this.policy = JSON.parse(localStorage['preserve-policy']) this.policy = JSON.parse(localStorage['preserve-policy'])
this.bnfDTOs = this.policy.bnfDTOs this.bnfDTOs = this.policy.bnfDTOs
this.bnfDTOs.map(i => {
if (i.idExpDate == '9999-01-01') {
i.effectiveDateType = true
}
})
if (this.$route.query.edit) { if (this.$route.query.edit) {
this.editIndex = this.$route.query.edit this.editIndex = this.$route.query.edit
this.userInfo = this.bnfDTOs[this.$route.query.edit] this.userInfo = this.bnfDTOs[this.$route.query.edit]
@@ -305,7 +314,7 @@ export default {
;[this.userInfo.nationality, this.nationality] = [value.id, value.text] ;[this.userInfo.nationality, this.nationality] = [value.id, value.text]
} else if (this.pickerType == '2') { } else if (this.pickerType == '2') {
this.idLimit = false this.idLimit = false
this.userInfo.idNo = this.userInfo.effectiveDate = this.userInfo.birthday = '' this.userInfo.idNo = this.userInfo.idExpDate = this.userInfo.birthday = ''
// this.userInfo.sex = '0' // this.userInfo.sex = '0'
this.effectiveDateTypeAble = false this.effectiveDateTypeAble = false
//身份证以外的证件类型可以使用长期 //身份证以外的证件类型可以使用长期
@@ -336,7 +345,7 @@ export default {
this.userInfo.effectiveDateType = false this.userInfo.effectiveDateType = false
//如果录入日期早于当前日期 //如果录入日期早于当前日期
if (Date.parse(val) < Date.parse(new Date())) { if (Date.parse(val) < Date.parse(new Date())) {
this.userInfo.effectiveDate = '' this.userInfo.idExpDate = ''
this.$refs.effectiveDate.date = '' this.$refs.effectiveDate.date = ''
return this.$toast('您的证件已过期') return this.$toast('您的证件已过期')
} }
@@ -358,7 +367,7 @@ export default {
} }
//出生证有效期 //出生证有效期
if (this.userInfo.idType == '3') { if (this.userInfo.idType == '3') {
if (Date.parse(this.userInfo.effectiveDate) - Date.parse(val) > Date.parse('1973-01-01')) { if (Date.parse(this.userInfo.idExpDate) - Date.parse(val) > Date.parse('1973-01-01')) {
this.userInfo.birthday = '' this.userInfo.birthday = ''
this.$refs.birthday.date = '' this.$refs.birthday.date = ''
return this.$toast('出生证有效期或出生日期有误') return this.$toast('出生证有效期或出生日期有误')
@@ -388,7 +397,7 @@ export default {
if (data.idEffectEndDate == '9999-01-01') { if (data.idEffectEndDate == '9999-01-01') {
this.userInfo.effectiveDateType = true //是否长期 this.userInfo.effectiveDateType = true //是否长期
} else { } else {
this.userInfo.effectiveDate = data.idEffectEndDate //证件截止日期 this.userInfo.idExpDate = data.idEffectEndDate //证件截止日期
} }
this.userInfo.occupationCode = data.occupationCode //职业类别编码 this.userInfo.occupationCode = data.occupationCode //职业类别编码
this.userInfo.occupationName = data.occupationName //职业类别名称 this.userInfo.occupationName = data.occupationName //职业类别名称
@@ -444,22 +453,22 @@ export default {
//年龄在0-15周岁之间 //年龄在0-15周岁之间
if (age <= 15) { if (age <= 15) {
if (Date.parse(this.userInfo.effectiveDate) - Date.parse(new Date()) > Date.parse('1975-01-01')) { if (Date.parse(this.userInfo.idExpDate) - Date.parse(new Date()) > Date.parse('1975-01-01')) {
this.userInfo.effectiveDate = '' this.userInfo.idExpDate = ''
this.$refs.effectiveDate.date = '' this.$refs.effectiveDate.date = ''
return this.$toast('证件有效期不正常未满16周岁的公民身份证有效期应小于等于5年') return this.$toast('证件有效期不正常未满16周岁的公民身份证有效期应小于等于5年')
} }
//年龄在 16-25 周岁之间 //年龄在 16-25 周岁之间
} else if (age >= 16 && age <= 25) { } else if (age >= 16 && age <= 25) {
if (Date.parse(this.userInfo.effectiveDate) - Date.parse(new Date()) > Date.parse('1980-01-01')) { if (Date.parse(this.userInfo.idExpDate) - Date.parse(new Date()) > Date.parse('1980-01-01')) {
this.userInfo.effectiveDate = '' this.userInfo.idExpDate = ''
this.$refs.effectiveDate.date = '' this.$refs.effectiveDate.date = ''
return this.$toast('证件有效期不正常16周岁至25周岁公民身份证有效期应小于等于10年') return this.$toast('证件有效期不正常16周岁至25周岁公民身份证有效期应小于等于10年')
} }
//年龄在 26-45 周岁之间 //年龄在 26-45 周岁之间
} else if (age >= 26 && age <= 45) { } else if (age >= 26 && age <= 45) {
if (Date.parse(this.userInfo.effectiveDate) - Date.parse(new Date()) > Date.parse('1990-01-01')) { if (Date.parse(this.userInfo.idExpDate) - Date.parse(new Date()) > Date.parse('1990-01-01')) {
this.userInfo.effectiveDate = '' this.userInfo.idExpDate = ''
this.$refs.effectiveDate.date = '' this.$refs.effectiveDate.date = ''
return this.$toast('证件有效期不正常26周岁至45周岁公民身份证有效期应小于等于20年') return this.$toast('证件有效期不正常26周岁至45周岁公民身份证有效期应小于等于20年')
} }
@@ -517,15 +526,22 @@ export default {
this.bnfDTOs[this.editIndex] = this.userInfo this.bnfDTOs[this.editIndex] = this.userInfo
} }
this.policy.bnfDTOs = this.bnfDTOs this.policy.bnfDTOs = this.bnfDTOs
this.policy.bnfDTOs.map(i => {
if (i.effectiveDateType) {
i.idExpDate = '9999-01-01'
}
delete i.effectiveDateType
})
localStorage.fromAddBC = true
localStorage['preserve-policy'] = JSON.stringify(this.policy) localStorage['preserve-policy'] = JSON.stringify(this.policy)
this.$jump({ this.$jump({
flag: 'h5', flag: 'h5',
extra: { extra: {
url: location.origin + '/#/preserve/BeneficiaryInfo', url: location.origin + '/#/preserve/bc/BeneficiaryInfo',
needRefresh: '1' needRefresh: '1'
}, },
routerInfo: { routerInfo: {
path: '/preserve/BeneficiaryInfo' path: '/preserve/bc/BeneficiaryInfo'
} }
}) })
} else { } else {
@@ -554,7 +570,7 @@ export default {
effectiveDataTypeChange(val) { effectiveDataTypeChange(val) {
//勾选长期状态时,证件截止日期置空 //勾选长期状态时,证件截止日期置空
if (val) { if (val) {
this.userInfo.effectiveDate = '' this.userInfo.idExpDate = ''
this.effectiveDateRequired = false this.effectiveDateRequired = false
} else { } else {
this.effectiveDateRequired = true this.effectiveDateRequired = true
@@ -564,7 +580,7 @@ export default {
getIdentityInfo(data) { getIdentityInfo(data) {
console.log(data) console.log(data)
if (data.name && data.name != '待识别') { if (data.name && data.name != '待识别') {
this.userInfo.effectiveDate = data.endDate this.userInfo.idExpDate = data.endDate
this.userInfo.name = data.name this.userInfo.name = data.name
this.userInfo.idNo = data.idNo this.userInfo.idNo = data.idNo
} }

View File

@@ -16,7 +16,7 @@
:after-read="afterRead" :after-read="afterRead"
:before-delete="beforeDelete" :before-delete="beforeDelete"
class="mt10 ml20" class="mt10 ml20"
:max-count="1" :max-count="2"
@delete="deleteImg" @delete="deleteImg"
/> />
</div> </div>
@@ -355,36 +355,6 @@ export default {
} }
}) })
} }
},
computed: {
listenChange() {
const { fileListIdFront, fileListIdBack, fileListBank } = this
return {
fileListIdFront,
fileListIdBack,
fileListBank
}
}
},
watch: {
listenChange(val) {
if (
(val.fileListIdFront.length != '0' &&
val.fileListIdBack.length != '0' &&
val.fileListBank.length != '0' &&
(this.entry == 'surrender' || this.entry == 'hesitateSurrender') &&
this.accountType == '1') ||
(this.entry == 'renewal' && val.fileListBank.length != '0') ||
(val.fileListIdFront.length != '0' &&
val.fileListIdBack.length != '0' &&
(this.entry == 'surrender' || this.entry == 'hesitateSurrender') &&
this.accountType == '0')
) {
this.isDisabled = false
} else {
this.isDisabled = true
}
}
} }
} }
</script> </script>

View File

@@ -70,19 +70,31 @@ export default {
policyList: [] //保单列表 policyList: [] //保单列表
} }
}, },
mounted() { async mounted() {
if (localStorage['preserve-policy']) {
localStorage.removeItem('preserve-policy')
}
this.entry = this.$route.query.entry this.entry = this.$route.query.entry
this.getPolicyList({ customerNo: this.customerInfo.customerNo, edorType: this.entry }) await this.getPolicyList({ customerNo: this.customerInfo.customerNo, edorType: this.entry })
}, },
methods: { methods: {
//获取保单列表 //获取保单列表
getPolicyList(data) { getPolicyList(data) {
policyList(data).then(res => { return new Promise((resolve, reject) => {
if (res.result == '0') { policyList(data).then(
this.policyList = res.content.policyDTOList res => {
} else { if (res.result == '0') {
this.$toast(res.content) this.policyList = res.content.policyDTOList
} resolve()
} else {
this.$toast(res.content)
reject()
}
},
error => {
reject(console.log(error))
}
)
}) })
}, },