From 7f710ff92b23a734176f50e3d8416d3c990fc9ea Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Wed, 13 Sep 2023 21:59:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=95=86=E6=88=B7=E5=90=88?= =?UTF-8?q?=E5=90=8C=E5=87=AD=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shop_contract.ts | 4 ++++ src/views/shop_contract/index.vue | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/api/shop_contract.ts b/src/api/shop_contract.ts index c914f4a..0719b5e 100644 --- a/src/api/shop_contract.ts +++ b/src/api/shop_contract.ts @@ -38,4 +38,8 @@ export function apiShopDraftingcontracts(params: any) { // 重新发送短信 export function apiShopSendMsgApi(params: any) { return request.get({ url: '/shop_contract/postsms', params }) +} +//请求证据包下载地址 +export function contractEvidence(params: any) { + return request.get({ url: "/shop_contract/evidence", params }); } \ No newline at end of file diff --git a/src/views/shop_contract/index.vue b/src/views/shop_contract/index.vue index f1b4fce..07749b3 100644 --- a/src/views/shop_contract/index.vue +++ b/src/views/shop_contract/index.vue @@ -209,6 +209,7 @@ import { apiShopContractDelete, apiShopDraftingcontracts, apiShopSendMsgApi, + contractEvidence } from "@/api/shop_contract"; import { timeFormat } from "@/utils/util"; import feedback from "@/utils/feedback"; @@ -265,6 +266,20 @@ const handleDelete = async (id: number | any[]) => { await apiShopContractDelete({ id }); 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);