Jelajahi Sumber

feat(销售管理): 在物品清单表格中添加汇总行功能

liujt 3 bulan lalu
induk
melakukan
45fd880595

+ 15 - 1
src/BIZComponents/inventoryTable.vue

@@ -11,6 +11,8 @@
       @columns-change="handleColumnChange"
       :cache-key="cacheKeyUrl"
       :selection.sync="selection"
+      :show-summary="showSummary"
+      :summary-method="getSummaries"
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
@@ -999,6 +1001,7 @@
     getGoodsByCategoryId
   } from '@/api/goodsManage/index';
   import { parameterGetByCode } from '@/api/main/index.js';
+  import { getSummaries } from '@/utils/util.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -1149,6 +1152,10 @@
             unitIdKey: 'saleUnitId'
           };
         }
+      },
+      showSummary: {
+        type: Boolean,
+        default: false
       }
     },
     data() {
@@ -1209,7 +1216,7 @@
         // 基础列定义
         let baseColumns = [
           {
-            width: 45,
+            width: 65,
             type: 'index',
             columnKey: 'index',
             align: 'center',
@@ -1773,6 +1780,13 @@
       });
     },
     methods: {
+      getSummaries(param) {
+        return getSummaries(
+          param,
+          ['saleCount'],
+          ' '
+        );
+      },
       handleCountChange(row, index,weightType) {
         // 数量变化时,若为生产加工类型,触发含税小计计算
         if (this.quoteType === 2) {

+ 14 - 0
src/BIZComponents/inventoryTableDetails.vue

@@ -15,6 +15,8 @@
       @select-all="handleSelectionChange"
       :cache-key="cacheKeyUrl"
       @done="handleDone"
+      :show-summary="showSummary"
+      :summary-method="getSummaries"
     >
       <!-- 原有插槽 -->
       <template v-slot:technicalDrawings="scope">
@@ -130,6 +132,7 @@
   import tabMixins from '@/mixins/tableColumnsMixin';
   import { levelList, pricingWayList, quoteTypeOp } from '@/enum/dict.js';
   import { getInventoryTotalAPI } from '@/api/wms';
+  import { getSummaries } from '@/utils/util.js';
 
   const dayjs = require('dayjs');
 
@@ -229,6 +232,10 @@
       quoteType: {
         type: Number,
         default: 1
+      },
+      showSummary: {
+        type: Boolean,
+        default: false
       }
     },
     data() {
@@ -920,6 +927,13 @@
       this.requestDict('商品价格类型');
     },
     methods: {
+      getSummaries(param) {
+        return getSummaries(
+          param,
+          ['saleCount'],
+          ' '
+        );
+      },
       handleDone() {
         if (this.isSelected) {
           console.log('selectedIds~~~~~', this.selectedIds);

+ 1 - 0
src/views/saleManage/saleOrder/components/addDialogNew.vue

@@ -549,6 +549,7 @@
         :isBatchNo="isBatchNo == 1 && form.saleTypeName.includes('受托')"
         :isProductionRequirements="true"
         :isIncreaseTotalWeight="true"
+        :showSummary="true"
       ></inventoryTable>
       <headerTitle
         title="类型清单"

+ 1 - 0
src/views/saleManage/saleOrder/components/darwerComponents/saleOrderInfo.vue

@@ -316,6 +316,7 @@
       :isProductionRequirements="true"
       :isWms="true"
       :isIncreaseTotalWeight="true"
+      :showSummary="true"
     ></inventoryTabledetail>
     <headerTitle title="类型清单" v-if="form.needProduce == 4"></headerTitle>
     <typeList