
@@ -69,19 +69,30 @@ export default {
beneficiaries: [] // 指定受益人列表
}
},
- created() {
+ async created() {
// 获取保单列表存储的数据
- this.policy = JSON.parse(localStorage['preserve-policy'])
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.getPolicyInfo()
- /*this.type = this.policy.bnfDTOs[0].bnfType
if (this.type == 2) {
this.isDisType = true
}
-
- this.beneficiaries = this.policy.bnfDTOs
- */
},
mounted() {},
methods: {
@@ -95,16 +106,24 @@ export default {
mobile: this.customerInfo.mobile,
name: this.customerInfo.name
}
- policyInfo(data).then(res => {
- if (res.result == '0') {
- this.beneficiaries = res.content.cont.bcBnfList
- this.type = this.beneficiaries[0].isLegal == '1' ? '1' : '2' //isLegal:法定标记 1-是法定受益人 0-是指定受益人
- if (this.type == 2) {
- this.isDisType = true
+ return new Promise((resolve, reject) => {
+ policyInfo(data).then(
+ res => {
+ if (res.result == '0') {
+ this.beneficiaries = res.content.cont.bcBnfList
+ //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('受益人列表不能为空')
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 = {
platformType: 'APP',
edorType: 'BC',
@@ -124,6 +150,7 @@ export default {
if (res.result == 0) {
this.policy.bnfDTOs = this.beneficiaries
localStorage['preserve-policy'] = JSON.stringify(this.policy)
+ localStorage.removeItem('fromAddBC')
let path = ''
if (this.type != 2) {
path = '/preserve/common/HandleResult?entry=BC'
@@ -188,7 +215,7 @@ export default {
editBeneficiary(index) {
this.policy.bnfDTOs = this.beneficiaries
localStorage['preserve-policy'] = JSON.stringify(this.policy)
- let path = '/preserve/BeneficiaryInfoAdd?edit=' + index
+ let path = '/preserve/bc/BeneficiaryInfoAdd?edit=' + index
this.$jump({
flag: 'h5',
extra: {
diff --git a/src/views/ebiz/preserve/bc/BeneficiaryInfoAdd.vue b/src/views/ebiz/preserve/bc/BeneficiaryInfoAdd.vue
index c39c8effb..035db2f99 100644
--- a/src/views/ebiz/preserve/bc/BeneficiaryInfoAdd.vue
+++ b/src/views/ebiz/preserve/bc/BeneficiaryInfoAdd.vue
@@ -66,7 +66,7 @@
name="证件截止日期"
:required="isRequired"
:defaultDate="new Date()"
- :value.sync="userInfo.effectiveDate"
+ :value.sync="userInfo.idExpDate"
type="date"
@confirm="onDateConfirm($event, '1')"
ref="effectiveDate"
@@ -104,7 +104,7 @@
name="受益比例"
placeholder="请输入"
required
- v-validate="'required|onlyNumber'"
+ v-validate="'required|onlyInteger'"
maxlength="3"
clearable
/>
@@ -225,29 +225,33 @@ export default {
marriage: '',
isRequired: '', //长期前是否有*
userInfo: {
- bnfId: '',
- bnfType: '2',
+ bnfType: '1', //受益人类别 0-生存受益人 1-身故受益人
+ isLegal: '0', //1-法定受益人 0-指定受益人
+ bnfNo: '1',
+ relationToInsured: '', //受益人和被保人关系
+ bnfOrder: 1,
bnfGrade: '',
name: '',
sex: '0',
- nationality: '1',
- birthday: '',
+ isNewInfo: '0', //是否是新信息 0-是 1-否
idType: '1',
idNo: '',
- certificateValidate: '',
- effectiveDate: '',
- effectiveDateType: false, //是否长期
- bnfNo: '1',
- bnfOrder: 1,
- bnfLot: '',
+ idExpDate: '', //证件截止日期
phone: '',
+ birthday: '',
+ nationality: '1',
+ email: '',
province: '',
city: '',
- area: '',
- postalAddress: '',
- email: '',
+ postalAddress: '', //详细地址
occupationCode: '',
- occupationName: '' // 职业中文
+ occupationType: '',
+ occupationName: '',
+ area: '',
+ bnfLot: '', //受益比例
+
+ // certificateValidate: '',
+ effectiveDateType: false //是否长期
},
areaList: areaList,
occupationShowPicker: false,
@@ -260,6 +264,11 @@ export default {
created() {
this.policy = JSON.parse(localStorage['preserve-policy'])
this.bnfDTOs = this.policy.bnfDTOs
+ this.bnfDTOs.map(i => {
+ if (i.idExpDate == '9999-01-01') {
+ i.effectiveDateType = true
+ }
+ })
if (this.$route.query.edit) {
this.editIndex = 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]
} else if (this.pickerType == '2') {
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.effectiveDateTypeAble = false
//身份证以外的证件类型可以使用长期
@@ -336,7 +345,7 @@ export default {
this.userInfo.effectiveDateType = false
//如果录入日期早于当前日期
if (Date.parse(val) < Date.parse(new Date())) {
- this.userInfo.effectiveDate = ''
+ this.userInfo.idExpDate = ''
this.$refs.effectiveDate.date = ''
return this.$toast('您的证件已过期')
}
@@ -358,7 +367,7 @@ export default {
}
//出生证有效期
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.$refs.birthday.date = ''
return this.$toast('出生证有效期或出生日期有误')
@@ -388,7 +397,7 @@ export default {
if (data.idEffectEndDate == '9999-01-01') {
this.userInfo.effectiveDateType = true //是否长期
} else {
- this.userInfo.effectiveDate = data.idEffectEndDate //证件截止日期
+ this.userInfo.idExpDate = data.idEffectEndDate //证件截止日期
}
this.userInfo.occupationCode = data.occupationCode //职业类别编码
this.userInfo.occupationName = data.occupationName //职业类别名称
@@ -444,22 +453,22 @@ export default {
//年龄在0-15周岁之间
if (age <= 15) {
- if (Date.parse(this.userInfo.effectiveDate) - Date.parse(new Date()) > Date.parse('1975-01-01')) {
- this.userInfo.effectiveDate = ''
+ if (Date.parse(this.userInfo.idExpDate) - Date.parse(new Date()) > Date.parse('1975-01-01')) {
+ this.userInfo.idExpDate = ''
this.$refs.effectiveDate.date = ''
return this.$toast('证件有效期不正常,未满16周岁的公民身份证有效期应小于等于5年')
}
//年龄在 16-25 周岁之间
} else if (age >= 16 && age <= 25) {
- if (Date.parse(this.userInfo.effectiveDate) - Date.parse(new Date()) > Date.parse('1980-01-01')) {
- this.userInfo.effectiveDate = ''
+ if (Date.parse(this.userInfo.idExpDate) - Date.parse(new Date()) > Date.parse('1980-01-01')) {
+ this.userInfo.idExpDate = ''
this.$refs.effectiveDate.date = ''
return this.$toast('证件有效期不正常,16周岁至25周岁公民身份证有效期应小于等于10年')
}
//年龄在 26-45 周岁之间
} else if (age >= 26 && age <= 45) {
- if (Date.parse(this.userInfo.effectiveDate) - Date.parse(new Date()) > Date.parse('1990-01-01')) {
- this.userInfo.effectiveDate = ''
+ if (Date.parse(this.userInfo.idExpDate) - Date.parse(new Date()) > Date.parse('1990-01-01')) {
+ this.userInfo.idExpDate = ''
this.$refs.effectiveDate.date = ''
return this.$toast('证件有效期不正常,26周岁至45周岁公民身份证有效期应小于等于20年')
}
@@ -517,15 +526,22 @@ export default {
this.bnfDTOs[this.editIndex] = this.userInfo
}
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)
this.$jump({
flag: 'h5',
extra: {
- url: location.origin + '/#/preserve/BeneficiaryInfo',
+ url: location.origin + '/#/preserve/bc/BeneficiaryInfo',
needRefresh: '1'
},
routerInfo: {
- path: '/preserve/BeneficiaryInfo'
+ path: '/preserve/bc/BeneficiaryInfo'
}
})
} else {
@@ -554,7 +570,7 @@ export default {
effectiveDataTypeChange(val) {
//勾选长期状态时,证件截止日期置空
if (val) {
- this.userInfo.effectiveDate = ''
+ this.userInfo.idExpDate = ''
this.effectiveDateRequired = false
} else {
this.effectiveDateRequired = true
@@ -564,7 +580,7 @@ export default {
getIdentityInfo(data) {
console.log(data)
if (data.name && data.name != '待识别') {
- this.userInfo.effectiveDate = data.endDate
+ this.userInfo.idExpDate = data.endDate
this.userInfo.name = data.name
this.userInfo.idNo = data.idNo
}
diff --git a/src/views/ebiz/preserve/bc/ImageUpload.vue b/src/views/ebiz/preserve/bc/ImageUpload.vue
index 48445ac35..6fafef359 100644
--- a/src/views/ebiz/preserve/bc/ImageUpload.vue
+++ b/src/views/ebiz/preserve/bc/ImageUpload.vue
@@ -16,7 +16,7 @@
:after-read="afterRead"
:before-delete="beforeDelete"
class="mt10 ml20"
- :max-count="1"
+ :max-count="2"
@delete="deleteImg"
/>
@@ -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
- }
- }
}
}
diff --git a/src/views/ebiz/preserve/common/PolicyList.vue b/src/views/ebiz/preserve/common/PolicyList.vue
index 419e3e607..692ccae42 100644
--- a/src/views/ebiz/preserve/common/PolicyList.vue
+++ b/src/views/ebiz/preserve/common/PolicyList.vue
@@ -70,19 +70,31 @@ export default {
policyList: [] //保单列表
}
},
- mounted() {
+ async mounted() {
+ if (localStorage['preserve-policy']) {
+ localStorage.removeItem('preserve-policy')
+ }
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: {
//获取保单列表
getPolicyList(data) {
- policyList(data).then(res => {
- if (res.result == '0') {
- this.policyList = res.content.policyDTOList
- } else {
- this.$toast(res.content)
- }
+ return new Promise((resolve, reject) => {
+ policyList(data).then(
+ res => {
+ if (res.result == '0') {
+ this.policyList = res.content.policyDTOList
+ resolve()
+ } else {
+ this.$toast(res.content)
+ reject()
+ }
+ },
+ error => {
+ reject(console.log(error))
+ }
+ )
})
},