Commit 85f4185e authored by 郭志伟's avatar 郭志伟

fix: 问题修复

parent 41a0daec
This diff is collapsed.
......@@ -12,7 +12,7 @@
<script>
import popupPickerMixin from "../mixins/popupPicker.mixin.js";
import areaList from "@qg/cherry-ui/src/area/demo/china";
import areaList from "@/api/china";
export default {
name: "PopupAreaPicker",
mixins: [popupPickerMixin],
......
......@@ -2,7 +2,7 @@
* @Description: PopupPicker mixin
* @Date: 2020-07-28 19:46:31
* @LastEditors: gzw
* @LastEditTime: 2020-08-19 18:08:05
* @LastEditTime: 2020-08-21 15:10:01
*/
// TODO 默认值需要处理
......@@ -39,6 +39,8 @@ export default {
this.$refs[this.refName].refreshColumns();
this.setDefaultVal();
}, 500);
} else {
this.refreshed = false;
}
}
// value: {
......
//引入axios
import store from "@/store";
import router from "@/router";
import axios from "axios";
import cherry from "@qg/cherry-ui";
import config from "../config";
......@@ -77,7 +78,12 @@ axios.interceptors.response.use(
delete pending[response.config.url];
if (response.data.code === "0") return response.data.data;
// 特殊处理,下单已存在时,跳转到保单列表
if (response.config.url === "policy_order" && response.data.code === "40601") {
setTimeout(() => {
router.push("/policy");
}, 1000);
}
Notify({ type: "danger", message: response.data.msg || "后端服务异常" });
store.dispatch("setIsPayWait", false);
return Promise.reject(response.data);
......
......@@ -6,7 +6,7 @@
<h1>{{ info.name }}</h1>
<cr-tag><svg-icon icon-class="medal" />{{ info.role }}</cr-tag>
<small>执业保险销售资质:</small>
<small v-html="`${info.card.slice(0, 15)}<br />${info.id.slice(15)}`"></small>
<small v-html="`${info.card.slice(0, 15)}<br />${info.card.slice(15)}`"></small>
</div>
<cr-image
class="cul-hd-img"
......
......@@ -238,6 +238,7 @@ export default {
sub: "请预留您的信息,保险师会在您方便时联系您"
}
],
// 给谁买
insuredOptions: [
{ label: "本人", value: "本人" },
{ label: "配偶", value: "配偶" },
......@@ -246,6 +247,7 @@ export default {
{ label: "父亲", value: "父亲" },
{ label: "母亲", value: "母亲" }
],
// 有无社保
hasSocialOptions: [
{ label: "", value: "1" },
{ label: "", value: "0" }
......@@ -254,7 +256,9 @@ export default {
{ label: "", value: "0" },
{ label: "", value: "1" }
],
// 收入
incomeOptions: ["10万", "20万", "25万", "30万"],
// 贷款
loanOptions: ["无房贷", "1000元", "2000元", "3000元", "4000元"],
solveOptions: [
{ label: "之前从没买过保险,打算配置保险", value: "之前从没买过保险,打算配置保险" },
......
......@@ -355,9 +355,10 @@ export default {
const res = await trail(_param);
if (res) {
price[2] = payType === "2" ? "" : "首月";
price[0] = res.downPayPrice;
subPrice[1] = "元/月";
subPrice[0] = res.regularPrice;
subPrice[0] = payType === "2" ? "" : res.regularPrice;
this.goodActionInfo = {
title: price,
sub: subPrice[0] ? subPrice : ""
......
......@@ -340,8 +340,9 @@ export default {
};
const res = await trail(_param);
if (res) {
price[2] = payType === "2" ? "" : "首月";
price[0] = res.downPayPrice;
subPrice[0] = res.regularPrice;
subPrice[0] = payType === "2" ? "" : res.regularPrice;
subPrice[1] = "元/月";
this.goodActionInfo = {
title: price,
......
......@@ -60,7 +60,15 @@
:readonly="infoReadonly"
label="姓名"
:rules="[{ required: true, message: '请输入姓名' }]"
/>
>
<cr-icon
type="arrow"
slot="button"
v-if="relationList.length > 1"
class="relation-select"
@click="showRelations = true"
/>
</cr-field>
<cr-field
name="relativeIdNo"
v-if="formData.relation !== '1'"
......@@ -119,6 +127,16 @@
title="我们常说的社保都包括哪些?"
confirm-btn="我知道了"
/>
<cr-popup v-model="showRelations" position="bottom" get-container="body">
<cr-picker
ref="relationsPicker"
:columns="relationList"
value-key="nameMask"
show-toolbar
@cancel="onRelationCancel"
@confirm="onRelationConfirm"
/>
</cr-popup>
</div>
</template>
......@@ -170,10 +188,25 @@ export default {
xyqbAuthState: localStorage.get("xyqbAuthState"),
selfInfoReadonly: false,
infoReadonly: false,
question: false
question: false,
showRelations: false,
refreshed: false,
relationList: []
};
},
watch: {
showRelations(val) {
if (val && !this.refreshed && this.$refs["relationsPicker"]) {
const $relationsPicker = this.$refs["relationsPicker"];
$relationsPicker.formattedColumns = $relationsPicker.formatColumns(this.relationList);
setTimeout(() => {
this.refreshed = true;
$relationsPicker.refreshColumns();
}, 500);
} else {
this.refreshed = false;
}
},
detailType: {
immediate: true,
handler(val) {
......@@ -240,6 +273,28 @@ export default {
this.setAuthXyqb(2);
}
},
onRelationCancel() {
this.showRelations = false;
},
onRelationConfirm(picker, res) {
// console.log(res[0]);
const { idNoMask, nameMask, userInfoSecId, socialSecurity } = res[0];
this.formData = {
...this.formData,
...{
idNo: idNoMask,
name: nameMask,
userInfoSecId,
socialSecurity:
socialSecurity === "" || typeof socialSecurity === "undefined"
? ""
: socialSecurity
? "1"
: "0"
}
};
this.onRelationCancel();
},
relationChange(relation = this.formData.relation) {
this.familyList.forEach(item => {
const {
......@@ -301,6 +356,7 @@ export default {
}
this.infoReadonly = false;
}
this.relationList = userArray.length > 1 ? userArray : [];
this.formData = {
...this.formData,
...{
......@@ -446,4 +502,10 @@ export default {
top: 10px;
left: -35px;
}
.relation-select {
width: 13px;
height: 22px;
text-align: center;
line-height: 22px;
}
</style>
......@@ -112,4 +112,10 @@
}
}
}
}
.relation-select {
width: 13px;
height: 22px;
text-align: center;
line-height: 22px;
}
\ No newline at end of file
......@@ -229,7 +229,15 @@
message: '请填写正确的被保人姓名,最少2个中文字符'
}
]"
/>
>
<cr-icon
type="arrow"
slot="button"
v-if="relationList.length > 1"
class="relation-select"
@click="showRelations = true"
/>
</cr-field>
<cr-field
v-model="formData.insuredUserInfo.idNo"
name="insuredUserInfo_idNo"
......@@ -459,6 +467,16 @@
:url="pupopData.url"
>
</popup-with-iframe>
<cr-popup v-model="showRelations" position="bottom" get-container="body">
<cr-picker
ref="relationsPicker"
:columns="relationList"
value-key="nameMask"
show-toolbar
@cancel="onRelationCancel"
@confirm="onRelationConfirm"
/>
</cr-popup>
</div>
</template>
......@@ -558,10 +576,25 @@ export default {
insuredAmountOptions,
bankInfo,
selfInfoReadonly: false,
infoReadonly: false
infoReadonly: false,
showRelations: false,
refreshed: false,
relationList: []
};
},
watch: {
showRelations(val) {
if (val && !this.refreshed && this.$refs["relationsPicker"]) {
const $relationsPicker = this.$refs["relationsPicker"];
$relationsPicker.formattedColumns = $relationsPicker.formatColumns(this.relationList);
setTimeout(() => {
this.refreshed = true;
$relationsPicker.refreshColumns();
}, 500);
} else {
this.refreshed = false;
}
},
popupShow(val) {
if (!val && this.currentPupopIndex === 6) this.currentPupopIndex = null;
},
......@@ -693,6 +726,28 @@ export default {
this.setAuthXyqb(2);
}
},
onRelationCancel() {
this.showRelations = false;
},
onRelationConfirm(picker, res) {
// console.log(res[0]);
const { idNoMask, nameMask, userInfoSecId, socialSecurity } = res[0];
this.formData.insuredUserInfo = {
...this.formData.insuredUserInfo,
...{
idNo: idNoMask,
name: nameMask,
userInfoSecId,
socialSecurity:
socialSecurity === "" || typeof socialSecurity === "undefined"
? ""
: socialSecurity
? "1"
: "0"
}
};
this.onRelationCancel();
},
onFormSubmit() {
this.goInsureState = true;
},
......@@ -758,6 +813,7 @@ export default {
}
this.infoReadonly = false;
}
this.relationList = userArray.length > 1 ? userArray : [];
this.formData.insuredUserInfo = {
...this.formData.insuredUserInfo,
...{
......
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