ded81416 by simon

默认提交

1 parent f7ec6769
1 import api from '@/api/api' 1 import api from '@/api/api'
2 import { 2 import {
3 httpGet, 3 httpGet,
4 httpPost, 4 httpPost,
5 formdata 5 formdata
6 } from '@/api/fetch-api.js' 6 } from '@/api/fetch-api.js'
7 7
8 import DatePicker from '@/components/date-picker/date-picker.vue'; 8 import DatePicker from '@/components/date-picker/date-picker.vue';
9 import ClarmsUpload from './clarms-plugins-upload.vue'; 9 import ClarmsUpload from './clarms-plugins-upload.vue';
10 import Vue from 'vue'; 10 import Vue from 'vue';
11 import { Loading } from 'vant'; 11 import {
12 import { Select, Option } from 'element-ui'; 12 Loading
13 } from 'vant';
14 import {
15 Select,
16 Option
17 } from 'element-ui';
13 18
14 Vue.use(Loading); 19 Vue.use(Loading);
15 Vue.use(Select); 20 Vue.use(Select);
16 Vue.use(Option); 21 Vue.use(Option);
17 22
18 export default { 23 export default {
19 props: { 24 props: {
20 // 是否显示组件 25 // 是否显示组件
21 insuredList: { 26 insuredList: {
22 type: Array, 27 type: Array,
23 default() { 28 default () {
24 return [] 29 return []
25 } 30 }
26 }, 31 },
27 cid: { 32 cid: {
28 type: String, 33 type: String,
29 default: "" 34 default: ""
30 } 35 }
31 }, 36 },
32 data() { 37 data() {
33 return { 38 return {
34 showTips: false, 39 showTips: false,
35 // 候选人所购买的保单可选择的类型 40 // 候选人所购买的保单可选择的类型
36 /** 41 /**
37 * 1 意外医疗 42 * 1 意外医疗
38 * 2 疾病医疗 43 * 2 疾病医疗
39 * 3 意外残疾 44 * 3 意外残疾
40 * 4 疾病残疾 45 * 4 疾病残疾
41 * 5 意外死亡 46 * 5 意外死亡
42 * 6 疾病死亡 47 * 6 疾病死亡
43 * 7 重大疾病 48 * 7 重大疾病
44 */ 49 */
45 typeCandidates: ['1', '2', '5', '6', '7'], 50 typeCandidates: ['1', '2', '5', '6', '7'],
46 // 已经选择的类型, 51 // 已经选择的类型,
47 typeSelected: [], 52 typeSelected: [],
48 images: [], 53 images: [],
49 agress: false, 54 agress: false,
50 data: { 55 data: {
51 insuredIndex: "", 56 insuredIndex: "",
52 amount: null, 57 amount: null,
53 contactDate: "", 58 contactDate: "",
54 // 必传资料 59 // 必传资料
55 HT41: null, 60 HT41: null,
56 HT26: null, 61 HT26: null,
57 // 非必传资料 62 // 非必传资料
58 HT29: null, 63 HT29: null,
59 HT34: null, 64 HT34: null,
60 HT16: null, 65 HT16: null,
61 66
62 // 是否正在上传 67 // 是否正在上传
63 HT41Uploading: false, 68 HT41Uploading: false,
64 HT26Uploading: false, 69 HT26Uploading: false,
65 HT29Uploading: false, 70 HT29Uploading: false,
66 HT34Uploading: false, 71 HT34Uploading: false,
67 HT16Uploading: false, 72 HT16Uploading: false,
68 73
69 }, 74 },
70 loading: false, 75 loading: false,
71 contactDateError: false, 76 contactDateError: false,
72 // 判断是否有合法的保单 77 // 判断是否有合法的保单
73 policyIllegal: true, 78 policyIllegal: true,
74 } 79 }
75 }, 80 },
76 components: { 81 components: {
77 DatePicker, 82 DatePicker,
78 ClarmsUpload 83 ClarmsUpload
79 }, 84 },
80 computed: { 85 computed: {
81 lan() { 86 lan() {
82 return this.$i18n.locale; 87 return this.$i18n.locale;
83 }, 88 },
84 i18n() { 89 i18n() {
85 return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {}; 90 return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {};
86 }, 91 },
87 submitBtnDisabled() { 92 submitBtnDisabled() {
88 // 受保人 93 // 受保人
89 let b1 = this.data.insuredIndex ? false : true; 94 let b1 = this.data.insuredIndex ? false : true;
90 // 申请类型 95 // 申请类型
91 let b2 = this.typeSelected.length > 0 ? false : true; 96 let b2 = this.typeSelected.length > 0 ? false : true;
92 // 申请额度 97 // 申请额度
93 let b3 = this.data.amount > 0 ? false : true; 98 let b3 = this.data.amount > 0 ? false : true;
94 // 日期校验 99 // 日期校验
95 let b4 = this.data.contactDate ? false : true; 100 let b4 = this.data.contactDate ? false : true;
96 let b5 = this.contactDateError; 101 let b5 = this.contactDateError;
97 102
98 // 必传资料 103 // 必传资料
99 let b6 = this.data.HT41 && this.data.HT41.length > 0 ? false : true; 104 let b6 = this.data.HT41 && this.data.HT41.length > 0 ? false : true;
100 let b7 = this.data.HT26 && this.data.HT26.length > 0 ? false : true; 105 let b7 = this.data.HT26 && this.data.HT26.length > 0 ? false : true;
101 // 资料上传中 106 // 资料上传中
102 let b8 = this.data.HT41Uploading || this.data.HT26Uploading || this.data.HT29Uploading || this.data.HT34Uploading || this.data.HT16Uploading; 107 let b8 = this.data.HT41Uploading || this.data.HT26Uploading || this.data.HT29Uploading || this.data.HT34Uploading || this.data.HT16Uploading;
103 let b9 = !this.agress; 108 let b9 = !this.agress;
104 109
105 let b10 = this.policyIllegal; 110 let b10 = this.policyIllegal;
106 111
107 return b1 || b2 || b3 || b4 || b5 || b6 || b7 || b8 || b9 || b10; 112 return b1 || b2 || b3 || b4 || b5 || b6 || b7 || b8 || b9 || b10;
108 } 113 }
109 }, 114 },
110 methods: { 115 methods: {
111 initData() { 116 initData() {
112 // console.log("this.insuredList = ", this.insuredList); 117 // console.log("this.insuredList = ", this.insuredList);
113 }, 118 },
114 typeClickHandle(t) { 119 typeClickHandle(t) {
115 let index = this.typeSelected.indexOf(t); 120 let index = this.typeSelected.indexOf(t);
116 if (index > -1) { 121 if (index > -1) {
117 this.typeSelected.splice(index, 1); 122 this.typeSelected.splice(index, 1);
118 } else { 123 } else {
119 this.typeSelected.push(t); 124 this.typeSelected.push(t);
120 } 125 }
121 }, 126 },
122 amountCheck() { 127 amountCheck() {
123 if (this.data.amount) { 128 if (this.data.amount) {
124 if (this.data.amount < 0) { 129 if (this.data.amount < 0) {
125 this.data.amount = 0; 130 this.data.amount = 0;
126 } else if (this.data.amount > 5000) { 131 } else if (this.data.amount > 5000) {
127 this.data.amount = 5000; 132 this.data.amount = 5000;
128 } 133 }
129 } 134 }
130 }, 135 },
131 uploadSuccess(data) { 136 uploadSuccess(data) {
132 // console.log(data); 137 // console.log(data);
133 switch (data.type) { 138 switch (data.type) {
134 case "HT41": 139 case "HT41":
135 this.data.HT41Uploading = false; 140 this.data.HT41Uploading = false;
136 this.data.HT41 = data.list; 141 this.data.HT41 = data.list;
137 break; 142 break;
138 case "HT26": 143 case "HT26":
139 this.data.HT26Uploading = false; 144 this.data.HT26Uploading = false;
140 this.data.HT26 = data.list; 145 this.data.HT26 = data.list;
141 break; 146 break;
142 case "HT29": 147 case "HT29":
143 this.data.HT29Uploading = false; 148 this.data.HT29Uploading = false;
144 this.data.HT29 = data.list; 149 this.data.HT29 = data.list;
145 break; 150 break;
146 case "HT34": 151 case "HT34":
147 this.data.HT34Uploading = false; 152 this.data.HT34Uploading = false;
148 this.data.HT34 = data.list; 153 this.data.HT34 = data.list;
149 break; 154 break;
150 case "HT16": 155 case "HT16":
151 this.data.HT16Uploading = false; 156 this.data.HT16Uploading = false;
152 this.data.HT16 = data.list; 157 this.data.HT16 = data.list;
153 break; 158 break;
154 } 159 }
155 }, 160 },
156 beforeUpload(data) { 161 beforeUpload(data) {
157 // console.log(data); 162 // console.log(data);
158 switch (data.type) { 163 switch (data.type) {
159 case "HT41": 164 case "HT41":
160 this.data.HT41Uploading = true; 165 this.data.HT41Uploading = true;
161 this.data.HT41 = []; 166 this.data.HT41 = [];
162 break; 167 break;
163 case "HT26": 168 case "HT26":
164 this.data.HT26Uploading = true; 169 this.data.HT26Uploading = true;
165 this.data.HT26 = []; 170 this.data.HT26 = [];
166 break; 171 break;
167 case "HT29": 172 case "HT29":
168 this.data.HT29Uploading = true; 173 this.data.HT29Uploading = true;
169 this.data.HT29 = []; 174 this.data.HT29 = [];
170 break; 175 break;
171 case "HT34": 176 case "HT34":
172 this.data.HT34Uploading = true; 177 this.data.HT34Uploading = true;
173 this.data.HT34 = []; 178 this.data.HT34 = [];
174 break; 179 break;
175 case "HT16": 180 case "HT16":
176 this.data.HT16Uploading = true; 181 this.data.HT16Uploading = true;
177 this.data.HT16 = []; 182 this.data.HT16 = [];
178 break; 183 break;
179 } 184 }
180 }, 185 },
181 checkDate(data) { 186 checkDate(data) {
182 this.contactDateError = data.disable; 187 this.contactDateError = data.disable;
183 }, 188 },
184 toContact() { 189 toContact() {
185 this.$router.push({ 190 this.$router.push({
186 path: "/custom/service?q=m1" 191 path: "/custom/service?q=m1"
187 }); 192 });
188 }, 193 },
189 submitMaterial() { 194 submitMaterial() {
190 195
191 if (this.submitBtnDisabled) { 196 if (this.submitBtnDisabled) {
192 return; 197 return;
193 } 198 }
194 if (this.loading) { 199 if (this.loading) {
195 return; 200 return;
196 } 201 }
197 let policy = this.checkPolicy(); 202 let policy = this.checkPolicy();
198 if (!policy) { 203 if (!policy) {
199 return; 204 return;
200 } 205 }
201 let insured = this.insuredList[this.data.insuredIndex - 1]; 206 let insured = this.insuredList[this.data.insuredIndex - 1];
202 this.loading = true; 207 this.loading = true;
203 208
204 let imageList = []; 209 let imageList = [];
205 imageList = this.data.HT41 && this.data.HT41.length > 0 ? imageList.concat(this.data.HT41) : imageList; 210 imageList = this.data.HT41 && this.data.HT41.length > 0 ? imageList.concat(this.data.HT41) : imageList;
206 imageList = this.data.HT26 && this.data.HT26.length > 0 ? imageList.concat(this.data.HT26) : imageList; 211 imageList = this.data.HT26 && this.data.HT26.length > 0 ? imageList.concat(this.data.HT26) : imageList;
207 imageList = this.data.HT29 && this.data.HT29.length > 0 ? imageList.concat(this.data.HT29) : imageList; 212 imageList = this.data.HT29 && this.data.HT29.length > 0 ? imageList.concat(this.data.HT29) : imageList;
208 imageList = this.data.HT34 && this.data.HT34.length > 0 ? imageList.concat(this.data.HT34) : imageList; 213 imageList = this.data.HT34 && this.data.HT34.length > 0 ? imageList.concat(this.data.HT34) : imageList;
209 imageList = this.data.HT16 && this.data.HT16.length > 0 ? imageList.concat(this.data.HT16) : imageList; 214 imageList = this.data.HT16 && this.data.HT16.length > 0 ? imageList.concat(this.data.HT16) : imageList;
210 215
211 let params = { 216 let params = {
212 cid: this.cid, 217 cid: this.cid,
213 insuredId: insured.insuredId, 218 insuredId: insured.insuredId,
214 policyId: policy.policyId, 219 policyId: policy.policyId,
215 accidentTime: this.data.contactDate, 220 accidentTime: this.data.contactDate,
216 applyReasonList: this.typeSelected.join(","), 221 applyReasonList: this.typeSelected.join(","),
217 treatmentAmount: this.data.amount, 222 treatmentAmount: this.data.amount,
218 imageList: imageList 223 imageList: imageList
219 } 224 }
220 httpPost({ url: api.clarmsRegisterCase, data: params }).then(res => { 225 httpPost({
221 this.$emit("showModal", 2); 226 url: api.clarmsRegisterCase,
222 this.loading = false; 227 data: params
223 this.agress = false; 228 }).then(res => {
224 }).catch(e => { 229 this.$emit("showModal", 2);
225 this.loading = false; 230 this.loading = false;
226 this.showTips = true; 231 this.agress = false;
227 this.agress = false; 232 }).catch(e => {
228 }) 233 this.loading = false;
229 }, 234 this.showTips = true;
230 checkPolicy() { 235 this.agress = false;
231 // 校验选择的受保人在选择的时间点内是否有保单 236 })
232 if (this.contactDateError) { 237 },
233 return false; 238 checkPolicy() {
234 } 239 // 校验选择的受保人在选择的时间点内是否有保单
235 if (!this.data.contactDate || !this.data.insuredIndex) { 240 if (this.contactDateError) {
236 return false; 241 return false;
237 } 242 }
238 let insured = this.insuredList[this.data.insuredIndex - 1]; 243 if (!this.data.contactDate || !this.data.insuredIndex) {
239 if (!insured.policyInfoList || insured.policyInfoList.length <= 0) { 244 return false;
240 this.$emit("showModal", 1); 245 }
241 return false; 246 let insured = this.insuredList[this.data.insuredIndex - 1];
242 } 247 if (!insured.policyInfoList || insured.policyInfoList.length <= 0) {
243 // console.log("insured === ", insured); 248 this.$emit("showModal", 1);
244 var time = new Date(this.data.contactDate.replace(/\-/g, "/") + " 00:00:00").getTime(); 249 return false;
245 for (let index = 0; index < insured.policyInfoList.length; index++) { 250 }
246 let policy = insured.policyInfoList[index]; 251 // console.log("insured === ", insured);
247 // 有效期为生效日至满期日+60天 252 var time = new Date(this.data.contactDate.replace(/\-/g, "/") + " 00:00:00").getTime();
248 if (policy.activeDate <= time && policy.expireDate + 60 * 24 * 60 * 60 * 1000 >= time) { 253 for (let index = 0; index < insured.policyInfoList.length; index++) {
249 return policy; 254 let policy = insured.policyInfoList[index];
250 } 255 // 有效期为生效日至满期日+60天
251 } 256 if (policy.activeDate <= time && policy.expireDate + 60 * 24 * 60 * 60 * 1000 >= time) {
252 this.$emit("showModal", 1); 257 return policy;
253 return false; 258 }
254 } 259 }
255 }, 260 this.$emit("showModal", 1);
256 watch: { 261 return false;
257 "data.insuredIndex": function (v, ov) { 262 }
258 this.typeSelected = []; 263 },
264 watch: {
265 "data.insuredIndex": function (v, ov) {
266 this.typeSelected = [];
259 267
260 let d = { 268 let d = {
261 insuredIndex: this.data.insuredIndex, 269 insuredIndex: this.data.insuredIndex,
262 amount: null, 270 amount: null,
263 contactDate: "", 271 contactDate: "",
264 // 必传资料 272 // 必传资料
265 HT41: null, 273 HT41: null,
266 HT26: null, 274 HT26: null,
267 // 非必传资料 275 // 非必传资料
268 HT29: null, 276 HT29: null,
269 HT34: null, 277 HT34: null,
270 HT16: null, 278 HT16: null,
271 279
272 // 是否正在上传 280 // 是否正在上传
273 HT41Uploading: false, 281 HT41Uploading: false,
274 HT26Uploading: false, 282 HT26Uploading: false,
275 HT29Uploading: false, 283 HT29Uploading: false,
276 HT34Uploading: false, 284 HT34Uploading: false,
277 HT16Uploading: false, 285 HT16Uploading: false,
278 }; 286 };
279 this.$set(this, "data", d); 287 this.$set(this, "data", d);
280 if (this.checkPolicy()) { 288 if (this.checkPolicy()) {
281 this.policyIllegal = false; 289 this.policyIllegal = false;
282 } else { 290 } else {
283 this.policyIllegal = true; 291 this.policyIllegal = true;
284 } 292 }
285 }, 293 },
286 "data.contactDate": function () { 294 "data.contactDate": function () {
287 if (this.checkPolicy()) { 295 if (this.checkPolicy()) {
288 this.policyIllegal = false; 296 this.policyIllegal = false;
289 } else { 297 } else {
290 this.policyIllegal = true; 298 this.policyIllegal = true;
291 } 299 }
292 }, 300 },
293 'agree': function () { 301 'agree': function () {
294 this.showTips = false; 302 this.showTips = false;
295 } 303 }
296 }, 304 },
297 mounted() { 305 mounted() {
298 this.initData(); 306 this.initData();
299 }, 307 },
300 created() { } 308 created() {
309 try {
310 this.$root.eventBus.$off("_evt_to_account_information");
311 } catch (e) {}
312 this.$root.eventBus.$on("_evt_to_account_information", () => {
313 this.$nextTick(() => {
314 console.log("ccccc:", document.getElementById("sc"));
315 let sc = document.getElementById("sc");
316 if (sc) {
317 document.getElementById("sc").scrollIntoView();
318 }
319 })
320 });
321 }
301 } 322 }
......
...@@ -124,13 +124,13 @@ ...@@ -124,13 +124,13 @@
124 </div> 124 </div>
125 <div class="value"> 125 <div class="value">
126 <clarms-upload :icon="require('@/assets/images/clarms/icon3.png')" :options="{name:$t('clarms.step2.label14'),imageTypeID:'HT29',imageMainTypeID:'HT06',toast:$t('clarms.step2.toast3')}" @success="uploadSuccess" @beforeUpload="beforeUpload"></clarms-upload> 126 <clarms-upload :icon="require('@/assets/images/clarms/icon3.png')" :options="{name:$t('clarms.step2.label14'),imageTypeID:'HT29',imageMainTypeID:'HT06',toast:$t('clarms.step2.toast3')}" @success="uploadSuccess" @beforeUpload="beforeUpload"></clarms-upload>
127 <clarms-upload class="mt20" :icon="require('@/assets/images/clarms/icon4.png')" :options="{name:$t('clarms.step2.label15'),imageTypeID:'HT34',imageMainTypeID:'HT08',toast:$t('clarms.step2.toast4')}" @success="uploadSuccess" @beforeUpload="beforeUpload"></clarms-upload> 127 <clarms-upload id="sc" ref="sc" class="mt20" :icon="require('@/assets/images/clarms/icon4.png')" :options="{name:$t('clarms.step2.label15'),imageTypeID:'HT34',imageMainTypeID:'HT08',toast:$t('clarms.step2.toast4')}" @success="uploadSuccess" @beforeUpload="beforeUpload"></clarms-upload>
128 <clarms-upload class="mt20" :icon="require('@/assets/images/clarms/icon5.png')" :options="{name:$t('clarms.step2.label16'),imageTypeID:'HT16',imageMainTypeID:'HT03',toast:$t('clarms.step2.toast5')}" @success="uploadSuccess" @beforeUpload="beforeUpload"></clarms-upload> 128 <clarms-upload class="mt20" :icon="require('@/assets/images/clarms/icon5.png')" :options="{name:$t('clarms.step2.label16'),imageTypeID:'HT16',imageMainTypeID:'HT03',toast:$t('clarms.step2.toast5')}" @success="uploadSuccess" @beforeUpload="beforeUpload"></clarms-upload>
129 </div> 129 </div>
130 </div> 130 </div>
131 </template> 131 </template>
132 </div> 132 </div>
133 <hr v-if="data.amount > 0"> 133 <hr v-if="data.amount > 0" >
134 <div class="bottom-tip orange mt20">{{$t('clarms.step2.label17')}}</div> 134 <div class="bottom-tip orange mt20">{{$t('clarms.step2.label17')}}</div>
135 <div class="bottom-tip gray mt10">{{$t('clarms.step2.tip1')}}</div> 135 <div class="bottom-tip gray mt10">{{$t('clarms.step2.tip1')}}</div>
136 136
......
1
2
3 export default { 1 export default {
4 data() { 2 data() {
5 return { 3 return {
6 4
7 } 5 }
8 }, 6 },
9 components: {}, 7 components: {},
10 computed: { 8 computed: {},
11 }, 9 methods: {
12 methods: { 10 initData() {
13 initData() {
14 11
15 }, 12 },
16 onOverLayHandler() { 13 onOverLayHandler() {
17 this.$emit("close"); 14 this.$emit("close");
18 }, 15 },
19 toContact() { 16 toAccountInformation() {
20 this.$router.push({ 17 this.$emit("close");
21 path: "/custom/service?q=m1" 18 this.$root.eventBus.$emit('_evt_to_account_information');
22 }); 19 },
23 } 20 toContact() {
24 }, 21 this.$router.push({
25 mounted() { 22 path: "/custom/service?q=m1"
23 });
24 }
25 },
26 mounted() {
26 27
27 }, 28 },
28 created() { 29 created() {
29 this.initData(); 30 this.initData();
30 }, 31 },
31 watch: { 32 watch: {},
32 },
33 } 33 }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
9 <img src="@/assets/images/clarms/suc.png"> 9 <img src="@/assets/images/clarms/suc.png">
10 </div> 10 </div>
11 <div class="message"> 11 <div class="message">
12 {{$t('clarms.step2.tip7')}}<span @click="onOverLayHandler">{{$t('clarms.step2.tip8')}}</span> 12 {{$t('clarms.step2.tip7')}}<span @click="toAccountInformation">{{$t('clarms.step2.tip8')}}</span>
13 </div> 13 </div>
14 </div> 14 </div>
15 </div> 15 </div>
......
1 import { 1 import {
2 mapGetters, 2 mapGetters,
3 mapActions, 3 mapActions,
4 mapState 4 mapState
5 } from "vuex"; 5 } from "vuex";
6 6
7 import api from '@/api/api' 7 import api from '@/api/api'
8 import { 8 import {
9 httpGet, 9 httpGet,
10 httpPost 10 httpPost
11 } from '@/api/fetch-api.js' 11 } from '@/api/fetch-api.js'
12 12
13 import ClarmsModalOne from '@/components/clarms/clarms-plugins-modal1.vue'; 13 import ClarmsModalOne from '@/components/clarms/clarms-plugins-modal1.vue';
...@@ -25,126 +25,140 @@ import ClarmsMaterial from '@/components/clarms/clarms-plugins-material.vue'; ...@@ -25,126 +25,140 @@ import ClarmsMaterial from '@/components/clarms/clarms-plugins-material.vue';
25 // 有保单 25 // 有保单
26 26
27 export default { 27 export default {
28 data() { 28 data() {
29 return { 29 return {
30 step: 0, // 1是表单;2是报案页面;3=信息不完整 30 step: 0, // 1是表单;2是报案页面;3=信息不完整
31 showModal1: false, 31 showModal1: false,
32 showModal2: false, 32 showModal2: false,
33 agress: false, 33 agress: false,
34 reservationTypes: [], 34 reservationTypes: [],
35 cid: false, 35 cid: "",
36 // 可以理赔的客户信息 36 // 可以理赔的客户信息
37 customerList: [] 37 customerList: []
38 } 38 }
39 }, 39 },
40 components: { 40 components: {
41 ClarmsVerifyForm, 41 ClarmsVerifyForm,
42 ClarmsMaterial, 42 ClarmsMaterial,
43 ClarmsModalOne, 43 ClarmsModalOne,
44 ClarmsModalTwo 44 ClarmsModalTwo
45 }, 45 },
46 computed: { 46 computed: {
47 ...mapState({ 47 ...mapState({
48 userInfo: state => state.userInfo 48 userInfo: state => state.userInfo
49 }), 49 }),
50 i18n() { 50 i18n() {
51 return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {}; 51 return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {};
52 }, 52 },
53 }, 53 },
54 methods: { 54 methods: {
55 initData() { 55 initData() {
56 // this.step = 2; 56 // this.step = 2;
57 // return; 57 // return;
58 if (this.userInfo && this.userInfo.name) { 58 if (this.userInfo && this.userInfo.name) {
59 this.loadCidIfLogin(); 59 this.loadCidIfLogin();
60 sessionStorage.removeItem("clarmsRequestCid") 60 sessionStorage.removeItem("clarmsRequestCid")
61 } else { 61 } else {
62 let cid = sessionStorage.getItem("clarmsRequestCid"); 62 let cid = sessionStorage.getItem("clarmsRequestCid");
63 if (cid) { 63 if (cid) {
64 this.cid = cid; 64 this.cid = cid;
65 this.checkCid(); 65 this.checkCid();
66 } else { 66 } else {
67 this.step = 1; 67 this.step = 1;
68 } 68 }
69 } 69 }
70 }, 70 },
71 loadCidIfLogin() { 71 loadCidIfLogin() {
72 let param = { 72 let param = {
73 sid: this.userInfo.sid 73 sid: this.userInfo.sid
74 }; 74 };
75 httpPost({ url: api.getCidByLogin, sid: true, data: param }).then(res => { 75 httpPost({
76 if (res) { 76 url: api.getCidByLogin,
77 this.cid = res; 77 sid: true,
78 this.checkCid(); 78 data: param
79 } else { 79 }).then(res => {
80 this.step = 3; 80 if (res) {
81 } 81 this.cid = res;
82 }).catch(e => { 82 this.checkCid();
83 this.step = 1; 83 } else {
84 }); 84 this.step = 3;
85 }, 85 }
86 checkCid() { 86 }).catch(e => {
87 let param = { 87 this.step = 1;
88 cid: this.cid 88 });
89 } 89 },
90 httpPost({ url: api.clarmsCustomerList, data: param }).then(res => { 90 checkCid() {
91 sessionStorage.removeItem("clarmsRequestCid"); 91 let param = {
92 if (res) { 92 cid: this.cid
93 this.customerList = res.insuredInfoList; 93 }
94 this.step = 2; 94 httpPost({
95 } 95 url: api.clarmsCustomerList,
96 // if (res && res.insuredInfoList && res.insuredInfoList.length > 0) { 96 data: param
97 // this.customerList = res.insuredInfoList; 97 }).then(res => {
98 // this.step = 2; 98 sessionStorage.removeItem("clarmsRequestCid");
99 // } else { 99 if (res) {
100 // sessionStorage.removeItem("clarmsRequestCid"); 100 this.customerList = res.insuredInfoList;
101 // this.step = 1; 101 this.step = 2;
102 // } 102 }
103 }).catch(e => { 103 // if (res && res.insuredInfoList && res.insuredInfoList.length > 0) {
104 sessionStorage.removeItem("clarmsRequestCid"); 104 // this.customerList = res.insuredInfoList;
105 this.step = 1; 105 // this.step = 2;
106 }); 106 // } else {
107 }, 107 // sessionStorage.removeItem("clarmsRequestCid");
108 handleInsuredInfo(data) { 108 // this.step = 1;
109 this.cid = data.cid; 109 // }
110 this.customerList = data.list; 110 }).catch(e => {
111 this.step = 2; 111 sessionStorage.removeItem("clarmsRequestCid");
112 }, 112 this.step = 1;
113 handleShowModal(modalIndex) { 113 });
114 console.log(modalIndex); 114 },
115 if (modalIndex == 1) { 115 handleInsuredInfo(data) {
116 this.showModal1 = true; 116 this.cid = data.cid;
117 } else if (modalIndex == 2) { 117 this.customerList = data.list;
118 this.showModal2 = true; 118 this.step = 2;
119 } 119 },
120 }, 120 handleShowModal(modalIndex) {
121 gotoInformationPage() { 121 console.log(modalIndex);
122 let c = this.$route.fullPath; 122 if (modalIndex == 1) {
123 this.$router.push({ path: "/infomation/improve", query: { c: c, a: 1 } }); 123 this.showModal1 = true;
124 }, 124 } else if (modalIndex == 2) {
125 logoutAction() { 125 this.showModal2 = true;
126 this.sid = false; 126 }
127 this.hadQueryCustomerList = false; 127 },
128 this.customerList = []; 128 gotoInformationPage() {
129 this.step = 1; 129 let c = this.$route.fullPath;
130 }, 130 this.$router.push({
131 loginAction() { 131 path: "/infomation/improve",
132 this.sid = false; 132 query: {
133 this.hadQueryCustomerList = false; 133 c: c,
134 this.customerList = []; 134 a: 1
135 } 135 }
136 }, 136 });
137 watch: { 137 },
138 userInfo(val) { 138 logoutAction() {
139 if (val && val.name) { 139 this.sid = false;
140 this.loginAction(); 140 this.hadQueryCustomerList = false;
141 } else { 141 this.customerList = [];
142 this.logoutAction(); 142 this.step = 1;
143 } 143 },
144 } 144 loginAction() {
145 }, 145 this.sid = false;
146 mounted() { 146 this.hadQueryCustomerList = false;
147 this.initData(); 147 this.customerList = [];
148 }, 148 }
149 created() { } 149 },
150 watch: {
151 userInfo(val) {
152 if (val && val.name) {
153 this.loginAction();
154 } else {
155 this.logoutAction();
156 }
157 }
158 },
159 mounted() {
160 this.initData();
161
162 },
163 created() {}
150 } 164 }
......