16ebd6b4 by simon

默认提交

1 parent 129c9089
......@@ -12,11 +12,6 @@ export default {
type: Boolean,
default: true,
},
// 取消按钮回调方法
close: {
type: Function,
default: null
},
// 确认文案
confirmText: {
type: String,
......@@ -27,21 +22,6 @@ export default {
type: String,
default: "取消",
},
// 确定按钮回调方法
confirm: {
type: Function,
default: null
},
// 取消按钮回调方法
cancel: {
type: Function,
default: null
},
// 点击蒙层回调方法
overlay: {
type: Function,
default: null
},
// 传入数据
items: {
......@@ -66,27 +46,20 @@ export default {
methods: {
// 点击关闭
onCloseHandler() {
if (this.close) {
this.close();
}
this.$emit("close");
},
// 点击取消
onCancelHandler() {
if (this.close) {
this.close();
}
this.$emit("close");
},
// 点击蒙层
onOverLayHandler() {
if (this.overlay) {
this.overlay();
}
// this.$emit("close");
},
// 点击确认
onConfirmHandler() {
if (this.confirm) {
this.confirm(this.checkList);
}
this.$emit("close");
this.$emit("confirm", this.checkList);
},
initData() {}
},
......
import { mapState } from "vuex";
import {
mapState
} from "vuex";
import api from '@/api/api'
import {
httpGet,
httpPost
httpGet,
httpPost
} from '@/api/fetch-api.js'
import Auth from '@components/auth/auth.vue';
import ECorrespondenceHeadList from "./e-correspondence-head-list.vue";
import { formatMoney, getInsuredPeriod, getBenefitType, getPayPeriod, getPayType, getMoneyName, getPayMode, getPolicyName } from "@/utils/biz.js";
import {
formatMoney,
getInsuredPeriod,
getBenefitType,
getPayPeriod,
getPayType,
getMoneyName,
getPayMode,
getPolicyName
} from "@/utils/biz.js";
export default {
name: "ECorrespondenceEnquiry",
data() {
return {
showForm: false,
dataForm: null,
insuranceForm: {
f1: true,
f2: true,
f3: true,
f4: true,
f5: true,
},
policy: null,
}
},
methods: {
handlePolicySelect(data) {
let submitData = {
policyId: data[0].id,
policyCode: data[0].code
}
this.policy = submitData;
this.dataForm = null;
httpPost({ url: api.policyDetail, sid: true, data: submitData }).then(res => {
this.dataForm = res;
name: "ECorrespondenceEnquiry",
data() {
return {
showForm: false,
dataForm: null,
insuranceForm: {
f1: true,
f2: true,
f3: true,
f4: true,
f5: true,
},
policy: null,
}
},
methods: {
handlePolicySelect() {
if (this.dataForm.clientNameCn) {
let userInfo = JSON.parse(JSON.stringify(this.userInfo));
userInfo.name = this.dataForm.clientNameCn
this.$store.commit("SET_USER_INFO", userInfo);
}
}).catch(err => {
if (err.code == 404) {
this.$refs.auth.noAuth();
}
});
},
toMoneyCode(moneyCode) {
switch (moneyCode) {
case "USD":
return "$";
default:
return "HK$";
}
},
toMoneyCodeName(moneyCode) {
switch (moneyCode) {
case "USD":
return "美元";
default:
return "港币";
}
},
toModifyPage(type, toContact) {
// 1=受保人;2=投保人
if (!this.policy || !this.dataForm) {
return;
}
let data = encodeURIComponent(JSON.stringify({ id: this.policy.policyId, code: this.policy.policyCode }));
sessionStorage.setItem("_hklife_policy", data);
if (type == 1) {
this.$router.push({ path: "/custom/service", query: { q: "m43", u: 2 } });
} else {
if (1 == toContact) {
this.$router.push({ path: "/custom/service", query: { q: "m42" } });
} else {
this.$router.push({ path: "/custom/service", query: { q: "m43", u: 1 } });
}
}
},
formatMoney(s, t) {
if (typeof t == "undefined") {
t = 1;
}
return formatMoney(s, t);
},
// 保障年限,保n年
formatInsuredPeriod(t, v) {
return getInsuredPeriod(this.$i18n.locale, t, v);
},
formatBenefitType(t) {
return getBenefitType(this.$i18n.locale, t);
},
// 缴费方式,交n年
formatPayPeriod(t, v) {
return getPayPeriod(this.$i18n.locale, t, v);
},
// 支付方式,支票xxx
formatPayMode(v) {
return getPayMode(this.$i18n.locale, v);
},
// 缴费频率
formatPayType(v) {
return getPayType(this.$i18n.locale, v);
},
// 钱的名字
formatMoneyName(c) {
return getMoneyName(this.$i18n.locale, c);
},
formatPanduPayPeriod(y, p) {
switch (this.$i18n.locale) {
case "zh":
case "tc":
return "第" + y + "年第" + p + "期";
default:
return this.formatNumber(p) + " payment in " + this.formatNumber(y) + " year";
}
},
formatPolicyName(c, n) {
return getPolicyName(this.$i18n.locale, c, c);
},
formatNumber(p) {
let pmod = p % 4;
let pstr = p + "";
switch (pmod) {
case 0:
pstr += "th";
break;
case 1:
pstr += "st";
break;
case 2:
pstr += "nd";
break;
case 3:
pstr += "rd";
break;
default:
pstr += "th";
break;
}
return pstr;
},
userLogout() {
this.showForm = false;
},
userLogin(data) {
this.showForm = true;
}
},
computed: {
...mapState({
userInfo: state => state.userInfo
}),
i18n() {
return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {};
},
},
components: {
Auth,
ECorrespondenceHeadList,
},
},
userLogout() {
this.showForm = false;
},
userLogin(data) {
this.showForm = true;
}
},
computed: {
...mapState({
userInfo: state => state.userInfo
}),
i18n() {
return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {};
},
},
components: {
Auth,
ECorrespondenceHeadList,
},
}
......
......@@ -64,220 +64,27 @@ export default {
let child = event.currentTarget.childNodes[0];
child.style.display = "none";
},
toContactUs() {
this.$router.push({
path: "/custom/service",
query: {
q: "m1"
}
});
},
queryList() {
if (this.policyList && this.policyList.length > 0) {
this.myPolicyList = this.policyList;
this.myPolicyList = this.myPolicyList.slice(0, 5);
this.myPolicyList.forEach(element => {
element.activity = false;
})
this.initSelected();
} else {
this.checkCustomer().then(() => {
httpPost({
url: api.policyList,
sid: true
}).then(res => {
if (!res || res.length == 0) {
this.myPolicyList = null;
} else {
res.forEach(element => {
element.activity = false;
// let len = element.policyCode.length;
// element.policyCodeStr = element.policyCode && len > 5 ?
// element.policyCode.substring(0, 2) + "**********"
// + element.policyCode.substring(len - 4, len) : element.policyCode;
});
this.$store.commit("CACHE_POLICY_LIST", res);
this.myPolicyList = res;
}
this.initSelected();
}).catch(e => {
this.myPolicyList = null;
switch (e.code) {
case "2002":
// 不是客户,没有购买保单
break;
}
});
});
}
},
initSelected() {
let selectPolicy = null;
try {
let data = sessionStorage.getItem("_hklife_policy");
if (data) {
sessionStorage.removeItem("_hklife_policy");
selectPolicy = JSON.parse(decodeURIComponent(data));
if (selectPolicy) {
if (this.multiSelectable) {
this.selectPolicyCodes[selectPolicy.code] = selectPolicy;
} else {
this.selectPolicyCode = selectPolicy.code;
}
this.$emit("onSelect", [selectPolicy]);
// 判断最大显示
let index = -1;
for (let i = 0; i < this.myPolicyList.length; i++) {
if (selectPolicy.code == this.myPolicyList[i].policyCode) {
this.myPolicyList[i].activity = true;
index = i;
}
}
this.$set(this, "myPolicyList", this.myPolicyList);
if (index > 2) {
this.maxShow = this.myPolicyList.length;
}
}
}
} catch (e) {
}
if (!selectPolicy) {
let firstPolicy = this.myPolicyList[0];
this.myPolicyList[0].activity = true;
selectPolicy = {
id: firstPolicy.policyId,
code: firstPolicy.policyCode
};
if (this.multiSelectable) {
this.selectPolicyCodes[selectPolicy.code] = selectPolicy;
} else {
this.selectPolicyCode = selectPolicy.code;
}
this.$emit("onSelect", [selectPolicy]);
}
},
handlePolicySelect(item, index) {
let code = item.policyCode;
if (this.multiSelectable) {
let c = this.selectPolicyCodes[code];
if (!c || typeof c == "undefined") {
item.activity = true;
this.selectPolicyCodes[code] = {
code: code,
id: item.policyId
};
} else {
item.activity = false;
delete this.selectPolicyCodes[code];
}
// this.$set(this, 'myPolicyList', this.myPolicyList);
let data = [];
for (let key in this.selectPolicyCodes) {
data.push(this.selectPolicyCodes[key]);
}
this.$emit("onSelect", data);
} else {
if (code != this.selectPolicyCode) {
this.selectPolicyCode = code;
this.$emit("onSelect", [{
code: code,
id: item.policyId
}]);
}
}
},
isPolicySelect(item, index) {
let code = item.policyCode;
if (this.multiSelectable) {
let c = this.selectPolicyCodes[code];
if (!c || typeof c == "undefined") {
return false;
} else {
return true;
}
}
return false;
},
checkCustomer() {
return new Promise(resolve => {
resolve();
// httpPost({ url: api.profile, sid: true }).then(res => {
// if (res.isCustomer == 1) {
// resolve();
// } else {
// this.gotoCustomerAuthPage();
// }
// }).catch(res => {
// });
});
},
gotoCustomerAuthPage() {
let c = this.$route.fullPath;
this.$router.push({
name: "customerAuth",
query: {
c: c
}
});
},
formatMoney(s, t) {
if (typeof t == "undefined") {
t = 1;
}
return formatMoney(s, t);
},
// 保障年限,保n年
formatInsuredPeriod(t, v) {
return getInsuredPeriod(this.$i18n.locale, t, v);
},
formatInsuredState(c) {
return getInsuredState(this.$i18n.locale, c);
},
formatPolicyName(c, n) {
return getPolicyName(this.$i18n.locale, c, n);
},
downloadPolicy(policy) {
if (policy) {
httpPost({
url: api.getDownloadPath,
sid: true,
data: {
policyCode: policy.policyCode
}
}).then(res => {
if (res) {
let url = requestDomain() + api.downloadPolicy + "/" + res;
window.open(url);
} else {
this.showDownloadError = true;
}
});
}
},
// 过滤筛选
onFilterHandler(idx) {
this.checkList = []
this.checkList = [
"复选框 A",
"复选框 B",
"复选框 C",
"复选框 D",
"复选框 E",
"复选框 F",
"复选框 G",
"复选框 H",
"复选框 I",
"复选框 J",
"复选框 K",
"复选框 L",
]
switch (idx) {
// 保单号码
case 1:
this.checkList = [
"复选框 A",
"复选框 B",
"复选框 C",
"复选框 D",
"复选框 E",
"复选框 F",
"复选框 G",
"复选框 H",
"复选框 I",
"复选框 J",
"复选框 K",
"复选框 L",
]
break;
// 通知书类型
case 2:
......@@ -304,14 +111,12 @@ export default {
* 多选确认
*/
onCheckConfirmHandler(evt) {
console.log("checkList evt:", evt);
console.log("checkList evt :", evt);
}
},
components: {
Modal2Comp,
FilterComp
},
mounted() {
this.queryList();
},
mounted() {},
}
......
......@@ -28,6 +28,9 @@
@include border-tans();
min-width: 80px;
}
img{
margin-right: 4px;
}
}
.guide {
......
<template>
<div class="list-container">
<modal2-comp :visible="showDownloadError" :close="()=>{showDownloadError = false}" :content="$t('glbalTips.sysError')"></modal2-comp>
<filter-comp :items="checkList" :confirm="onCheckConfirmHandler" :visible="filterVisible" :close="()=>{filterVisible = false}" ></filter-comp>
<filter-comp :items="checkList" @confirm="onCheckConfirmHandler" :visible="filterVisible" @close="filterVisible = false"></filter-comp>
<div class="cell-group">
<div class="table-contaner">
<div class="table-header orange new">
......@@ -26,35 +26,22 @@
</div>
<div class="table-content" :class="{hide : hide}">
<template v-if="myPolicyList">
<div v-for="(item,index) in myPolicyList" :key="index">
<div v-for="(item,index) in 5" :key="index">
<template v-if="index < maxShow">
<div class="data-line" @click="handlePolicySelect(item,index)">
<div class="td w1 pointer">
<template v-if="multiSelectable">
<img v-if="item.activity" class="icon-check pointer" src="@/assets/images/insurance-query/check.png">
<img v-else class="icon-check pointer" src="@/assets/images/insurance-query/un-check.png">
<span class="sp" :class="{ac: item.activity}">{{item.policyCode}}</span>
</template>
<template v-else>
<template v-if="model != 'download'">
<img v-if="selectPolicyCode == item.policyCode" class="icon-check pointer" src="@/assets/images/insurance-query/check.png">
<img v-else class="icon-check pointer" src="@/assets/images/insurance-query/un-check.png">
</template>
<span class="sp" :class="{ac: selectPolicyCode == item.policyCode}">{{item.policyCode}}</span>
<template v-if="model == 'download'">
<div class="download" @mouseover="onShowTipsOverHandler($event,item,index)" @mouseout="onShowTipsOutHandler($event,item,index)" @click="downloadPolicy(item)">
<div class="download-tips">
<div class="cont">{{$t('customService.insuranceQuery.downloadClick')}}</div>
</div>
<img class="icon-download" src="@/assets/images/insurance-query/icon-down-load.png" alt="">
</div>
</template>
</template>
<div class="td w1">P388888880772</div>
<div class="td w1">保單繕發及冷靜期通知書</div>
<div class="td w2">2020-3-1</div>
<div class="td w2 pointer">
<div class="download" @mouseover="onShowTipsOverHandler($event,item,index)" @mouseout="onShowTipsOutHandler($event,item,index)" @click="downloadPolicy(item)">
<div class="download-tips">
<div class="cont">{{$t('customService.insuranceQuery.downloadClick')}}</div>
</div>
<img class="icon-download" src="@/assets/images/insurance-query/icon-down-load.png" alt="">
</div>
下載文檔
</div>
<div class="td w1">{{formatInsuredState(item.policyState)}}</div>
<div class="td w2">{{item.activeDate?item.activeDate.split(" ")[0]:""}}</div>
<div class="td w2">{{formatPolicyName(item.productCode, item.productName)}}</div>
<div class="td w2">{{formatInsuredPeriod(item.insuredPeriodType,item.insuredPeriodValue)}}</div>
<div class="td w2">已閱讀</div>
</div>
<div class="separator-h" v-if="index < myPolicyList.length - 1 && index < maxShow - 1"></div>
</template>
......
......@@ -38,7 +38,6 @@ export default {
size: 999999
}
}).then((result) => {
console.log("result:", result);
let lang = this.$i18n.locale;
let dataList = [];
result.forEach(element => {
......