Ver código fonte

新增 导出航次列表

wzh 3 anos atrás
pai
commit
0ddf96c014
1 arquivos alterados com 22 adições e 6 exclusões
  1. 22 6
      src/views/voyage/voyageList.vue

+ 22 - 6
src/views/voyage/voyageList.vue

@@ -715,16 +715,32 @@ async function exportZip() {
   if (!currentMonth.value) return;
 
   isLoadingZip.value = true;
+  let path = "";
+  let type = "";
+  switch (exportModalTitle.value) {
+    case "航次列表": {
+      path = "/voyage/exportListExcel";
+      type =
+        "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
+      break;
+    }
+    case "航次跟踪": {
+      path = "/voyage/exportMultExcel";
+      type = "application/zip";
+      break;
+    }
+    case "卸货记录": {
+      path = "/voyage/exportMultDischargeExcel";
+      type = "application/zip";
+      break;
+    }
+  }
   let res = await downloadBlobFile(
-    `${url.baseurl}${
-      exportModalTitle.value == "卸货记录"
-        ? "/voyage/exportMultDischargeExcel"
-        : "/voyage/exportMultExcel"
-    }`,
+    `${url.baseurl}${path}`,
     { loginAccountId: localStorage.loginAccountId, date: currentMonth.value },
     `${exportModalTitle.value}${currentMonth.value}`,
     "post",
-    "application/zip"
+    type
   );
   ElNotification({
     title: "导出成功!",