zhongxiaoyu 1 жил өмнө
parent
commit
ac14bb7b1c

+ 9 - 3
src/views/statisticalanalysis/cargoflight/index.vue

@@ -119,9 +119,8 @@ export default {
         {
           prop: "dateTime",
           inputType: "datePicker",
-          clearable: true,
           width: "240px",
-          options: [],
+          requiredWarning: '请先选择统计时间范围'
         },
       ],
     };
@@ -323,7 +322,14 @@ export default {
             item.landing_i,
           ];
         });
-        data[data.length - 1].indexs = "总计";
+        const originalSummaryRow = Array.from(
+          { length: this.listHeader.length },
+          (_, i) => i === 0 ? '合计' : i === 1 ? '' : 0
+        )
+        const summaryRow = data.reduce((prev, curr) => {
+          return prev.map((v, i) => i < 2 ? v : v + (curr[i] ?? 0))
+        }, originalSummaryRow)
+        data.push(summaryRow)
         // 调用我们封装好的方法进行导出Excel
         excel.export_json_to_excel({
           // 导出的头部

+ 10 - 2
src/views/statisticalanalysis/cargoperiod/index.vue

@@ -166,6 +166,7 @@ export default {
       this.listHeaders = [
         "序号",
         "日期",
+        "每日总计",
         "t0",
         "t1",
         "t2",
@@ -337,7 +338,6 @@ export default {
             item.landing_i,
           ];
         });
-        data[data.length - 1].indexs = "总计";
         // 调用我们封装好的方法进行导出Excel
         excel.export_json_to_excel({
           // 导出的头部
@@ -365,6 +365,7 @@ export default {
           return [
             item.indexs,
             item.dat,
+            item.alltxt,
             item.t0,
             item.t1,
             item.t2,
@@ -391,7 +392,14 @@ export default {
             item.t23,
           ];
         });
-        data[data.length - 1].indexs = "总计";
+        const originalSummaryRow = Array.from(
+          { length: this.listHeaders.length },
+          (_, i) => i === 0 ? '合计' : i === 1 ? '' : 0
+        )
+        const summaryRow = data.reduce((prev, curr) => {
+          return prev.map((v, i) => i < 2 ? v : v + (curr[i] ?? 0))
+        }, originalSummaryRow)
+        data.push(summaryRow)
         // 调用我们封装好的方法进行导出Excel
         excel.export_json_to_excel({
           // 导出的头部

+ 0 - 1
src/views/statisticalanalysis/components/echart/statisticsHeader.vue

@@ -292,7 +292,6 @@ export default {
         {
           prop: "dateTime",
           inputType: "datePicker",
-          clearable: true,
           width: "240px",
           requiredWarning: "请先选择统计时间范围",
         },

+ 18 - 8
src/views/statisticalanalysis/components/echart/tableforms.vue

@@ -1270,6 +1270,10 @@ export default {
       type: Number,
       default: "",
     },
+    totalNum: {
+      type: Number,
+      default: 0
+    }
   },
   data() {
     return {
@@ -1453,23 +1457,29 @@ export default {
       columns.forEach((column, index) => {
         if (index === 0) {
           sums[index] = "合计";
-          return;
+          if (this.totalNum) {
+            sums[index] += `:${this.totalNum}`
+          }
+          // return;
         }
         const values = data.map((item) => Number(item[column.property]));
         if (
-          column.property != "stand" &&
-          column.property != "flightdate" &&
-          column.property != "indexs" &&
-          column.property != "flightNo" &&
-          column.property != "line" &&
-          column.property != "cargoCompany"
+          ![
+            'stand',
+            'flightdate',
+            'indexs',
+            'flightNo',
+            'line',
+            'cargoCompany',
+            'dat',
+          ].includes(column.property)
         ) {
           sums[index] = values.reduce((prev, curr) => {
             const value = Number(curr);
             if (!isNaN(value)) {
               return prev + curr;
             } else {
-              return "";
+              return prev;
             }
           }, 0);
           sums[index];

+ 11 - 3
src/views/statisticalanalysis/deliverydetails/index.vue

@@ -161,7 +161,7 @@ export default {
       // this.getQuerys(option, null);
       this.listname =
         "拉货明细统计" + data.dateTime[0] + "--" + data.dateTime[1];
-      this.listHeader = ["序号", "日期", "航班号", "运单号"];
+      this.listHeader = ["序号", "日期", "航班号", "运单号", '重量'];
     },
     //获取表格数据
     async getQuery(data, dat) {
@@ -195,6 +195,7 @@ export default {
           //   }
           // }
           this.listall.alllist = this.tableList.length;
+          this.listall.allwei = 0
           for (let i = 0; i < this.tableList.length; i++) {
             this.listall.allwei += this.tableList[i].weight;
           }
@@ -241,9 +242,16 @@ export default {
          * 源数据导入到excel的数据每一条重新拼成一个数组,数组里的每个元素就是filterVal里的每个字段
          */
         const data = this.tableListcop.map((item, index) => {
-          return [item.indexs, item.flightDate, item.flightNO, item.stockCode];
+          return [item.indexs, item.flightDate, item.flightNO, item.stockCode, item.weight];
         });
-        data[data.length - 1].indexs = "总计";
+        const originalSummaryRow = Array.from(
+          { length: this.listHeader.length },
+          (_, i) => i === 0 ? '合计' : i < this.listHeader.length - 1 ? '' : 0
+        )
+        const summaryRow = data.reduce((prev, curr) => {
+          return prev.map((v, i) => i < this.listHeader.length - 1 ? v : v + (curr[i] ?? 0))
+        }, originalSummaryRow)
+        data.push(summaryRow)
         // 调用我们封装好的方法进行导出Excel
         excel.export_json_to_excel({
           // 导出的头部

+ 8 - 7
src/views/statisticalanalysis/domesticdeparture/index.vue

@@ -208,12 +208,6 @@ export default {
           this.tableListcop.forEach((item, index) => {
             item.indexs = index + 1;
           });
-          // let objar = {
-          //   indexs: "合计",
-          //   flightDate: returnData.listValues[0].totalPullFlightNum,
-          //   pullWeight: returnData.listValues[0].totalPullWeight,
-          // };
-          this.tableListcop.push(objar);
           returnData.listValues.forEach((element) => {
             this.tableData.data1 = [];
           });
@@ -267,7 +261,14 @@ export default {
             item.pullSureNum,
           ];
         });
-        data[data.length - 1].indexs = "总计";
+        const originalSummaryRow = Array.from(
+          { length: this.listHeader.length },
+          (_, i) => i === 0 ? '合计' : i === 1 ? '' : 0
+        )
+        const summaryRow = data.reduce((prev, curr) => {
+          return prev.map((v, i) => i < 2 ? v : v + (curr[i] ?? 0))
+        }, originalSummaryRow)
+        data.push(summaryRow)
         // 调用我们封装好的方法进行导出Excel
         excel.export_json_to_excel({
           // 导出的头部

+ 3 - 4
src/views/statisticalanalysis/flightvolume/index.vue

@@ -236,7 +236,7 @@ export default {
           });
           let objar = {
             indexs: "合计",
-            weight: returnData.listValues[0].totalWeight,
+            flightNum: returnData.listValues[0].totalFlightNum,
           };
           this.tableListcop.push(objar);
           returnData.listValues.forEach((element) => {
@@ -279,10 +279,9 @@ export default {
         /**
          * 源数据导入到excel的数据每一条重新拼成一个数组,数组里的每个元素就是filterVal里的每个字段
          */
-        const data = this.tableListcop.map((item, index) => {
-          return [item.indexs, item.dat, item.flightNum, item.weightChain];
+        const data = this.tableListcop.map((item, index, arr) => {
+          return [item.indexs, item.dat, item.flightNum, index < arr.length - 1 ? `${item.flightChain ?? 0}%` : ''];
         });
-        data[data.length - 1].indexs = "总计";
         // 调用我们封装好的方法进行导出Excel
         excel.export_json_to_excel({
           // 导出的头部

+ 0 - 1
src/views/statisticalanalysis/gantryframe/index.vue

@@ -399,7 +399,6 @@ export default {
             ];
           }
         });
-        data[data.length - 1].indexs = "总计";
         // 调用我们封装好的方法进行导出Excel
         excel.export_json_to_excel({
           // 导出的头部

+ 3 - 0
src/views/statisticalanalysis/pickingstatistics/index.vue

@@ -28,6 +28,7 @@
         :action="action"
         v-if="!picShow"
         :set="set"
+        :total-num="totalNum"
       />
     </div>
   </div>
@@ -153,6 +154,7 @@ export default {
           options: [],
         },
       ],
+      totalNum: 0
     };
   },
   mounted() {
@@ -221,6 +223,7 @@ export default {
           this.tableData.time = [];
           this.tableData.data1 = [];
           this.tableData.data2 = [];
+          this.totalNum = returnData.listValues.length
           this.tableList = JSON.parse(JSON.stringify(returnData.listValues));
           this.tableListcop = JSON.parse(JSON.stringify(returnData.listValues));
           this.tableList.forEach((item, index) => {

+ 12 - 2
src/views/statisticalanalysis/specialgoodsdelist/index.vue

@@ -260,11 +260,12 @@ export default {
       // this.getQuerys(option, null);
       this.listname =
         "特货明细统计" + data.dateTime[0] + "--" + data.dateTime[1];
-      this.listHeader = ["序号", "日期", "特货名称", "航班号", "运单号"];
+      this.listHeader = ["序号", "日期", "特货名称", "航班号", "运单号", '重量'];
     },
     //获取表格数据
     async getQuery(data, dat) {
       try {
+        
         const { code, returnData } = await Query({
           id: this.listqueryTemplateID,
           dataContent: data,
@@ -294,6 +295,7 @@ export default {
           //   }
           // }
           this.listall.alllist = this.tableList.length;
+          this.listall.allwei = 0
           for (let i = 0; i < this.tableList.length; i++) {
             this.listall.allwei += this.tableList[i].weight;
           }
@@ -346,9 +348,17 @@ export default {
             item.specialTypeName,
             item.flightNO,
             item.stockCode,
+            item.weight
           ];
         });
-        data[data.length - 1].indexs = "总计";
+        const originalSummaryRow = Array.from(
+          { length: this.listHeader.length },
+          (_, i) => i === 0 ? '合计' : i < this.listHeader.length - 1 ? '' : 0
+        )
+        const summaryRow = data.reduce((prev, curr) => {
+          return prev.map((v, i) => i < this.listHeader.length - 1 ? v : v + (curr[i] ?? 0))
+        }, originalSummaryRow)
+        data.push(summaryRow)
         // 调用我们封装好的方法进行导出Excel
         excel.export_json_to_excel({
           // 导出的头部