Commit 558bc780 authored by 郭志伟's avatar 郭志伟

fix: 日期选择优化;华贵生效日期修复;下单有隐藏确认购买弹框

parent 46a04a6e
...@@ -40,6 +40,8 @@ ...@@ -40,6 +40,8 @@
:max-date="maxDate" :max-date="maxDate"
@change="onPickerChange('', 'birthday')" @change="onPickerChange('', 'birthday')"
:show-toolbar="false" :show-toolbar="false"
tem-height="35"
visible-item-count="5"
/> />
<cr-radio-btn <cr-radio-btn
v-model="formData.socialSecurity" v-model="formData.socialSecurity"
......
...@@ -255,6 +255,7 @@ export default { ...@@ -255,6 +255,7 @@ export default {
}, },
nextStep() { nextStep() {
this.generateFormData(); this.generateFormData();
this.goInsureState = false;
this.generateOrder("ai"); this.generateOrder("ai");
}, },
generateFormData() { generateFormData() {
......
...@@ -251,6 +251,7 @@ export default { ...@@ -251,6 +251,7 @@ export default {
}, },
nextStep() { nextStep() {
this.generateFormData(); this.generateFormData();
this.goInsureState = false;
this.generateOrder("mi"); this.generateOrder("mi");
}, },
generateFormData() { generateFormData() {
......
...@@ -399,11 +399,11 @@ ...@@ -399,11 +399,11 @@
</cr-cell-group> </cr-cell-group>
<cr-cell-group title="续费银行账户"> <cr-cell-group title="续费银行账户">
<cr-field <cr-field
v-model="formData.holderUserInfo.bankCardName" :value="formData.holderUserInfo.name"
name="insuredUserInfo_bankCardName" name="insuredUserInfo_bankCardName"
disabled
label="持卡人" label="持卡人"
placeholder="请填写持卡人姓名" placeholder="请填写持卡人姓名"
:rules="[{ required: true, message: '请填写持卡人姓名' }]"
/> />
<cr-field <cr-field
v-model="formData.holderUserInfo.bankCardCode" v-model="formData.holderUserInfo.bankCardCode"
...@@ -492,13 +492,14 @@ import Stepper from "@/components/Stepper"; ...@@ -492,13 +492,14 @@ import Stepper from "@/components/Stepper";
import GoInsureDialog from "@/views/Goods/Detail/modules/GoInsureDialog"; import GoInsureDialog from "@/views/Goods/Detail/modules/GoInsureDialog";
import detailPayMixin from "@/views/Goods/Detail/modules/detailPay.mixin"; import detailPayMixin from "@/views/Goods/Detail/modules/detailPay.mixin";
import autoSaveForm from "@/mixins/autoSaveForm.mixin"; import autoSaveForm from "@/mixins/autoSaveForm.mixin";
import moment from "moment";
import _ from "lodash";
import localStorage from "@/service/localStorage"; import localStorage from "@/service/localStorage";
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import Detail from "@/api/detail.huagui.shouxian"; import Detail from "@/api/detail.huagui.shouxian";
import { list, trail } from "@/api/product"; import { list, trail } from "@/api/product";
import { getFamilyList } from "@/api/user"; import { getFamilyList } from "@/api/user";
import { parseTime } from "@/service/utils";
import { import {
isIdNo, isIdNo,
isChineseName, isChineseName,
...@@ -634,6 +635,7 @@ export default { ...@@ -634,6 +635,7 @@ export default {
} = oldVal.productItem; } = oldVal.productItem;
let idNoWho = !relation || relation === "1" ? val.holderUserInfo.idNo : idNo; let idNoWho = !relation || relation === "1" ? val.holderUserInfo.idNo : idNo;
let oldidNoWho = !relation || relation === "1" ? oldVal.holderUserInfo.idNo : oldIdNo; let oldidNoWho = !relation || relation === "1" ? oldVal.holderUserInfo.idNo : oldIdNo;
this.setEffectiveDate();
if ( if (
(idNoWho && idNoWho.indexOf("************") === -1 && !isIdNo(idNoWho)) || (idNoWho && idNoWho.indexOf("************") === -1 && !isIdNo(idNoWho)) ||
(idNoWho === oldidNoWho && (idNoWho === oldidNoWho &&
...@@ -771,6 +773,7 @@ export default { ...@@ -771,6 +773,7 @@ export default {
} }
sessionStorage.setItem("policyFormData", JSON.stringify(this.subFormData)); sessionStorage.setItem("policyFormData", JSON.stringify(this.subFormData));
// this.$router.push({ path: "/goods/inform", query: { url: popupArray[1].url } }); // this.$router.push({ path: "/goods/inform", query: { url: popupArray[1].url } });
this.goInsureState = false;
this.generateOrder("li"); this.generateOrder("li");
}, },
relationOptionChange(relation) { relationOptionChange(relation) {
...@@ -856,10 +859,44 @@ export default { ...@@ -856,10 +859,44 @@ export default {
...{ amountInsured, policyPeriod, payPeriod, payType } ...{ amountInsured, policyPeriod, payPeriod, payType }
}; };
} }
const nextDate = Date.parse(new Date()) + 86400000;
this.formData.effectiveDate = parseTime(nextDate, "{y}-{m}-{d} 00:00:00");
this.$forceUpdate(); this.$forceUpdate();
}, },
getBirthDate(idCard) {
let birthday = "";
if (idCard) {
if (idCard.length == 15) {
birthday = "19" + idCard.substr(6, 6);
} else if (idCard.length == 18) {
birthday = idCard.substr(6, 8);
}
birthday = birthday.replace(/(.{4})(.{2})/, "$1-$2-");
}
return birthday;
},
setEffectiveDate: _.debounce(function() {
const { relation, userInfoSecId: userId, idNo: idNoMask } = this.formData.insuredUserInfo;
const { userInfoSecId: holderUserId, idNo: holderIdNoMask } = this.formData.holderUserInfo;
let currentIdNo = !relation || relation === "1" ? holderIdNoMask : idNoMask;
const currentUserId = !relation || relation === "1" ? holderUserId : userId;
if (!currentIdNo) return;
currentIdNo =
currentIdNo.indexOf("**") > -1
? this.familyList.find(item => item.userInfoSecId === currentUserId).idNo
: currentIdNo;
const birthday = this.getBirthDate(currentIdNo);
const birthdayArr = birthday.split("-");
const currentdayArr = moment()
.format("YYYY-MM-DD")
.split("-");
const nextDate =
birthdayArr[1] === currentdayArr[1] && +currentdayArr[2] === +birthdayArr[2] - 1
? moment().format("YYYY-MM-DD 00:00:00")
: moment()
.add(1, "d")
.format("YYYY-MM-DD 00:00:00");
this.formData.effectiveDate = nextDate;
}),
async getDetail() { async getDetail() {
const res = await list(); const res = await list();
if (res) { if (res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment