Commit d67389a0 authored by huhaiqing's avatar huhaiqing

下载功能开发

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