Commit b2b82715 authored by huhaiqing's avatar huhaiqing

提交批量下载

parent cdd9eca0
...@@ -190,6 +190,7 @@ export function getBillService(params) { ...@@ -190,6 +190,7 @@ export function getBillService(params) {
export function zipDownload(params) { export function zipDownload(params) {
return request({ return request({
url: "/shipment/make-bill-of-lading/zipDownload", url: "/shipment/make-bill-of-lading/zipDownload",
responseType: "arraybuffer",
method: "get", method: "get",
params, params,
}); });
......
...@@ -91,9 +91,10 @@ import { ...@@ -91,9 +91,10 @@ import {
deleteBillService, deleteBillService,
zipDownload, zipDownload,
} from "@/api/ecw/box"; } from "@/api/ecw/box";
import { getTotlContent, getCapacity, serviceMsg } from "../shippingSea/utils"; import { getTotlContent, getCapacity } from "../shippingSea/utils";
import makeLadingBill from "./makeLadingBill.vue"; import makeLadingBill from "./makeLadingBill.vue";
import previewBill from "./previewBill.vue"; import previewBill from "./previewBill.vue";
import FileSaver from "file-saver";
export default { export default {
name: "ladingBill", name: "ladingBill",
...@@ -196,7 +197,8 @@ export default { ...@@ -196,7 +197,8 @@ export default {
}, },
clickZipDownload() { clickZipDownload() {
zipDownload({ shipmentId: this.shipmentObj.id }).then((res) => { zipDownload({ shipmentId: this.shipmentObj.id }).then((res) => {
serviceMsg(res); let blob = new Blob([res], { type: "application/zip" });
FileSaver.saveAs(blob, "打包文件.zip");
}); });
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment