Commit d67389a0 authored by huhaiqing's avatar huhaiqing

下载功能开发

parent 9e71f942
...@@ -215,8 +215,8 @@ export function downloadByOrderId(orderId) { ...@@ -215,8 +215,8 @@ export function downloadByOrderId(orderId) {
return request({ return request({
url: "/shipment/make-bill-of-lading/downloadByOrderId", url: "/shipment/make-bill-of-lading/downloadByOrderId",
method: "get", method: "get",
params: {orderId}, params: { orderId },
responseType: 'arraybuffer' responseType: "arraybuffer",
}); });
} }
...@@ -228,3 +228,53 @@ export function getBoxApproval(params) { ...@@ -228,3 +228,53 @@ export function getBoxApproval(params) {
params, params,
}); });
} }
// 下载清关文件
export function downloadClearanceFiles(params) {
return request({
url: "/ecw/box-preload-goods/downloadClearanceFiles",
responseType: "arraybuffer",
method: "get",
params,
});
}
// 下载报关单
export function downloadCustomFiles(params) {
return request({
url: "/ecw/box-preload-goods/downloadCustomFiles",
responseType: "arraybuffer",
method: "get",
params,
});
}
// 下载已装单
export function downloadLoadGoodsList(params) {
return request({
url: "/ecw/box-preload-goods/downloadLoadGoodsList",
responseType: "arraybuffer",
method: "get",
params,
});
}
// 下载预装单
export function downloadPreloadGoodsList(params) {
return request({
url: "/ecw/box-preload-goods/downloadPreloadGoodsList",
responseType: "arraybuffer",
method: "get",
params,
});
}
// 下载应收汇总
export function downloadReceivableList(params) {
return request({
url: "/ecw/box-preload-goods/downloadReceivableList",
responseType: "arraybuffer",
method: "get",
params,
});
}
...@@ -127,16 +127,16 @@ ...@@ -127,16 +127,16 @@
<el-dropdown-item v-if="scope.row.ldStatus==47" command="editLadingBill">编辑提货单</el-dropdown-item> <el-dropdown-item v-if="scope.row.ldStatus==47" command="editLadingBill">编辑提货单</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-dropdown trigger="click"> <el-dropdown trigger="click" @command="(command)=>handleCommand(scope.row, command)">
<el-button type="primary"> <el-button type="primary">
下载<i class="el-icon-arrow-down el-icon--right"></i> 下载<i class="el-icon-arrow-down el-icon--right"></i>
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="">预装单</el-dropdown-item> <el-dropdown-item command="downloadPreloadGoodsList">预装单</el-dropdown-item>
<el-dropdown-item command="">已装单</el-dropdown-item> <el-dropdown-item command="downloadLoadGoodsList">已装单</el-dropdown-item>
<el-dropdown-item command="">应收汇总表</el-dropdown-item> <el-dropdown-item command="downloadReceivableList">应收汇总表</el-dropdown-item>
<el-dropdown-item command="">agent list</el-dropdown-item> <el-dropdown-item command="">agent list</el-dropdown-item>
<el-dropdown-item command="">son cap</el-dropdown-item> <el-dropdown-item command="">soncap</el-dropdown-item>
<el-dropdown-item command="">提货单</el-dropdown-item> <el-dropdown-item command="">提货单</el-dropdown-item>
<el-dropdown-item command="">提单Copy</el-dropdown-item> <el-dropdown-item command="">提单Copy</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
...@@ -167,6 +167,7 @@ ...@@ -167,6 +167,7 @@
<script> <script>
import { deletebox, getbox, getboxPage, exportboxExcel } from "@/api/ecw/box"; import { deletebox, getbox, getboxPage, exportboxExcel } from "@/api/ecw/box";
import { downloadFile } 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";
...@@ -389,6 +390,31 @@ export default { ...@@ -389,6 +390,31 @@ export default {
case "error": case "error":
this.$set(this.dialogCfg, "title", "异常登记"); this.$set(this.dialogCfg, "title", "异常登记");
break; break;
case "downloadPreloadGoodsList":
downloadFile(
command,
{ shipmentId: row.id },
`预装单(${row.selfNo}).xlsx`,
"xlsx"
);
break;
case "downloadLoadGoodsList":
downloadFile(
command,
{ shipmentId: row.id },
`已装单(${row.selfNo}).xlsx`,
"xlsx"
);
break;
case "downloadReceivableList":
downloadFile(
command,
{ shipmentId: row.id },
`应收汇总表(${row.selfNo}).xlsx`,
"xlsx"
);
break;
} }
if (["editLadingBill", "cost", "error"].includes(command)) { if (["editLadingBill", "cost", "error"].includes(command)) {
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<el-row class="shipping-ladingBill"> <el-row class="shipping-ladingBill">
<el-row class="oper-button"> <el-row class="oper-button">
<el-button type="primary" @click="clickZipDownload">打包下载</el-button> <el-button type="primary" @click="clickZipDownload">打包下载</el-button>
<el-button type="primary">应收汇总单</el-button> <el-button type="primary" @click="handleCommand('downloadReceivableList')">应收汇总表</el-button>
<el-button type="primary">下载已装单</el-button> <el-button type="primary" @click="handleCommand('downloadLoadGoodsList')">下载已装单</el-button>
</el-row> </el-row>
<el-row style="margin-top:15px"> <el-row style="margin-top:15px">
...@@ -91,7 +91,11 @@ import { ...@@ -91,7 +91,11 @@ import {
deleteBillService, deleteBillService,
zipDownload, zipDownload,
} from "@/api/ecw/box"; } from "@/api/ecw/box";
import { getTotlContent, getCapacity } from "../shippingSea/utils"; import {
getTotlContent,
getCapacity,
downloadFile,
} 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"; import FileSaver from "file-saver";
...@@ -169,6 +173,22 @@ export default { ...@@ -169,6 +173,22 @@ export default {
} }
}); });
break; break;
case "downloadLoadGoodsList":
downloadFile(
type,
{ shipmentId: this.shipmentObj.id },
`已装单(${this.shipmentObj.selfNo}).xlsx`,
"xlsx"
);
return;
case "downloadReceivableList":
downloadFile(
type,
{ shipmentId: this.shipmentObj.id },
`应收汇总表(${this.shipmentObj.selfNo}).xlsx`,
"xlsx"
);
return;
} }
this.currRow = row; this.currRow = row;
this.$set(this.dialogCfg, "type", type); this.$set(this.dialogCfg, "type", type);
...@@ -178,7 +198,7 @@ export default { ...@@ -178,7 +198,7 @@ export default {
// TODO zgDate需要返回 // TODO zgDate需要返回
makeBillService({ makeBillService({
orderId: row.orderId, orderId: row.orderId,
zgDate: '2022-09-27', zgDate: "2022-09-27",
// zgDate: bookSeaInfo.sailTime, // zgDate: bookSeaInfo.sailTime,
}).then((res) => { }).then((res) => {
const { data } = res; const { data } = res;
......
...@@ -157,9 +157,14 @@ ...@@ -157,9 +157,14 @@
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="表单" name="download"> <el-tab-pane label="表单" name="download">
<el-table :data="[]" style="width: 50%"> <el-table :data="downloadList" style="width: 50%">
<el-table-column prop="" label="文件类型"> </el-table-column> <el-table-column prop="title" label="文件类型"></el-table-column>
<el-table-column prop="" label="下载链接"> </el-table-column> <el-table-column prop="" label="下载链接">
<template slot-scope="scope">
<a v-if="scope.row.serviceName" href="javascript:void(0)" @click="downloadDetailFile(scope.row)">下载</a>
<div v-else>未完成</div>
</template>
</el-table-column>
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
...@@ -199,6 +204,7 @@ import { ...@@ -199,6 +204,7 @@ import {
getTotlContent, getTotlContent,
formatDate, formatDate,
serviceMsg, serviceMsg,
downloadFile,
} 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";
...@@ -264,6 +270,16 @@ export default { ...@@ -264,6 +270,16 @@ export default {
transportTypes: [], transportTypes: [],
// 费用详情 // 费用详情
costDetail: {}, costDetail: {},
// 下载
downloadList: [
{ title: "预装单", serviceName: "downloadPreloadGoodsList" },
{ title: "已装单", serviceName: "downloadLoadGoodsList" },
{ title: "应收汇总表", serviceName: "downloadReceivableList" },
{ title: "提货单", serviceName: "" },
{ title: "agent list", serviceName: "" },
{ title: "soncap", serviceName: "" },
{ title: "提单Copy", serviceName: "" },
],
}; };
}, },
methods: { methods: {
...@@ -427,6 +443,14 @@ export default { ...@@ -427,6 +443,14 @@ export default {
} }
}, },
formatDate, formatDate,
downloadDetailFile(row) {
downloadFile(
row.serviceName,
{ shipmentId: this.shipmentId },
`${row.title}(${this.shipmentObj.selfNo}).xlsx`,
"xlsx"
);
},
}, },
computed: { computed: {
visitedViews() { visitedViews() {
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<el-button type="primary">下载装箱单</el-button> <el-button type="primary">下载装箱单</el-button>
</el-form-item> --> </el-form-item> -->
<el-form-item label="报关单"> <el-form-item label="报关单">
<el-button type="primary">下载所有报关单</el-button> <el-button type="primary" @click="downloadCusFile">下载所有报关单</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -153,6 +153,7 @@ import { ...@@ -153,6 +153,7 @@ import {
formatDateStr, formatDateStr,
serviceMsg, serviceMsg,
toReviewDetail, toReviewDetail,
downloadFile,
} from "../utils"; } from "../utils";
import ImageUpload from "@/components/ImageUpload"; import ImageUpload from "@/components/ImageUpload";
...@@ -443,6 +444,15 @@ export default { ...@@ -443,6 +444,15 @@ export default {
} }
return false; return false;
}, },
/* 下载报关单 */
downloadCusFile() {
downloadFile(
"downloadCustomFiles",
{ shipmentId: this.shipmentObj.id },
`报关单(${this.shipmentObj.selfNo}).xlsx`,
"xlsx"
);
},
}, },
watch: { watch: {
"cusDeclarationObj.dcBoxWgt"(dcBoxWgt) { "cusDeclarationObj.dcBoxWgt"(dcBoxWgt) {
......
import dayjs from "dayjs"; import dayjs from "dayjs";
import * as _BOX from "@/api/ecw/box";
import FileSaver from "file-saver";
/** /**
* 节点状态值 * 节点状态值
...@@ -442,7 +444,7 @@ function seaBaseData() { ...@@ -442,7 +444,7 @@ function seaBaseData() {
* *
* @return {*} * @return {*}
*/ */
function seaAirBaseData() { function seaAirBaseData() {
return [ return [
[ [
{ {
...@@ -1492,6 +1494,13 @@ function toReviewDetail(bpmProcessId) { ...@@ -1492,6 +1494,13 @@ function toReviewDetail(bpmProcessId) {
}); });
} }
function downloadFile(funName, params, fileName, fileFormat) {
_BOX[funName](params).then((res) => {
let blob = new Blob([res], { type: `application/${fileFormat}` });
FileSaver.saveAs(blob, fileName);
});
}
export { export {
getStatusName, getStatusName,
getColmnMapping, getColmnMapping,
...@@ -1508,4 +1517,5 @@ export { ...@@ -1508,4 +1517,5 @@ export {
sumStatistics, sumStatistics,
serviceMsg, serviceMsg,
toReviewDetail, toReviewDetail,
downloadFile,
}; };
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