Эх сурвалжийг харах

所有导出文件功能:文件名称带上当前日期

lxf 1 жил өмнө
parent
commit
42dffcfdad

+ 1 - 1
src/views/group/data-board/material-in-transit/index.vue

@@ -155,7 +155,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.postFile("/purchaseInTransitBom/export", sourceList.value.pagination).then((res) => {
-        proxy.downloadFile(res, "在途物料.xlsx");
+        proxy.downloadFile(res, "在途物料-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});

+ 2 - 1
src/views/group/data-board/sku-quoted-price/index.vue

@@ -39,6 +39,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([]);
@@ -192,7 +193,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.postFile("/skuSpecQuotationBoard/exportExcel", sourceList.value.pagination).then((res) => {
-        proxy.downloadFile(res, "SKU报价看板.xlsx");
+        proxy.downloadFile(res, "SKU报价看板-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});

+ 3 - 2
src/views/group/data-board/turnover-rate/index.vue

@@ -76,6 +76,7 @@
 import byTable from "/src/components/byTable/index";
 import { nextTick } from "vue";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("1");
@@ -236,9 +237,9 @@ const deriveExcel = () => {
     .then(() => {
       proxy.postFile("/turnoverRateBoard/exportExcel", { bomClassify: activeName.value, ...sourceList.value.pagination }).then((res) => {
         if (activeName.value == "1") {
-          proxy.downloadFile(res, "周转率-裸垫.xlsx");
+          proxy.downloadFile(res, "周转率-裸垫-" + moment().format("yyyy-MM-DD") + ".xlsx");
         } else {
-          proxy.downloadFile(res, "周转率-裸砖.xlsx");
+          proxy.downloadFile(res, "周转率-裸砖-" + moment().format("yyyy-MM-DD") + ".xlsx");
         }
       });
     })

+ 2 - 1
src/views/group/finance/check-bill/printBOM.vue

@@ -39,6 +39,7 @@
 
 <script setup>
 import { ElMessage } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -191,7 +192,7 @@ const deriveExcel = () => {
   loading.value = true;
   proxy.getFile("/statementOfAccount/exportDocumentByBom", { id: props.rowData.id, orderClassify: props.tabValues.tabsCard }).then(
     (res) => {
-      proxy.downloadFile(res, "BOM对账单.xlsx");
+      proxy.downloadFile(res, "BOM对账单-" + moment().format("yyyy-MM-DD") + ".xlsx");
       loading.value = false;
     },
     (err) => {

+ 0 - 1
src/views/group/finance/check-bill/printOrder.vue

@@ -131,7 +131,6 @@ const deriveExcel = () => {
   proxy.getFile("/statementOfAccount/exportDocumentByOrder", { id: props.rowData.id, orderClassify: props.tabValues.tabsCard }).then(
     () => {
       emit("clickCancel", true);
-      // proxy.downloadFile(res, "订单对账单.xlsx");
       loading.value = false;
     },
     (err) => {

+ 2 - 1
src/views/group/finance/check-bill/printSKU.vue

@@ -33,6 +33,7 @@
 
 <script setup>
 import { ElMessage } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -178,7 +179,7 @@ const deriveExcel = () => {
   loading.value = true;
   proxy.getFile("/statementOfAccount/exportDocumentBySku", { id: props.rowData.id, orderClassify: props.tabValues.tabsCard }).then(
     (res) => {
-      proxy.downloadFile(res, "SKU对账单.xlsx");
+      proxy.downloadFile(res, "SKU对账单-" + moment().format("yyyy-MM-DD") + ".xlsx");
       loading.value = false;
     },
     (err) => {

+ 2 - 1
src/views/group/finance/sales-return/index.vue

@@ -23,6 +23,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
@@ -197,7 +198,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.getFile("/orderExchangeDetail/excelExport", sourceList.value.pagination).then((res) => {
-        proxy.downloadFile(res, "销售退货明细表.xlsx");
+        proxy.downloadFile(res, "销售退货明细表-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});

+ 2 - 1
src/views/group/finance/summary/printBOM.vue

@@ -39,6 +39,7 @@
 
 <script setup>
 import { ElMessage } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -198,7 +199,7 @@ const deriveExcel = () => {
     })
     .then(
       (res) => {
-        proxy.downloadFile(res, "BOM对账单.xlsx");
+        proxy.downloadFile(res, "BOM对账单-" + moment().format("yyyy-MM-DD") + ".xlsx");
         loading.value = false;
       },
       (err) => {

+ 0 - 1
src/views/group/finance/summary/printOrder.vue

@@ -137,7 +137,6 @@ const deriveExcel = () => {
     .then(
       () => {
         emit("clickCancel", true);
-        // proxy.downloadFile(res, "订单对账单.xlsx");
         loading.value = false;
       },
       (err) => {

+ 2 - 1
src/views/group/finance/summary/printSKU.vue

@@ -33,6 +33,7 @@
 
 <script setup>
 import { ElMessage } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -185,7 +186,7 @@ const deriveExcel = () => {
     })
     .then(
       (res) => {
-        proxy.downloadFile(res, "SKU对账单.xlsx");
+        proxy.downloadFile(res, "SKU对账单-" + moment().format("yyyy-MM-DD") + ".xlsx");
         loading.value = false;
       },
       (err) => {

+ 2 - 1
src/views/production/warehouse/check/index.vue

@@ -67,6 +67,7 @@
 
 <script setup>
 import byTable from "/src/components/byTable/index";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("first");
@@ -437,7 +438,7 @@ const clickSubmit = () => {
   proxy.$refs.derive.validate((valid) => {
     if (valid) {
       proxy.postFile("/check/inventoryExportExcel", { id: formData.data.warehouseId }).then((res) => {
-        proxy.downloadFile(res, "盘点.xlsx");
+        proxy.downloadFile(res, "盘点-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     }
   });

+ 3 - 2
src/views/production/warehouse/finished-parts-storage/index.vue

@@ -46,6 +46,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("first");
@@ -283,7 +284,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.getFile("/inventoryFinished/excelExport", sourceList.value.pagination).then((res) => {
-        proxy.downloadFile(res, "成品库.xlsx");
+        proxy.downloadFile(res, "成品库-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});
@@ -296,7 +297,7 @@ const deriveExcelTwo = () => {
   })
     .then(() => {
       proxy.getFile("/inventoryFinishedOrder/excelExport", sourceListTwo.value.pagination).then((res) => {
-        proxy.downloadFile(res, "成品库明细.xlsx");
+        proxy.downloadFile(res, "成品库明细-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});

+ 2 - 1
src/views/production/warehouse/flow-record/index.vue

@@ -22,6 +22,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([{ dictKey: "0", dictValue: "胜德体育" }]);
@@ -252,7 +253,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.postFile("/inOutStorageBom/exportExcelSummary", sourceList.value.pagination).then((res) => {
-        proxy.downloadFile(res, "出入库流水.xlsx");
+        proxy.downloadFile(res, "出入库流水-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});

+ 3 - 2
src/views/production/warehouse/inventory/index.vue

@@ -56,6 +56,7 @@ import byTable from "/src/components/byTable/index";
 import { useRoute } from "vue-router";
 import useTagsViewStore from "/src/store/modules/tagsView";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const props = defineProps({
@@ -390,11 +391,11 @@ const deriveExcel = () => {
     .then(() => {
       if (route.query && route.query.backupDate) {
         proxy.getFile("/inventory/exportBackExcel", sourceList.value.pagination).then((res) => {
-          proxy.downloadFile(res, "库存.xlsx");
+          proxy.downloadFile(res, "库存-" + moment().format("yyyy-MM-DD") + ".xlsx");
         });
       } else {
         proxy.getFile("/inventory/exportExcel", sourceList.value.pagination).then((res) => {
-          proxy.downloadFile(res, "库存.xlsx");
+          proxy.downloadFile(res, "库存-" + moment().format("yyyy-MM-DD") + ".xlsx");
         });
       }
     })

+ 2 - 1
src/views/production/warehouse/outbound/index.vue

@@ -63,6 +63,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("first");
@@ -449,7 +450,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.postFile("/inOutStorageBom/exportExcel", sourceListTwo.value.pagination).then((res) => {
-        proxy.downloadFile(res, "出库明细.xlsx");
+        proxy.downloadFile(res, "出库明细-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});

+ 2 - 1
src/views/production/warehouse/putInStorage/index.vue

@@ -59,6 +59,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const activeName = ref("first");
@@ -436,7 +437,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.postFile("/inOutStorageBom/exportExcel", sourceListTwo.value.pagination).then((res) => {
-        proxy.downloadFile(res, "入库明细.xlsx");
+        proxy.downloadFile(res, "入库明细-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});

+ 2 - 1
src/views/subsidiary/warehouse/inventory/index.vue

@@ -54,6 +54,7 @@
 <script setup>
 import byTable from "/src/components/byTable/index";
 import { ElMessageBox } from "element-plus";
+import moment from "moment";
 
 const { proxy } = getCurrentInstance();
 const departmentList = ref([]);
@@ -312,7 +313,7 @@ const deriveExcel = () => {
   })
     .then(() => {
       proxy.getFile("/inventory/exportExcel", sourceList.value.pagination).then((res) => {
-        proxy.downloadFile(res, "库存.xlsx");
+        proxy.downloadFile(res, "库存-" + moment().format("yyyy-MM-DD") + ".xlsx");
       });
     })
     .catch(() => {});