diff --git a/src/views/ebiz/cardList/GroupCheckInfo.vue b/src/views/ebiz/cardList/GroupCheckInfo.vue index faca8cc0e..3391e5931 100644 --- a/src/views/ebiz/cardList/GroupCheckInfo.vue +++ b/src/views/ebiz/cardList/GroupCheckInfo.vue @@ -12,24 +12,23 @@

产品信息

- -
- -
+ +
- +
-

被保人信息

- + - + @@ -47,7 +46,7 @@ 总保费:{{ - riskDTO.prem }}元 + orderInfoDTO.orderAmount }}元 @@ -60,7 +59,6 @@ import { Field, GoodsAction, GoodsActionIcon, GoodsActionButton, Icon ,Collapse, import {cardOrderDetail } from '@/api/ebiz/cardList/cardList.js' import getAreaName from '@/assets/js/utils/getAreaNameForSale' import afterDate from '@/assets/js/utils/getAfterDate.js' -import utilsAge from '@/assets/js/utils/age' export default { name: 'cardDetail', @@ -80,7 +78,8 @@ export default { insuredInfo: {}, bnfTypeVal: '法定受益人', //受益人类型文字展示 riskDTO: {}, - // productDate: '', + productDate: '', + orderInfoDTO:{} // isLessEighteen: true // 被保人手机号和邮箱默认展示 } }, @@ -88,6 +87,9 @@ export default { if (this.$route.query.cardOrderNo) { this.cardOrderNo = this.$route.query.cardOrderNo } + + }, + mounted() { //根据后台数据来展示 let cardInfoDTO = { orderNo: this.cardOrderNo @@ -96,44 +98,34 @@ export default { if (res.result == '0') { this.appntInfo = res.orderDTO.appntDTO this.appntInfo.homeName = getAreaName([{ code: this.appntInfo.homeProvince }, { code: this.appntInfo.homeCity }, { code: this.appntInfo.homeArea }]) + this.orderInfoDTO = res.orderDTO.orderInfoDTO this.insuredInfo = res.orderDTO.insuredDTOs this.insuredInfo.forEach(item => { item.homeName = getAreaName([{ code: item.homeProvince }, { code: item.homeCity }, { code: item.homeArea }]) }) - this.riskDTO = res.orderDTO.insuredDTOs[0].riskDTOLst[0] - } - }) - - - // let insuYear = (this.riskDTO = this.orderDTO.insuredDTOs[0].riskDTOLst[0]) - // if (this.riskDTO.dutyLst && this.riskDTO.dutyLst.length > 0) { - // this.riskDTO.dutyLst.forEach(val => { - // if (val.dutyCode === 'C006') { - // val.amtContain = val.amt + '元/天' - // } else { - // val.amtContain = val.amt + '元' - // } - // }) - // } - // let currentDataArr = insuYear.cvaliDate.split('-') - // let currentData = currentDataArr[0] + '年' + currentDataArr[1] + '月' + currentDataArr[2] + '日' - // let insuYearM, productDate, productDateTime, insuYearD, hoDate + // this.riskDTO = res.orderDTO.insuredDTOs[0].riskDTOLst[0] + let insuYear = (this.riskDTO = res.orderDTO.insuredDTOs[0].riskDTOLst[0]) + let currentDataArr = insuYear.cvaliDate.split('-') + let currentData = currentDataArr[0] + '年' + currentDataArr[1] + '月' + currentDataArr[2] + '日' + let insuYearM, productDate, productDateTime, insuYearD, hoDate - // switch (insuYear.insuYearFlag) { - // case 'D': - // this.riskDTO.dateCN = '天' - // hoDate = Date.parse(insuYear.cvaliDate) / 1000 + (insuYear['insuYear'] - 1) * 24 * 3600 - // break - // case 'Y': - // 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时止' + switch (insuYear.insuYearFlag) { + case 'D': + this.riskDTO.dateCN = '天' + hoDate = Date.parse(insuYear.cvaliDate) / 1000 + (insuYear['insuYear'] - 1) * 24 * 3600 + break + case 'Y': + 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时止,共'+ this.riskDTO.insuYear + this.riskDTO.dateCN + } + }) }, methods: { nextStep() {