Commit 04a45d44 authored by huhaiqing's avatar huhaiqing

agentlist以及提单copy下载功能

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