This commit is contained in:
parent
d7a84f7e46
commit
4ac35f9b6e
|
@ -96,25 +96,6 @@ export default {
|
||||||
const res = await getContractListsApi();
|
const res = await getContractListsApi();
|
||||||
this.contractObj = res.data;
|
this.contractObj = res.data;
|
||||||
},
|
},
|
||||||
async downloadWord(type) {
|
|
||||||
const res = await postDownloadContractApi();
|
|
||||||
if (res.error === 0) {
|
|
||||||
let blob_url = type === 1 ? res.data.domestic : res.data.abroad;
|
|
||||||
const extension = blob_url.substring(blob_url.lastIndexOf("."));
|
|
||||||
console.log(blob_url, "blob_url");
|
|
||||||
let txt = (type === 1 ? "境内合同" : "境外合同") + extension;
|
|
||||||
const url = URL.createObjectURL(new Blob([blob_url]));
|
|
||||||
const link = document.createElement("a");
|
|
||||||
link.style.display = "none";
|
|
||||||
link.href = url;
|
|
||||||
link.setAttribute("download", txt);
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
document.body.removeChild(link);
|
|
||||||
URL.revokeObjectURL(objectUrl);
|
|
||||||
}
|
|
||||||
console.log(res, "下载合同");
|
|
||||||
},
|
|
||||||
async downloadWord(type) {
|
async downloadWord(type) {
|
||||||
const res = await postDownloadContractApi();
|
const res = await postDownloadContractApi();
|
||||||
if (res.error === 0) {
|
if (res.error === 0) {
|
||||||
|
|
Loading…
Reference in New Issue