lxf 1 year ago
parent
commit
8b62d21f06
1 changed files with 16 additions and 7 deletions
  1. 16 7
      src/views/group/data-board/turnover-rate/index.vue

+ 16 - 7
src/views/group/data-board/turnover-rate/index.vue

@@ -220,6 +220,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { nextTick } from "vue";
+import { ElMessageBox } from "element-plus";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("1");
@@ -281,13 +282,21 @@ const getList = () => {
 };
 getList();
 const deriveExcel = (days) => {
-  proxy.postFile("/turnoverRateBoard/exportExcel", { bomClassify: activeName.value, days: days, sortField: 1 }).then((res) => {
-    if (activeName.value == "1") {
-      proxy.downloadFile(res, "周转率-裸垫-" + days + "天.xlsx");
-    } else {
-      proxy.downloadFile(res, "周转率-裸砖-" + days + "天.xlsx");
-    }
-  });
+  ElMessageBox.confirm("你是否确认此操作", "提示", {
+    confirmButtonText: "确定",
+    cancelButtonText: "取消",
+    type: "warning",
+  })
+    .then(() => {
+      proxy.postFile("/turnoverRateBoard/exportExcel", { bomClassify: activeName.value, days: days, sortField: 1 }).then((res) => {
+        if (activeName.value == "1") {
+          proxy.downloadFile(res, "周转率-裸垫-" + days + "天.xlsx");
+        } else {
+          proxy.downloadFile(res, "周转率-裸砖-" + days + "天.xlsx");
+        }
+      });
+    })
+    .catch(() => {});
 };
 </script>