Commit 66b3dcd2 authored by 郭志伟's avatar 郭志伟

Merge branch 'fix/goods' into 'master'

fix: userid

See merge request !75
parents 1933546d bcf63e92
......@@ -270,9 +270,9 @@ export function isBankNumber(str) {
// 判断中文地址不能少于5个汉字,且必须有一位数字
export function isChnAddress(str) {
const isNum = /[0-9]\d*/;
const isChinese_var = /[\u0391-\uFFE5]{5,}/g;
const isChinese_var = /[\u4e00-\u9fa5]/g;
if (!isNull(str)) {
return isNum.test(str) && isChinese_var.test(str);
return isNum.test(str) && str.match(isChinese_var).length >= 5;
}
return false;
}
......
......@@ -167,6 +167,7 @@ export default {
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
let oldidNoWho = !relation || relation === "1" ? oldselfIdNo : oldidNo;
if (
!relation &&
idNoWho &&
idNoWho.indexOf("************") === -1 &&
!isIdNo(idNoWho) &&
......@@ -309,15 +310,17 @@ export default {
},
async calFee() {
let { price } = this.headerInfo;
const { idNo, selfIdNo, relation, amountInsured, userInfoSecId } = this.formData;
const { idNo, selfIdNo, relation, amountInsured, userInfoSecId, selfSecId } = this.formData;
let idNoWho = !relation || relation === "1" ? selfIdNo : idNo;
let idWho = !relation || relation === "1" ? selfSecId : userInfoSecId;
idWho = idNoWho.indexOf("**") > -1 ? idWho || undefined : undefined;
if (!idNoWho || !amountInsured) return;
const _param = {
productNo: this.goodId,
productUserInfo: {
insuredUserInfo: {
idNo: idNoWho,
userInfoSecId: userInfoSecId ? userInfoSecId : undefined
userInfoSecId: idWho
},
productItem: {
amountInsured
......
......@@ -387,20 +387,23 @@ export default {
this.infoReadonly = false;
}
this.relationList = userArray.length > 1 ? userArray : [];
this.formData = {
...this.formData,
...{
name,
idNo,
userInfoSecId,
socialSecurity:
socialSecurity === "" || typeof socialSecurity === "undefined"
? ""
: socialSecurity
? "1"
: "0"
}
};
setTimeout(() => {
this.formData = {
...this.formData,
...{
name,
idNo,
userInfoSecId,
socialSecurity:
socialSecurity === "" || typeof socialSecurity === "undefined"
? ""
: socialSecurity
? "1"
: "0"
}
};
});
if (!this.formData.socialSecurity && this.radioOptions.medicalOptions) {
try {
this.formData.socialSecurity = localStorage.get(this.autoSaveKey).socialSecurity;
......@@ -418,6 +421,12 @@ export default {
this.familyList = res;
if (this.hasAutoSaveData(this.autoSaveKey)) {
this.getSaveInfoHandler(this.autoSaveKey, AUTO_SAVE_TARGET);
if (this.formData.relation) {
const userArray = this.familyList.filter(
item => item.relation === +this.formData.relation
);
this.relationList = userArray.length > 1 ? userArray : [];
}
} else {
let relation = this.formData.relation;
(this.showAuthXyqb || this.mongoToken) && this.relationChange(relation);
......
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