|
|
@@ -65,14 +65,51 @@
|
|
|
<!-- <div class="cargo-owner-add" @click="voyageAddDialogVisible = true">
|
|
|
添加航次
|
|
|
</div> -->
|
|
|
- <el-button
|
|
|
- v-auth="'DOWNLOADFYDI'"
|
|
|
- type="primary"
|
|
|
- size="medium"
|
|
|
- @click="downloadFYDI"
|
|
|
- >下载FYDI指数</el-button
|
|
|
- >
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="medium"
|
|
|
+ class="mr20"
|
|
|
+ @click="showExportModal('卸货信息')"
|
|
|
+ >导出卸货信息</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="medium"
|
|
|
+ class="mr20"
|
|
|
+ @click="showExportModal('航次信息')"
|
|
|
+ >导出航次信息</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-auth="'DOWNLOADFYDI'"
|
|
|
+ type="primary"
|
|
|
+ size="medium"
|
|
|
+ @click="downloadFYDI"
|
|
|
+ >下载FYDI指数</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <el-dialog
|
|
|
+ v-model="exportModalVisable"
|
|
|
+ :title="exportModalTitle"
|
|
|
+ width="200px"
|
|
|
+ >
|
|
|
+ <div class="df aic jcsb">
|
|
|
+ <div class="df aic">
|
|
|
+ <div class="mr20">请选择月份:</div>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="currentMonth"
|
|
|
+ type="month"
|
|
|
+ placeholder="请选择年月"
|
|
|
+ value-format="YYYYMM"
|
|
|
+ :disabled="isLoadingZip"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <el-button type="primary" @click="exportZip" :loading="isLoadingZip"
|
|
|
+ >导出{{ exportModalTitle }}</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<el-dialog v-model="voyageAddDialogVisible" title="添加航次">
|
|
|
<el-form
|
|
|
:rules="rules"
|
|
|
@@ -308,6 +345,8 @@ import md5 from "md5";
|
|
|
import api from "../../apis/fetch";
|
|
|
import _ from "lodash";
|
|
|
import { subTimeStr } from "../../utils/utils";
|
|
|
+import downloadBlobFile from "../../utils/downloadBlobFile";
|
|
|
+import url from "../../apis/config";
|
|
|
|
|
|
let currentPage = ref(1);
|
|
|
let term = ref("");
|
|
|
@@ -621,7 +660,6 @@ function resetAddVoyageForm() {
|
|
|
}
|
|
|
|
|
|
let sortradio = ref(0);
|
|
|
-let isLoadingExcel = ref(false);
|
|
|
async function downloadFYDI() {
|
|
|
let res0 = await api.getFYFIDownloadUrl({
|
|
|
loginAccountId: localStorage.loginAccountId,
|
|
|
@@ -633,6 +671,41 @@ async function downloadFYDI() {
|
|
|
a.click();
|
|
|
}
|
|
|
|
|
|
+let exportModalVisable = ref(false);
|
|
|
+let exportModalTitle = ref("");
|
|
|
+let currentMonth = ref("");
|
|
|
+
|
|
|
+function showExportModal(type) {
|
|
|
+ exportModalVisable.value = true;
|
|
|
+ exportModalTitle.value = type;
|
|
|
+}
|
|
|
+
|
|
|
+let isLoadingZip = ref(false);
|
|
|
+
|
|
|
+async function exportZip() {
|
|
|
+ if (!currentMonth.value) return;
|
|
|
+
|
|
|
+ isLoadingZip.value = true;
|
|
|
+ let res = await downloadBlobFile(
|
|
|
+ `${url.baseurl}${
|
|
|
+ exportModalTitle.value == "卸货信息"
|
|
|
+ ? "/voyage/exportMultDischargeExcel"
|
|
|
+ : "/voyage/exportMultExcel"
|
|
|
+ }`,
|
|
|
+ { loginAccountId: localStorage.loginAccountId, date: currentMonth.value },
|
|
|
+ `${exportModalTitle.value}${currentMonth.value}`,
|
|
|
+ "post",
|
|
|
+ "application/zip"
|
|
|
+ );
|
|
|
+ ElNotification({
|
|
|
+ title: "导出成功!",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ isLoadingZip.value = false;
|
|
|
+ currentMonth.value = "";
|
|
|
+ exportModalVisable.value = false;
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getVoyageList();
|
|
|
});
|