Browse Source

fix(生产退料入库): 添加计量数量验证并调整仓库ID处理逻辑

liujt 7 tháng trước cách đây
mục cha
commit
01b71e2170

+ 9 - 1
src/views/bpm/handleTask/components/productionWarehousing/submit.vue

@@ -76,9 +76,17 @@
         if (!storageData) {
           return;
         }
+        console.log('res~~~~~~~~~~~~~~~~', res);
         // 入库来源isSkip 0-正常  1-外部(外部跳过内部审核流程)
         storageData.isSkip = 1;
-        console.log(storageData);
+        console.log('storageData~~~~~~~~~~~~~~~~', storageData);
+        
+        // 验证outInDetailList中是否存在数量为空的情况
+        if (storageData.outInDetailList && storageData.outInDetailList.some(item => item.number ==undefined || item.number == '' || item.number == null)) {
+          this.$message.error('计量数量不为空');
+          return;
+        }
+        
         try {
           this.isSaveLoading = true;
           let res = await storageApi.storage(storageData);

+ 4 - 1
src/views/bpm/stockManagement/storage.vue

@@ -1777,6 +1777,8 @@
           });
           storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
             console.log(res, 'detailList-res');
+            console.log(this.form, 'this.form.warehouseId');
+            console.log(this.bizType, 'this.bizType~~~');
             // 获取批次号
             const batchNo = await getCode('lot_number_code');
             // 获取供应商
@@ -1796,11 +1798,12 @@
             // 获取相同仓库
             let warehouseIds = [];
             let warehouseNames = [];
+            console.log(this.form.totalCount, 'this.form.warehouseId');
             for (let index = 0; index < this.form.totalCount; index++) {
               warehouseIds.push(this.form.warehouseId);
               warehouseNames.push(this.form.warehouseName);
             }
-            if (this.bizType == 4) {
+            if (this.bizType == 4 || this.bizType == 1) {
               warehouseIds.push(this.form.warehouseId);
               warehouseNames.push(this.form.warehouseName);
             }