c7c6e26e by joe

电子保单下拉变更

1 parent 5e0dd4ce
......@@ -74,47 +74,51 @@ export default {
// res.push({ "recordId": "10", "bizNo": "P000000000000323", "letterType": "5", "printTime": "2020-05-08 16:02:21", "key": "c4ace2829737459cb6c95f523e0f5223", "isRead": "Y" })
// }
// this.isReadCandiates = [{ "v": "N", "n": this.i18n.eCorrespondenceEnquiry.UnRead }, { "v": "Y", "n": this.i18n.eCorrespondenceEnquiry.Read }];
this.letterTypeCandiates = [{ "v": "5", "n": this.i18n.eCorrespondenceEnquiry.letterName }];
// 缓存,用于判断重复
let bizNoCache = [];
let printTimeCache = [];
let isReadCache = [];
let letterTypeCache = [];
let newBizNoCandidates = [], newPrintTimeCandidates = [], newIsReadCandiates = [];
for (let index = 0; index < res.length; index++) {
let letter = res[index];
if (letter.letterType == "5") {
let bizNo = letter.bizNo;
let printTime = letter.printTime.split(" ")[0];
let isRead = letter.isRead;
if (bizNoCache.indexOf(bizNo) < 0) {
bizNoCache.push(bizNo);
newBizNoCandidates.push({ "v": bizNo, "n": bizNo });
}
if (printTimeCache.indexOf(printTime) < 0) {
printTimeCache.push(printTime);
newPrintTimeCandidates.push({ "v": printTime, "n": printTime });
}
if (isReadCache.indexOf(isRead) < 0) {
isReadCache.push(isRead);
let n = isRead == "Y" ? this.i18n.eCorrespondenceEnquiry.Read : this.i18n.eCorrespondenceEnquiry.UnRead;
newIsReadCandiates.push({ v: isRead, n: n });
}
this.originalList.push(letter);
this.contentList.push(letter);
}
}
this.bizNoCandidates = newBizNoCandidates;
this.printTimeCandidates = newPrintTimeCandidates;
this.isReadCandiates = newIsReadCandiates;
this.initCandidates();
});
},
initCandidates() {
this.letterTypeCandiates = [{ "v": "5", "n": this.i18n.eCorrespondenceEnquiry.letterName }];
// 缓存,用于判断重复
let bizNoCache = [];
let printTimeCache = [];
let isReadCache = [];
let newBizNoCandidates = [], newPrintTimeCandidates = [], newIsReadCandiates = [];
for (let index = 0; index < this.originalList.length; index++) {
let letter = this.originalList[index];
let bizNo = letter.policyCode;
let printTime = letter.printTime.split(" ")[0];
let isRead = letter.isRead;
if (bizNoCache.indexOf(bizNo) < 0) {
bizNoCache.push(bizNo);
newBizNoCandidates.push({ "v": bizNo, "n": bizNo });
}
if (printTimeCache.indexOf(printTime) < 0) {
printTimeCache.push(printTime);
newPrintTimeCandidates.push({ "v": printTime, "n": printTime });
}
if (isReadCache.indexOf(isRead) < 0) {
isReadCache.push(isRead);
let n = isRead == "Y" ? this.i18n.eCorrespondenceEnquiry.Read : this.i18n.eCorrespondenceEnquiry.UnRead;
newIsReadCandiates.push({ v: isRead, n: n });
}
}
this.bizNoCandidates = newBizNoCandidates;
this.printTimeCandidates = newPrintTimeCandidates;
this.isReadCandiates = newIsReadCandiates;
},
onShowTipsOverHandler(event, item, index) {
let child = event.currentTarget.childNodes[0];
child.style.display = "block";
......@@ -251,5 +255,11 @@ export default {
},
mounted() {
this.initData();
this.$root.eventBus.$on("langChange", () => {
try {
this.initCandidates();
} catch (e) { }
});
},
}
......