16ebd6b4 by simon

默认提交

1 parent 129c9089
...@@ -12,11 +12,6 @@ export default { ...@@ -12,11 +12,6 @@ export default {
12 type: Boolean, 12 type: Boolean,
13 default: true, 13 default: true,
14 }, 14 },
15 // 取消按钮回调方法
16 close: {
17 type: Function,
18 default: null
19 },
20 // 确认文案 15 // 确认文案
21 confirmText: { 16 confirmText: {
22 type: String, 17 type: String,
...@@ -27,21 +22,6 @@ export default { ...@@ -27,21 +22,6 @@ export default {
27 type: String, 22 type: String,
28 default: "取消", 23 default: "取消",
29 }, 24 },
30 // 确定按钮回调方法
31 confirm: {
32 type: Function,
33 default: null
34 },
35 // 取消按钮回调方法
36 cancel: {
37 type: Function,
38 default: null
39 },
40 // 点击蒙层回调方法
41 overlay: {
42 type: Function,
43 default: null
44 },
45 25
46 // 传入数据 26 // 传入数据
47 items: { 27 items: {
...@@ -66,27 +46,20 @@ export default { ...@@ -66,27 +46,20 @@ export default {
66 methods: { 46 methods: {
67 // 点击关闭 47 // 点击关闭
68 onCloseHandler() { 48 onCloseHandler() {
69 if (this.close) { 49 this.$emit("close");
70 this.close();
71 }
72 }, 50 },
73 // 点击取消 51 // 点击取消
74 onCancelHandler() { 52 onCancelHandler() {
75 if (this.close) { 53 this.$emit("close");
76 this.close();
77 }
78 }, 54 },
79 // 点击蒙层 55 // 点击蒙层
80 onOverLayHandler() { 56 onOverLayHandler() {
81 if (this.overlay) { 57 // this.$emit("close");
82 this.overlay();
83 }
84 }, 58 },
85 // 点击确认 59 // 点击确认
86 onConfirmHandler() { 60 onConfirmHandler() {
87 if (this.confirm) { 61 this.$emit("close");
88 this.confirm(this.checkList); 62 this.$emit("confirm", this.checkList);
89 }
90 }, 63 },
91 initData() {} 64 initData() {}
92 }, 65 },
......
1 import { mapState } from "vuex"; 1 import {
2 mapState
3 } from "vuex";
2 import api from '@/api/api' 4 import api from '@/api/api'
3 import { 5 import {
4 httpGet, 6 httpGet,
...@@ -8,7 +10,16 @@ import { ...@@ -8,7 +10,16 @@ import {
8 import Auth from '@components/auth/auth.vue'; 10 import Auth from '@components/auth/auth.vue';
9 import ECorrespondenceHeadList from "./e-correspondence-head-list.vue"; 11 import ECorrespondenceHeadList from "./e-correspondence-head-list.vue";
10 12
11 import { formatMoney, getInsuredPeriod, getBenefitType, getPayPeriod, getPayType, getMoneyName, getPayMode, getPolicyName } from "@/utils/biz.js"; 13 import {
14 formatMoney,
15 getInsuredPeriod,
16 getBenefitType,
17 getPayPeriod,
18 getPayType,
19 getMoneyName,
20 getPayMode,
21 getPolicyName
22 } from "@/utils/biz.js";
12 23
13 export default { 24 export default {
14 name: "ECorrespondenceEnquiry", 25 name: "ECorrespondenceEnquiry",
...@@ -27,123 +38,8 @@ export default { ...@@ -27,123 +38,8 @@ export default {
27 } 38 }
28 }, 39 },
29 methods: { 40 methods: {
30 handlePolicySelect(data) { 41 handlePolicySelect() {
31 let submitData = {
32 policyId: data[0].id,
33 policyCode: data[0].code
34 }
35 this.policy = submitData;
36 this.dataForm = null;
37 httpPost({ url: api.policyDetail, sid: true, data: submitData }).then(res => {
38 this.dataForm = res;
39
40 42
41 if (this.dataForm.clientNameCn) {
42 let userInfo = JSON.parse(JSON.stringify(this.userInfo));
43 userInfo.name = this.dataForm.clientNameCn
44 this.$store.commit("SET_USER_INFO", userInfo);
45 }
46 }).catch(err => {
47 if (err.code == 404) {
48 this.$refs.auth.noAuth();
49 }
50 });
51 },
52 toMoneyCode(moneyCode) {
53 switch (moneyCode) {
54 case "USD":
55 return "$";
56 default:
57 return "HK$";
58 }
59 },
60 toMoneyCodeName(moneyCode) {
61 switch (moneyCode) {
62 case "USD":
63 return "美元";
64 default:
65 return "港币";
66 }
67 },
68 toModifyPage(type, toContact) {
69 // 1=受保人;2=投保人
70 if (!this.policy || !this.dataForm) {
71 return;
72 }
73 let data = encodeURIComponent(JSON.stringify({ id: this.policy.policyId, code: this.policy.policyCode }));
74 sessionStorage.setItem("_hklife_policy", data);
75 if (type == 1) {
76 this.$router.push({ path: "/custom/service", query: { q: "m43", u: 2 } });
77 } else {
78 if (1 == toContact) {
79 this.$router.push({ path: "/custom/service", query: { q: "m42" } });
80 } else {
81 this.$router.push({ path: "/custom/service", query: { q: "m43", u: 1 } });
82 }
83 }
84 },
85 formatMoney(s, t) {
86 if (typeof t == "undefined") {
87 t = 1;
88 }
89 return formatMoney(s, t);
90 },
91 // 保障年限,保n年
92 formatInsuredPeriod(t, v) {
93 return getInsuredPeriod(this.$i18n.locale, t, v);
94 },
95 formatBenefitType(t) {
96 return getBenefitType(this.$i18n.locale, t);
97 },
98 // 缴费方式,交n年
99 formatPayPeriod(t, v) {
100 return getPayPeriod(this.$i18n.locale, t, v);
101 },
102 // 支付方式,支票xxx
103 formatPayMode(v) {
104 return getPayMode(this.$i18n.locale, v);
105 },
106 // 缴费频率
107 formatPayType(v) {
108 return getPayType(this.$i18n.locale, v);
109 },
110 // 钱的名字
111 formatMoneyName(c) {
112 return getMoneyName(this.$i18n.locale, c);
113 },
114 formatPanduPayPeriod(y, p) {
115 switch (this.$i18n.locale) {
116 case "zh":
117 case "tc":
118 return "第" + y + "年第" + p + "期";
119 default:
120 return this.formatNumber(p) + " payment in " + this.formatNumber(y) + " year";
121 }
122 },
123 formatPolicyName(c, n) {
124 return getPolicyName(this.$i18n.locale, c, c);
125 },
126 formatNumber(p) {
127 let pmod = p % 4;
128 let pstr = p + "";
129 switch (pmod) {
130 case 0:
131 pstr += "th";
132 break;
133 case 1:
134 pstr += "st";
135 break;
136 case 2:
137 pstr += "nd";
138 break;
139 case 3:
140 pstr += "rd";
141 break;
142 default:
143 pstr += "th";
144 break;
145 }
146 return pstr;
147 }, 43 },
148 userLogout() { 44 userLogout() {
149 this.showForm = false; 45 this.showForm = false;
......
...@@ -64,206 +64,9 @@ export default { ...@@ -64,206 +64,9 @@ export default {
64 let child = event.currentTarget.childNodes[0]; 64 let child = event.currentTarget.childNodes[0];
65 child.style.display = "none"; 65 child.style.display = "none";
66 }, 66 },
67 toContactUs() {
68 this.$router.push({
69 path: "/custom/service",
70 query: {
71 q: "m1"
72 }
73 });
74 },
75 queryList() {
76 if (this.policyList && this.policyList.length > 0) {
77 this.myPolicyList = this.policyList;
78 this.myPolicyList = this.myPolicyList.slice(0, 5);
79 this.myPolicyList.forEach(element => {
80 element.activity = false;
81 })
82 this.initSelected();
83 } else {
84 this.checkCustomer().then(() => {
85 httpPost({
86 url: api.policyList,
87 sid: true
88 }).then(res => {
89 if (!res || res.length == 0) {
90 this.myPolicyList = null;
91 } else {
92 res.forEach(element => {
93 element.activity = false;
94 // let len = element.policyCode.length;
95 // element.policyCodeStr = element.policyCode && len > 5 ?
96 // element.policyCode.substring(0, 2) + "**********"
97 // + element.policyCode.substring(len - 4, len) : element.policyCode;
98 });
99 this.$store.commit("CACHE_POLICY_LIST", res);
100 this.myPolicyList = res;
101 }
102 this.initSelected();
103 }).catch(e => {
104 this.myPolicyList = null;
105 switch (e.code) {
106 case "2002":
107 // 不是客户,没有购买保单
108 break;
109 }
110 });
111 });
112
113 }
114 },
115 initSelected() {
116 let selectPolicy = null;
117 try {
118 let data = sessionStorage.getItem("_hklife_policy");
119 if (data) {
120 sessionStorage.removeItem("_hklife_policy");
121 selectPolicy = JSON.parse(decodeURIComponent(data));
122 if (selectPolicy) {
123 if (this.multiSelectable) {
124 this.selectPolicyCodes[selectPolicy.code] = selectPolicy;
125 } else {
126 this.selectPolicyCode = selectPolicy.code;
127 }
128 this.$emit("onSelect", [selectPolicy]);
129
130 // 判断最大显示
131 let index = -1;
132 for (let i = 0; i < this.myPolicyList.length; i++) {
133 if (selectPolicy.code == this.myPolicyList[i].policyCode) {
134 this.myPolicyList[i].activity = true;
135 index = i;
136 }
137 }
138 this.$set(this, "myPolicyList", this.myPolicyList);
139 if (index > 2) {
140 this.maxShow = this.myPolicyList.length;
141 }
142 }
143 }
144 } catch (e) {
145
146 }
147 if (!selectPolicy) {
148 let firstPolicy = this.myPolicyList[0];
149 this.myPolicyList[0].activity = true;
150 selectPolicy = {
151 id: firstPolicy.policyId,
152 code: firstPolicy.policyCode
153 };
154 if (this.multiSelectable) {
155 this.selectPolicyCodes[selectPolicy.code] = selectPolicy;
156 } else {
157 this.selectPolicyCode = selectPolicy.code;
158 }
159 this.$emit("onSelect", [selectPolicy]);
160 }
161 },
162 handlePolicySelect(item, index) {
163 let code = item.policyCode;
164 if (this.multiSelectable) {
165 let c = this.selectPolicyCodes[code];
166 if (!c || typeof c == "undefined") {
167 item.activity = true;
168 this.selectPolicyCodes[code] = {
169 code: code,
170 id: item.policyId
171 };
172 } else {
173 item.activity = false;
174 delete this.selectPolicyCodes[code];
175 }
176 // this.$set(this, 'myPolicyList', this.myPolicyList);
177 let data = [];
178 for (let key in this.selectPolicyCodes) {
179 data.push(this.selectPolicyCodes[key]);
180 }
181 this.$emit("onSelect", data);
182 } else {
183 if (code != this.selectPolicyCode) {
184 this.selectPolicyCode = code;
185 this.$emit("onSelect", [{
186 code: code,
187 id: item.policyId
188 }]);
189 }
190 }
191 },
192 isPolicySelect(item, index) {
193 let code = item.policyCode;
194 if (this.multiSelectable) {
195 let c = this.selectPolicyCodes[code];
196 if (!c || typeof c == "undefined") {
197 return false;
198 } else {
199 return true;
200 }
201 }
202 return false;
203 },
204 checkCustomer() {
205 return new Promise(resolve => {
206 resolve();
207 // httpPost({ url: api.profile, sid: true }).then(res => {
208 // if (res.isCustomer == 1) {
209 // resolve();
210 // } else {
211 // this.gotoCustomerAuthPage();
212 // }
213 // }).catch(res => {
214
215 // });
216 });
217 },
218 gotoCustomerAuthPage() {
219 let c = this.$route.fullPath;
220 this.$router.push({
221 name: "customerAuth",
222 query: {
223 c: c
224 }
225 });
226 },
227 formatMoney(s, t) {
228 if (typeof t == "undefined") {
229 t = 1;
230 }
231 return formatMoney(s, t);
232 },
233 // 保障年限,保n年
234 formatInsuredPeriod(t, v) {
235 return getInsuredPeriod(this.$i18n.locale, t, v);
236 },
237 formatInsuredState(c) {
238 return getInsuredState(this.$i18n.locale, c);
239 },
240 formatPolicyName(c, n) {
241 return getPolicyName(this.$i18n.locale, c, n);
242 },
243 downloadPolicy(policy) {
244 if (policy) {
245 httpPost({
246 url: api.getDownloadPath,
247 sid: true,
248 data: {
249 policyCode: policy.policyCode
250 }
251 }).then(res => {
252 if (res) {
253 let url = requestDomain() + api.downloadPolicy + "/" + res;
254 window.open(url);
255 } else {
256 this.showDownloadError = true;
257 }
258 });
259 }
260 },
261 // 过滤筛选 67 // 过滤筛选
262 onFilterHandler(idx) { 68 onFilterHandler(idx) {
263 this.checkList = [] 69 this.checkList = []
264 switch (idx) {
265 // 保单号码
266 case 1:
267 this.checkList = [ 70 this.checkList = [
268 "复选框 A", 71 "复选框 A",
269 "复选框 B", 72 "复选框 B",
...@@ -278,6 +81,10 @@ export default { ...@@ -278,6 +81,10 @@ export default {
278 "复选框 K", 81 "复选框 K",
279 "复选框 L", 82 "复选框 L",
280 ] 83 ]
84 switch (idx) {
85 // 保单号码
86 case 1:
87
281 break; 88 break;
282 // 通知书类型 89 // 通知书类型
283 case 2: 90 case 2:
...@@ -304,14 +111,12 @@ export default { ...@@ -304,14 +111,12 @@ export default {
304 * 多选确认 111 * 多选确认
305 */ 112 */
306 onCheckConfirmHandler(evt) { 113 onCheckConfirmHandler(evt) {
307 console.log("checkList evt:", evt); 114 console.log("checkList evt :", evt);
308 } 115 }
309 }, 116 },
310 components: { 117 components: {
311 Modal2Comp, 118 Modal2Comp,
312 FilterComp 119 FilterComp
313 }, 120 },
314 mounted() { 121 mounted() {},
315 this.queryList();
316 },
317 } 122 }
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
28 @include border-tans(); 28 @include border-tans();
29 min-width: 80px; 29 min-width: 80px;
30 } 30 }
31 img{
32 margin-right: 4px;
33 }
31 } 34 }
32 35
33 .guide { 36 .guide {
......
1 <template> 1 <template>
2 <div class="list-container"> 2 <div class="list-container">
3 <modal2-comp :visible="showDownloadError" :close="()=>{showDownloadError = false}" :content="$t('glbalTips.sysError')"></modal2-comp> 3 <modal2-comp :visible="showDownloadError" :close="()=>{showDownloadError = false}" :content="$t('glbalTips.sysError')"></modal2-comp>
4 <filter-comp :items="checkList" :confirm="onCheckConfirmHandler" :visible="filterVisible" :close="()=>{filterVisible = false}" ></filter-comp> 4 <filter-comp :items="checkList" @confirm="onCheckConfirmHandler" :visible="filterVisible" @close="filterVisible = false"></filter-comp>
5 <div class="cell-group"> 5 <div class="cell-group">
6 <div class="table-contaner"> 6 <div class="table-contaner">
7 <div class="table-header orange new"> 7 <div class="table-header orange new">
...@@ -26,35 +26,22 @@ ...@@ -26,35 +26,22 @@
26 </div> 26 </div>
27 <div class="table-content" :class="{hide : hide}"> 27 <div class="table-content" :class="{hide : hide}">
28 <template v-if="myPolicyList"> 28 <template v-if="myPolicyList">
29 <div v-for="(item,index) in myPolicyList" :key="index"> 29 <div v-for="(item,index) in 5" :key="index">
30 <template v-if="index < maxShow"> 30 <template v-if="index < maxShow">
31 <div class="data-line" @click="handlePolicySelect(item,index)"> 31 <div class="data-line" @click="handlePolicySelect(item,index)">
32 <div class="td w1 pointer"> 32 <div class="td w1">P388888880772</div>
33 <template v-if="multiSelectable"> 33 <div class="td w1">保單繕發及冷靜期通知書</div>
34 <img v-if="item.activity" class="icon-check pointer" src="@/assets/images/insurance-query/check.png"> 34 <div class="td w2">2020-3-1</div>
35 <img v-else class="icon-check pointer" src="@/assets/images/insurance-query/un-check.png"> 35 <div class="td w2 pointer">
36 <span class="sp" :class="{ac: item.activity}">{{item.policyCode}}</span>
37 </template>
38 <template v-else>
39 <template v-if="model != 'download'">
40 <img v-if="selectPolicyCode == item.policyCode" class="icon-check pointer" src="@/assets/images/insurance-query/check.png">
41 <img v-else class="icon-check pointer" src="@/assets/images/insurance-query/un-check.png">
42 </template>
43 <span class="sp" :class="{ac: selectPolicyCode == item.policyCode}">{{item.policyCode}}</span>
44 <template v-if="model == 'download'">
45 <div class="download" @mouseover="onShowTipsOverHandler($event,item,index)" @mouseout="onShowTipsOutHandler($event,item,index)" @click="downloadPolicy(item)"> 36 <div class="download" @mouseover="onShowTipsOverHandler($event,item,index)" @mouseout="onShowTipsOutHandler($event,item,index)" @click="downloadPolicy(item)">
46 <div class="download-tips"> 37 <div class="download-tips">
47 <div class="cont">{{$t('customService.insuranceQuery.downloadClick')}}</div> 38 <div class="cont">{{$t('customService.insuranceQuery.downloadClick')}}</div>
48 </div> 39 </div>
49 <img class="icon-download" src="@/assets/images/insurance-query/icon-down-load.png" alt=""> 40 <img class="icon-download" src="@/assets/images/insurance-query/icon-down-load.png" alt="">
50 </div> 41 </div>
51 </template> 42 下載文檔
52 </template>
53 </div> 43 </div>
54 <div class="td w1">{{formatInsuredState(item.policyState)}}</div> 44 <div class="td w2">已閱讀</div>
55 <div class="td w2">{{item.activeDate?item.activeDate.split(" ")[0]:""}}</div>
56 <div class="td w2">{{formatPolicyName(item.productCode, item.productName)}}</div>
57 <div class="td w2">{{formatInsuredPeriod(item.insuredPeriodType,item.insuredPeriodValue)}}</div>
58 </div> 45 </div>
59 <div class="separator-h" v-if="index < myPolicyList.length - 1 && index < maxShow - 1"></div> 46 <div class="separator-h" v-if="index < myPolicyList.length - 1 && index < maxShow - 1"></div>
60 </template> 47 </template>
......
...@@ -38,7 +38,6 @@ export default { ...@@ -38,7 +38,6 @@ export default {
38 size: 999999 38 size: 999999
39 } 39 }
40 }).then((result) => { 40 }).then((result) => {
41 console.log("result:", result);
42 let lang = this.$i18n.locale; 41 let lang = this.$i18n.locale;
43 let dataList = []; 42 let dataList = [];
44 result.forEach(element => { 43 result.forEach(element => {
......