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

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

parent 46a04a6e
......@@ -40,6 +40,8 @@
:max-date="maxDate"
@change="onPickerChange('', 'birthday')"
:show-toolbar="false"
tem-height="35"
visible-item-count="5"
/>
<cr-radio-btn
v-model="formData.socialSecurity"
......
......@@ -255,6 +255,7 @@ export default {
},
nextStep() {
this.generateFormData();
this.goInsureState = false;
this.generateOrder("ai");
},
generateFormData() {
......
......@@ -251,6 +251,7 @@ export default {
},
nextStep() {
this.generateFormData();
this.goInsureState = false;
this.generateOrder("mi");
},
generateFormData() {
......
......@@ -399,11 +399,11 @@
</cr-cell-group>
<cr-cell-group title="续费银行账户">
<cr-field
v-model="formData.holderUserInfo.bankCardName"
:value="formData.holderUserInfo.name"
name="insuredUserInfo_bankCardName"
disabled
label="持卡人"
placeholder="请填写持卡人姓名"
:rules="[{ required: true, message: '请填写持卡人姓名' }]"
/>
<cr-field
v-model="formData.holderUserInfo.bankCardCode"
......@@ -492,13 +492,14 @@ import Stepper from "@/components/Stepper";
import GoInsureDialog from "@/views/Goods/Detail/modules/GoInsureDialog";
import detailPayMixin from "@/views/Goods/Detail/modules/detailPay.mixin";
import autoSaveForm from "@/mixins/autoSaveForm.mixin";
import moment from "moment";
import _ from "lodash";
import localStorage from "@/service/localStorage";
import { mapState, mapActions } from "vuex";
import Detail from "@/api/detail.huagui.shouxian";
import { list, trail } from "@/api/product";
import { getFamilyList } from "@/api/user";
import { parseTime } from "@/service/utils";
import {
isIdNo,
isChineseName,
......@@ -634,6 +635,7 @@ export default {
} = oldVal.productItem;
let idNoWho = !relation || relation === "1" ? val.holderUserInfo.idNo : idNo;
let oldidNoWho = !relation || relation === "1" ? oldVal.holderUserInfo.idNo : oldIdNo;
this.setEffectiveDate();
if (
(idNoWho && idNoWho.indexOf("************") === -1 && !isIdNo(idNoWho)) ||
(idNoWho === oldidNoWho &&
......@@ -771,6 +773,7 @@ export default {
}
sessionStorage.setItem("policyFormData", JSON.stringify(this.subFormData));
// this.$router.push({ path: "/goods/inform", query: { url: popupArray[1].url } });
this.goInsureState = false;
this.generateOrder("li");
},
relationOptionChange(relation) {
......@@ -856,10 +859,44 @@ export default {
...{ amountInsured, policyPeriod, payPeriod, payType }
};
}
const nextDate = Date.parse(new Date()) + 86400000;
this.formData.effectiveDate = parseTime(nextDate, "{y}-{m}-{d} 00:00:00");
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() {
const res = await list();
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