Prechádzať zdrojové kódy

新增 下载卸货记录excel

wzh 4 rokov pred
rodič
commit
cfac59460d
1 zmenil súbory, kde vykonal 29 pridanie a 2 odobranie
  1. 29 2
      src/views/voyage/voyageDetail.vue

+ 29 - 2
src/views/voyage/voyageDetail.vue

@@ -319,7 +319,16 @@
       </el-button>
     </div>
   </div>
-  <div class="container-title">卸货记录</div>
+  <div class="container-title df aic jcsb">
+    <div>卸货记录</div>
+    <el-button
+      @click="exportDischargeExcel"
+      style="width: 220px; margin-right: 20px"
+      type="primary"
+      :loading="isDischargeLoadingExcel"
+      >下载卸货信息</el-button
+    >
+  </div>
   <div class="line-container-p24">
     <el-card
       style="
@@ -657,6 +666,7 @@ import router from "../../router";
 import store from "../../store";
 import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
 import downloadBlobFile from "../../utils/downloadBlobFile";
+import url from "../../apis/config";
 
 export default {
   setup() {
@@ -1135,7 +1145,7 @@ export default {
     async function downloadExcel() {
       isLoadingExcel.value = true;
       let res = await downloadBlobFile(
-        "https://interface.huihenduo.com.cn/hhd-pat/voyage/exportExcel",
+        `${url.baseurl}/voyage/exportExcel`,
         { voyageId: route.query.id },
         "船舶跟踪表",
         "post"
@@ -1176,6 +1186,21 @@ export default {
         });
     }
     let certs = ref(null);
+
+    let isDischargeLoadingExcel = ref(false);
+    async function exportDischargeExcel() {
+      isDischargeLoadingExcel.value = true;
+      let res = await downloadBlobFile(
+        `${url.baseurl}/voyage/exportDischargeExcel`,
+        { voyageId: route.query.id },
+        "卸货记录表",
+        "post"
+      );
+      if (res) {
+        isDischargeLoadingExcel.value = false;
+      }
+    }
+
     onMounted(() => {
       getVoyageDetail(1);
       getDischargeList(1);
@@ -1184,6 +1209,7 @@ export default {
       certs,
       downloadExcel,
       isLoadingExcel,
+      isDischargeLoadingExcel,
       options,
       voyage,
       coordinates,
@@ -1238,6 +1264,7 @@ export default {
       updatePoundParams,
       getupdatePoundBillList,
       updatePoundBillList,
+      exportDischargeExcel,
     };
   },
 };