Quellcode durchsuchen

Merge branch 'dev' into test

liujt vor 1 Woche
Ursprung
Commit
41ce537430

+ 11 - 1
src/BIZComponents/inventoryTable.vue

@@ -1,6 +1,16 @@
 <template>
   <el-form ref="form" :model="form" :rules="rules">
-    <ele-pro-table ref="table" :needPage="false" :columns="columns" :datasource="form.datasource" class="time-form" height="300" full-height="calc(100vh - 76px)" @columns-change="handleColumnChange" :cache-key="cacheKeyUrl" :selection.sync="selection">
+    <ele-pro-table ref="table" 
+      :needPage="false" 
+      :columns="columns" 
+      :datasource="form.datasource" 
+      class="time-form" 
+      height="300" 
+      full-height="calc(100vh - 76px)" 
+      @columns-change="handleColumnChange" 
+      :cache-key="cacheKeyUrl" 
+      :selection.sync="selection" 
+    >
       <!-- :show-summary="showSummary"
       :summary-method="getSummaries" -->
       <!-- 表头工具栏 -->

+ 1 - 1
src/BIZComponents/product-list.vue

@@ -139,8 +139,8 @@
             :row-class-name="tableRowClassName"
             :initLoad="!isFirstRefreshTable"
             @columns-change="handleColumnChange"
-            :rowClickChecked="true"
             :cache-key="cacheKeyUrl"
+            :page-size="20"
           >
             <!-- 表头工具栏 -->
             <template v-slot:action="{ row }">

+ 27 - 19
src/BIZComponents/selectStockLedger/selectStockLedgerDialog.vue

@@ -1,16 +1,16 @@
 <template>
-  <el-dialog
+  <ele-modal
     title="库存台账"
     :visible.sync="visible"
-    :before-close="handleClose"
+    v-if="visible"
     :close-on-click-modal="false"
-    top="5vh"
+    :before-close="handleClose"
     :close-on-press-escape="false"
+    destroy-on-close
+    top="5vh"
     append-to-body
     width="70%"
     :maxable="true"
-    :resizable="true"
-  
   >
     <el-card shadow="never">
       <item-search @search="reload" ref="refSeavch"></item-search>
@@ -51,6 +51,7 @@
             @cell-click="cellClick"
             :selection.sync="selection"
             :cache-key="cacheKeyUrl"
+            :page-size="20"
             @columns-change="handleColumnChange"
           >
             <template v-slot:saleCount="{ row }">
@@ -77,7 +78,7 @@
       <el-button type="primary" size="small" @click="selected">选择</el-button>
       <el-button size="small" @click="handleClose">关闭</el-button>
     </div>
-  </el-dialog>
+  </ele-modal>
 </template>
 
 <script>
@@ -133,7 +134,8 @@
         treeList: [],
         treeLoading: false,
         // cacheKeyUrl: '',
-        columnsVersion: 1
+        columnsVersion: 1,
+        tabMixinsInit: false
       };
     },
     watch: {},
@@ -159,7 +161,10 @@
             align: 'center',
             reserveSelection: true,
             selectable: (row) => {
-              return row.measureQuantity != 0;
+              const measureQuantity = parseFloat(row.measureQuantity) || 0;
+              const lockQuantity = parseFloat(row.lockQuantity) || 0;
+              const available = measureQuantity - lockQuantity;
+              return available != 0;
             }
 
           };
@@ -190,6 +195,15 @@
             showOverflowTooltip: true,
             minWidth: 110
           },
+          {
+            prop: 'saleCount',
+            slot: 'saleCount',
+            label: '订单数量',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 120,
+            hide: !this.showSaleCount
+          },
           {
             prop: 'brandNum',
             align: 'center',
@@ -257,15 +271,6 @@
             showOverflowTooltip: true,
             hide: this.dimension == 1
           },
-          {
-            prop: 'saleCount',
-            slot: 'saleCount',
-            label: '订单数量',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 120,
-            hide: !this.showSaleCount
-          },
           {
             prop: 'measureQuantity',
             label: '库存',
@@ -360,15 +365,18 @@
       },
 
       /* 表格数据源 */
-      datasource({ page, limit, where, order }) {
+      async datasource({ page, limit, where, order }) {
         this.dimension = where.dimension||'2';
         let api = where.dimension == '1' ? getOutindetailtwoList : getBatchList;
-        return api({
+
+        const data = await api({
           ...where,
           ...order,
           pageNum: page,
           size: limit
         });
+        this.getTabColumns();
+        return data
       },
 
       /* 刷新表格 */

+ 3 - 0
src/views/purchasingManage/purchaseOrder/invoice/components/addInvoiceDialog.vue

@@ -119,6 +119,7 @@
 
     <headerTitle title="物品清单" style="margin-top: 30px"></headerTitle>
     <inventoryTable
+      :modalType="modalType"
       :pricingWay="form.pricingWay"
       :sourceType="form.sourceType"
       :outsourceSendCode="form.outsourceSendCode"
@@ -213,6 +214,7 @@
       };
 
       return {
+        modalType: 'add',
         fullscreen: false,
         searchParams: {},
         detailData: {},
@@ -459,6 +461,7 @@
         this.title = type === 'add' ? '新增收货单' : '修改';
         this.row = row;
         this.visible = true;
+        this.modalType = type;
         if (orderId) {
           await this.getPurchaseorderDetail(orderId);
         }

+ 6 - 2
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -15,6 +15,7 @@
       <template v-slot:toolbar>
         <div class="headbox">
           <el-button
+            v-if="modalType === 'add'"
             size="small"
             type="primary"
             icon="el-icon-plus"
@@ -434,10 +435,13 @@
       outsourceSendCode: String,
       pricingWay: [String, Number],
       sourceType: [String, Number],
-      productType: ''
+      productType: '',
+      modalType: {
+        type: String,
+        default: 'add'
+      }
     },
     components: {
-      outboundDetailsDialog,
       productList,
       taskinstanceDialog,
       productListMain,

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

@@ -190,6 +190,7 @@
           :isTotalCount="isTotalCount"
           :oldProductList="oldProductList"
           :sourceType="form.sourceType"
+          :isReturnGoodsCreate="isReturnGoodsCreate"
         ></inventoryTable>
       </el-tab-pane>
       <el-tab-pane label="托盘清单" name="second">

+ 50 - 7
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -486,6 +486,7 @@
   import { parameterGetByCode } from '@/api/main/index.js';
   import { getSummaries } from '@/utils/util.js';
   import { getBatchList } from '@/api/wms';
+  import Vue from 'vue';
 
   export default {
     mixins: [dictMixins, getDynamicsColumns, tabMixins],
@@ -514,6 +515,10 @@
       },
       isTotalCount: {
         default: 0
+      },
+      isReturnGoodsCreate: {
+        type: Boolean,
+        default: false
       }
     },
     components: {
@@ -1127,6 +1132,7 @@
           warehouseId: data?.warehouseId || '',
           code: row.productCode,
           batchNo: row.batchNo,
+          systemBatchNo: row.systemBatchNo,
           colorKey: row.colorKey,
           modelType: row.modelType
         });
@@ -1182,6 +1188,7 @@
                   warehouseId: row.warehouseId,
                   code: row.productCode,
                   batchNo: row.batchNo,
+                  systemBatchNo: row.systemBatchNo,
                   colorKey: row.colorKey,
                   modelType: row.modelType
                 })
@@ -1527,7 +1534,7 @@
         }
       },
       setValue(data) {
-        console.log('setValue~~~~~~', data);
+        console.log('setValue~~~~~~', data, this.sourceType);
         let indexS = [];
         data.forEach((item, index) => {
           if (item.modelKey) {
@@ -1537,9 +1544,36 @@
             this.$set(data[index], 'colorKey', item.colorKey);
           }
           item.receiveTotalWeight = item.receiveTotalWeight || 0;
-
-          // item.saleCount = item.notGenerateSendCount || item.saleCount;
-          // item.totalCount = item.saleCount || item.totalCount;
+          // console.log('item~~~~', item, this.sourceType);
+          // if(!this.isReturnGoodsCreate) {
+          //   console.log('isReturnGoodsCreate', this.isReturnGoodsCreate)
+          //   item.totalCount = item.notGenerateSendCount || item.totalCount;
+          //   // item.saleCount = item.notGenerateSendCount || item.saleCount;
+          //   let total = item.totalCount || 0;
+          //   let _endIndex = 0; //计算单重需要
+          //   if (item.packageDispositionList) {
+          //     let endIndex = item.packageDispositionList.findIndex(
+          //       (ite) => item.saleUnitId == ite.id
+          //     );
+          //     _endIndex = endIndex;
+          //     let packageData = item.packageDispositionList.find(
+          //       (ite) => item.saleUnitId== ite.id
+          //     );
+          //     item.saleUnitId = packageData?.conversionUnit;
+          //     if (item.weightUnit == item.measuringUnit && item.singleWeight) {
+          //       item.packageDispositionList[1].packageCell = item.singleWeight;
+          //     }
+          //     for (; 0 < endIndex; endIndex--) {
+          //       total = Vue.prototype.$math.format(
+          //         total / item.packageDispositionList[endIndex].packageCell,
+          //         14
+          //       );
+          //     }
+          //   }
+          //   item.saleCount = total;
+          // }
+          
+        
           // this.changeCount(item, index, false);
 
           if (item.weightUnit == item.measuringUnit) {
@@ -1588,6 +1622,7 @@
                     warehouseId: item.warehouseId,
                     code: item.productCode,
                     batchNo: item.batchNo,
+                    systemBatchNo: item.systemBatchNo,
                     colorKey: item.colorKey,
                     modelType: item.modelType
                   })
@@ -1646,6 +1681,7 @@
                 warehouseId: item.warehouseId,
                 code: item.productCode,
                 batchNo: item.batchNo,
+                systemBatchNo: item.systemBatchNo,
                 colorKey: item.colorKey,
                 modelType: item.modelType
               })
@@ -1672,11 +1708,13 @@
           let tempBatchNoList = templist1?.list || [];
           console.log('888~~~~', index, item.batchNo);
 
-          // 新数据按系统批次精确匹配,历史数据保持按外部批次号兼容匹配
+          // 优先按批次明细ID匹配,无ID时按系统批次和业务批次兼容匹配
           const batchNoObj = tempBatchNoList.find(
             (i) =>
-              i.batchNo == item.batchNo &&
-              (!item.systemBatchNo || i.systemBatchNo == item.systemBatchNo)
+              (item.batchStockId && i.id == item.batchStockId) ||
+              (!item.batchStockId &&
+                i.batchNo == item.batchNo &&
+                (!item.systemBatchNo || i.systemBatchNo == item.systemBatchNo))
           );
 
           if (batchNoObj) {
@@ -1685,6 +1723,11 @@
               'batchStockId',
               batchNoObj.id
             );
+            this.$set(
+              this.form.datasource[index],
+              'systemBatchNo',
+              batchNoObj.systemBatchNo || ''
+            );
             this.$set(
               this.form.datasource[index],
               'warehouseNum',

+ 3 - 2
vue.config.js

@@ -2,7 +2,7 @@
  * @Author: mlchen 374826075@qq.com
  * @Date: 2026-07-22 15:43:30
  * @LastEditors: mlchen 374826075@qq.com
- * @LastEditTime: 2026-07-27 09:31:46
+ * @LastEditTime: 2026-08-11 10:52:40
  * @FilePath: /kd-aiot-frontend-eom/vue.config.js
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -44,7 +44,8 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        target: 'http://192.168.1.251:18086', //开发
+        // target: 'http://192.168.1.251:18086', //开发
+        target: 'http://localhost:18086', //开发
         // target: 'http://192.168.1.251:18186', //测试
         // target: 'http://192.168.1.15:18086',//罗
         // target: 'http://192.168.1.144:18086',//付