This commit is contained in:
邓晓坤
2019-09-25 15:59:14 +08:00
parent cbba1e0526
commit 191d614c53
2 changed files with 51 additions and 52 deletions

View File

@@ -31,9 +31,9 @@ service.interceptors.request.use(
})
}
config.headers['token'] = window.localStorage.getItem('token')
// config.headers['token'] = `507e5ff426364e95b22cd4c1e22f427f`
// return config
// config.headers['token'] = window.localStorage.getItem('token')
config.headers['token'] = `507e5ff426364e95b22cd4c1e22f427f`
return config
},
error => {
// Do something with request error

View File

@@ -1,7 +1,6 @@
<template>
<div class="notifyingMessage-container">
<div class="pb50">
<div class="pt20 pb20 pr10 bg-white flex justify-content-s align-items-c allFalse">
<span class="pl10">告知项目</span>
<div @click="allFalse" class="pr10">
@@ -15,11 +14,13 @@
<div slot="title" class="flex align-items-c justify-content-s">
<!--投保人 0 1 被保人 2 3 -->
{{ impartTypeNumber[im.impartType] }}
<span
class="ml100"
>{{ (im.impartType == 0||im.impartType == 1) ? saleInsuredInfo.name : saleInsuredPersonInfo.name }}</span>
<span class="ml100">{{ im.impartType == 0 || im.impartType == 1 ? saleInsuredInfo.name : saleInsuredPersonInfo.name }}</span>
<img :src="$assetsUrl + 'images/avatar.png'" class="w20 ml15" />
</div>
<!-- <div class="h50">
<img />
<span>请如实填写问题中的每一项情况并对出现的情况载体是框列举说明</span>
</div>-->
<div class="h50 mt10 flex align-items-c notifyingMessage-text">
<div class="ml15 w315 h35 flex">
<!-- <img :src="$assetsUrl + 'images/notifiy.png'" class="w18 h18 " /> -->
@@ -45,14 +46,7 @@
<div v-if="item.show">
<div>
<van-cell-group v-for="(it, ind) in item.questions" :key="ind">
<van-field
v-model="it.answer"
placeholder="请输入"
:label="it.questionContent"
clearable
v-validate="'required'"
data-vv-name="答案"
/>
<van-field v-model="it.answer" placeholder="请输入" :label="it.questionContent" clearable v-validate="'required'" data-vv-name="答案" />
</van-cell-group>
</div>
</div>
@@ -63,13 +57,7 @@
</div>
</div>
<div class="bottom-btn bg-white">
<van-button
type="danger"
size="large"
@click="next"
:disabled="isDisabled"
v-no-more-click="1000"
>下一步</van-button>
<van-button type="danger" size="large" @click="next" :disabled="isDisabled" v-no-more-click="1000">下一步</van-button>
</div>
</div>
</template>
@@ -96,13 +84,13 @@ export default {
'0': '投保人健康告知',
'1': '投保人财务告知',
'2': '被保人健康告知',
'3': '保人财务告知'
'3': '保人财务告知'
}
}
},
created() {
getOrderDetail({ orderNo: localStorage.orderNo }).then(res => {
// getOrderDetail({ orderNo: `8186270000000036` }).then(res => {
if (res.result == 0) {
//投被保人关系
this.relationToAppnt = res.orderDTO.insuredDTOs[0].relationToAppnt
@@ -115,40 +103,50 @@ export default {
this.$toast(res.resultMessage)
}
})
// this.relationToAppnt = `1`
this.information()
},
methods: {
// 一键全否
allFalse() {
let that = this
// alert('1')
that.impartDTOS.map(it => {
it.impartItemDTOS.map(itm => {
itm.impartAnswer = '1'
// console.log(itm.impartAnswer)
// console.log(itm.show)
})
})
},
// 单选改变时候
change(item, val) {
// console.log(item)
// console.log(val)
let that = this
if (val == '0') {
that.impartDTOS.map(it => {
it.impartItemDTOS.map(itm => {
if (item == itm.extra2) {
// itm.isTrue = val
itm.show = true
}
})
})
// that.impartItemDTOS[item].show = true
} else {
that.impartDTOS.map(it => {
it.impartItemDTOS.map(itm => {
if (item == itm.extra2) {
// itm.isTrue = val
itm.show = false
}
})
})
}
},
// 获取告知消息
information() {
let that = this
@@ -159,11 +157,14 @@ export default {
type: '2'
}
information(data).then(res => {
// console.log(res)
if (res.result == '0') {
res.productImpartLstDTO.impartDTOS.map(item => {
// that.impartItemDTOS = item.impartItemDTOS
item.impartItemDTOS.map(im => {
// debugger
im.impartAnswer = ''
if (im.questions.length == '0') {
let obj = {
answer: ''
@@ -182,15 +183,13 @@ export default {
array.splice(index, 1)
}
})
that.impartDTOS = res.productImpartLstDTO.impartDTOS
this.activeNames.push(res.productImpartLstDTO.impartDTOS.length)
} else {
that.impartDTOS = res.productImpartLstDTO.impartDTOS
this.activeNames.push(res.productImpartLstDTO.impartDTOS.length)
}
this.impartDTOS.sort(function(a,b){
return a.impartType-b.impartType;
});
// that.impartDTOS = res.productImpartLstDTO.impartDTOS
}
})
@@ -214,17 +213,17 @@ export default {
})
obj = item
return obj
} else if(item.impartType =='1') {
} else if (item.impartType == '2') {
// 投保人财富
item.impartItemDTOS.map(i => {
delete i.extra2
delete i.show
})
// console.log(item.impartType)
financeImpartDTO = item
return financeImpartDTO
}else if(item.impartType =='2'){
} else if (item.impartType == '1') {
// 被保人健康
item.impartItemDTOS.map(i => {
delete i.extra2
delete i.show
@@ -254,20 +253,20 @@ export default {
financeImpartDTO: financeImpartDTO
},
// 被保人
insuredDTOs: [{ impartDTO: objInsured },{financeImpart:financeImpart}]
insuredDTOs: [{ impartDTO: objInsured, financeImpartDTO: financeImpart }]
}
}
saveInformation(data).then(res => {
if (res.result == '0') {
that.$jump({
flag: 'h5',
extra: {
url: location.origin + '/#/sale/accountInformation'
},
routerInfo: {
path: '/sale/accountInformation'
}
})
// that.$jump({
// flag: 'h5',
// extra: {
// url: location.origin + '/#/sale/accountInformation'
// },
// routerInfo: {
// path: '/sale/accountInformation'
// }
// })
} else {
this.$toast(res.resultMessage)
}