Procházet zdrojové kódy

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wms into dev

xieyong před 2 týdny
rodič
revize
46c3cbff42

+ 47 - 18
src/views/warehouseManagement/inventoryAllocation/add.vue

@@ -93,7 +93,7 @@
                       <el-option
                         v-for="item in outTreeList"
                         :disabled="item.hiden"
-                        :label="item.name"
+                        :label="warehouseLabel(item)"
                         :value="item.id"
                         :key="item.name"
                       >
@@ -319,7 +319,7 @@
                       <el-option
                         v-for="item in inTreeList"
                         :disabled="item.hiden"
-                        :label="item.name"
+                        :label="warehouseLabel(item)"
                         :value="item.id"
                         :key="item.name"
                       >
@@ -1023,7 +1023,6 @@
         this.factoryId = baseInfo.factoriesId;
         this.allocateId = baseInfo.type;
         this.transferOrderId = baseInfo.id;
-        await this.getTreeData(); // 初始仓库
         this.params = {
           code: baseInfo.allotCode,
           name: baseInfo.name,
@@ -1045,6 +1044,7 @@
           inFreightId: '', // 调入货位
           inFreightName: ''
         };
+        await this.getTreeData(this.factoryId, this.params.targetFactoriesId);
 
         console.log('baseInfo------', baseInfo);
         // 兼容旧数据
@@ -1128,16 +1128,26 @@
         console.log(dataList);
         console.log(baseInfo);
       },
-      factoryChange() {
+      async factoryChange() {
         // this.params.inWarehouseName = this.params.outWarehouseName;
         this.params.targetFactoriesId = this.factoryId;
         console.log('this.params------', this.params);
         this.reset();
-        this.getTreeData();
+        await this.getTreeData(this.factoryId, this.params.targetFactoriesId);
       },
-      targetFactoryChange() {
-        // this.reset();
-        // this.getTreeData();
+      async targetFactoryChange() {
+        this.params.inWarehouseId = '';
+        this.params.inWarehouseName = '';
+        this.params.inCargoAreaId = '';
+        this.params.inCargoAreaName = '';
+        this.params.inShelvesId = '';
+        this.params.inShelvesName = '';
+        this.params.inFreightId = '';
+        this.params.inFreightName = '';
+        this.inCargoAreaList = [];
+        this.inShelvesList = [];
+        this.inFreightList = [];
+        await this.getTreeData(this.factoryId, this.params.targetFactoriesId);
       },
       search() {
         return new Promise((resolve, reject) => {
@@ -1326,6 +1336,10 @@
         });
         this.factoryList = res.list;
       },
+      // 返回带工厂名的仓库选项标签。
+      warehouseLabel(item) {
+        return item.factoryName ? `${item.factoryName}-${item.name}` : item.name;
+      },
       async outWarehouseChange(val) {
         console.log('val------', val);
         this.outCargoAreaList = this.outTreeList.filter(
@@ -1514,21 +1528,36 @@
         this.total = data.count;
         this.productList = data.list;
       },
-      async getTreeData() {
+      // 分别按调出和调入工厂加载仓库树。
+      async getTreeData(
+        outFactoryId = this.factoryId,
+        inFactoryId = this.params.targetFactoriesId
+      ) {
         try {
           this.treeLoading = true;
-          let res = await storageApi.getWarehouseTrees({
-            factoriesId: this.factoryId
-          });
-          this.treeLoading = false;
-          if (res?.code === '0') {
-            this.outTreeList = res.data;
-            this.inTreeList = res.data;
-          }
+          const [outRes, inRes] = await Promise.all([
+            storageApi.getWarehouseTrees({ factoryId: outFactoryId }),
+            storageApi.getWarehouseTrees({ factoryId: inFactoryId })
+          ]);
+          this.outTreeList = (outRes?.code === '0' ? outRes.data : []).map(
+            (item) => ({
+              ...item,
+              hiden: this.allocateId == 2 && item.id == this.params.inWarehouseId
+            })
+          );
+          this.inTreeList = (inRes?.code === '0' ? inRes.data : []).map(
+            (item) => ({
+              ...item,
+              hiden: this.allocateId == 2 && item.id == this.params.outWarehouseId
+            })
+          );
         } catch (error) {
           console.log(error);
+          this.outTreeList = [];
+          this.inTreeList = [];
+        } finally {
+          this.treeLoading = false;
         }
-        this.treeLoading = false;
       },
       deleted(row, index) {
         console.log('deleted~~~', row.id, index);

+ 38 - 2
src/views/warehouseManagement/statisticalReports/transceiverDetails/add.vue

@@ -156,6 +156,24 @@
                 ></el-input>
               </el-form-item>
             </el-col>
+            <el-col :span="6">
+              <el-form-item label-width="90px" label="仓库:" prop="warehouseId">
+                <el-select
+                  v-model="formData.warehouseId"
+                  filterable
+                  clearable
+                  placeholder="请选择"
+                  :disabled="isView"
+                >
+                  <el-option
+                    v-for="item in warehouseList"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
             <el-col v-if="!isView" :span="12">
               <div class="ele-form-actions filter-actions">
                 <el-button
@@ -241,6 +259,7 @@
   import storageApi from '@/api/warehouseManagement';
   import { allCategoryLevel } from '@/api/classifyManage';
   import { getTreeByGroup } from '@/api/classifyManage';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import {
     warehousingType,
     sceneState,
@@ -280,8 +299,10 @@
           categoryCode: '',
           colorKey: '',
           batchNo: '',
+          warehouseId: '',
           type: ''
         },
+        warehouseList: [],
         // 表单验证规则
         rules: {
           name: [
@@ -391,6 +412,13 @@
             showOverflowTooltip: true,
             width: 120
           },
+          {
+            prop: 'warehouseName',
+            label: '仓库名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
           {
             prop: 'modelType',
             label: '型号',
@@ -622,7 +650,8 @@
     },
     created() {
       this.getTypeList();
-      this.getAssetTypeList()
+      this.getAssetTypeList();
+      this.getWarehouseList();
     },
     methods: {
       // 获取物品类型下拉选择树
@@ -632,6 +661,10 @@
           return { dictCode: item.id, dictValue: item.name };
         });
       },
+      // 加载仓库筛选项,选择值作为仓库 ID 参与明细查询。
+      async getWarehouseList() {
+        this.warehouseList = await warehouseDefinition.list({});
+      },
       handleOutInChange() {
         // this.formData.bizType = '';
       },
@@ -761,6 +794,7 @@
           this.formData.categoryCode = row.categoryCode || '';
           this.formData.colorKey = row.colorKey || '';
           this.formData.batchNo = row.batchNo || '';
+          this.formData.warehouseId = row.warehouseId || '';
         } else {
           this.tableList = [];
           this.formData = Object.assign({}, {
@@ -774,7 +808,8 @@
             categoryLevelId: '',
             categoryCode: '',
             colorKey: '',
-            batchNo: ''
+            batchNo: '',
+            warehouseId: ''
           }, searchParams);
         }
         this.isView = isView;
@@ -818,6 +853,7 @@
         this.formData.categoryCode = '';
         this.formData.colorKey = '';
         this.formData.batchNo = '';
+        this.formData.warehouseId = '';
         this.$refs.formRef.resetFields()
         this.search();
       }

+ 38 - 2
src/views/warehouseManagement/statisticalReports/transceiverDetails/transceiver-details.vue

@@ -149,6 +149,24 @@
                 ></el-input>
               </el-form-item>
             </el-col>
+            <el-col :span="6">
+              <el-form-item label-width="90px" label="仓库:" prop="warehouseId">
+                <el-select
+                  v-model="formData.warehouseId"
+                  filterable
+                  clearable
+                  placeholder="请选择"
+                  :disabled="isView"
+                >
+                  <el-option
+                    v-for="item in warehouseList"
+                    :key="item.id"
+                    :label="item.name"
+                    :value="item.id"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
             <el-col v-if="!isView" :span="24">
               <div class="ele-form-actions filter-actions">
                 <el-button
@@ -223,6 +241,7 @@
     outintwoPage
   } from '@/api/warehouseManagement/statisticalReports';
   import storageApi from '@/api/warehouseManagement';
+  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import { allCategoryLevel } from '@/api/classifyManage';
   import { getTreeByGroup } from '@/api/classifyManage';
   import {
@@ -262,8 +281,10 @@
           categoryCode: '',
           colorKey: '',
           batchNo: '',
+          warehouseId: '',
           type: ''
         },
+        warehouseList: [],
         // 表单验证规则
         rules: {
         //   name: [
@@ -373,6 +394,13 @@
             showOverflowTooltip: true,
             width: 120
           },
+          {
+            prop: 'warehouseName',
+            label: '仓库名称',
+            align: 'center',
+            showOverflowTooltip: true,
+            width: 150
+          },
           {
             prop: 'modelType',
             label: '型号',
@@ -604,9 +632,14 @@
     },
     created() {
       this.getTypeList();
-      this.getAssetTypeList()
+      this.getAssetTypeList();
+      this.getWarehouseList();
     },
     methods: {
+      // 加载仓库筛选项,使用仓库 ID 提交查询条件。
+      async getWarehouseList() {
+        this.warehouseList = await warehouseDefinition.list({});
+      },
       // 获取物品类型下拉选择树
       async getAssetTypeList() {
         const { data } = await getTreeByGroup({ type: 2 });
@@ -744,6 +777,7 @@
           this.formData.categoryCode = row.categoryCode || '';
           this.formData.colorKey = row.colorKey || '';
           this.formData.batchNo = row.batchNo || '';
+          this.formData.warehouseId = row.warehouseId || '';
         } else {
           this.tableList = [];
           this.formData = {
@@ -757,7 +791,8 @@
             categoryLevelId: '',
             categoryCode: '',
             colorKey: '',
-            batchNo: ''
+            batchNo: '',
+            warehouseId: ''
           };
         }
         this.isView = isView;
@@ -806,6 +841,7 @@
         this.formData.categoryCode = '';
         this.formData.colorKey = '';
         this.formData.batchNo = '';
+        this.formData.warehouseId = '';
         this.$refs.formRef.resetFields()
         this.search();
       }

+ 25 - 2
src/views/warehouseManagement/stockLedger/components/item-list.vue

@@ -76,6 +76,7 @@
             v-if="selectedDime == 2"
             type="primary"
             size="small"
+            :disabled="hasUnreleasedBatch"
             @click="handleUnlock"
             >库存解锁</el-button
           >
@@ -83,7 +84,7 @@
             v-if="selectedDime == 2"
             size="small"
             icon="el-icon-s-operation"
-            :disabled="checkRadioData.length !== 1"
+            :disabled="checkRadioData.length !== 1 || hasUnreleasedBatch"
             @click="openBatchChange('split')"
             >拆批申请</el-button
           >
@@ -91,7 +92,7 @@
             v-if="selectedDime == 2"
             size="small"
             icon="el-icon-connection"
-            :disabled="checkRadioData.length < 2"
+            :disabled="checkRadioData.length < 2 || hasUnreleasedBatch"
             @click="openBatchChange('merge')"
             >合批申请</el-button
           >
@@ -369,6 +370,11 @@
       });
     },
     computed: {
+      hasUnreleasedBatch() {
+        return this.checkRadioData.some(
+          (row) => Number(row.preWarehousing) === 1
+        );
+      },
       // 表格列配置
       columns() {
         // 当columnsVersion变化时会重新计算
@@ -418,6 +424,16 @@
                 formatter: (row) => row.systemBatchNo || '-'
               }
             : '',
+          this.selectedDime == 2
+            ? {
+                prop: 'preWarehousing',
+                label: '放行状态',
+                align: 'center',
+                width: 100,
+                formatter: (row) =>
+                  Number(row.preWarehousing) === 1 ? '待放行' : '已放行'
+              }
+            : '',
           {
             prop: 'categoryCode',
             label: '物品编码',
@@ -491,6 +507,7 @@
             align: 'center',
             showOverflowTooltip: true,
             formatter: (row) => {
+              if (Number(row.preWarehousing) === 1) return 0;
               // 入库计量数量不会随出库变化,可用数量必须使用当前批次库存余额计算
               const inventoryBalance = Number(row.availableCountBase) || 0;
               const lock = Number(row.lockQuantity) || 0;
@@ -765,6 +782,9 @@
         if (this.checkRadioData?.length != 1) {
           return this.$message.warning('请选择一条数据进行解锁!');
         }
+        if (this.hasUnreleasedBatch) {
+          return this.$message.warning('待放行批次不能解锁');
+        }
         this.$refs.unlockModalRef.open('add', this.checkRadioData[0]);
       },
       async openBatchChange(mode) {
@@ -772,6 +792,8 @@
           return this.$message.warning('拆批请选择一条库存批次');
         if (mode === 'merge' && this.checkRadioData.length < 2)
           return this.$message.warning('合批请选择至少两条库存批次');
+        if (this.hasUnreleasedBatch)
+          return this.$message.warning('待放行批次不能拆批或合批');
         if (
           this.checkRadioData.some(
             (row) =>
@@ -955,6 +977,7 @@
           };
           this.params = {
             ...params,
+            includePreWarehousing: true,
             pageNum: page,
             size: limit
           };

+ 2 - 2
vue.config.js

@@ -2,7 +2,7 @@
  * @Author: mlchen 374826075@qq.com
  * @Date: 2026-07-21 09:26:11
  * @LastEditors: mlchen 374826075@qq.com
- * @LastEditTime: 2026-08-26 14:45:52
+ * @LastEditTime: 2026-09-29 15:53:40
  * @FilePath: /kd-aiot-frontend-wms/vue.config.js
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -43,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://localhost:18086', //开发
+        target: 'http://localhost:18090', //开发
         // target: 'http://192.168.1.251:18086', //测试
         // target: 'http://192.168.1.116:18086',