Эх сурвалжийг харах

fix:修改发货单选择批次号没有修改systemBatchNo字段的问题

mlchen 6 өдөр өмнө
parent
commit
5d2cc78294

+ 44 - 6
src/views/warehouseManagement/components/AssetsDialog.vue

@@ -55,6 +55,17 @@
             ></el-input>
           </el-form-item>
         </el-col>
+        <el-col :span="6" v-if="dimension != 1">
+          <el-form-item label="系统批次:">
+            <el-input
+              clearable
+              type="text"
+              placeholder="请输入完整系统内部批次号"
+              v-model.trim="searchForm.systemBatchNo"
+              @keyup.enter.native="doSearch"
+            ></el-input>
+          </el-form-item>
+        </el-col>
         <el-col :span="6">
           <el-form-item label="刻码">
             <el-input
@@ -257,6 +268,7 @@
           categoryCode: '',
           categoryName: '',
           batchNo: '',
+          systemBatchNo: '',
           factoryId: '',
           brandNum: '',
           engrave: '',
@@ -324,6 +336,13 @@
               label: '批次号',
               prop: 'batchNo',
               showOverflowTooltip: true
+            },
+            {
+              label: '系统内部批次号',
+              prop: 'systemBatchNo',
+              minWidth: 180,
+              showOverflowTooltip: true,
+              formatter: (row) => row.systemBatchNo || '-'
             }
           ];
         }
@@ -391,9 +410,11 @@
                 align: 'center',
                 reserveSelection: true,
                 selectable: (row) => {
-                  return !_this.productLists.some(
-                    (it) => it.categoryId == row.categoryId
-                  ) && row.measureQuantity != 0;
+                  return (
+                    !_this.productLists.some((item) =>
+                      _this.isSameStockRecord(item, row)
+                    ) && row.measureQuantity != 0
+                  );
                 }
               }
             : {
@@ -404,9 +425,11 @@
                 align: 'center',
                 reserveSelection: true,
                 selectable: (row) => {
-                  return !_this.productLists.some(
-                    (it) => it.categoryId == row.categoryId
-                  ) && row.measureQuantity != 0;
+                  return (
+                    !_this.productLists.some((item) =>
+                      _this.isSameStockRecord(item, row)
+                    ) && row.measureQuantity != 0
+                  );
                 }
               },
           {
@@ -549,6 +572,17 @@
 
     watch: {},
     methods: {
+      isSameStockRecord(source, target) {
+        if (source.id && target.id) {
+          return source.id == target.id;
+        }
+        return (
+          source.categoryId == target.categoryId &&
+          source.warehouseId == target.warehouseId &&
+          source.batchNo == target.batchNo &&
+          (source.systemBatchNo || '') == (target.systemBatchNo || '')
+        );
+      },
       //获取工厂列表
       async getFactoryList() {
         const res = await warehouseDefinition.getFactoryarea({
@@ -761,6 +795,9 @@
               return {
                 warehouseId: this.searchForm.warehouseId,
                 categoryId: item.categoryId,
+                batchNo: item.batchNo,
+                // 历史数据保持空值,由后端按外部批次号兼容匹配
+                systemBatchNo: item.systemBatchNo || '',
                 num: item.outboundNum,
                 id: item.id
               };
@@ -804,6 +841,7 @@
           categoryCode: '',
           categoryName: '',
           batchNo: '',
+          systemBatchNo: '',
           brandNum: '',
           engrave: '',
           barcodes: '',

+ 6 - 0
src/views/warehouseManagement/components/enum.js

@@ -74,6 +74,7 @@ export const warehousingMaterialListTable = {
     assetCode: 'materialCode', //编码
     assetName: 'materialName', //名称
     batchNo: 'batchNo', //批次号
+    systemBatchNo: 'systemBatchNo', //系统内部批次号
     brandNum: 'tradeMark', //牌号
     modelType: 'model', //型号
     materialId: 'classificationId', //类型
@@ -92,6 +93,7 @@ export const warehousingMaterialListTable = {
     assetCode: 'code', //编码
     assetName: 'name', //名称
     batchNo: '', //批次号
+    systemBatchNo: '', //系统内部批次号
     brandNum: 'model', //牌号
     materialId: 'classificationId', //类型
     materialName: 'classificationName', //类型
@@ -107,6 +109,7 @@ export const warehousingMaterialListTable = {
     assetCode: 'code', //编码
     assetName: 'name', //名称
     batchNo: '', //批次号
+    systemBatchNo: '', //系统内部批次号
     brandNum: 'model', //牌号
     materialId: 'classificationId', //类型
     materialName: 'classificationName', //类型
@@ -122,6 +125,7 @@ export const warehousingMaterialListTable = {
     assetCode: 'code', //编码
     assetName: 'name', //名称
     batchNo: '', //批次号
+    systemBatchNo: '', //系统内部批次号
     brandNum: 'specifications', //牌号
     materialId: 'classificationId', //类型
     materialName: 'classificationName', //类型
@@ -137,6 +141,7 @@ export const warehousingMaterialListTable = {
     assetCode: 'code', //编码
     assetName: 'name', //名称
     batchNo: '', //批次号
+    systemBatchNo: '', //系统内部批次号
     brandNum: 'model', //牌号
     materialId: 'classificationId', //类型
     materialName: 'classificationName', //类型
@@ -152,6 +157,7 @@ export const warehousingMaterialListTable = {
     assetCode: 'code', //编码
     assetName: 'name', //名称
     batchNo: '', //批次号
+    systemBatchNo: '', //系统内部批次号
     brandNum: 'model', //牌号
     materialId: 'classificationId', //类型
     materialName: 'classificationName', //类型

+ 2 - 0
src/views/warehouseManagement/components/outboundRequisitionDialog.vue

@@ -420,6 +420,8 @@ export default {
               builders: res.map((item) => {
                 return {
                   categoryId: item.categoryId,
+                  batchNo: item.batchNo,
+                  systemBatchNo: item.systemBatchNo || '',
                   num: item.measureQuantity
                 };
               })

+ 19 - 0
src/views/warehouseManagement/inventoryAllocation/add.vue

@@ -640,6 +640,14 @@
             minWidth: 130,
             showOverflowTooltip: true,
           }] : []),
+          ...(this.dimension != '1' ? [{
+            prop: 'systemBatchNo',
+            label: '系统内部批次号',
+            align: 'center',
+            minWidth: 180,
+            showOverflowTooltip: true,
+            formatter: (row) => row.systemBatchNo || '-'
+          }] : []),
           ...(this.dimension == '3' ? [
             {
               prop: 'packageNo',
@@ -821,6 +829,14 @@
             minWidth: 130,
             showOverflowTooltip: true,
           }] : []),
+          ...(this.dimension != '1' ? [{
+            prop: 'systemBatchNo',
+            label: '系统内部批次号',
+            align: 'center',
+            minWidth: 180,
+            showOverflowTooltip: true,
+            formatter: (row) => row.systemBatchNo || '-'
+          }] : []),
           this.dimension == 3 ? {
             prop: 'packageNo',
             label: '包装编码',
@@ -1555,6 +1571,9 @@
                 return {
                   colorKey: item.colorKey,
                   modeKey: item.modeKey,
+                  batchNo: item.batchNo,
+                  // 历史数据保持空值,新数据原值透传系统批次号
+                  systemBatchNo: item.systemBatchNo || '',
                   quantity: item.quantity,
                   categoryCode: item.categoryCode,
                   categoryId: item.categoryId,

+ 9 - 0
src/views/warehouseManagement/inventoryAllocation/details.vue

@@ -199,6 +199,15 @@
             minWidth: 110,
             hide: this.infoData.inventoryDimension == 1
           },
+          {
+            prop: 'systemBatchNo',
+            label: '系统内部批次号',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 180,
+            hide: this.infoData.inventoryDimension == 1,
+            formatter: (row) => row.systemBatchNo || '-'
+          },
           {
             prop: 'warehouseName',
             label: '调出仓库',

+ 2 - 0
src/views/warehouseManagement/outgoingManagement/edit.vue

@@ -832,6 +832,7 @@
           assetCode: row.categoryCode,
           assetName: row.name,
           batchNo: row.batchNo,
+          systemBatchNo: row.systemBatchNo,
           clientCode: row.clientCode,
           createTime: row.createTime,
           engrave: '',
@@ -1200,6 +1201,7 @@
               assetCode: item.categoryCode,
               assetName: item.name,
               batchNo: item.batchNo,
+              systemBatchNo: item.systemBatchNo || '',
               minPackingCount: 1,
               measuringUnit: item.measuringUnit,
               materielCode: item.materielCode,

+ 1 - 0
src/views/warehouseManagement/stockLedger/components/details/BatchDetail.vue

@@ -212,6 +212,7 @@
           name: this.baseInfo.assetName,
           // dimension: +this.$route.query.dimension
           batchNo: this.$route.query.batchNo,
+          systemBatchNo: this.$route.query.systemBatchNo,
           categoryId: this.baseParams.categoryId
         };
         const res = await getBatchDetails(params);

+ 11 - 0
src/views/warehouseManagement/stockLedger/components/item-list.vue

@@ -359,6 +359,16 @@
                 align: 'center'
               }
             : '',
+          this.selectedDime != 1
+            ? {
+                prop: 'systemBatchNo',
+                label: '系统内部批次号',
+                align: 'center',
+                minWidth: 180,
+                showOverflowTooltip: true,
+                formatter: (row) => row.systemBatchNo || '-'
+              }
+            : '',
           {
             prop: 'categoryCode',
             label: '物品编码',
@@ -961,6 +971,7 @@
             id: row.categoryId,
             assetId: row.assetId,
             batchNo: row.batchNo,
+            systemBatchNo: row.systemBatchNo,
             categoryCode: row.categoryCode
           }
         });

+ 11 - 0
src/views/warehouseManagement/stockLedger/components/item-search.vue

@@ -169,6 +169,15 @@
             ></el-input>
           </el-form-item>
         </el-col>  
+        <el-col :span="6" v-if="dimension != 1">
+          <el-form-item label="系统批次:" prop="systemBatchNo">
+            <el-input
+              clearable
+              v-model.trim="params.systemBatchNo"
+              placeholder="请输入完整系统内部批次号"
+            ></el-input>
+          </el-form-item>
+        </el-col>
         <el-col :span="6">
           <el-form-item label="颜色:" prop="colorKey">
             <el-input
@@ -256,6 +265,7 @@
       // 默认表单数据
       const defaultParams = {
         batchNo: '',
+        systemBatchNo: '',
         informationName: '',
         manualBatchNo: '',
         barcodes: '',
@@ -275,6 +285,7 @@
         endTime: ''
       };
       return {
+        defaultParams,
         // 表单数据
         params: { ...defaultParams },
         qualityResultOption: [

+ 19 - 0
src/views/warehouseManagement/stockManagement/add.vue

@@ -1156,6 +1156,14 @@
             align: 'center',
             headerSlot: 'headerBatchNo'
           },
+          {
+            label: '系统内部批次号',
+            showOverflowTooltip: true,
+            prop: 'systemBatchNo',
+            minWidth: 180,
+            align: 'center',
+            formatter: (row) => row.systemBatchNo || '-'
+          },
           {
             label: '数量',
             showOverflowTooltip: true,
@@ -1437,6 +1445,7 @@
                 specification: item.specification, // 规格
                 brandNum: item.brandNum, // 牌号
                 batchNo: item.batchNo || batchNo, // 批次号
+                systemBatchNo: item.systemBatchNo || '', // 系统内部批次号
                 minPackingQuantity: item.quantity, // 最小包装单元数量
                 packingQuantity: 1, // 包装数量
                 packingUnit: item.packingUnit, // 单位
@@ -1514,6 +1523,7 @@
                   packingSpecificationLabel:
                     productItem.extField?.packingSpecification?.split(','),
                   batchNo: productItem.batchNo || batchNo, // 批次号
+                  systemBatchNo: productItem.systemBatchNo || '', // 系统内部批次号
                   warehouseIds: [productItem.warehouseId], // 仓库Id
                   warehouseNames: [productItem.warehouseName], // 仓库名称
                   outInDetailRecordRequestList:
@@ -1528,6 +1538,7 @@
                                 '-' +
                                 packingIndex, // 包装索引
                               batchNo: productItem.batchNo || batchNo, // 批次号
+                              systemBatchNo: productItem.systemBatchNo || '', // 系统内部批次号
                               parentIndex:
                                 this.productList.length + productIndex, // 物品索引
                               categoryName: productItem.categoryName,
@@ -1759,6 +1770,8 @@
               builders: res.map((item) => {
                 return {
                   categoryId: item.categoryId,
+                  batchNo: item.batchNo,
+                  systemBatchNo: item.systemBatchNo || '',
                   num: item.measureQuantity
                 };
               })
@@ -1879,6 +1892,7 @@
                           '-' +
                           packingIndex, // 包装索引
                         batchNo: productItem.batchNo || batchNo, // 批次号
+                        systemBatchNo: productItem.systemBatchNo || '', // 系统内部批次号
                         parentIndex: this.productList.length + productIndex, // 物品索引
                         categoryName: productItem.categoryName,
                         categoryCode: productItem.categoryCode,
@@ -2322,6 +2336,7 @@
                 specification: item.specification, // 规格
                 brandNum: item.brandNum, // 牌号
                 batchNo: item.batchNo || batchNo, // 批次号
+                systemBatchNo: item.systemBatchNo || '', // 系统内部批次号
                 minPackingQuantity: 1, // 最小包装单元数量
                 packingQuantity: filterArray[0]['数量'], // 包装数量
                 packingUnit: item.packingUnit, // 单位
@@ -2789,6 +2804,7 @@
             color: item.color,
             brandNum: item.brandNum, // 牌号
             batchNo: item.batchNo || batchNo, // 批次号
+            systemBatchNo: item.systemBatchNo || '', // 系统内部批次号
             supplierListOptions: supplierList[item.id], // 供应商列表
             supplierId: '', // 供应商id
             supplierName: '', // 供应商名称
@@ -3204,6 +3220,7 @@
               brandNum: row.brandNum, // 牌号
               parentIndex: row.index, // 产品索引
               batchNo: row.batchNo, // 批次号
+              systemBatchNo: row.systemBatchNo, // 系统内部批次号
               packageNo: packingCodeList[index]?.onlyCode, // 包装编码
               packingQuantity: packingQuantity, // 包装数量
               packingUnit: packingUnit, //包装单位
@@ -3337,6 +3354,7 @@
               modelKey: row.modelKey, // 机型
               colorKey: row.colorKey, //颜色
               batchNo: row.batchNo, // 批次号
+              systemBatchNo: row.systemBatchNo, // 系统内部批次号
               packageNo: packingCodeList[index]?.onlyCode, // 包装编码
               packingQuantity: packingQuantity, // 包装数量
               measureQuantity: measureQuantity, // 计量数量
@@ -3697,6 +3715,7 @@
             categoryCode: row.categoryCode, // 产品编码
             parentIndex: row.index, // 产品索引
             batchNo: row.batchNo, // 批次号
+            systemBatchNo: row.systemBatchNo, // 系统内部批次号
             packageNo: row.packageNo, // 包装编码
             measureQuantity: 1, // 计量数量
             measureUnit: row.measureUnit, // 计量单位

+ 3 - 0
src/views/warehouseManagement/stockManagement/components/itemListed.vue

@@ -652,6 +652,7 @@
             categoryCode: item.categoryCode || '',
             categoryName: item.categoryName || '',
             batchNo: item.batchNo || '',
+            systemBatchNo: item.systemBatchNo || '',
             measureQuantity: item.measureQuantity || 0,
             measureUnit: item.measureUnit || '',
             packingQuantity: item.packingQuantity || item.measureQuantity || 0,
@@ -688,6 +689,7 @@
             categoryCode: item.categoryCode || '',
             categoryName: item.categoryName || '',
             batchNo: item.batchNo || '',
+            systemBatchNo: item.systemBatchNo || '',
             measureQuantity: item.measureQuantity || item.quantity || 0,
             measureUnit: item.measureUnit || '',
             packingQuantity: item.packingQuantity || item.quantity || 0,
@@ -1105,6 +1107,7 @@
               measureQuantity: row.quantity,
               categoryId: matchedItem.categoryId,
               batchNo: matchedItem.batchNo,
+              systemBatchNo: matchedItem.systemBatchNo,
               outInDetailId: this.locationType == 'shelf' ? matchedItem.id : '',
               outInDetailRecordId: this.locationType !== 'shelf' ? matchedItem.id : '',
               outInId: this.rowData.outInId || this.rowData.id,

+ 2 - 0
src/views/warehouseManagement/stockManagement/edit.vue

@@ -843,6 +843,7 @@
           assetCode: row.categoryCode,
           assetName: row.name,
           batchNo: row.batchNo,
+          systemBatchNo: row.systemBatchNo,
           clientCode: row.clientCode,
           createTime: row.createTime,
           engrave: '',
@@ -1228,6 +1229,7 @@
               assetCode: item.categoryCode,
               assetName: item.name,
               batchNo: item.batchNo,
+              systemBatchNo: item.systemBatchNo || '',
               minPackingCount: 1,
               measuringUnit: item.measuringUnit,
               materielCode: item.materielCode,

+ 9 - 1
vue.config.js

@@ -1,3 +1,11 @@
+/*
+ * @Author: mlchen 374826075@qq.com
+ * @Date: 2026-07-21 09:26:11
+ * @LastEditors: mlchen 374826075@qq.com
+ * @LastEditTime: 2026-07-27 09:31:32
+ * @FilePath: /kd-aiot-frontend-wms/vue.config.js
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
 const CompressionWebpackPlugin = require('compression-webpack-plugin');
 const { transformElementScss } = require('ele-admin/lib/utils/dynamic-theme');
 const path = require('path');
@@ -35,7 +43,7 @@ module.exports = {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.132:18086',
         // target: 'http://192.168.1.105:18086', //开发
-        target: 'http://192.168.1.251:18086', //开发
+        target: 'http://localhost:18086', //开发
         // target: 'http://192.168.1.251:18186', //测试
         // target: 'http://192.168.1.116:18086',