zhaoke 1 anno fa
parent
commit
0b08947086

+ 18 - 0
src/views/statisticalanalysis/dataException/func/index.js

@@ -1,3 +1,4 @@
+
 export function setSortMsg (name) {
   const sortMap = {
     '国内出港': ['有预配载数据,无交接复核、机下交接、装机、关闭舱门数据', '有预配,1、有核单数据、无安检节点数据,2、机下交接数据、装机、关闭舱门(其中一项)、无交接复核数据', '有预配载,交接复核时间>机下交接', '有预配载,机下交接时间=装机完成时间'],
@@ -6,4 +7,21 @@ export function setSortMsg (name) {
     '国际进港': ['', '有理货数据,1、无卸机数据、2、无货站交接', '', '有理货数据,卸机完成时间=货站交接时间']
   }
   return sortMap[name]
+}
+
+export function setMapKeys (data, id, returnData, name) {
+  const catchMap = {
+    k1: _.assign(data[0], { fttp: id }),
+    k2: returnData
+  }
+  sessionStorage.setItem(name, JSON.stringify(catchMap))
+}
+
+export function getMapKeys (name) {
+  const catchMap = sessionStorage.getItem(name)
+  if (catchMap) {
+    const newCatchMap = JSON.parse(catchMap)
+    return newCatchMap
+  }
+  return {}
 }

+ 21 - 37
src/views/statisticalanalysis/dataException/views/dimension.vue

@@ -129,8 +129,17 @@ export default {
       tableSortMsg: []
     };
   },
-  mounted () {
-    // this.getQuery([]);
+  created () {
+    const catchMap = sessionStorage.getItem(this.$route.name)
+    if (catchMap) {
+      const { k1, k2, k3, k4 } = JSON.parse(catchMap)
+      this.formData = k1
+      this.formData.dateTime = [k1.fd1, k1.fd2]
+      this.tableList = k2
+      this.tableListcop = k2
+      this.tableSortMsg = setSortMsg(k3)
+      this.searchParams = k4
+    }
   },
   watch: {
     // 监听数据变化,重绘折线图
@@ -153,7 +162,6 @@ export default {
           fd2: data.dateTime[1]
         },
       ];
-      this.getQuery(data.fttp, option, null);
       let typeName = null
       switch (data.fttp) {
         case 52229:
@@ -178,16 +186,11 @@ export default {
         flighttype: data.flighttype,
         fd1: data.dateTime[0],
         fd2: data.dateTime[1]
-      },
-        this.listname =
-        "航班部门维度统计" + '-' +
-        typeName + '-' +
-        data.flighttype + '-' +
-        data.dateTime;
-      this.listHeader = ["序号", "时间", "航班(班)", "环比(%)"];
+      }
+      this.getQuery(data.fttp, option, typeName, this.searchParams);
     },
     //获取表格数据
-    async getQuery (id, data, dat) {
+    async getQuery (id, data, dat, params) {
       this.loading = true
       try {
         const { code, returnData } = await Query({
@@ -223,32 +226,13 @@ export default {
           this.tableList = copyDatas;
           this.tableListcop = copyDatas;
           this.loading = false
-          // returnData.listValues.forEach((element) => {
-          //   this.tableData.data2.push(
-          //     element.flightNum ? element.flightNum : 0
-          //   );
-          //   this.tableData.time.push(element.dat);
-          //   this.tableData.kg = "单位:班";
-          //   this.tableData.data1 = [];
-          // });
-          // this.tableData.data1.push(0);
-          // for (let index = 0; index < this.tableData.data2.length; index++) {
-          //   if (index > 0) {
-          //     const element =
-          //       (this.tableData.data2[index] -
-          //         this.tableData.data2[index - 1]) /
-          //       this.tableData.data2[index - 1];
-          //     this.tableData.data1.push(
-          //       element.toFixed(2) ? element.toFixed(2) : 0
-          //     );
-          //     this.tableData.data1.forEach((element) => {
-          //       element = Number(element);
-          //       if (typeof element !== "number") {
-          //         element = 0;
-          //       }
-          //     });
-          //   }
-          // }
+          const catchMap = {
+            k1: _.assign(data[0], { fttp: id }),
+            k2: copyDatas,
+            k3: dat,
+            k4: params
+          }
+          sessionStorage.setItem(this.$route.name, JSON.stringify(catchMap))
         } else {
           this.loading = false
           console.log(code)

+ 22 - 38
src/views/statisticalanalysis/dataException/views/dimensionWay.vue

@@ -44,7 +44,7 @@ export default {
       },
       loading: false,
       formData: {
-        flighttype: "",
+        flighttype: "全部",
         dateTime: "",
       },
       titleTop: "运单部门维度统计",
@@ -129,8 +129,17 @@ export default {
       tableSortMsg: []
     };
   },
-  mounted () {
-    // this.getQuery([]);
+  created () {
+    const catchMap = sessionStorage.getItem(this.$route.name)
+    if (catchMap) {
+      const { k1, k2, k3, k4 } = JSON.parse(catchMap)
+      this.formData = k1
+      this.formData.dateTime = [k1.fd1, k1.fd2]
+      this.tableList = k2
+      this.tableListcop = k2
+      this.tableSortMsg = setSortMsg(k3)
+      this.searchParams = k4
+    }
   },
   watch: {
     // 监听数据变化,重绘折线图
@@ -153,7 +162,6 @@ export default {
           fd2: data.dateTime[1]
         },
       ];
-      this.getQuery(data.fttp, option, null);
       let typeName = null
       switch (data.fttp) {
         case 52229:
@@ -178,16 +186,11 @@ export default {
         flighttype: data.flighttype,
         fd1: data.dateTime[0],
         fd2: data.dateTime[1]
-      },
-        this.listname =
-        "运单部门维度统计" + '-' +
-        typeName + '-' +
-        data.flighttype + '-' +
-        data.dateTime;
-      this.listHeader = ["序号", "时间", "航班(班)", "环比(%)"];
+      }
+      this.getQuery(data.fttp, option, typeName, this.searchParams);
     },
     //获取表格数据
-    async getQuery (id, data, dat) {
+    async getQuery (id, data, dat, params) {
       this.loading = true
       try {
         const { code, returnData } = await Query({
@@ -223,32 +226,13 @@ export default {
           this.tableList = copyDatas;
           this.tableListcop = copyDatas;
           this.loading = false
-          // returnData.listValues.forEach((element) => {
-          //   this.tableData.data2.push(
-          //     element.flightNum ? element.flightNum : 0
-          //   );
-          //   this.tableData.time.push(element.dat);
-          //   this.tableData.kg = "单位:班";
-          //   this.tableData.data1 = [];
-          // });
-          // this.tableData.data1.push(0);
-          // for (let index = 0; index < this.tableData.data2.length; index++) {
-          //   if (index > 0) {
-          //     const element =
-          //       (this.tableData.data2[index] -
-          //         this.tableData.data2[index - 1]) /
-          //       this.tableData.data2[index - 1];
-          //     this.tableData.data1.push(
-          //       element.toFixed(2) ? element.toFixed(2) : 0
-          //     );
-          //     this.tableData.data1.forEach((element) => {
-          //       element = Number(element);
-          //       if (typeof element !== "number") {
-          //         element = 0;
-          //       }
-          //     });
-          //   }
-          // }
+          const catchMap = {
+            k1: _.assign(data[0], { fttp: id }),
+            k2: copyDatas,
+            k3: dat,
+            k4: params
+          }
+          sessionStorage.setItem(this.$route.name, JSON.stringify(catchMap))
         } else {
           this.loading = false
           console.log(code)

+ 22 - 35
src/views/statisticalanalysis/dataException/views/flight.vue

@@ -129,6 +129,18 @@ export default {
       tableSortMsg: []
     };
   },
+  created () {
+    const catchMap = sessionStorage.getItem(this.$route.name)
+    if (catchMap) {
+      const { k1, k2, k3, k4 } = JSON.parse(catchMap)
+      this.formData = k1
+      this.formData.dateTime = [k1.fd1, k1.fd2]
+      this.tableList = k2
+      this.tableListcop = k2
+      this.tableSortMsg = setSortMsg(k3)
+      this.searchParams = k4
+    }
+  },
   methods: {
     getFormData (data) {
       this.tableData.time = [];
@@ -141,7 +153,6 @@ export default {
           fd2: data.dateTime[1]
         },
       ];
-      this.getQuery(data.fttp, option, null);
       let typeName = null
       switch (data.fttp) {
         case 52221:
@@ -166,16 +177,11 @@ export default {
         flighttype: data.flighttype,
         fd1: data.dateTime[0],
         fd2: data.dateTime[1]
-      },
-        this.listname =
-        "航班统计" + '-' +
-        typeName + '-' +
-        data.flighttype + '-' +
-        data.dateTime;
-      this.listHeader = ["序号", "时间", "航班(班)", "环比(%)"];
+      }
+      this.getQuery(data.fttp, option, typeName, this.searchParams);
     },
     //获取表格数据
-    async getQuery (id, data, dat) {
+    async getQuery (id, data, dat, params) {
       try {
         this.loading = true
         const { code, returnData } = await Query({
@@ -189,32 +195,13 @@ export default {
           this.tableList = _.cloneDeep(returnData);
           this.tableListcop = _.cloneDeep(returnData);
           this.loading = false
-          // returnData.listValues.forEach((element) => {
-          //   this.tableData.data2.push(
-          //     element.flightNum ? element.flightNum : 0
-          //   );
-          //   this.tableData.time.push(element.dat);
-          //   this.tableData.kg = "单位:班";
-          //   this.tableData.data1 = [];
-          // });
-          // this.tableData.data1.push(0);
-          // for (let index = 0; index < this.tableData.data2.length; index++) {
-          //   if (index > 0) {
-          //     const element =
-          //       (this.tableData.data2[index] -
-          //         this.tableData.data2[index - 1]) /
-          //       this.tableData.data2[index - 1];
-          //     this.tableData.data1.push(
-          //       element.toFixed(2) ? element.toFixed(2) : 0
-          //     );
-          //     this.tableData.data1.forEach((element) => {
-          //       element = Number(element);
-          //       if (typeof element !== "number") {
-          //         element = 0;
-          //       }
-          //     });
-          //   }
-          // }
+          const catchMap = {
+            k1: _.assign(data[0], { fttp: id }),
+            k2: returnData,
+            k3: dat,
+            k4: params
+          }
+          sessionStorage.setItem(this.$route.name, JSON.stringify(catchMap))
         } else {
           this.loading = false
           console.log(code)

+ 21 - 37
src/views/statisticalanalysis/dataException/views/waybill.vue

@@ -128,8 +128,17 @@ export default {
       tableSortMsg: []
     };
   },
-  mounted () {
-    // this.getQuery([]);
+  created () {
+    const catchMap = sessionStorage.getItem(this.$route.name)
+    if (catchMap) {
+      const { k1, k2, k3, k4 } = JSON.parse(catchMap)
+      this.formData = k1
+      this.formData.dateTime = [k1.fd1, k1.fd2]
+      this.tableList = k2
+      this.tableListcop = k2
+      this.tableSortMsg = setSortMsg(k3)
+      this.searchParams = k4
+    }
   },
   watch: {
     // 监听数据变化,重绘折线图
@@ -151,7 +160,6 @@ export default {
           fd2: data.dateTime[1]
         },
       ];
-      this.getQuery(data.fttp, option, null);
       let typeName = null
       switch (data.fttp) {
         case 52225:
@@ -176,16 +184,11 @@ export default {
         flighttype: data.flighttype,
         fd1: data.dateTime[0],
         fd2: data.dateTime[1]
-      },
-        this.listname =
-        "运单统计" + '-' +
-        typeName + '-' +
-        data.flighttype + '-' +
-        data.dateTime;
-      this.listHeader = ["序号", "时间", "航班(班)", "环比(%)"];
+      }
+      this.getQuery(data.fttp, option, typeName, this.searchParams);
     },
     //获取表格数据
-    async getQuery (id, data, dat) {
+    async getQuery (id, data, dat, params) {
       try {
         this.loading = true
         const { code, returnData } = await Query({
@@ -199,32 +202,13 @@ export default {
           this.tableList = _.cloneDeep(returnData);
           this.tableListcop = _.cloneDeep(returnData);
           this.loading = false
-          // returnData.listValues.forEach((element) => {
-          //   this.tableData.data2.push(
-          //     element.flightNum ? element.flightNum : 0
-          //   );
-          //   this.tableData.time.push(element.dat);
-          //   this.tableData.kg = "单位:班";
-          //   this.tableData.data1 = [];
-          // });
-          // this.tableData.data1.push(0);
-          // for (let index = 0; index < this.tableData.data2.length; index++) {
-          //   if (index > 0) {
-          //     const element =
-          //       (this.tableData.data2[index] -
-          //         this.tableData.data2[index - 1]) /
-          //       this.tableData.data2[index - 1];
-          //     this.tableData.data1.push(
-          //       element.toFixed(2) ? element.toFixed(2) : 0
-          //     );
-          //     this.tableData.data1.forEach((element) => {
-          //       element = Number(element);
-          //       if (typeof element !== "number") {
-          //         element = 0;
-          //       }
-          //     });
-          //   }
-          // }
+          const catchMap = {
+            k1: _.assign(data[0], { fttp: id }),
+            k2: returnData,
+            k3: dat,
+            k4: params
+          }
+          sessionStorage.setItem(this.$route.name, JSON.stringify(catchMap))
         } else {
           this.loading = false
           console.log(code)