584d3b86 by joe

完成回执回销的逻辑对接

1 parent 9838660d
......@@ -85,11 +85,11 @@ export default {
sid: true
}).then(res => {
this.hadLoadPolicy = true;
if (!res || res.length == 0) {} else {
if (!res || res.length == 0) { } else {
this.$store.commit("CACHE_POLICY_LIST", res);
this.checkIfShowPolicy();
}
}).catch(e => {});
}).catch(e => { });
} else {
this.checkIfShowPolicy();
}
......@@ -130,6 +130,24 @@ export default {
data: params
}).then(res => {
this.policyDetail = res;
// 两份电子函的ID
this.policyDetail.agree1 = false;
this.policyDetail.agree2 = false;
this.policyDetail.letterNo1Id = "";
this.policyDetail.letterNo2Id = "";
for (let index = 0; index < this.policyDetail.policyAcknowledges.length; index++) {
let policyAcknowledge = this.policyDetail.policyAcknowledges[index];
switch (policyAcknowledge.letterNo) {
case "1":
this.policyDetail.letterNo1Id = policyAcknowledge.recordId;
break;
case "2":
this.policyDetail.letterNo2Id = policyAcknowledge.recordId;
break;
}
}
this.policyDetail.ymd1 = "";
this.policyDetail.ymd2 = "";
this.policyDetail.ymd3 = "";
......@@ -178,7 +196,8 @@ export default {
// this.checkIfShowPolicy();
let params = {
policyCode: policyCode
policyCode: policyCode,
recordIds: [this.policyDetail.letterNo1Id, this.policyDetail.letterNo2Id]
};
// 回销
httpPost({
......@@ -207,13 +226,14 @@ export default {
},
// 下载冷静期通知书
downloadPolicy2() {
this.agree1 = true;
this.policyDetail.agree2 = true;
if (this.policyDetail) {
httpPost({
url: api.getDownloadPath,
sid: true,
data: {
policyCode: this.policyDetail.policyCode
policyCode: this.policyDetail.policyCode,
recordId: this.policyDetail.letterNo2Id
}
}).then(res => {
if (res) {
......@@ -225,15 +245,16 @@ export default {
});
}
},
// 下载政策协议
// 下载保险合约
downloadPolicy() {
this.agree2 = true;
this.policyDetail.agree1 = true;
if (this.policyDetail) {
httpPost({
url: api.getDownloadPath,
sid: true,
data: {
policyCode: this.policyDetail.policyCode
policyCode: this.policyDetail.policyCode,
recordId: this.policyDetail.letterNo1Id
}
}).then(res => {
if (res) {
......@@ -286,7 +307,7 @@ export default {
return this.userInfo && this.userInfo.sid;
},
onCheckHandler() {
if (this.agree1 && this.agree2) {
if (this.policyDetail.agree1 && this.policyDetail.agree2) {
this.checked = !this.checked;
this.errtipsVisible = false;
} else {
......