feature/GFRS-2301【需求】健康险渠道国富无忧卡金掌桂开发的需求--修改地址信息添加市辖区字段,有效期修改,投保信息确认页-保险责任-保费期间-有效期显示修改--提交人庞兴月

This commit is contained in:
庞兴月
2021-04-07 11:47:28 +08:00
parent 793c3ce7dc
commit 10e0522be7
4 changed files with 53 additions and 44 deletions

View File

@@ -2587,6 +2587,7 @@ export default {
445321: '新兴县',
445322: '郁南县',
445381: '罗定市',
450101: '市辖区',
450102: '兴宁区',
450103: '青秀区',
450105: '江南区',

View File

@@ -13,5 +13,19 @@ export default {
//获取“多少天数”之后的时间 例如28天后 即days=28
let currentTime = new Date().getTime()
return new Date(Number(currentTime) + 1000 * 60 * 60 * 24 * days)
},
isLeapYear: function(year) {
var cond1 = year % 4 == 0 //条件1年份必须要能被4整除
var cond2 = year % 100 != 0 //条件2年份不能是整百数
var cond3 = year % 400 == 0 //条件3年份是400的倍数
//当条件1和条件2同时成立时就肯定是闰年所以条件1和条件2之间为“与”的关系。
//如果条件1和条件2不能同时成立但如果条件3能成立则仍然是闰年。所以条件3与前2项为“或”的关系。
//所以得出判断闰年的表达式:
var cond = (cond1 && cond2) || cond3
if (cond) {
return 366
} else {
return 365
}
}
}

View File

@@ -26,10 +26,15 @@
</van-cell-group>
<van-cell-group class="mt10">
<p style="border-bottom: 1px solid #ebedf0" class="fs15 fwb pl10 pv12">产品信息</p>
<van-field :value="riskDTO.riskName" label="保障方案" name="保障方案" readonly />
<van-field value="保额" label="保险责任" name="保险责任" readonly />
<van-field :value="riskDTO.proScheme" label="保障方案" name="保障方案" readonly />
<div class="duty">
<van-field value="保额" label="保险责任" name="保险责任" readonly />
</div>
<div class="duty" v-for="(item, index) in riskDTO.dutyLst" :key="index">
<van-field :value="item.prem" :label="item.dutyName" :name="item.dutyName" readonly />
</div>
<van-field :value="riskDTO.prem" label="保费" name="保费" readonly />
<van-field :value="'1年'" label="保险期间" name="保险期间" readonly />
<van-field :value="riskDTO.insuYear + riskDTO.dateCN" label="保险期间" name="保险期间" readonly />
</van-cell-group>
<div class="tips">{{productDate}}</div>
<van-goods-action style="z-index: 99">
@@ -44,6 +49,7 @@
import { Field, GoodsAction, GoodsActionIcon, GoodsActionButton, Icon } from 'vant'
import { getOrderDetail, information, underWrite } from '@/api/ebiz/sale/sale'
import getAreaName from '@/assets/js/utils/getAreaNameForSale'
import afterDate from '@/assets/js/utils/getAfterDate.js'
export default {
name: 'cardDetail',
components: {
@@ -70,38 +76,33 @@ export default {
productDate: ''
}
},
created() {
created() {
this.appntInfo = this.orderDTO.appntDTO
this.appntInfo.homeName = getAreaName([{ code: this.appntInfo.homeProvince }, { code: this.appntInfo.homeCity }, { code: this.appntInfo.homeArea }])
this.insuredInfo = this.orderDTO.insuredDTOs[0]
this.insuredInfo.homeName = getAreaName([{ code: this.insuredInfo.homeProvince }, { code: this.insuredInfo.homeCity }, { code: this.insuredInfo.homeArea }])
let insuYear = (this.riskDTO = this.orderDTO.insuredDTOs[0].riskDTOLst[0])
let currentDataArr = insuYear.cvaliDate.split('-')
let currentData = currentDataArr[0] + '年' + currentDataArr[1] + '月' + currentDataArr[2] + '日'
let insuYearM, productDate, productDateTime,insuYearD;
let insuYearM, productDate, productDateTime, insuYearD, hoDate
switch (insuYear.insuYearFlag) {
case 'D':
let hoDate = Date.parse(insuYear.cvaliDate) / 1000 + insuYear['insuYear'] * 24 * 3600
productDate = new Date(parseInt(hoDate) * 1000)
insuYearM = productDate.getMonth() + 1 < 10 ? '0' + (productDate.getMonth() + 1) : productDate.getMonth() + 1
insuYearD = productDate.getDate() < 10 ? '0' + productDate.getDate() : productDate.getDate()
productDateTime = productDate.getFullYear() + '年' + insuYearM + '月' + insuYearD + '日'
this.productDate = currentData + '0时至' + productDateTime + '24时止'
this.riskDTO.dateCN = '天'
hoDate = Date.parse(insuYear.cvaliDate) / 1000 + (insuYear['insuYear'] - 1) * 24 * 3600
break
case 'Y':
productDate = new Date(insuYear.cvaliDate)
insuYearM = productDate.getMonth() + 1 < 10 ? '0' + (productDate.getMonth() + 1) : productDate.getMonth() + 1
insuYearD = productDate.getDate() < 10 ? '0' + productDate.getDate() : productDate.getDate()
productDateTime = parseInt(productDate.getFullYear()) + parseInt(insuYear['insuYear']) + '年' + insuYearM + '月' + insuYearD + '日'
this.productDate = currentData + '0时至' + productDateTime + '24时止'
break
case 'M':
productDateTime = this.GetNextMonthDay(insuYear.cvaliDate, insuYear['insuYear'])
this.productDate = currentData + '0时至' + productDateTime + '24时止'
this.riskDTO.dateCN = '年'
hoDate = Date.parse(insuYear.cvaliDate) / 1000 + insuYear['insuYear'] * 24 * 3600 * (afterDate.isLeapYear(new Date(insuYear.cvaliDate).getFullYear()) - 1)
break
}
productDate = new Date(parseInt(hoDate) * 1000)
insuYearM = productDate.getMonth() + 1 < 10 ? '0' + (productDate.getMonth() + 1) : productDate.getMonth() + 1
insuYearD = productDate.getDate() < 10 ? '0' + productDate.getDate() : productDate.getDate()
productDateTime = productDate.getFullYear() + '年' + insuYearM + '月' + insuYearD + '日'
this.productDate = currentData + '0时至' + productDateTime + '24时止'
},
methods: {
nextStep() {
@@ -128,4 +129,12 @@ export default {
color: #333;
padding: 15px;
}
.duty{
.van-field__label{
width: 60vw;
}
.van-field__control{
text-align: center;
}
}
</style>

View File

@@ -418,8 +418,7 @@ export default {
}
}
}
underWrite(data).then(res => {
console.log(res)
underWrite(data).then(res => {
if (res.result == '0') {
this.$toast.clear()
if (res.uwResult == '33') {
@@ -440,9 +439,9 @@ export default {
}
})
return true
} else {
return false
} else {
this.$toast(res.resultMessage)
return false
}
})
},
@@ -722,13 +721,13 @@ export default {
let currentData = currentDataArr[0] + '年' + currentDataArr[1] + '月' + currentDataArr[2] + '日'
let insuYear = JSON.parse(localStorage.insuYear)
let insuYearM, productDate, productDateTime
let insuYearD, hoDate
let insuYearD, hoDate
switch (insuYear.insuYearFlag) {
case 'D':
hoDate = Date.parse(val) / 1000 + (insuYear['insuYear'] - 1) * 24 * 3600
break
case 'Y':
hoDate = Date.parse(val) / 1000 + insuYear['insuYear'] * 24 * 3600 * 364
case 'Y':
hoDate = Date.parse(val) / 1000 + insuYear['insuYear'] * 24 * 3600 * (afterDate.isLeapYear(new Date(val).getFullYear())-1)
break
}
productDate = new Date(parseInt(hoDate) * 1000)
@@ -740,20 +739,6 @@ export default {
break
}
},
isLeapYear(year) {
var cond1 = year % 4 == 0 //条件1年份必须要能被4整除
var cond2 = year % 100 != 0 //条件2年份不能是整百数
var cond3 = year % 400 == 0 //条件3年份是400的倍数
//当条件1和条件2同时成立时就肯定是闰年所以条件1和条件2之间为“与”的关系。
//如果条件1和条件2不能同时成立但如果条件3能成立则仍然是闰年。所以条件3与前2项为“或”的关系。
//所以得出判断闰年的表达式:
var cond = (cond1 && cond2) || cond3
if (cond) {
return 366
} else {
return 365
}
},
GetNextMonthDay(date, monthNum) {
var dateArr = date.split('-')
var year = dateArr[0] //获取当前日期的年份
@@ -815,7 +800,7 @@ export default {
this.userInfo.homeProvince = data.homeProvince //家庭省
this.userInfo.homeCity = data.homeCity //家庭市
this.userInfo.homeArea = data.homeArea //家庭区
if (data.homeProvince && data.homeCity && data.homeArea) {
if (data.homeProvince && data.homeCity && data.homeArea) {
this.userInfo.homeName = getAreaName([{ code: data.homeProvince }, { code: data.homeCity }, { code: data.homeArea }]) //家庭地址
}
this.userInfo.homeAddress = data.homeAddress //家庭详细地址