Commit 04a45d44 authored by huhaiqing's avatar huhaiqing

agentlist以及提单copy下载功能

parent f8152820
......@@ -233,7 +233,6 @@ export function getBoxApproval(params) {
export function downloadAgentListFiles(params) {
return request({
url: "/ecw/box-preload-goods/downloadAgentListFiles",
responseType: "arraybuffer",
method: "get",
params,
});
......@@ -243,7 +242,6 @@ export function downloadAgentListFiles(params) {
export function downloadSoncapFiles(params) {
return request({
url: "/ecw/box-preload-goods/downloadSoncapFiles",
responseType: "arraybuffer",
method: "get",
params,
});
......@@ -288,3 +286,12 @@ export function downloadReceivableList(params) {
params,
});
}
// 下载提单copy
export function downloadLadingCopy(params) {
return request({
url: "/ecw/box-lading-copy/downloadLadingCopy",
method: "get",
params,
});
}
......@@ -137,8 +137,8 @@
<el-dropdown-item command="downloadReceivableList">应收汇总表</el-dropdown-item>
<el-dropdown-item command="downloadAgentListFiles">agent list</el-dropdown-item>
<el-dropdown-item command="downloadSoncapFiles">soncap</el-dropdown-item>
<el-dropdown-item command="">提货单</el-dropdown-item>
<el-dropdown-item command="">提单Copy</el-dropdown-item>
<el-dropdown-item command="zipDownload">提货单</el-dropdown-item>
<el-dropdown-item command="downloadLadingCopy">提单Copy</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
......@@ -166,8 +166,15 @@
</template>
<script>
import { deletebox, getbox, getboxPage, exportboxExcel } from "@/api/ecw/box";
import { downloadFile } from "./shippingSea/utils";
import {
deletebox,
getbox,
getboxPage,
exportboxExcel,
downloadAgentListFiles,
downloadSoncapFiles,
} from "@/api/ecw/box";
import { downloadFile, downloadFileByUrl } from "./shippingSea/utils";
import { getCabinetPage } from "@/api/ecw/cabinet";
import { getWarehouseList } from "@/api/ecw/warehouse";
import { getListTree } from "@/api/ecw/region";
......@@ -418,21 +425,18 @@ export default {
"xlsx"
);
break;
case "downloadAgentListFiles":
case "zipDownload":
downloadFile(
command,
{ shipmentId: row.id },
`agentList(${row.selfNo}).xlsx`,
"xlsx"
`提货单(${row.selfNo}).zip`,
"zip"
);
break;
case "downloadAgentListFiles":
case "downloadSoncapFiles":
downloadFile(
command,
{ shipmentId: row.id },
`soncap(${row.selfNo}).xlsx`,
"xlsx"
);
case "downloadLadingCopy":
downloadFileByUrl(command, { shipmentId: row.id });
break;
}
......
......@@ -205,6 +205,7 @@ import {
formatDate,
serviceMsg,
downloadFile,
downloadFileByUrl,
} from "./shippingSea/utils";
import { getSectionList, boxGoodsDetail } from "@/api/ecw/boxSea";
import { getSupplierPage } from "@/api/ecw/supplier";
......@@ -275,10 +276,14 @@ export default {
{ title: "预装单", serviceName: "downloadPreloadGoodsList" },
{ title: "已装单", serviceName: "downloadLoadGoodsList" },
{ title: "应收汇总表", serviceName: "downloadReceivableList" },
{ title: "提货单", serviceName: "" },
{ title: "agent list", serviceName: "" },
{ title: "soncap", serviceName: "" },
{ title: "提单Copy", serviceName: "" },
{ title: "提货单", serviceName: "zipDownload", fileFormat: "zip" },
{
title: "agent list",
serviceName: "downloadAgentListFiles",
type: "url",
},
{ title: "soncap", serviceName: "downloadSoncapFiles", type: "url" },
{ title: "提单Copy", serviceName: "downloadLadingCopy", type: "url" },
],
};
},
......@@ -444,12 +449,20 @@ export default {
},
formatDate,
downloadDetailFile(row) {
downloadFile(
row.serviceName,
{ shipmentId: this.shipmentId },
`${row.title}(${this.shipmentObj.selfNo}).xlsx`,
"xlsx"
);
const { fileFormat, type } = row;
if (type === "url") {
downloadFileByUrl(row.serviceName, { shipmentId: this.shipmentId });
} else {
let fileName = `${row.title}(${this.shipmentObj.selfNo}).${
fileFormat ?? "xlsx"
}`;
downloadFile(
row.serviceName,
{ shipmentId: this.shipmentId },
fileName,
fileFormat ?? "xlsx"
);
}
},
},
computed: {
......
......@@ -1501,6 +1501,12 @@ function downloadFile(funName, params, fileName, fileFormat) {
});
}
function downloadFileByUrl(funName, params) {
_BOX[funName](params).then((res) => {
if (res.data) FileSaver.saveAs(res.data);
});
}
export {
getStatusName,
getColmnMapping,
......@@ -1518,4 +1524,5 @@ export {
serviceMsg,
toReviewDetail,
downloadFile,
downloadFileByUrl,
};
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