huang_an 2 سال پیش
والد
کامیت
a99a1e9195
2فایلهای تغییر یافته به همراه51 افزوده شده و 60 حذف شده
  1. 49 58
      src/views/bpm/stockManagement/add.vue
  2. 2 2
      src/views/bpm/todo/index.vue

+ 49 - 58
src/views/bpm/stockManagement/add.vue

@@ -1915,41 +1915,8 @@
               return this.$message.error('请保存入库明细!');
             }
 
-            const params = {
-              outInWarehouse: { ...this.formData, type: 1 },
-              warehouseLedgerInfos: this.warehousingMaterialList
-            };
-
-            for (let key in this.warehousingMaterialList) {
-              for (let k in this.warehousingMaterialList[key].houseList) {
-                this.warehousingMaterialList[key].warehouseName =
-                  this.warehousingMaterialList[key].houseList[k].warehouseName;
-
-                this.warehousingMaterialList[key].areaName =
-                  this.warehousingMaterialList[key].houseList[k].areaName;
-
-                this.warehousingMaterialList[key].shelfCode =
-                  this.warehousingMaterialList[key].houseList[k].shelfCode;
-
-                this.warehousingMaterialList[key].cargoSpaceCode =
-                  this.warehousingMaterialList[key].houseList[k].cargoSpaceCode;
-
-                this.warehousingMaterialList[key].warehouseId =
-                  this.warehousingMaterialList[key].houseList[k].warehouseId;
+            this.formatWarehouseMaterialList();
 
-                this.warehousingMaterialList[key].areaId =
-                  this.warehousingMaterialList[key].houseList[k].areaId;
-
-                this.warehousingMaterialList[key].shelfId =
-                  this.warehousingMaterialList[key].houseList[k].shelfId;
-
-                this.warehousingMaterialList[key].cargoSpaceId =
-                  this.warehousingMaterialList[key].houseList[k].cargoSpaceId;
-                this.warehousingMaterialList[key].num =
-                  this.warehousingMaterialList[key].houseList[k].num;
-              }
-            }
-            console.log('1122', this.warehousingMaterialList);
             let arr = this.warehousingMaterialList.map((item) => {
               return {
                 netWeight: item.netWeight,
@@ -1967,7 +1934,6 @@
                 price: item.univalence,
                 outInDetailRecordAddPOList: item.warehouseLedgerDetails,
                 position: `${item.warehouseName}-${item.areaName}-${item.shelfCode}-${item.cargoSpaceCode}`,
-                // pathIds: item.categoryLevelPathId.toString(),
                 remark: '',
                 pathIds: `${item.warehouseId},${item.areaId},${item.shelfId},${item.cargoSpaceId}`,
                 pathName: `${item.warehouseName},${item.areaName},${item.shelfCode},${item.cargoSpaceCode}`,
@@ -1979,29 +1945,11 @@
                 weight: item.weight
               };
             });
+
             arr.forEach((item) => {
               if (item.outInDetailRecordAddPOList.length > 0) {
                 let list = item.outInDetailRecordAddPOList.map((it) => {
-                  return {
-                    code: it.onlyCode,
-                    dateType: this.curDateType === 'manufactureTime' ? 2 : 1,
-                    dateValue: it[this.curDateType],
-                    minUnit: it.minPackingCount,
-                    minPositionId: it.cargoSpaceId,
-                    name: it.assetName,
-                    pathIds: item.pathIds,
-                    unit: it.unit,
-                    packageNo: it.num,
-                    clientCode: it.clientCode,
-                    materielCode: it.materielCode,
-                    weight: it.weight,
-                    weightUtil: it.weightUtil,
-                    engrave: it.engrave,
-                    materialDetails: this.materialDetails(it.onlyCode),
-                    packingCount: it.packingCount,
-                    status: it.status,
-                    result: it.result
-                  };
+                  return this.formatOutInDetailRecordAddPO(it, item);
                 });
                 item.outInDetailRecordAddPOList = list;
               }
@@ -2010,20 +1958,63 @@
             let obj = { ...this.formData, type: 1 };
             obj.outInDetailAddPOList = arr;
 
-            console.log('====>>', obj);
-
             this.saveLoading = true;
             try {
               const res = await outin.save(obj);
               if (res.code == 0) {
                 this.$message.success('保存成功!');
               }
-            } catch (error) {}
+            } catch (error) {
+              console.error('保存失败:', error);
+            }
             this.saveLoading = false;
             // this.$router.push('/warehouseManagement/stockManagement');
           }
         });
       },
+
+      formatWarehouseMaterialList() {
+        for (let key in this.warehousingMaterialList) {
+          for (let k in this.warehousingMaterialList[key].houseList) {
+            let house = this.warehousingMaterialList[key].houseList[k];
+            this.warehousingMaterialList[key].warehouseName =
+              house.warehouseName;
+            this.warehousingMaterialList[key].areaName = house.areaName;
+            this.warehousingMaterialList[key].shelfCode = house.shelfCode;
+            this.warehousingMaterialList[key].cargoSpaceCode =
+              house.cargoSpaceCode;
+            this.warehousingMaterialList[key].warehouseId = house.warehouseId;
+            this.warehousingMaterialList[key].areaId = house.areaId;
+            this.warehousingMaterialList[key].shelfId = house.shelfId;
+            this.warehousingMaterialList[key].cargoSpaceId = house.cargoSpaceId;
+            this.warehousingMaterialList[key].num = house.num;
+          }
+        }
+      },
+
+      formatOutInDetailRecordAddPO(it, item) {
+        return {
+          code: it.onlyCode,
+          dateType: this.curDateType === 'manufactureTime' ? 2 : 1,
+          dateValue: it[this.curDateType],
+          minUnit: it.minPackingCount,
+          minPositionId: it.cargoSpaceId,
+          name: it.assetName,
+          pathIds: item.pathIds,
+          unit: it.unit,
+          packageNo: it.num,
+          clientCode: it.clientCode,
+          materielCode: it.materielCode,
+          weight: it.weight,
+          weightUtil: it.weightUtil,
+          engrave: it.engrave,
+          materialDetails: this.materialDetails(it.onlyCode),
+          packingCount: it.packingCount,
+          status: it.status,
+          result: it.result
+        };
+      },
+
       materialDetails(onlyCode) {
         return this.resultArray.filter((item) => item.onlyCode === onlyCode);
       },

+ 2 - 2
src/views/bpm/todo/index.vue

@@ -101,7 +101,7 @@
     <handleTask ref="handleTaskRef" @reload="reload"></handleTask>
     <detail ref="detailRef"></detail>
 
-    <el-button type="text" @click="dialogVisible = true"
+    <!-- <el-button type="text" @click="dialogVisible = true"
       >点击打开 Dialog</el-button
     >
 
@@ -113,7 +113,7 @@
           >确 定</el-button
         >
       </span>
-    </el-dialog>
+    </el-dialog> -->
   </div>
 </template>