zhongxiaoyu 1 жил өмнө
parent
commit
27592f4de0

+ 174 - 177
src/components/SimpleTable/index.vue

@@ -4,7 +4,6 @@
     v-bind="tableProps"
     v-el-table-infinite-scroll="scrollOver"
     :data="dealedTableData"
-    
   >
     <el-table-column
       v-if="sequence || customSequence"
@@ -33,14 +32,14 @@
           :filter-options="filterOptionMap[column.columnName]"
           :sortable="!!column.needSort"
           filter-style="arrow"
-          @update:changeValues="
-            (sortRule) => {
-              filterValuesChangeHandler(sortRule);
+          @update:filter-values="
+            filterValues => {
+              filterValuesChangeHandler(column.columnName, filterValues)
             }
           "
           @update:sort-rule="
-            (sortRule) => {
-              sortRuleChangeHandler(column.columnName, sortRule);
+            sortRule => {
+              sortRuleChangeHandler(column.columnName, sortRule)
             }
           "
         />
@@ -53,126 +52,126 @@
 </template>
 
 <script setup lang="ts">
-import TableHeaderCell from "@/components/TableHeaderCell/index.vue";
-import type { CSSProperties, VNode } from "vue";
-import { TableColumnCtx } from "element-plus/es/components/table/src/table-column/defaults";
-import { CommonData, CommonTableColumn } from "~/common";
-import { Options, useTableFilterAndSort } from "@/hooks/useTableFilterAndSort";
-import { ElTable } from "element-plus";
-import { useTableSettingsStore } from "@/store/tableSettings";
+import TableHeaderCell from '@/components/TableHeaderCell/index.vue'
+import type { CSSProperties, VNode } from 'vue'
+import { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'
+import { CommonData, CommonTableColumn } from '~/common'
+import { Options, useTableFilterAndSort } from '@/hooks/useTableFilterAndSort'
+import { ElTable } from 'element-plus'
+import { useTableSettingsStore } from '@/store/tableSettings'
 
 type SummaryMethod<T> = (data: {
-  columns: TableColumnCtx<T>[];
-  data: T[];
-}) => string[];
-type ColumnCls<T> = string | ((data: { row: T; rowIndex: number }) => string);
+  columns: TableColumnCtx<T>[]
+  data: T[]
+}) => string[]
+type ColumnCls<T> = string | ((data: { row: T; rowIndex: number }) => string)
 type ColumnStyle<T> =
   | CSSProperties
-  | ((data: { row: T; rowIndex: number }) => CSSProperties);
+  | ((data: { row: T; rowIndex: number }) => CSSProperties)
 type CellCls<T> =
   | string
   | ((data: {
-      row: T;
-      rowIndex: number;
-      column: TableColumnCtx<T>;
-      columnIndex: number;
-    }) => string);
+      row: T
+      rowIndex: number
+      column: TableColumnCtx<T>
+      columnIndex: number
+    }) => string)
 type CellStyle<T> =
   | CSSProperties
   | ((data: {
-      row: T;
-      rowIndex: number;
-      column: TableColumnCtx<T>;
-      columnIndex: number;
-    }) => CSSProperties);
+      row: T
+      rowIndex: number
+      column: TableColumnCtx<T>
+      columnIndex: number
+    }) => CSSProperties)
 type Sort = {
-  prop: string;
-  order: "ascending" | "descending";
-  init?: any;
-  silent?: any;
-};
+  prop: string
+  order: 'ascending' | 'descending'
+  init?: any
+  silent?: any
+}
 type TreeNode = {
-  expanded?: boolean;
-  loading?: boolean;
-  noLazyChildren?: boolean;
-  indent?: number;
-  level?: number;
-  display?: boolean;
-};
-type Layout = "fixed" | "auto";
+  expanded?: boolean
+  loading?: boolean
+  noLazyChildren?: boolean
+  indent?: number
+  level?: number
+  display?: boolean
+}
+type Layout = 'fixed' | 'auto'
 type TableColumnProps<T> = {
-  type?: string;
-  index?: number | ((index: number) => number);
-  columnKey?: string;
-  width?: string | number;
-  minWidth?: string | number;
-  fixed?: boolean | string;
-  renderHeader?: (data: { column: TableColumnCtx<T>; $index: number }) => VNode;
-  resizable?: boolean;
+  type?: string
+  index?: number | ((index: number) => number)
+  columnKey?: string
+  width?: string | number
+  minWidth?: string | number
+  fixed?: boolean | string
+  renderHeader?: (data: { column: TableColumnCtx<T>; $index: number }) => VNode
+  resizable?: boolean
   formatter?: (
     row: T,
     column: TableColumnCtx<T>,
     cellValue: any,
     index: number
-  ) => VNode | string;
-  showOverflowTooltip?: boolean;
-  align?: string;
-  headerAlign?: string;
-  className?: string;
-  labelClassName?: string;
-  selectable?: (row: T, index: number) => boolean;
-  reserveSelection?: boolean;
-};
+  ) => VNode | string
+  showOverflowTooltip?: boolean
+  align?: string
+  headerAlign?: string
+  className?: string
+  labelClassName?: string
+  selectable?: (row: T, index: number) => boolean
+  reserveSelection?: boolean
+}
 
 const props = withDefaults(
   defineProps<{
-    data: CommonData[];
-    size?: string;
-    width?: string | number;
-    height?: string | number;
-    maxHeight?: string | number;
-    fit?: boolean;
-    stripe?: boolean;
-    border?: boolean;
-    rowKey?: string | ((row: CommonData) => string);
-    showHeader?: boolean;
-    showSummary?: boolean;
-    sumText?: string;
-    summaryMethod?: SummaryMethod<CommonData>;
-    rowClassName?: ColumnCls<CommonData>;
-    rowStyle?: ColumnStyle<CommonData>;
-    cellClassName?: CellCls<CommonData>;
-    cellStyle?: CellStyle<CommonData>;
-    headerRowClassName?: ColumnCls<CommonData>;
-    headerRowStyle?: ColumnStyle<CommonData>;
-    headerCellClassName?: CellCls<CommonData>;
-    headerCellStyle?: CellStyle<CommonData>;
-    highlightCurrentRow?: boolean;
-    currentRowKey?: string | number;
-    emptyText?: string;
-    expandRowKeys?: any[];
-    defaultExpandAll?: boolean;
-    defaultSort?: Sort;
-    tooltipEffect?: string;
+    data: CommonData[]
+    size?: string
+    width?: string | number
+    height?: string | number
+    maxHeight?: string | number
+    fit?: boolean
+    stripe?: boolean
+    border?: boolean
+    rowKey?: string | ((row: CommonData) => string)
+    showHeader?: boolean
+    showSummary?: boolean
+    sumText?: string
+    summaryMethod?: SummaryMethod<CommonData>
+    rowClassName?: ColumnCls<CommonData>
+    rowStyle?: ColumnStyle<CommonData>
+    cellClassName?: CellCls<CommonData>
+    cellStyle?: CellStyle<CommonData>
+    headerRowClassName?: ColumnCls<CommonData>
+    headerRowStyle?: ColumnStyle<CommonData>
+    headerCellClassName?: CellCls<CommonData>
+    headerCellStyle?: CellStyle<CommonData>
+    highlightCurrentRow?: boolean
+    currentRowKey?: string | number
+    emptyText?: string
+    expandRowKeys?: any[]
+    defaultExpandAll?: boolean
+    defaultSort?: Sort
+    tooltipEffect?: string
     spanMethod?: (data: {
-      row: CommonData;
-      rowIndex: number;
-      column: TableColumnCtx<CommonData>;
-      columnIndex: number;
+      row: CommonData
+      rowIndex: number
+      column: TableColumnCtx<CommonData>
+      columnIndex: number
     }) =>
       | number[]
       | {
-          rowspan: number;
-          colspan: number;
+          rowspan: number
+          colspan: number
         }
-      | undefined;
-    selectOnIndeterminate?: boolean;
-    indent?: number;
+      | undefined
+    selectOnIndeterminate?: boolean
+    indent?: number
     treeProps?: {
-      hasChildren?: string;
-      children?: string;
-    };
-    lazy?: boolean;
+      hasChildren?: string
+      children?: string
+    }
+    lazy?: boolean
     load?: (
       row: CommonData,
       treeNode: TreeNode,
@@ -193,86 +192,86 @@ const props = withDefaults(
     labelFormatter?: (label: string) => string
   }>(),
   {
-    size: "default",
-    height: "100%",
-    maxHeight: "100%",
+    size: 'default',
+    height: '100%',
+    maxHeight: '100%',
     stripe: true,
     border: true,
     fit: true,
     showHeader: true,
     labelFormatter: (label: string) => label,
   }
-);
+)
 
 const defaultSummaryMethod: SummaryMethod<CommonData> = ({ columns, data }) => {
-  const sums: string[] = [];
+  const sums: string[] = []
   columns.forEach((column, index) => {
     const countColumn = tableColumns.value.find(
-      (col) => column.property === col.columnName && col.needCount
-    );
+      col => column.property === col.columnName && col.needCount
+    )
     if (countColumn) {
       const sumNumber = data.reduce((prev: number, curr: CommonData) => {
-        const cellData = curr[column.property];
-        if (countColumn.countMode === "all") {
-          return prev + 1;
+        const cellData = curr[column.property]
+        if (countColumn.countMode === 'all') {
+          return prev + 1
         }
-        if (countColumn.countMode === "notNull") {
-          return cellData ? prev + 1 : prev;
+        if (countColumn.countMode === 'notNull') {
+          return cellData ? prev + 1 : prev
         }
-        const value = Number(cellData);
+        const value = Number(cellData)
         if (!Number.isNaN(value)) {
-          prev += value;
+          prev += value
         }
-        return prev;
-      }, 0);
-      sums[index] = sumNumber.toString();
+        return prev
+      }, 0)
+      sums[index] = sumNumber.toString()
     }
-  });
-  sums[0] = "合计:" + (sums[0] ?? "");
-  return sums;
-};
+  })
+  sums[0] = '合计:' + (sums[0] ?? '')
+  return sums
+}
 
 const tableProps = computed(() => {
-  const rawProps = toRaw(props);
-  const result: { [x: string]: any } = {};
+  const rawProps = toRaw(props)
+  const result: { [x: string]: any } = {}
   Object.entries(rawProps).forEach(([key, value]) => {
     if (
       ![
-        "columnProps",
-        "columns",
-        "sequence",
-        "customSequence",
-        "filterSortOptions",
-        "cacheKeys",
-        "labelFormatter",
+        'columnProps',
+        'columns',
+        'sequence',
+        'customSequence',
+        'filterSortOptions',
+        'cacheKeys',
+        'labelFormatter',
       ].includes(key) &&
-      (value ?? "") !== ""
+      (value ?? '') !== ''
     ) {
-      result[key] = value;
+      result[key] = value
     }
-    if (props.columns.some((column) => column.needCount)) {
-      result.showSummary = true;
+    if (props.columns.some(column => column.needCount)) {
+      result.showSummary = true
     }
     if (!result.summaryMethod) {
-      result.summaryMethod = defaultSummaryMethod;
+      result.summaryMethod = defaultSummaryMethod
     }
-  });
-  return result;
-});
+  })
+  return result
+})
 
 const computedColumnProps = computed(() => {
   const defaultColumnProps: TableColumnProps<CommonData> = {
-    align: "center",
-  };
+    align: 'center',
+  }
   return (column: CommonTableColumn & TableColumnProps<CommonData>) => ({
     ...defaultColumnProps,
     ...props.columnProps,
     ...column,
-  });
-});
+  })
+})
 
-const tableColumns = ref<CommonTableColumn[]>([]);
-const tableData = ref<CommonData[]>([]);
+const tableColumns = ref<CommonTableColumn[]>([])
+const tableData = ref<CommonData[]>([])
 watchEffect(() => {
   tableColumns.value = props.columns.reduce(
     (prevColumns: CommonTableColumn[], column) => {
@@ -281,18 +280,18 @@ watchEffect(() => {
           label: column.columnLabel,
           prop: column.columnName,
           ...column,
-        });
+        })
       }
-      return prevColumns;
+      return prevColumns
     },
     []
-  );
-  tableData.value = props.data;
-});
+  )
+  tableData.value = props.data
+})
 
 const hasFixedColumn = computed(() =>
-  tableColumns.value.some((column) => column.fixed)
-);
+  tableColumns.value.some(column => column.fixed)
+)
 
 const {
   filterOptionMap,
@@ -300,51 +299,49 @@ const {
   sortRuleMap,
   dealedTableData,
   sortChangeHandler,
-} = useTableFilterAndSort(tableColumns, tableData, props.filterSortOptions);
+} = useTableFilterAndSort(tableColumns, tableData, props.filterSortOptions)
 
-const { saveTableFilterValues } = useTableSettingsStore();
+const { saveTableFilterValues } = useTableSettingsStore()
 
 watch(
   sortRuleMap,
-  (map) => {
-    emit("sortRuleChange", map);
+  map => {
+    emit('sortRuleChange', map)
   },
   { deep: true }
-);
+)
 
 const sortRuleChangeHandler = (columnName: string, sortRule: string) => {
-  sortRuleMap[columnName] = sortRule;
-  sortChangeHandler(columnName, sortRule);
-};
+  sortRuleMap[columnName] = sortRule
+  sortChangeHandler(columnName, sortRule)
+}
 
-const filterValuesChangeHandler = (sortRule: string[]) => {
-  emit("filterChange", sortRule);
-};
+const filterValuesChangeHandler = (columnName: string, filterValues: string[]) => {
+  filterValueMap[columnName] = filterValues
+  emit('filterChange', filterValues)
+}
 
 if (props.cacheKeys?.length) {
-  watch(filterValueMap, (map) => {
-    const values: { [x: string]: string[] } = {};
-    props.cacheKeys!.forEach((columnName) => {
-      values[columnName] = map[columnName];
-    });
-    saveTableFilterValues(values);
-  });
+  watch(filterValueMap, map => {
+    const values: { [x: string]: string[] } = {}
+    props.cacheKeys!.forEach(columnName => {
+      values[columnName] = map[columnName]
+    })
+    saveTableFilterValues(values)
+  })
 }
 
 // 组件的inheritAttrs属性默认为true,此时组件上的属性(包括v-on)会被添加到根元素上
-const emit = defineEmits([
-  'sortRuleChange',
-  'scrollOver',
-])
+const emit = defineEmits(['filterChange', 'sortRuleChange', 'scrollOver'])
 
 const scrollOver = () => {
-  emit("scrollOver");
-};
+  emit('scrollOver')
+}
 
-const table = ref<InstanceType<typeof ElTable> | null>(null);
+const table = ref<InstanceType<typeof ElTable> | null>(null)
 defineExpose({
   table,
-});
+})
 </script>
 
 <style scoped lang="scss">
@@ -355,7 +352,7 @@ defineExpose({
     &.cell-filter {
       position: relative;
       &::before {
-        content: "";
+        content: '';
         position: absolute;
         width: 100%;
         height: 100%;

+ 10 - 14
src/components/TableHeaderCell/index.vue

@@ -17,12 +17,12 @@
             :class="['filter-button', { 'filter-button-active': active }]"
             ref="buttonRef"
             v-click-outside="clickOutsideHandler"
-            >{{ `${showDesc ? "*" : ""}${label}` }}</span
+            >{{ `${showDesc ? '*' : ''}${label}` }}</span
           >
         </span>
       </template>
       <template v-else>
-        <span style="flex: 1">{{ `${showDesc ? "*" : ""}${label}` }}</span>
+        <span style="flex: 1">{{ `${showDesc ? '*' : ''}${label}` }}</span>
       </template>
       <div
         v-if="(filterable && filterStyle === 'arrow') || sortable"
@@ -62,12 +62,12 @@
         placement="bottom"
         @show="
           () => {
-            expand = true;
+            expand = true
           }
         "
         @hide="
           () => {
-            expand = false;
+            expand = false
           }
         "
       >
@@ -136,7 +136,7 @@ const props = defineProps({
   },
 })
 
-const emit = defineEmits(['update:filterValues', 'update:sortRule','update:changeValues'])
+const emit = defineEmits(['update:filterValues', 'update:sortRule'])
 
 const selections = ref<string[]>([])
 const groupedOptions = computed(() => {
@@ -166,12 +166,12 @@ const active = computed(() => !!props.filterValues?.length)
 const filterable = computed(() => !!props.filterOptions)
 watchEffect(() => {
   if (props.filterValues) {
-    selections.value = props.filterValues
+    selections.value = _.cloneDeep(props.filterValues)
   }
 })
-watchEffect(() => {
+const selectionChange = () => {
   emit('update:filterValues', selections.value)
-})
+}
 const selectAll = () => {
   selections.value.push(...props.filterOptions!.reduce((pre: string[], { value }) => {
     if (!selections.value.includes(value)) {
@@ -204,10 +204,6 @@ const sortChange = () => {
         : ''
   emit('update:sortRule', sortRule)
 }
-
-const selectionChange = (val:string[]) =>{
-  emit('update:changeValues', val)
-}
 </script>
 
 <style lang="scss" scoped>
@@ -232,7 +228,7 @@ const selectionChange = (val:string[]) =>{
       position: relative;
 
       &::after {
-        content: "";
+        content: '';
         display: block;
         width: calc(100% + 4px);
         position: absolute;
@@ -264,7 +260,7 @@ const selectionChange = (val:string[]) =>{
     position: relative;
 
     &::after {
-      content: "";
+      content: '';
       display: block;
       width: 100%;
       height: 100%;

+ 6 - 2
src/views/dataQuery/components/DataQueryView/index.vue

@@ -388,13 +388,17 @@ const flightStateMap = {
   DLY: '延误',
 }
 const flightTypeMap = ['货机', '客机', '其他']
+const DITypeMap = {
+  DOM: '国内',
+  INT: '国际'
+}
 const formatter: CommonTableFormatter = (row, column, cellValue, index) => {
   const value = String(cellValue ?? '').trim()
   if (column.property.includes('Time')) {
     return value.replace(/[T|\s]+/, '\n')
   }
   if (column.property === 'DIType' && value) {
-    return value === 'DOM' ? '国内' : '国际'
+    return DITypeMap[value] ?? value
   }
   if (column.property === 'flightState') {
     return value ? flightStateMap[value] ?? '正常' : '正常'
@@ -438,7 +442,7 @@ const cellClickHandler = (row, column, cell, event) => {
             return
           }
           if (!['INT', 'DOM'].includes(row.DIType)) {
-            ElMessage.error('航班类型无法识别!')
+            ElMessage.error('国内/国际无法识别!')
             return
           }
           const viewName = `${row.DIType === 'DOM' ? '' : 'International'}${

+ 12 - 9
src/views/statisticalanalysis/components/echart/tableforms.vue

@@ -1272,10 +1272,6 @@ export default {
       type: Number,
       default: "",
     },
-    totalNum: {
-      type: Number,
-      default: 0,
-    },
   },
   data() {
     return {
@@ -1321,6 +1317,7 @@ export default {
           columnLabel: "代理人",
           needFilters: 1,
           needSort: 1,
+          width: 240,
         },
         {
           columnName: "codeNum",
@@ -1423,6 +1420,7 @@ export default {
       ],
       tableData: [],
       listNewall: {
+        channelall: 0,
         piclvall: 0,
         acclvall: 0,
         readlvall: 0,
@@ -1472,10 +1470,7 @@ export default {
       columns.forEach((column, index) => {
         if (index === 0) {
           sums[index] = "合计";
-          if (this.totalNum) {
-            sums[index] += `:${this.totalNum}`;
-          }
-          // return;
+          return;
         }
         const values = data.map((item) => Number(item[column.property]));
         if (
@@ -1487,6 +1482,7 @@ export default {
             "line",
             "cargoCompany",
             "dat",
+            "ChannelId",
           ].includes(column.property)
         ) {
           sums[index] = values.reduce((prev, curr) => {
@@ -1507,6 +1503,7 @@ export default {
         ) {
           if (this.capLen) {
             if (this.action === 12) {
+              sums[2] = this.listNewall.channelall
               sums[3] = this.listNewall.codeNumall;
               sums[4] = this.listNewall.reCodeNumall;
               sums[5] = this.listNewall.accNumall;
@@ -1517,6 +1514,7 @@ export default {
               sums[10] = this.listNewall.readlvall;
               sums[11] = this.listNewall.oklvall;
             } else if (this.action === 13) {
+              sums[2] = this.listNewall.channelall
               sums[3] = this.listNewall.codeNumall;
               sums[4] = this.listNewall.reCodeNumall;
               sums[5] = this.listNewall.accNumall;
@@ -1529,6 +1527,7 @@ export default {
             }
           } else {
             if (this.action === 12) {
+              sums[2] = this.listall.channelall
               sums[3] = this.listall.codeNumall;
               sums[4] = this.listall.reCodeNumall;
               sums[5] = this.listall.accNumall;
@@ -1539,6 +1538,7 @@ export default {
               sums[10] = this.listall.readlvall;
               sums[11] = this.listall.oklvall;
             } else if (this.action === 13) {
+              sums[2] = this.listall.channelall
               sums[3] = this.listall.codeNumall;
               sums[4] = this.listall.reCodeNumall;
               sums[5] = this.listall.accNumall;
@@ -1557,6 +1557,8 @@ export default {
         } else if (this.action === 14) {
           sums[4] = this.listall.alllist;
           sums[5] = this.listall.allwei;
+        } else if (this.action === 4) {
+          sums[2] = this.listall.alllist
         }
       });
       return sums;
@@ -1582,12 +1584,12 @@ export default {
             arr.some((c) => item.cargoCompany == c)
         );
       }
+      this.capLen = res.length;
       if (res.length) {
         res.forEach((item, index) => {
           item.indexs = index + 1;
         });
         this.tableData = res;
-        this.capLen = res.length;
       } else {
         this.tableList.forEach((item, index) => {
           item.indexs = index + 1;
@@ -1600,6 +1602,7 @@ export default {
       const returnData = {
         listValues: [...arr],
       };
+      this.listNewall.channelall = returnData.listValues.length;
       for (let i = 0; i < returnData.listValues.length; i++) {
         this.listNewall.reCodeNumall =
           this.listNewall.reCodeNumall + returnData.listValues[i].reCodeNum;

+ 8 - 2
src/views/statisticalanalysis/deliverydetails/index.vue

@@ -246,10 +246,16 @@ export default {
         });
         const originalSummaryRow = Array.from(
           { length: this.listHeader.length },
-          (_, i) => i === 0 ? '合计' : i < this.listHeader.length - 1 ? '' : 0
+          (_, i) => (i === 0 ? '合计' : i < this.listHeader.length - 2 ? '' : 0)
         )
         const summaryRow = data.reduce((prev, curr) => {
-          return prev.map((v, i) => i < this.listHeader.length - 1 ? v : v + (curr[i] ?? 0))
+          return prev.map((v, i) =>
+            i === this.listHeader.length - 1
+              ? v + (curr[i] ?? 0)
+              : i === this.listHeader.length - 2
+              ? v + 1
+              : v
+          )
         }, originalSummaryRow)
         data.push(summaryRow)
         // 调用我们封装好的方法进行导出Excel

+ 20 - 3
src/views/statisticalanalysis/gantryframe/index.vue

@@ -59,7 +59,7 @@ export default {
       currentPage: 1,
       pagesize: 10,
       total: 0,
-      changing: "12",
+      changing: 12,
       asShow: false,
       optiondata: [],
       picShow: true, //图片表格切换
@@ -113,6 +113,7 @@ export default {
         },
       ],
       listall: {
+        channelall: 0,
         piclvall: 0,
         acclvall: 0,
         readlvall: 0,
@@ -146,6 +147,7 @@ export default {
     },
     getFormData(data) {
       const ppsName = data.pps == 1 ? "基于通道" : "基于代理人";
+      this.listall.channelall = 0
       this.listall.piclvall = 0;
       this.listall.acclvall = 0;
       this.listall.readlvall = 0;
@@ -190,7 +192,7 @@ export default {
             "序号",
             "日期",
             "代理人",
-            "通道",
+            // "通道",
             "龙门架扫码数",
             "龙门架扫码重复条码数",
             "加货条码数量",
@@ -225,6 +227,7 @@ export default {
           this.tableList = JSON.parse(JSON.stringify(returnData.listValues));
           this.tableListcop = JSON.parse(JSON.stringify(returnData.listValues));
           this.total = this.tableList.length;
+          this.listall.channelall = returnData.listValues.length;
           // for (let i = 0; i < 9; i++) {
           //   if (!this.tableList[i]) {
           //     this.tableList.push({});
@@ -394,7 +397,7 @@ export default {
               item.indexs,
               item.dat,
               item.cargoCompany,
-              item.ChannelId,
+              // item.ChannelId,
               item.codeNum,
               item.reCodeNum,
               item.accNum,
@@ -407,6 +410,20 @@ export default {
             ];
           }
         });
+        data.push([
+          '合计',
+          '',
+          this.listall.channelall,
+          this.listall.codeNumall,
+          this.listall.reCodeNumall,
+          this.listall.accNumall,
+          this.listall.reAccNumall,
+          this.listall.pcsall,
+          this.listall.piclvall,
+          this.listall.acclvall,
+          this.listall.readlvall,
+          this.listall.oklvall,
+        ])
         // 调用我们封装好的方法进行导出Excel
         excel.export_json_to_excel({
           // 导出的头部

+ 28 - 25
src/views/statisticalanalysis/pickingstatistics/index.vue

@@ -24,11 +24,11 @@
         v-if="picShow == true ? true : false"
       />
       <Tableformbrs
+        v-if="!picShow"
         :tableList="tableList"
         :action="action"
-        v-if="!picShow"
         :set="set"
-        :total-num="totalNum"
+        :listall="listall"
       />
     </div>
   </div>
@@ -57,6 +57,10 @@ export default {
       tableListcop: [],
       listname: "",
       listHeader: [],
+      listall: {
+        alllist: "",
+        allwei: 0,
+      },
       tableData: {
         time: [],
         data1: [],
@@ -154,7 +158,6 @@ export default {
           options: [],
         },
       ],
-      totalNum: 0
     };
   },
   mounted() {
@@ -223,7 +226,7 @@ export default {
           this.tableData.time = [];
           this.tableData.data1 = [];
           this.tableData.data2 = [];
-          this.totalNum = returnData.listValues.length
+          this.listall.alllist = returnData.listValues.length
           this.tableList = JSON.parse(JSON.stringify(returnData.listValues));
           this.tableListcop = JSON.parse(JSON.stringify(returnData.listValues));
           this.tableList.forEach((item, index) => {
@@ -301,28 +304,28 @@ export default {
          * 源数据导入到excel的数据每一条重新拼成一个数组,数组里的每个元素就是filterVal里的每个字段
          */
         const data = this.tableListcop.map((item, index) => {
-          if (this.picShow == true) {
-            return [
-              item.indexs,
-              item.dat,
-              item.pullFlightNum,
-              item.flightChain,
-              item.pullWeight,
-              item.weightChain,
-            ];
-          } else {
-            return [
-              item.indexs,
-              item.flightdate,
-              item.flightNo,
-              item.line,
-              item.stand,
-              item.totalWeight,
-              item.pullWeight,
-            ];
-          }
+          return this.picShow
+            ? [
+                item.indexs,
+                item.dat,
+                item.pullFlightNum,
+                item.flightChain,
+                item.pullWeight,
+                item.weightChain,
+              ]
+            : [
+                item.indexs,
+                item.flightdate,
+                item.flightNo,
+                item.line,
+                item.stand,
+                item.totalWeight,
+                item.pullWeight,
+              ]
         });
-        data[data.length - 1].indexs = "总计";
+        if (!this.picShow) {
+          data[data.length - 1][2] = data.length - 1
+        }
         // 调用我们封装好的方法进行导出Excel
         excel.export_json_to_excel({
           // 导出的头部

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

@@ -353,10 +353,16 @@ export default {
         });
         const originalSummaryRow = Array.from(
           { length: this.listHeader.length },
-          (_, i) => i === 0 ? '合计' : i < this.listHeader.length - 1 ? '' : 0
+          (_, i) => (i === 0 ? '合计' : i < this.listHeader.length - 2 ? '' : 0)
         )
         const summaryRow = data.reduce((prev, curr) => {
-          return prev.map((v, i) => i < this.listHeader.length - 1 ? v : v + (curr[i] ?? 0))
+          return prev.map((v, i) =>
+            i === this.listHeader.length - 1
+              ? v + (curr[i] ?? 0)
+              : i === this.listHeader.length - 2
+              ? v + 1
+              : v
+          )
         }, originalSummaryRow)
         data.push(summaryRow)
         // 调用我们封装好的方法进行导出Excel