新增证据包下载
This commit is contained in:
parent
7cd7fadc2d
commit
2767ce7872
@ -41,4 +41,9 @@ export function leaseUpContract(params: any) {
|
||||
url: "/contract.VehicleContract/uploadContract",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
//请求证据包下载地址
|
||||
export function contractEvidence(params: any) {
|
||||
return request.get({ url: "/contract.contract/evidence", params });
|
||||
}
|
@ -168,6 +168,14 @@
|
||||
>发送短信</el-button
|
||||
>
|
||||
</template>
|
||||
<el-button
|
||||
v-else
|
||||
type="primary"
|
||||
link
|
||||
@click="loadContractZip(row)"
|
||||
>
|
||||
下载证据包
|
||||
</el-button>
|
||||
<!-- <el-button v-perms="['contract.contract/delete']" type="danger" link
|
||||
@click="handleDelete(row.id)">删除</el-button> -->
|
||||
</template>
|
||||
@ -212,6 +220,7 @@ import {
|
||||
apiContractLists,
|
||||
apiContractDelete,
|
||||
apiContractDetail,
|
||||
contractEvidence,
|
||||
} from "@/api/contract";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
@ -308,6 +317,21 @@ const handleDelete = async (id: number | any[]) => {
|
||||
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);
|
||||
};
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
Loading…
x
Reference in New Issue
Block a user