c7c6e26e by joe

电子保单下拉变更

1 parent 5e0dd4ce
...@@ -74,47 +74,51 @@ export default { ...@@ -74,47 +74,51 @@ export default {
74 // res.push({ "recordId": "10", "bizNo": "P000000000000323", "letterType": "5", "printTime": "2020-05-08 16:02:21", "key": "c4ace2829737459cb6c95f523e0f5223", "isRead": "Y" }) 74 // res.push({ "recordId": "10", "bizNo": "P000000000000323", "letterType": "5", "printTime": "2020-05-08 16:02:21", "key": "c4ace2829737459cb6c95f523e0f5223", "isRead": "Y" })
75 // } 75 // }
76 // this.isReadCandiates = [{ "v": "N", "n": this.i18n.eCorrespondenceEnquiry.UnRead }, { "v": "Y", "n": this.i18n.eCorrespondenceEnquiry.Read }]; 76 // this.isReadCandiates = [{ "v": "N", "n": this.i18n.eCorrespondenceEnquiry.UnRead }, { "v": "Y", "n": this.i18n.eCorrespondenceEnquiry.Read }];
77 this.letterTypeCandiates = [{ "v": "5", "n": this.i18n.eCorrespondenceEnquiry.letterName }];
78
79 // 缓存,用于判断重复 77 // 缓存,用于判断重复
80 let bizNoCache = [];
81 let printTimeCache = [];
82 let isReadCache = [];
83 let letterTypeCache = [];
84
85 let newBizNoCandidates = [], newPrintTimeCandidates = [], newIsReadCandiates = [];
86
87 for (let index = 0; index < res.length; index++) { 78 for (let index = 0; index < res.length; index++) {
88 let letter = res[index]; 79 let letter = res[index];
89 if (letter.letterType == "5") { 80 if (letter.letterType == "5") {
90 let bizNo = letter.bizNo;
91 let printTime = letter.printTime.split(" ")[0];
92 let isRead = letter.isRead;
93
94 if (bizNoCache.indexOf(bizNo) < 0) {
95 bizNoCache.push(bizNo);
96 newBizNoCandidates.push({ "v": bizNo, "n": bizNo });
97 }
98 if (printTimeCache.indexOf(printTime) < 0) {
99 printTimeCache.push(printTime);
100 newPrintTimeCandidates.push({ "v": printTime, "n": printTime });
101 }
102
103 if (isReadCache.indexOf(isRead) < 0) {
104 isReadCache.push(isRead);
105 let n = isRead == "Y" ? this.i18n.eCorrespondenceEnquiry.Read : this.i18n.eCorrespondenceEnquiry.UnRead;
106 newIsReadCandiates.push({ v: isRead, n: n });
107 }
108
109 this.originalList.push(letter); 81 this.originalList.push(letter);
110 this.contentList.push(letter); 82 this.contentList.push(letter);
111 } 83 }
112 } 84 }
113 this.bizNoCandidates = newBizNoCandidates; 85 this.initCandidates();
114 this.printTimeCandidates = newPrintTimeCandidates;
115 this.isReadCandiates = newIsReadCandiates;
116 }); 86 });
117 }, 87 },
88 initCandidates() {
89 this.letterTypeCandiates = [{ "v": "5", "n": this.i18n.eCorrespondenceEnquiry.letterName }];
90
91 // 缓存,用于判断重复
92 let bizNoCache = [];
93 let printTimeCache = [];
94 let isReadCache = [];
95 let newBizNoCandidates = [], newPrintTimeCandidates = [], newIsReadCandiates = [];
96
97 for (let index = 0; index < this.originalList.length; index++) {
98 let letter = this.originalList[index];
99 let bizNo = letter.policyCode;
100 let printTime = letter.printTime.split(" ")[0];
101 let isRead = letter.isRead;
102
103 if (bizNoCache.indexOf(bizNo) < 0) {
104 bizNoCache.push(bizNo);
105 newBizNoCandidates.push({ "v": bizNo, "n": bizNo });
106 }
107 if (printTimeCache.indexOf(printTime) < 0) {
108 printTimeCache.push(printTime);
109 newPrintTimeCandidates.push({ "v": printTime, "n": printTime });
110 }
111
112 if (isReadCache.indexOf(isRead) < 0) {
113 isReadCache.push(isRead);
114 let n = isRead == "Y" ? this.i18n.eCorrespondenceEnquiry.Read : this.i18n.eCorrespondenceEnquiry.UnRead;
115 newIsReadCandiates.push({ v: isRead, n: n });
116 }
117 }
118 this.bizNoCandidates = newBizNoCandidates;
119 this.printTimeCandidates = newPrintTimeCandidates;
120 this.isReadCandiates = newIsReadCandiates;
121 },
118 onShowTipsOverHandler(event, item, index) { 122 onShowTipsOverHandler(event, item, index) {
119 let child = event.currentTarget.childNodes[0]; 123 let child = event.currentTarget.childNodes[0];
120 child.style.display = "block"; 124 child.style.display = "block";
...@@ -251,5 +255,11 @@ export default { ...@@ -251,5 +255,11 @@ export default {
251 }, 255 },
252 mounted() { 256 mounted() {
253 this.initData(); 257 this.initData();
258
259 this.$root.eventBus.$on("langChange", () => {
260 try {
261 this.initCandidates();
262 } catch (e) { }
263 });
254 }, 264 },
255 } 265 }
......