下载商户合同凭证

This commit is contained in:
chenbo 2023-09-13 21:59:48 +08:00
parent f514af0894
commit 7f710ff92b
2 changed files with 19 additions and 0 deletions

View File

@ -39,3 +39,7 @@ export function apiShopDraftingcontracts(params: any) {
export function apiShopSendMsgApi(params: any) { export function apiShopSendMsgApi(params: any) {
return request.get({ url: '/shop_contract/postsms', params }) return request.get({ url: '/shop_contract/postsms', params })
} }
//请求证据包下载地址
export function contractEvidence(params: any) {
return request.get({ url: "/shop_contract/evidence", params });
}

View File

@ -209,6 +209,7 @@ import {
apiShopContractDelete, apiShopContractDelete,
apiShopDraftingcontracts, apiShopDraftingcontracts,
apiShopSendMsgApi, apiShopSendMsgApi,
contractEvidence
} from "@/api/shop_contract"; } from "@/api/shop_contract";
import { timeFormat } from "@/utils/util"; import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback"; import feedback from "@/utils/feedback";
@ -265,6 +266,20 @@ const handleDelete = async (id: number | any[]) => {
await apiShopContractDelete({ id }); await apiShopContractDelete({ id });
getLists(); getLists();
}; };
//
const loadContractZip = (row: any) => {
contractEvidence({ id: row.id }).then((res) => {
downloadFile(res.url, "");
});
};
const downloadFile = (url: string, fileName: string) => {
let link = document.createElement("a");
link.href = url;
link.download = fileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};
// //
const showPop = ref(false); const showPop = ref(false);