chenrui  2 tahun lalu
induk
melakukan
a8670681c1

+ 19 - 1
src/views/statisticsCharts/components/tableformbrs.vue

@@ -9,7 +9,7 @@
       class="data-table-content"
     >
       <template v-if="tableData.length">
-        <el-table :data="tableData" style="width: 100%">
+        <el-table :data="tableData" style="width: 100%" ref="userTableData">
           <el-table-column label="PEK国航行李BRS扫描数据统计表">
             <el-table-column prop="A" label="航站"> </el-table-column>
             <el-table-column label="出港航班量">
@@ -41,6 +41,10 @@
 <script>
 import NoData from "@/components/nodata";
 import { Query } from "@/api/dataIntegration";
+import * as XLSX from "xlsx";
+import FileSaver from "file-saver";
+import { number } from "echarts";
+import { throttledExportToExcel } from "@/utils/table";
 export default {
   props: {
     //接口ID
@@ -48,6 +52,9 @@ export default {
       type: [String, Number],
       default: "",
     },
+    isloadings: {
+      type: Number,
+    },
     dataContent: {
       type: Array,
       default: () => [],
@@ -85,6 +92,11 @@ export default {
       },
       deep: true,
     },
+    isloadings: {
+      handler(val) {
+        this.downFile();
+      },
+    },
   },
   computed: {
     dataTableContentStyle() {
@@ -142,6 +154,12 @@ export default {
         console.log(error);
       }
     },
+    downFile() {
+      let tableName = "PEK国航行李BRS扫描数据统计表";
+      const table = this.$refs["userTableData"].$el.cloneNode(true);
+      const fileName = `${tableName}.xlsx`;
+      throttledExportToExcel(table, tableName, fileName);
+    },
   },
 };
 </script>

+ 20 - 0
src/views/statisticsCharts/components/tableformcp.vue

@@ -10,6 +10,7 @@
     >
       <template v-if="tableData.length">
         <el-table
+          ref="userTableDatas"
           :data="tableData"
           style="width: 100%"
           :show-summary="true"
@@ -80,7 +81,13 @@
 </template>
 <script>
 import NoData from "@/components/nodata";
+import { throttledExportToExcel } from "@/utils/table";
 export default {
+  props: {
+    isloadings: {
+      type: Number,
+    },
+  },
   data() {
     return {
       loading: false,
@@ -389,6 +396,13 @@ export default {
       ],
     };
   },
+  watch: {
+    isloadings: {
+      handler(val) {
+        this.downFile();
+      },
+    },
+  },
   components: {
     NoData,
   },
@@ -494,6 +508,12 @@ export default {
       // },
       return arr;
     },
+    downFile() {
+      let tableName = "中转专项报表";
+      const table = this.$refs["userTableDatas"].$el.cloneNode(true);
+      const fileName = `${tableName}.xlsx`;
+      throttledExportToExcel(table, tableName, fileName);
+    },
   },
 };
 </script>

+ 22 - 1
src/views/statisticsCharts/components/tableforms.vue

@@ -9,7 +9,7 @@
       class="data-table-content"
     >
       <template v-if="tableData.length">
-        <el-table :data="tableData" style="width: 100%">
+        <el-table :data="tableData" style="width: 100%" ref="userTableDatasr">
           <el-table-column prop="date" label="时间"> </el-table-column>
           <el-table-column label="行李平均运输时间">
             <el-table-column
@@ -55,7 +55,13 @@
 </template>
 <script>
 import NoData from "@/components/nodata";
+import { throttledExportToExcel } from "@/utils/table";
 export default {
+  props: {
+    isloadings: {
+      type: Number,
+    },
+  },
   data() {
     return {
       loading: false,
@@ -108,6 +114,13 @@ export default {
   components: {
     NoData,
   },
+  watch: {
+    isloadings: {
+      handler(val) {
+        this.downFile();
+      },
+    },
+  },
   computed: {
     dataTableContentStyle() {
       const style = {};
@@ -120,6 +133,14 @@ export default {
       return style;
     },
   },
+  methods: {
+    downFile() {
+      let tableName = "运送效率报表";
+      const table = this.$refs["userTableDatasr"].$el.cloneNode(true);
+      const fileName = `${tableName}.xlsx`;
+      throttledExportToExcel(table, tableName, fileName);
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>

+ 8 - 1
src/views/statisticsCharts/views/report/reportStatistics.vue

@@ -7,7 +7,7 @@
       :data="formData"
       with-setting
       :withSetting="false"
-      :withExport="false"
+      @export="exportup"
     />
     <Tableforms
       :rows="12"
@@ -15,6 +15,7 @@
       :min-height="70"
       width="800px"
       tableHeight="750"
+      :isloadings="isloadings"
     />
   </div>
 </template>
@@ -29,6 +30,7 @@ export default {
         airport: "",
         dateTime: "",
       },
+      isloadings: 1,
       formItems: [
         {
           prop: "airport",
@@ -56,6 +58,11 @@ export default {
     StatisticsHeader,
     Tableforms,
   },
+  methods: {
+    exportup() {
+      this.isloadings = this.isloadings += 1;
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>

+ 6 - 1
src/views/statisticsCharts/views/report/scanningStatistics.vue

@@ -7,11 +7,12 @@
       :data="formData"
       with-setting
       :withSetting="false"
-      :withExport="false"
       @getFormData="getFormData"
+      @export="exportup"
     />
     <Tableformbrs
       :data-id="dataId"
+      :isloadings="isloadings"
       :data-content="dataContent"
       :rows="12"
       label-width="140px"
@@ -80,6 +81,7 @@ export default {
       ],
       dataId: DATACONTENT_ID.stBrsId,
       dataContent: [],
+      isloadings: 1,
     };
   },
   components: {
@@ -96,6 +98,9 @@ export default {
         data.dateTime[1] ? data.dateTime[1] : ""
       );
     },
+    exportup() {
+      this.isloadings = this.isloadings += 1;
+    },
   },
 };
 </script>

+ 8 - 1
src/views/statisticsCharts/views/report/transitTable.vue

@@ -7,9 +7,10 @@
       :data="formData"
       with-setting
       :withSetting="false"
-      :withExport="false"
+      @export="exportup"
     />
     <Tableformcp
+      :isloadings="isloadings"
       :rows="12"
       label-width="140px"
       :min-height="70"
@@ -29,6 +30,7 @@ export default {
         airport: "",
         dateTime: "",
       },
+      isloadings: 1,
       formItems: [
         {
           prop: "airport",
@@ -56,6 +58,11 @@ export default {
     StatisticsHeader,
     Tableformcp,
   },
+  methods: {
+    exportup() {
+      this.isloadings = this.isloadings += 1;
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>