Răsfoiți Sursa

入库申请优化

yijing 1 an în urmă
părinte
comite
77db152dbe

+ 69 - 248
src/views/warehouseManagement/stockManagement/add.vue

@@ -467,7 +467,7 @@
           </el-table-column> -->
         </el-table>
       </div>
-      <div  class="storage_btn">
+      <div class="storage_btn">
         <el-button type="primary" :loading="saveLoading" @click="storage">入库</el-button>
       </div>
     </el-card>
@@ -820,26 +820,7 @@ export default {
 
         console.log(row, 'rowwwwwwwwwwwwww')
 
-        // if (row.packingUnit == row.measureUnit) {
-        //   let total = 0;
-        //   console.log(row.packingUnit,'row.packingUnit')
-        //   if (row.packingUnit == '立方' && row.netWeight) {
-        //     total = Number(row.packingQuantity) * row.netWeight;
-        //     console.log(total, 'jjjjjjjj')
-        //   } else {
-        //     console.log('不一样的单位')
-        //     total = 0;
-        //   }
-        // } else {
-        //   let total = Number(row.packingQuantity);
-        //   // packingQuantity 包装数量
-        //   for (; startIndex < endIndex; endIndex--) {
-        //     total = this.$math.format(
-        //       row.packingSpecificationOption[endIndex].packageCell * total,
-        //       14
-        //     );
-        //   }
-        // }
+
         let total = Number(row.packingQuantity);
         console.log(total, '111')
         if (row.packingUnit == row.measureUnit && row.measureUnit == '立方' && row.netWeight) {
@@ -856,10 +837,6 @@ export default {
           }
         }
         console.log(total, '444456')
-        // 除了计量单位是KG以外计算总重  总重量 = 单重singleWeight * 数量measureQuantity(计量数量);
-        // if (row.measuringUnit != 'KG') {
-        //   row.weight = Number(row.singleWeight) * Number(row.measureQuantity);
-        // }
 
         //计量数量
         row.measureQuantity = this.changeCount(total);
@@ -1092,12 +1069,21 @@ export default {
     async initUserInfo() {
       const res = await warehouseDefinition.tree();
       let info = JSON.parse(localStorage.getItem('info'));
+      console.log(info, 'infoinfoinfo')
       let obj = res.find(
         (item) => item.id === info.deptIds[info.deptIds.length - 1]
       );
-      if (!obj) return;
-      this.formData.extInfo.deptCode = obj.id;
-      this.formData.extInfo.deptName = obj.name;
+      // if (!obj) return;
+
+      if (obj) {
+        console.log(obj, 'objobjobjobjobjobjobjobjobjobjobjobjobjobjobjobjobj')
+
+        this.formData.extInfo.deptCode = obj?.id;
+        this.formData.extInfo.deptName = obj?.name;
+      } else {
+        this.formData.extInfo.deptName = info?.deptName;
+      }
+
       this.formData.extInfo.createUserName = info.name;
       this.formData.createUserId = info.userId;
     },
@@ -1789,6 +1775,17 @@ export default {
       }
       return { background: '#0000' };
     },
+    getNewSpecificationOption(packingSpecificationOption) {
+      return packingSpecificationOption.map(arr => {
+        return arr.reduce((acc, current) => {
+          const conversionUnit = current.conversionUnit;
+          if (!acc.some(item => item.conversionUnit === conversionUnit)) {
+            acc.push(current);
+          }
+          return acc;
+        }, []);
+      });
+    },
     async addGoods(data) {
       if (data.length === 0) return this.$message.warning('请选择产品信息')
       console.log(data, 'datadatadatadatadatadatadata111')
@@ -1815,6 +1812,8 @@ export default {
       });
       console.log('yeyyeyey----------------', data);
 
+      const newSpecificationOption = this.getNewSpecificationOption(this.packingSpecificationOption)
+
       let productList = data.map((item, index) => {
         // 显示规格
         let packingSpecificationLabel = this.packingSpecificationOption[index]
@@ -1824,6 +1823,7 @@ export default {
             }
           })
           .filter((item) => !!item);
+
         return {
           index:
             this.productList.length - 1 > -1
@@ -1848,7 +1848,7 @@ export default {
           supplierCode: '',
           approvalNumber: item.approvalNumber, // 批准文号
           packingSpecification: item.packingSpecification, // 包装规格
-          packingSpecificationOption: this.packingSpecificationOption[index], // 包装规格选项
+          packingSpecificationOption: newSpecificationOption[index], // 包装规格选项
           packingSpecificationLabel: packingSpecificationLabel, // 包装规格显示
           minPackingQuantity: '', // 最小包装单元数量
           packingQuantity: '', // 包装数量
@@ -2139,83 +2139,6 @@ export default {
       console.log(this.pageSize);
       console.log(this.materielPageNum);
     },
-
-    async getPackingList(row, index1, packingCodeList) {
-      console.log(packingCodeList, '开始组件--包装明细数据')
-
-      let packingList = [];
-      let obj = this.getNowDate();
-      let productionDate = '';
-      let purchaseDate = '';
-      if (this.formData.bizType == '1') {
-        // 生产入库
-        productionDate = `${obj.year}-${obj.month}-${obj.strDate} ${obj.hour}:${obj.minute}:${obj.second}`;
-        this.curDateType = 'productionDate';
-      } else if (this.formData.bizType == '2') {
-        // 采购入库
-        purchaseDate = `${obj.year}-${obj.month}-${obj.strDate} ${obj.hour}:${obj.minute}:${obj.second}`;
-        this.curDateType = 'purchaseDate';
-      }
-
-      for (let index = 0; index < packingCodeList.length; index++) {
-        let packingUnit = !row.isUnpack ? row.packingUnit : row.packingSpecificationOption[1].conversionUnit;
-        let packingQuantity = row.packingQuantity / packingCodeList.length;
-        let measureUnit = row.measureUnit;
-        let measureQuantity = row.measureQuantity / row.packingQuantity;
-        let item = {
-
-          index: row.index + '-' + index, // 包装索引
-          warehouseId: row.warehouseId, // 仓库id
-          warehouseName: row.warehouseName, // 仓库名称
-          categoryName: row.categoryName, // 产品名称
-          categoryCode: row.categoryCode, // 产品编码
-          categoryModel: row.categoryModel, // 物品型号
-          specification: row.specification, // 规格
-          supplierCode: row.supplierCode, // 供应商编码
-          brandNum: row.brandNum, // 牌号
-          parentIndex: row.index, // 产品索引
-          batchNo: row.batchNo, // 批次号
-          packageNo: packingCodeList[index]?.onlyCode, // 包装编码
-
-
-          packingQuantity: packingQuantity, // 包装数量
-          packingUnit: packingUnit,// 包装单位
-          measureQuantity: measureQuantity, // 计量数量
-          measureUnit: measureUnit, // 计量单位
-
-          weight: row.weight, // 重量
-          packingSpecificationOption: row.packingSpecificationOption, // 包装规格
-          weightUnit: row.weightUnit, // 重量单位
-          netWeight: row.netWeight, // 净重
-          barcodes: '', // 发货条码
-          clientCode: row.extInfo ? row.extInfo.clientCode : '', // 客户代号
-          materielDesignation: row.extInfo ? row.extInfo.materielCode : '', // 物料代号
-          engrave: '', // 刻码
-          isUnpack: row.isUnpack, // 是否允许拆包
-          productionDate: productionDate, // 生产日期
-          purchaseDate: purchaseDate, // 采购时间
-          result: 1, // 结果(1合格 2不合格)
-          status: 2 // 状态(0=未质检 1待检 2已检)
-        };
-        packingList.push(item);
-        console.log('包装明细数据!!!!!!!!!!!!!!!!!!', packingList)
-      }
-
-      // 单独点击保存并插入对应位置(包装)
-      if (index1 == 0) {
-        this.packingList.splice(index1, 0, ...packingList);
-      } else {
-        let packingIndex = this.packingList.findLastIndex(
-          (item) =>
-            item.parentIndex == this.productList[index1 - 1].index
-        );
-        this.packingList.splice(packingIndex + 1, 0, ...packingList);
-      }
-    },
-
-    getPackingList2(row, index1, packingCodeList) {
-
-    },
     // 产品保存操作
     listSave(row, index) {
       console.log('row22222222', row);
@@ -2285,7 +2208,7 @@ export default {
                 num: pNum,
               }
             ]);
-            this.getPackingList(row, index, data)
+            this.generateWrappers(row, index, data)
           } else {
             let pNum = 0;
             const { data } = await storageApi.getAssetNum([
@@ -2378,7 +2301,6 @@ export default {
         }
 
       } else {
-        // if (row.isUnpack == 1) {
         if (measureBoolen) {
           // 处理单位不为KG类,计量单位为KG类的情况
           let splitIndex = row.packingSpecificationOption.findIndex(
@@ -2499,10 +2421,6 @@ export default {
             }
           }
           packingList.push(item);
-          console.log(
-            packingList,
-            'packingList!!!!!!!!!!!!!!!!!!'
-          );
         }
       } else {
         console.log('拆包处理', row);
@@ -2527,7 +2445,6 @@ export default {
                   ? filterArr[0].packageCell
                   : Number(row.packingQuantity) -
                   this.$math.format(filterArr[0].packageCell * index, 14);
-              console.log(measureQuantity, 'measureQuantity')
             }
           } else {
             if (row.isUnpack == 1) {
@@ -2546,8 +2463,9 @@ export default {
                     14
                   );
                 }
+                console.log('2 拆--------', measureQuantity)
               } else {
-                measureQuantity = row.packingSpecificationOption[2]?.packageCell;
+                measureQuantity = row.packingSpecificationOption[1]?.packageCell;
 
                 console.log('3 拆--------', measureQuantity)
 
@@ -2576,20 +2494,6 @@ export default {
             batchNo: row.batchNo, // 批次号
             packageNo: packingCodeList[index]?.onlyCode, // 包装编码
             packingQuantity: packingQuantity, // 包装数量
-
-            // packingUnit: row.isUnpack ? packingBoolen ? filterArr[0].conversionUnit : measureBoolen ? row.packingSpecificationOption[1]
-            //       ? row.packingSpecificationOption[1].conversionUnit
-            //       : row.packingSpecificationOption[0].conversionUnit
-            //     : row.measureUnit
-            //   : packingBoolen
-            //     ? row.packingUnit === '立方' ? row.packingUnit : filterArr[0]?.conversionUnit
-            //     : row.packingUnit,
-            // packingUnit: row.isUnpack ? packingBoolen ? filterArr[0].conversionUnit : measureBoolen  ? row.packingSpecificationOption[2] ?
-            //   row.packingSpecificationOption[2].conversionUnit : row.packingSpecificationOption[1].conversionUnit: row.measureUnit: packingBoolen ? filterArr[0].conversionUnit : row.packingUnit,
-
-            //!row.isUnpack &&   row.packingUnit
-
-
             measureQuantity: row.isUnpack
               ? packingBoolen
                 ? measureQuantity
@@ -2636,7 +2540,7 @@ export default {
                 const option = row.packingSpecificationOption?.[1] || row.packingSpecificationOption?.[0];
                 item.packingUnit = option?.conversionUnit;
               } else {
-                item.packingUnit = row.packingUnit;
+                item.packingUnit = row.packingSpecificationOption?.[1].conversionUnit;
               }
             }
           } else {
@@ -2647,6 +2551,7 @@ export default {
               item.packingUnit = row.packingUnit;
             }
           }
+
           let outBoolen = !!this.getDict('不拆物料层规格', item.measureUnit)
             .dictValue;
           if (outBoolen) {
@@ -2702,10 +2607,7 @@ export default {
             }
           }
           packingList.push(item);
-          console.log(
-            packingList,
-            'packingList!!!!!!!!!!!!!!!!!!'
-          );
+
         }
       }
 
@@ -2719,39 +2621,6 @@ export default {
         );
         this.packingList.splice(packingIndex + 1, 0, ...packingList);
       }
-
-      // 单独点击保存并插入对应位置(物料)
-      // let materialList = packingList
-      //   .map((item) => {
-      //     if (item.isUnpack) {
-      //       return this.generateMaterial(item);
-      //     } else {
-      //       return [];
-      //     }
-      //   })
-      //   .flat();
-      // console.log(materialList);
-      // if (materialList.length > 0) {
-      //   if (productIndex == 0) {
-      //     this.materialList.splice(0, 0, ...materialList);
-      //   } else {
-      //     let preLastPackingIndex = this.packingList.findLastIndex((ite) => {
-      //       return ite.parentIndex <= productIndex - 1 && ite.isUnpack;
-      //     });
-      //     let preLastMaterialIndex = this.materialList.findLastIndex(
-      //       (ite) => {
-      //         return (
-      //           ite.parentIndex == this.packingList[preLastPackingIndex].index
-      //         );
-      //       }
-      //     );
-      //     this.materialList.splice(
-      //       preLastMaterialIndex + 1,
-      //       0,
-      //       ...materialList
-      //     );
-      //   }
-      // }
     },
     //入库明细删除
     listDel(row, index) {
@@ -2847,16 +2716,30 @@ export default {
                   row.categoryLevelPathIdParent
                 );
               } else {
-                console.log(packingBoolen, measureBoolen, row, '33333');
-
-                let num = Math.ceil(
-                  row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
-                );
-                console.log(num, 'num')
-                console.log(row.measureQuantity, 'row.measureQuantity')
-
-                this.$refs.wareHouseDailogRef.open(num ? num : 0, row.measureQuantity, idx, row.warehouseId, row.warehouseName + '',
-                  row.categoryLevelPathIdParent);
+                if (row.measureUnit == row.packingUnit) {
+                  let pNum = 0;
+                  let mNum = row.measureQuantity
+                  this.$refs.wareHouseDailogRef.open(
+                    pNum,
+                    mNum,
+                    idx,
+                    row.warehouseId,
+                    row.warehouseName + '',
+                    row.categoryLevelPathIdParent
+                  );
+                } else {
+                  let num = Math.ceil(
+                    row.measureQuantity / row.packingSpecificationOption[1]?.packageCell
+                  );
+                  console.log(num, 'num')
+                  this.$refs.wareHouseDailogRef.open(
+                    num,
+                    row.measureQuantity,
+                    idx,
+                    row.warehouseId,
+                    row.warehouseName + '',
+                    row.categoryLevelPathIdParent);
+                }
               }
             }
           }
@@ -2874,33 +2757,21 @@ export default {
           return;
         }
 
-        //如果此行不拆包,并且测量单位=包装单位 packingQuantity=0
-
-        // if (row[i].isUnpack === 0 && row[i].measureUnit === row[i].packingUnit) {
-        //   row[i].packingQuantity2 = 0;
-        // } else if (row[i].isUnpack === 1) {
-        //   const packageCell = row[i].packingSpecificationOption[1]?.packageCell;
-        //   if (packageCell) {
-        //     row[i].packingQuantity2 = Number(row[i].measureQuantity) / packageCell;
-        //   } else {
-        //     row[i].packingQuantity2 = 0; // 处理 packageCell 不存在的情况
-        //   }
-        // }
-
         for (let i = 0; i < row.length; i++) {
-          if (row[i].isUnpack === 0) {
-            if (row[i].measureUnit === row[i].packingUnit) {
-              row[i].packingQuantity2 = 0;
-              console.log(row[i].packingQuantity2)
-            } else {
-              row[i].packingQuantity2 = row[i].packingQuantity;
-              console.log(row[i].packingQuantity2, '单位不一样')
-            }
+          //测量单位等于包装单位
+          if (row[i].measureUnit === row[i].packingUnit) {
+            row[i].packingQuantity2 = 0;
+            console.log(row[i].packingQuantity2)
+          } else {
+            row[i].packingQuantity2 = Math.ceil(
+              row[i].measureQuantity / row[i].packingSpecificationOption[1]?.packageCell
+            );
+            console.log(row[i].packingQuantity2, '单位不一样')
           }
-
         }
         console.log(row, 'rowrowrowrowrowrow我看看')
 
+
         const pNum = row.reduce((sum, item) => {
           if (item.packingQuantity2 !== undefined && item.packingQuantity2 !== null) {
             return sum + Number(item.packingQuantity2);
@@ -2920,56 +2791,6 @@ export default {
           pNum,
           mNum
         );
-        // } else {
-        //   if (packingBoolen) {
-        //     let filterArr = row[0].packingSpecificationOption.filter(
-        //       (item) => {
-        //         return (
-        //           item.packingUnit == row[0]?.packingUnit &&
-        //           item.packingUnit != item.conversionUnit
-        //         );
-        //       }
-        //     );
-        //     let num = Math.ceil(
-        //       row[0]?.packingQuantity / filterArr[0].packageCell
-        //     );
-        //     this.$refs.wareHouseDailogRef.open(num, idx);
-        //   } else {
-        //     this.$refs.wareHouseDailogRef.open(
-        //       row[0]?.isUnpack
-        //         ? measureBoolen
-        //           ? row[0]?.packingQuantity
-        //           : row[0]?.measureQuantity
-        //         : row[0]?.packingQuantity,
-        //       idx
-        //     );
-        //   }
-        // }
-
-        // //计量和包装单位相同
-        // if (row.measureUnit == row.packingUnit) {
-        //   let pNum = 0;
-        //   let mNum = row.measureQuantity
-        //   this.$refs.wareHouseDailogRef.open(
-        //     pNum,
-        //     mNum,
-        //     idx,
-        //     row.warehouseId,
-        //     row.warehouseName + '',
-        //     row.categoryLevelPathIdParent
-        //   );
-        // } else {
-        //   let pNum = row.packingQuantity;
-        //   let mNum = row.measureQuantity
-        //   this.$refs.wareHouseDailogRef.open(
-        //     pNum,
-        //     mNum,
-        //     idx,
-        //     row.warehouseId,
-        //     row.warehouseName + '',
-        //     row.categoryLevelPathIdParent
-        //   );
-        // }
       }
     },
     wareHouseSelection(argum, idx) {

+ 737 - 942
src/views/warehouseManagement/stockManagement/details.vue

@@ -83,13 +83,8 @@
               </el-col>
               <el-col :span="8">
                 <el-form-item label="附件:">
-                  <el-link
-                    type="primary"
-                    v-for="item in infoData.qualityFile"
-                    @click="download(item)"
-                    :key="item.name"
-                    >{{ item.name }}</el-link
-                  >
+                  <el-link type="primary" v-for="item in infoData.qualityFile" @click="download(item)"
+                    :key="item.name">{{ item.name }}</el-link>
                 </el-form-item>
               </el-col>
               <el-col :span="24">
@@ -102,112 +97,41 @@
         </div>
         <div class="content-detail mt20">
           <header-title title="产品信息" size="16px"> </header-title>
-          <el-table
-            ref="productListTable"
-            :data="productList"
-            tooltip-effect="dark"
-            border
-            :max-height="300"
-            :header-cell-style="rowClass"
-          >
+          <el-table ref="productListTable" :data="productList" tooltip-effect="dark" border :max-height="300"
+            :header-cell-style="rowClass">
             <el-table-column label="序号" type="index" width="50">
             </el-table-column>
-            <el-table-column
-              label="编码"
-              prop="categoryCode"
-              align="center"
-              :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
-              label="名称"
-              align="center"
-              prop="categoryName"
-              :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
-              v-if="clientEnvironmentId == 4"
-              label="级别"
-              prop="level"
-              align="center"
-            >
-            </el-table-column>
-            <el-table-column
-              label="型号"
-              align="center"
-              prop="categoryModel"
-              :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
-              label="规格"
-              align="center"
-              prop="specification"
-              :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
-              label="牌号"
-              align="center"
-              prop="brandNum"
-              :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
-              v-for="(item, index) in newColumns"
-              :label="item.label"
-              :align="item.align"
-              :prop="item.prop"
-              :show-overflow-tooltip="item.showOverflowTooltip"
-            ></el-table-column>
-            <el-table-column
-              label="批次号"
-              prop="batchNo"
-              align="center"
-              :show-overflow-tooltip="true"
-            >
-            </el-table-column>
-            <el-table-column
-              label="包装数量"
-              prop="packingQuantity"
-              align="center"
-            >
+            <el-table-column label="编码" prop="categoryCode" align="center"
+              :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="名称" align="center" prop="categoryName"
+              :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column v-if="clientEnvironmentId == 4" label="级别" prop="level" align="center">
+            </el-table-column>
+            <el-table-column label="型号" align="center" prop="categoryModel"
+              :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="规格" align="center" prop="specification"
+              :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="牌号" align="center" prop="brandNum" :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column v-for="(item, index) in newColumns" :label="item.label" :align="item.align"
+              :prop="item.prop" :show-overflow-tooltip="item.showOverflowTooltip"></el-table-column>
+            <el-table-column label="批次号" prop="batchNo" align="center" :show-overflow-tooltip="true">
+            </el-table-column>
+            <el-table-column label="包装数量" prop="packingQuantity" align="center">
               <template slot-scope="{ row, $index }">
                 {{ row.packingQuantity }}
               </template>
             </el-table-column>
-            <el-table-column
-              label="包装单位"
-              align="center"
-              width="120"
-              prop="packingUnit"
-            >
+            <el-table-column label="包装单位" align="center" width="120" prop="packingUnit">
             </el-table-column>
-            <el-table-column
-              label="计量数量"
-              prop="measureQuantity"
-              width="100"
-              align="center"
-            >
+            <el-table-column label="计量数量" prop="measureQuantity" width="100" align="center">
             </el-table-column>
             <el-table-column label="计量单位" prop="measureUnit" align="center">
             </el-table-column>
-            <el-table-column
-              label="单重"
-              prop="singleWeight"
-              align="center"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="单重" prop="singleWeight" align="center" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="总重"
-              prop="weight"
-              align="center"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="总重" prop="weight" align="center" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="重量单位"
-              prop="weightUnit"
-              align="center"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="重量单位" prop="weightUnit" align="center" :show-overflow-tooltip="true">
             </el-table-column>
             <el-table-column label="单价" prop="unitPrice" align="center">
               <template slot-scope="{ row }">
@@ -217,112 +141,44 @@
               </template>
             </el-table-column>
 
-            <el-table-column
-              label="金额"
-              align="center"
-              prop="contentImage"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="金额" align="center" prop="contentImage" :show-overflow-tooltip="true">
               <template slot-scope="{ row, $index }">
                 {{ row.totalMoney ? row.totalMoney : 0 }}
               </template>
             </el-table-column>
-            <el-table-column
-              v-if="clientEnvironmentId == 4"
-              label="采购原因"
-              align="center"
-              prop="purpose"
-              :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
-              label="供应商"
-              prop="supplierName"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column v-if="clientEnvironmentId == 4" label="采购原因" align="center" prop="purpose"
+              :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="供应商" prop="supplierName" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              width="120"
-              label="供应商代号"
-              prop="supplierCode"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column width="120" label="供应商代号" prop="supplierCode" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="产地"
-              prop="provenance"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="产地" prop="provenance" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="仓库"
-              prop="warehouseName"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="仓库" prop="warehouseName" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              v-if="infoData.verifyStatus == 2"
-              label="操作"
-              width="200"
-              fixed="right"
-              align="center"
-            >
+            <el-table-column v-if="infoData.verifyStatus == 2" label="操作" width="200" fixed="right" align="center">
               <template slot-scope="{ row, $index }">
-                <el-button
-                  v-if="isUpper(row)"
-                  type="text"
-                  @click="shelvesWarehouse($index, '产品')"
-                  >下架</el-button
-                >
-                <el-button
-                  v-else
-                  type="text"
-                  @click="handleWareHouse(row, $index, '产品')"
-                  >上架</el-button
-                >
+                <el-button v-if="isUpper(row)" type="text" @click="shelvesWarehouse($index, '产品')">下架</el-button>
+                <el-button v-else type="text" @click="handleWareHouse(row, $index, '产品')">上架</el-button>
               </template>
             </el-table-column>
           </el-table>
         </div>
         <div class="mt20">
           <header-title :title="`包装明细`" size="16px">
-            <el-button
-              v-for="item in mergeOptions"
-              size="mini"
-              type="primary"
-              @click="openMergeDialog(item)"
-              >合并成{{ item.conversionUnit }}</el-button
-            >
-            <el-button
-              v-for="item in splitOptions"
-              size="mini"
-              type="primary"
-              @click="openSplitDialog(item)"
-              >拆分到{{ item.packageUnit }}</el-button
-            >
+            <el-button v-for="item in mergeOptions" size="mini" type="primary" @click="openMergeDialog(item)">合并成{{
+              item.conversionUnit }}</el-button>
+            <el-button v-for="item in splitOptions" size="mini" type="primary" @click="openSplitDialog(item)">拆分到{{
+              item.packageUnit }}</el-button>
           </header-title>
-          <el-table
-            ref="showPackingListTable"
-            :data="packingList"
-            tooltip-effect="dark"
-            :max-height="300"
-            border
-            :row-class-name="tableRowClassName"
-            :header-cell-style="rowClass"
-            @selection-change="productSplit"
-          >
-            <el-table-column
-              v-if="infoData.verifyStatus == 2"
-              key="selection"
-              label="选择"
-              type="selection"
-              width="55"
-              align="center"
-              fixed="left"
-            >
+          <el-table ref="showPackingListTable" :data="packingList" tooltip-effect="dark" :max-height="300" border
+            :row-class-name="tableRowClassName" :header-cell-style="rowClass" @selection-change="productSplit">
+            <el-table-column v-if="infoData.verifyStatus == 2" key="selection" label="选择" type="selection" width="55"
+              align="center" fixed="left">
             </el-table-column>
             <el-table-column label="序号" type="index" width="50">
             </el-table-column>
-            
+
             <el-table-column label="批次号" prop="batchNo" width="80" :show-overflow-tooltip="true"></el-table-column>
             <el-table-column label="包装编码" prop="packageNo" width="130" :show-overflow-tooltip="true"></el-table-column>
             <el-table-column label="名称" prop="categoryName" width="120" :show-overflow-tooltip="true"></el-table-column>
@@ -330,838 +186,777 @@
             <el-table-column label="型号" prop="categoryModel" width="80" :show-overflow-tooltip="true"></el-table-column>
             <el-table-column label="规格" prop="specification" width="80" :show-overflow-tooltip="true"></el-table-column>
             <el-table-column label="牌号" prop="brandNum" width="80" :show-overflow-tooltip="true"></el-table-column>
-            <el-table-column
-              label="发货条码"
-              prop="barcodes"
-              :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
-              label="包装编码"
-              prop="packageNo"
-              :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
-              label="包装数量"
-              prop="packingQuantity"
-              :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
-              label="包装单位"
-              prop="packingUnit"
-              :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
-              label="计量数量"
-              prop="measureQuantity"
-              :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
-              label="计量单位"
-              prop="measureUnit"
-              :show-overflow-tooltip="true"
-            ></el-table-column>
-            <el-table-column
-              label="物料代号"
-              prop="materielDesignation"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="发货条码" prop="barcodes" :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="包装编码" prop="packageNo" :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="包装数量" prop="packingQuantity" :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="包装单位" prop="packingUnit" :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="计量数量" prop="measureQuantity" :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="计量单位" prop="measureUnit" :show-overflow-tooltip="true"></el-table-column>
+            <el-table-column label="物料代号" prop="materielDesignation" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="客户代号"
-              prop="clientCode"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="客户代号" prop="clientCode" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="刻码"
-              prop="engrave"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="刻码" prop="engrave" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="总重"
-              prop="weight"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="总重" prop="weight" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="重量单位"
-              prop="weightUnit"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="重量单位" prop="weightUnit" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="质检结果"
-              prop="result"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="质检结果" prop="result" :show-overflow-tooltip="true">
               <template slot-scope="{ row }">
                 <span>{{ qualityResults[row.result] }}</span>
               </template>
             </el-table-column>
-            <el-table-column
-              label="质检状态"
-              prop="status"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="质检状态" prop="status" :show-overflow-tooltip="true">
               <template slot-scope="{ row }">
                 <span>{{ qualityStatus[row.status] }}</span>
               </template>
             </el-table-column>
-            <el-table-column
-              label="仓库"
-              prop="warehouseName"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="仓库" prop="warehouseName" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="货区"
-              prop="areaName"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="货区" prop="areaName" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="货架"
-              prop="goodsShelfName"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="货架" prop="goodsShelfName" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="货位"
-              prop="goodsAllocationName"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="货位" prop="goodsAllocationName" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="生产日期"
-              prop="productionDate"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="生产日期" prop="productionDate" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              label="采购日期"
-              prop="purchaseDate"
-              :show-overflow-tooltip="true"
-            >
+            <el-table-column label="采购日期" prop="purchaseDate" :show-overflow-tooltip="true">
             </el-table-column>
-            <el-table-column
-              v-if="infoData.verifyStatus == 2"
-              label="操作"
-              width="200"
-              fixed="right"
-              align="center"
-            >
+            <el-table-column v-if="infoData.verifyStatus == 2" label="操作" width="200" fixed="right" align="center">
               <template slot-scope="{ row, $index }">
-                <el-button
-                  v-if="row.areaId"
-                  type="text"
-                  @click="shelvesWarehouse($index, '包装')"
-                  >下架</el-button
-                >
-                <el-button
-                  v-else
-                  type="text"
-                  @click="handleWareHouse(row, $index, '包装')"
-                  >上架</el-button
-                >
+                <el-button v-if="row.areaId" type="text" @click="shelvesWarehouse($index, '包装')">下架</el-button>
+                <el-button v-else type="text" @click="handleWareHouse(row, $index, '包装')">上架</el-button>
               </template>
             </el-table-column>
           </el-table>
-          <el-pagination
-            background
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="total"
-            :page-sizes="[5, 10, 20, 30]"
-            :page-size.sync="pages.size"
-            :current-page.sync="pages.pageNum"
-            @current-change="handleCurrentChange"
-            @size-change="handleSizeChange"
-          >
+          <el-pagination background layout="total, sizes, prev, pager, next, jumper" :total="total"
+            :page-sizes="[5, 10, 20, 30]" :page-size.sync="pages.size" :current-page.sync="pages.pageNum"
+            @current-change="handleCurrentChange" @size-change="handleSizeChange">
           </el-pagination>
         </div>
       </div>
     </el-card>
-    <WareHouseDailog
-      ref="wareHouseDailogRef"
-      @houseData="houseData"
-    ></WareHouseDailog>
-    <mergeDetails
-      ref="mergeDetailsRef"
-      @refresh="getPackingList"
-    ></mergeDetails>
+    <WareHouseDailog ref="wareHouseDailogRef" @houseData="houseData"></WareHouseDailog>
+    <mergeDetails ref="mergeDetailsRef" @refresh="getPackingList"></mergeDetails>
     <splitDetails ref="splitDetailsRef"></splitDetails>
   </div>
 </template>
 
 <script>
-  import mergeDetails from './mergeDetails.vue';
-  import splitDetails from './splitDetails.vue';
-  import WareHouseDailog from '../components/warehouseShelvesDialog.vue';
-  import elTableInfiniteScroll from 'el-table-infinite-scroll';
-  import { getFile } from '@/api/system/file/index.js';
-  import PageHeader from '@/components/PageHeader';
-  import storageApi from '@/api/warehouseManagement';
-  import { getCode } from '@/api/codeManagement/index.js';
-  import { allCategoryLevel } from '@/api/classifyManage';
-  import { useDictLabel, sceneState } from '@/utils/dict/index';
-  import { mapGetters, mapActions } from 'vuex';
-  export default {
-    components: { PageHeader, WareHouseDailog, mergeDetails, splitDetails },
-    directives: {
-      'el-table-infinite-scroll': elTableInfiniteScroll
-    },
-    data() {
-      return {
-        total: 0,
-        pages: { pageNum: 1, size: 10 },
-        oldSelectionList: [],
-        selectionList: [],
-        mergeOptions: [],
-        splitOptions: [],
-        currentId: '',
-        newColumns: [], // 动态表头
-        qualityStatus: {
-          0: '未质检',
-          1: '已质检'
-        }, // 质检状态 0未检 1已检
-        qualityResults: {
-          1: '合格',
-          2: '不合格'
-        }, // 质检结果 1合格 2不合格
-        productList: [], // 产品列表
-        showPackingList: [], // 展示的包装列表
-        packingList: [], // 包装列表
-        showMaterialList: [], // 展示物料列表
-        materialList: [], // 物料列表
-        extInfo: {}, // 扩展信息
-        pageSize: 20,
-        pickingPageNum: 1,
-        materielPageNum: 1,
-        codeList: [],
-        infoData: {},
-        stepsTitle: '已完成',
-        stepsStatus: 'success',
-        active: 0,
-        verifyStatus: ''
-      };
-    },
-    watch: {
-      'infoData.verifyStatus': {
-        immediate: true,
-        handler(val) {
-          if (val == 0) {
-            this.active = 1;
-            this.stepsTitle = '未审核';
-            this.stepsStatus = 'wait';
-          } else if (val == 1) {
-            this.active = 2;
-            this.stepsTitle = '审核中';
-            this.stepsStatus = 'process';
-          } else if (val == 2) {
-            this.active = 2;
-            this.stepsTitle = '审核通过';
-            this.stepsStatus = 'success';
-          } else if (val == 3) {
-            this.active = 2;
-            this.stepsTitle = '驳回';
-            this.stepsStatus = 'error';
-          }
+import mergeDetails from './mergeDetails.vue';
+import splitDetails from './splitDetails.vue';
+import WareHouseDailog from '../components/warehouseShelvesDialog.vue';
+import elTableInfiniteScroll from 'el-table-infinite-scroll';
+import { getFile } from '@/api/system/file/index.js';
+import PageHeader from '@/components/PageHeader';
+import storageApi from '@/api/warehouseManagement';
+import { getCode } from '@/api/codeManagement/index.js';
+import { allCategoryLevel } from '@/api/classifyManage';
+import { useDictLabel, sceneState } from '@/utils/dict/index';
+import { mapGetters, mapActions } from 'vuex';
+import {
+  qualityStatus,
+} from '@/utils/dict/index';
+export default {
+  components: { PageHeader, WareHouseDailog, mergeDetails, splitDetails },
+  directives: {
+    'el-table-infinite-scroll': elTableInfiniteScroll
+  },
+  data() {
+    return {
+      total: 0,
+      pages: { pageNum: 1, size: 10 },
+      oldSelectionList: [],
+      selectionList: [],
+      mergeOptions: [],
+      splitOptions: [],
+      currentId: '',
+      newColumns: [], // 动态表头
+      qualityStatus,
+      // qualityStatus: {
+      //   0: '未质检',
+      //   1: '已质检'
+      // }, // 质检状态 0未检 1已检
+      qualityResults: {
+        1: '合格',
+        2: '不合格'
+      }, // 质检结果 1合格 2不合格
+      productList: [], // 产品列表
+      showPackingList: [], // 展示的包装列表
+      packingList: [], // 包装列表
+      showMaterialList: [], // 展示物料列表
+      materialList: [], // 物料列表
+      extInfo: {}, // 扩展信息
+      pageSize: 20,
+      pickingPageNum: 1,
+      materielPageNum: 1,
+      codeList: [],
+      infoData: {},
+      stepsTitle: '已完成',
+      stepsStatus: 'success',
+      active: 0,
+      verifyStatus: ''
+    };
+  },
+  watch: {
+    'infoData.verifyStatus': {
+      immediate: true,
+      handler(val) {
+        if (val == 0) {
+          this.active = 1;
+          this.stepsTitle = '未审核';
+          this.stepsStatus = 'wait';
+        } else if (val == 1) {
+          this.active = 2;
+          this.stepsTitle = '审核中';
+          this.stepsStatus = 'process';
+        } else if (val == 2) {
+          this.active = 2;
+          this.stepsTitle = '审核通过';
+          this.stepsStatus = 'success';
+        } else if (val == 3) {
+          this.active = 2;
+          this.stepsTitle = '驳回';
+          this.stepsStatus = 'error';
         }
-      },
-      packingList: {
-        handler(newVal) {
-          console.log('包装列表', newVal);
-          console.log('当前包装列表加载页数', this.pickingPageNum);
-          this.showPackingList = newVal.slice(
-            0,
-            this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
-          );
-        },
-        deep: true
-      },
-      materialList: {
-        handler(newVal) {
-          console.log('物料列表', newVal);
-          console.log('当前物料列表加载页数', this.materielPageNum);
-          this.showMaterialList = newVal.slice(
-            0,
-            this.pageSize *
-              (this.materielPageNum > 0 ? this.materielPageNum : 1)
-          );
-        },
-        deep: true
-      }
-    },
-    computed: {
-      ...mapGetters(['getDictValue']),
-      clientEnvironmentId() {
-        return this.$store.state.user.info.clientEnvironmentId;
       }
     },
-    created() {
-      this.getFieldModel();
-      this.requestDict('类型用途');
-      this.requestDict('不拆物料层规格');
-      this.getAllCategoryType();
-      this._getInfo();
-      this.verifyStatus = this.$route.query.verifyStatus;
-    },
-    methods: {
-      openMergeDialog(dimensionRow) {
-        this.$refs.mergeDetailsRef.open(dimensionRow, this.selectionList);
-      },
-      openSplitDialog(dimensionRow) {
-        this.$refs.splitDetailsRef.open(dimensionRow, this.selectionList);
+    packingList: {
+      handler(newVal) {
+        console.log('包装列表', newVal);
+        console.log('当前包装列表加载页数', this.pickingPageNum);
+        this.showPackingList = newVal.slice(
+          0,
+          this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
+        );
       },
-      productSplit(selectionList) {
-        console.log(selectionList);
-        let isUnification = selectionList.every(
-          (item) =>
-            item.packingUnit == selectionList[0].packingUnit &&
-            item.categoryId == selectionList[0].categoryId
+      deep: true
+    },
+    materialList: {
+      handler(newVal) {
+        console.log('物料列表', newVal);
+        console.log('当前物料列表加载页数', this.materielPageNum);
+        this.showMaterialList = newVal.slice(
+          0,
+          this.pageSize *
+          (this.materielPageNum > 0 ? this.materielPageNum : 1)
         );
-        if (isUnification) {
-          if (selectionList.length > 0) {
-            this.selectionList = selectionList;
-            this.oldSelectionList = selectionList;
-            if (this.mergeOptions.length == 0) {
-              storageApi
-                .getCategoryPackageDisposition({
-                  categoryIds: [this.selectionList[0].categoryId]
-                })
-                .then((data) => {
-                  console.log(data);
-                  console.log(this.selectionList[0]);
-                  // 形成合并按钮
-                  let mergeIndex = data.findIndex(
-                    (item) =>
-                      item.packageUnit == this.selectionList[0].packingUnit &&
-                      item.packageUnit != item.conversionUnit
-                  );
-                  console.log(mergeIndex);
-                  this.mergeOptions = data.filter(
-                    (item) => item.sort == data[mergeIndex].sort
-                  );
-                  // 形成拆分按钮
-                  let splitIndex = data.findIndex(
-                    (item) =>
-                      item.conversionUnit ==
-                        this.selectionList[0].packingUnit &&
-                      item.packageUnit != item.conversionUnit
-                  );
-                  this.splitOptions = data.filter(
-                    (item) => item.sort == data[splitIndex].sort
-                  );
-                });
-            }
-          } else {
-            this.mergeOptions = [];
-            this.splitOptions = [];
+      },
+      deep: true
+    }
+  },
+  computed: {
+    ...mapGetters(['getDictValue']),
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
+    }
+  },
+  created() {
+    this.getFieldModel();
+    this.requestDict('类型用途');
+    this.requestDict('不拆物料层规格');
+    this.getAllCategoryType();
+    this._getInfo();
+    this.verifyStatus = this.$route.query.verifyStatus;
+  },
+  methods: {
+    openMergeDialog(dimensionRow) {
+      this.$refs.mergeDetailsRef.open(dimensionRow, this.selectionList);
+    },
+    openSplitDialog(dimensionRow) {
+      this.$refs.splitDetailsRef.open(dimensionRow, this.selectionList);
+    },
+    productSplit(selectionList) {
+      console.log(selectionList);
+      let isUnification = selectionList.every(
+        (item) =>
+          item.packingUnit == selectionList[0].packingUnit &&
+          item.categoryId == selectionList[0].categoryId
+      );
+      if (isUnification) {
+        if (selectionList.length > 0) {
+          this.selectionList = selectionList;
+          this.oldSelectionList = selectionList;
+          if (this.mergeOptions.length == 0) {
+            storageApi
+              .getCategoryPackageDisposition({
+                categoryIds: [this.selectionList[0].categoryId]
+              })
+              .then((data) => {
+                console.log(data);
+                console.log(this.selectionList[0]);
+                // 形成合并按钮
+                let mergeIndex = data.findIndex(
+                  (item) =>
+                    item.packageUnit == this.selectionList[0].packingUnit &&
+                    item.packageUnit != item.conversionUnit
+                );
+                console.log(mergeIndex);
+                this.mergeOptions = data.filter(
+                  (item) => item.sort == data[mergeIndex].sort
+                );
+                // 形成拆分按钮
+                let splitIndex = data.findIndex(
+                  (item) =>
+                    item.conversionUnit ==
+                    this.selectionList[0].packingUnit &&
+                    item.packageUnit != item.conversionUnit
+                );
+                this.splitOptions = data.filter(
+                  (item) => item.sort == data[splitIndex].sort
+                );
+              });
           }
         } else {
-          this.$message.error('请选择相同物品和包装装单位');
-          this.$refs.showPackingListTable.clearSelection();
+          this.mergeOptions = [];
+          this.splitOptions = [];
         }
-        console.log(isUnification);
-      },
-      // 获取动态表头
-      getFieldModel() {
-        storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
-          let newRes = res.map((m) => {
-            return {
-              prop: 'extField.' + m.prop,
-              label: m.label,
-              align: 'center',
-              showOverflowTooltip: true
-            };
-          });
-          this.newColumns = [...newRes];
-        });
-      },
-      isUpper(row) {
-        let filterPackingList = this.packingList.filter((packingItem) => {
-          return packingItem.parentIndex === row.index;
-        });
-        let boolen = filterPackingList.every((item) => {
-          return item.areaId && item.goodsShelfId && item.goodsAllocationId;
-        });
-        return boolen;
-      },
-      formDataData() {
-        // 处理包装数据
-        this.packingList = this.packingList.map((packingItem) => {
-          return {
-            ...packingItem,
-            materialDetailList: this.materialList.filter(
-              (item) => item.parentIndex === packingItem.index
-            )
-          };
-        });
-        // 处理产品数据
-        this.productList = this.productList.map((productItem) => {
+      } else {
+        this.$message.error('请选择相同物品和包装装单位');
+        this.$refs.showPackingListTable.clearSelection();
+      }
+      console.log(isUnification);
+    },
+    // 获取动态表头
+    getFieldModel() {
+      storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+        let newRes = res.map((m) => {
           return {
-            ...productItem,
-            outInDetailRecordRequestList: this.packingList.filter(
-              (item) => item.parentIndex === productItem.index
-            )
+            prop: 'extField.' + m.prop,
+            label: m.label,
+            align: 'center',
+            showOverflowTooltip: true
           };
         });
-        this.infoData.outInDetailList = this.productList;
-      },
-      houseData(argum, idx, type) {
-        console.log('-argum-------------------', argum);
-        switch (type) {
-          case '产品':
-            this.packingList.forEach((item) => {
-              if (item.parentIndex === this.productList[idx].index) {
-                this.$set(item, 'areaId', argum[0].areaId);
-                this.$set(item, 'areaName', argum[0].areaName);
-                this.$set(item, 'goodsShelfId', argum[0].shelfId);
-                this.$set(item, 'goodsShelfName', argum[0].shelfCode);
-                this.$set(item, 'goodsAllocationId', argum[0].cargoSpaceId);
-                this.$set(item, 'goodsAllocationName', argum[0].cargoSpaceCode);
-              }
-            });
-            break;
-          case '包装':
-            this.$set(this.packingList[idx], 'areaId', argum[0].areaId);
-            this.$set(this.packingList[idx], 'areaName', argum[0].areaName);
-            this.$set(this.packingList[idx], 'goodsShelfId', argum[0].shelfId);
-            this.$set(
-              this.packingList[idx],
-              'goodsShelfName',
-              argum[0].shelfCode
-            );
-            this.$set(
-              this.packingList[idx],
-              'goodsAllocationId',
-              argum[0].cargoSpaceId
-            );
-            this.$set(
-              this.packingList[idx],
-              'goodsAllocationName',
-              argum[0].cargoSpaceCode
-            );
-            break;
-        }
-        this.formDataData();
-        storageApi
-          .upperLowerShelves(this.infoData)
-          .then((data) => {
-            console.log(data);
-            this._getInfo();
-            this.$message.success('上架成功');
-          })
-          .catch(() => {
-            this.$message.error('上架失败');
+        this.newColumns = [...newRes];
+      });
+    },
+    isUpper(row) {
+      let filterPackingList = this.packingList.filter((packingItem) => {
+        return packingItem.parentIndex === row.index;
+      });
+      let boolen = filterPackingList.every((item) => {
+        return item.areaId && item.goodsShelfId && item.goodsAllocationId;
+      });
+      return boolen;
+    },
+    formDataData() {
+      // 处理包装数据
+      this.packingList = this.packingList.map((packingItem) => {
+        return {
+          ...packingItem,
+          materialDetailList: this.materialList.filter(
+            (item) => item.parentIndex === packingItem.index
+          )
+        };
+      });
+      // 处理产品数据
+      this.productList = this.productList.map((productItem) => {
+        return {
+          ...productItem,
+          outInDetailRecordRequestList: this.packingList.filter(
+            (item) => item.parentIndex === productItem.index
+          )
+        };
+      });
+      this.infoData.outInDetailList = this.productList;
+    },
+    houseData(argum, idx, type) {
+      console.log('-argum-------------------', argum);
+      switch (type) {
+        case '产品':
+          this.packingList.forEach((item) => {
+            if (item.parentIndex === this.productList[idx].index) {
+              this.$set(item, 'areaId', argum[0].areaId);
+              this.$set(item, 'areaName', argum[0].areaName);
+              this.$set(item, 'goodsShelfId', argum[0].shelfId);
+              this.$set(item, 'goodsShelfName', argum[0].shelfCode);
+              this.$set(item, 'goodsAllocationId', argum[0].cargoSpaceId);
+              this.$set(item, 'goodsAllocationName', argum[0].cargoSpaceCode);
+            }
           });
-      },
-      handleWareHouse(row, idx, type) {
-        this.$refs.wareHouseDailogRef.open(row, idx, type);
-      },
-      shelvesWarehouse(idx, type) {
-        switch (type) {
-          case '产品':
-            this.packingList.forEach((item) => {
-              if (item.parentIndex === this.productList[idx].index) {
-                this.$set(item, 'areaId', '');
-                this.$set(item, 'areaName', '');
-                this.$set(item, 'goodsShelfId', '');
-                this.$set(item, 'goodsShelfName', '');
-                this.$set(item, 'goodsAllocationId', '');
-                this.$set(item, 'goodsAllocationName', '');
-              }
-            });
-            break;
-          case '包装':
-            this.$set(this.packingList[idx], 'areaId', '');
-            this.$set(this.packingList[idx], 'areaName', '');
-            this.$set(this.packingList[idx], 'goodsShelfId', '');
-            this.$set(this.packingList[idx], 'goodsShelfName', '');
-            this.$set(this.packingList[idx], 'goodsAllocationId', '');
-            this.$set(this.packingList[idx], 'goodsAllocationName', '');
-            break;
-        }
-        this.formDataData();
-        storageApi
-          .upperLowerShelves(this.infoData)
-          .then((data) => {
-            console.log(data);
-            this._getInfo();
-            this.$message.success('下架成功');
-          })
-          .catch(() => {
-            this.$message.error('下架失败');
+          break;
+        case '包装':
+          this.$set(this.packingList[idx], 'areaId', argum[0].areaId);
+          this.$set(this.packingList[idx], 'areaName', argum[0].areaName);
+          this.$set(this.packingList[idx], 'goodsShelfId', argum[0].shelfId);
+          this.$set(
+            this.packingList[idx],
+            'goodsShelfName',
+            argum[0].shelfCode
+          );
+          this.$set(
+            this.packingList[idx],
+            'goodsAllocationId',
+            argum[0].cargoSpaceId
+          );
+          this.$set(
+            this.packingList[idx],
+            'goodsAllocationName',
+            argum[0].cargoSpaceCode
+          );
+          break;
+      }
+      this.formDataData();
+      storageApi
+        .upperLowerShelves(this.infoData)
+        .then((data) => {
+          console.log(data);
+          this._getInfo();
+          this.$message.success('上架成功');
+        })
+        .catch(() => {
+          this.$message.error('上架失败');
+        });
+    },
+    handleWareHouse(row, idx, type) {
+      this.$refs.wareHouseDailogRef.open(row, idx, type);
+    },
+    shelvesWarehouse(idx, type) {
+      switch (type) {
+        case '产品':
+          this.packingList.forEach((item) => {
+            if (item.parentIndex === this.productList[idx].index) {
+              this.$set(item, 'areaId', '');
+              this.$set(item, 'areaName', '');
+              this.$set(item, 'goodsShelfId', '');
+              this.$set(item, 'goodsShelfName', '');
+              this.$set(item, 'goodsAllocationId', '');
+              this.$set(item, 'goodsAllocationName', '');
+            }
           });
-      },
-      pickingHandleScroll() {
-        console.log('---------pickingHandleScroll------------');
-        if (this.showPackingList.length < this.packingList.length) {
-          if (this.packingList.length > this.pageSize) {
-            this.pickingPageNum += 1;
-          }
-          this.pickingFetchData();
-        }
-      },
-      pickingFetchData() {
-        const start = (this.pickingPageNum - 1) * this.pageSize;
-        const end = start + this.pageSize;
-        this.showPackingList = this.showPackingList.concat(
-          this.packingList.slice(start, end)
-        );
-      },
-      materielHandleScroll() {
-        console.log('---------materielHandleScroll------------');
-        if (this.showMaterialList.length < this.materialList.length) {
-          if (this.materialList.length > this.pageSize) {
-            this.materielPageNum += 1;
-          }
-          this.materielFetchData();
+          break;
+        case '包装':
+          this.$set(this.packingList[idx], 'areaId', '');
+          this.$set(this.packingList[idx], 'areaName', '');
+          this.$set(this.packingList[idx], 'goodsShelfId', '');
+          this.$set(this.packingList[idx], 'goodsShelfName', '');
+          this.$set(this.packingList[idx], 'goodsAllocationId', '');
+          this.$set(this.packingList[idx], 'goodsAllocationName', '');
+          break;
+      }
+      this.formDataData();
+      storageApi
+        .upperLowerShelves(this.infoData)
+        .then((data) => {
+          console.log(data);
+          this._getInfo();
+          this.$message.success('下架成功');
+        })
+        .catch(() => {
+          this.$message.error('下架失败');
+        });
+    },
+    pickingHandleScroll() {
+      console.log('---------pickingHandleScroll------------');
+      if (this.showPackingList.length < this.packingList.length) {
+        if (this.packingList.length > this.pageSize) {
+          this.pickingPageNum += 1;
         }
-      },
-      materielFetchData() {
-        const start = (this.materielPageNum - 1) * this.pageSize;
-        const end = start + this.pageSize;
-        this.showMaterialList = this.showMaterialList.concat(
-          this.materialList.slice(start, end)
-        );
-        console.log(this.showMaterialList);
-      },
-      ...mapActions('dict', ['requestDict']),
-      getSceneState: useDictLabel(sceneState),
-      handleAssetType(r) {
-        let arr = r?.split(',');
-        const filteredData = this.codeList.filter((item) =>
-          arr?.includes(item.dictCode)
-        );
-        return filteredData.map((item) => item.dictValue).join(',');
-      },
-      tableRowClassName({ row, rowIndex }) {
-        if (row.result == 2) {
-          return 'warning-row';
-        } else {
-          return '';
+        this.pickingFetchData();
+      }
+    },
+    pickingFetchData() {
+      const start = (this.pickingPageNum - 1) * this.pageSize;
+      const end = start + this.pageSize;
+      this.showPackingList = this.showPackingList.concat(
+        this.packingList.slice(start, end)
+      );
+    },
+    materielHandleScroll() {
+      console.log('---------materielHandleScroll------------');
+      if (this.showMaterialList.length < this.materialList.length) {
+        if (this.materialList.length > this.pageSize) {
+          this.materielPageNum += 1;
         }
-      },
-      goBack() {
-        this.$router.go(-1);
-      },
-      rowClass({ row, column, rowIndex, columnIndex }) {
-        if (rowIndex === 1) {
+        this.materielFetchData();
+      }
+    },
+    materielFetchData() {
+      const start = (this.materielPageNum - 1) * this.pageSize;
+      const end = start + this.pageSize;
+      this.showMaterialList = this.showMaterialList.concat(
+        this.materialList.slice(start, end)
+      );
+      console.log(this.showMaterialList);
+    },
+    ...mapActions('dict', ['requestDict']),
+    getSceneState: useDictLabel(sceneState),
+    handleAssetType(r) {
+      let arr = r?.split(',');
+      const filteredData = this.codeList.filter((item) =>
+        arr?.includes(item.dictCode)
+      );
+      return filteredData.map((item) => item.dictValue).join(',');
+    },
+    tableRowClassName({ row, rowIndex }) {
+      if (row.result == 2) {
+        return 'warning-row';
+      } else {
+        return '';
+      }
+    },
+    goBack() {
+      this.$router.go(-1);
+    },
+    rowClass({ row, column, rowIndex, columnIndex }) {
+      if (rowIndex === 1) {
+        return {
+          display: 'none',
+          background: '#EEEEEE'
+        };
+      }
+      return { background: '#0000' };
+    },
+    async getAllCategoryType() {
+      const { data } = await allCategoryLevel();
+      this.codeList = data.map((item) => {
+        return { dictCode: item.id, dictValue: item.name };
+      });
+    },
+    async _getInfo() {
+      const res = await storageApi.getInboundDetailsById(
+        this.$route.query.id
+      );
+      console.log('==============================res', res);
+      this.infoData = res;
+      this.extInfo = res.extInfo;
+      this.productList = res.outInDetailList.map(
+        (productItem, productIndex) => {
           return {
-            display: 'none',
-            background: '#EEEEEE'
+            ...productItem,
+            index: this.productList.length + productIndex,
+            outInDetailRecordRequestList:
+              productItem.outInDetailRecordRequestList.map(
+                (packingItem, packingIndex) => {
+                  return {
+                    ...packingItem,
+                    index:
+                      this.productList.length +
+                      productIndex +
+                      '-' +
+                      packingIndex, // 包装索引
+                    parentIndex: this.productList.length + productIndex, // 物品索引
+                    categoryName: productItem.categoryName,
+                    categoryCode: productItem.categoryCode,
+                    materialDetailList: packingItem.materialDetailList.map(
+                      (materialItem, materialIndex) => {
+                        return {
+                          ...materialItem,
+                          index:
+                            this.productList.length +
+                            productIndex +
+                            '-' +
+                            packingIndex +
+                            '——' +
+                            materialIndex, // 包装索引
+                          parentIndex:
+                            this.productList.length +
+                            productIndex +
+                            '-' +
+                            packingIndex, // 物品索引
+                          categoryName: productItem.categoryName,
+                          categoryCode: productItem.categoryCode
+                        };
+                      }
+                    )
+                  };
+                }
+              )
           };
         }
-        return { background: '#0000' };
-      },
-      async getAllCategoryType() {
-        const { data } = await allCategoryLevel();
-        this.codeList = data.map((item) => {
-          return { dictCode: item.id, dictValue: item.name };
-        });
-      },
-      async _getInfo() {
-        const res = await storageApi.getInboundDetailsById(
-          this.$route.query.id
-        );
-        console.log('===', res);
-        this.infoData = res;
-        this.extInfo = res.extInfo;
-        this.productList = res.outInDetailList.map(
-          (productItem, productIndex) => {
-            return {
-              ...productItem,
-              index: this.productList.length + productIndex,
-              outInDetailRecordRequestList:
-                productItem.outInDetailRecordRequestList.map(
-                  (packingItem, packingIndex) => {
-                    return {
-                      ...packingItem,
-                      index:
-                        this.productList.length +
-                        productIndex +
-                        '-' +
-                        packingIndex, // 包装索引
-                      parentIndex: this.productList.length + productIndex, // 物品索引
-                      categoryName: productItem.categoryName,
-                      categoryCode: productItem.categoryCode,
-                      materialDetailList: packingItem.materialDetailList.map(
-                        (materialItem, materialIndex) => {
-                          return {
-                            ...materialItem,
-                            index:
-                              this.productList.length +
-                              productIndex +
-                              '-' +
-                              packingIndex +
-                              '——' +
-                              materialIndex, // 包装索引
-                            parentIndex:
-                              this.productList.length +
-                              productIndex +
-                              '-' +
-                              packingIndex, // 物品索引
-                            categoryName: productItem.categoryName,
-                            categoryCode: productItem.categoryCode
-                          };
-                        }
-                      )
-                    };
-                  }
-                )
-            };
-          }
-        );
-        this.getPackingList();
-        // // 获取包装维度数据
-        // const arr = [];
-        // for (const key in this.productList) {
-        //   for (const k in this.productList[key].outInDetailRecordRequestList) {
-        //     arr.push({
-        //       ...this.productList[key].outInDetailRecordRequestList[k]
-        //     });
-        //   }
-        // }
-        // this.packingList = arr;
-        // // 获取物料维度数据
-        // let iArr = [];
-        // arr.forEach((item) => {
-        //   item.materialDetailList.forEach((ele) => {
-        //     iArr.push({ ...ele });
-        //   });
-        // });
-        // this.materialList = iArr;
-        // console.log(this.packingList);
-        // console.log(this.materialList);
-        // this.pickingFetchData();
-        // this.materielFetchData();
-      },
-      download(row) {
-        if (row.storePath) {
-          getFile({ objectName: row.storePath }, row.name);
-        }
-      },
-      handleCurrentChange(e) {
-        this.getPackingList();
-      },
-      handleSizeChange(e) {
-        this.pages.pageNum = 1;
-        this.getPackingList();
-      },
-      getPackingList() {
-        storageApi
-          .getOutInRecordsPage({
-            ...this.pages,
-            outInId: this.$route.query.id
-          })
-          .then((data) => {
-            this.total = data.count;
-            this.packingList = data.list;
-          });
+      );
+      this.getPackingList();
+      // // 获取包装维度数据
+      // const arr = [];
+      // for (const key in this.productList) {
+      //   for (const k in this.productList[key].outInDetailRecordRequestList) {
+      //     arr.push({
+      //       ...this.productList[key].outInDetailRecordRequestList[k]
+      //     });
+      //   }
+      // }
+      // this.packingList = arr;
+      // // 获取物料维度数据
+      // let iArr = [];
+      // arr.forEach((item) => {
+      //   item.materialDetailList.forEach((ele) => {
+      //     iArr.push({ ...ele });
+      //   });
+      // });
+      // this.materialList = iArr;
+      // console.log(this.packingList);
+      // console.log(this.materialList);
+      // this.pickingFetchData();
+      // this.materielFetchData();
+    },
+    download(row) {
+      if (row.storePath) {
+        getFile({ objectName: row.storePath }, row.name);
       }
+    },
+    handleCurrentChange(e) {
+      this.getPackingList();
+    },
+    handleSizeChange(e) {
+      this.pages.pageNum = 1;
+      this.getPackingList();
+    },
+    getPackingList() {
+      storageApi
+        .getOutInRecordsPage({
+          ...this.pages,
+          outInId: this.$route.query.id
+        })
+        .then((data) => {
+          this.total = data.count;
+          this.packingList = data.list;
+        });
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  ::v-deep .warning-row {
-    color: red;
-  }
-  ::v-deep .page-title {
-    border-bottom: none;
-  }
-  ::v-deep .page-title-div {
-    width: 100%;
-  }
-  .stepsStatus {
-    width: 40%;
-    margin: 0 auto;
+::v-deep .warning-row {
+  color: red;
+}
+
+::v-deep .page-title {
+  border-bottom: none;
+}
+
+::v-deep .page-title-div {
+  width: 100%;
+}
+
+.stepsStatus {
+  width: 40%;
+  margin: 0 auto;
+}
+
+.el-form-item {
+  margin-bottom: 10px;
+}
+
+.p20 {
+  padding: 20px;
+}
+
+.flex {
+  display: flex;
+}
+
+.title {
+  justify-content: space-between;
+  border-bottom: 1px solid #ccc;
+  padding-bottom: 5px;
+
+  span {
+    font-size: 16px;
   }
-  .el-form-item {
-    margin-bottom: 10px;
+
+  .col {
+    padding-left: 40px;
+    font-size: 14px;
+    color: #aaaaaa;
   }
-  .p20 {
-    padding: 20px;
+}
+
+.degree {
+  margin-right: 10px;
+  padding: 0px 15px;
+  color: #fff;
+  font-size: 13px;
+  line-height: 23px;
+  border-radius: 23px;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+
+  span {
+    width: 5px;
+    height: 5px;
+    border-radius: 100%;
+    margin-right: 6px;
+    background-color: #fff;
   }
-  .flex {
-    display: flex;
+}
+
+.red {
+  background-color: rgb(163, 0, 20);
+}
+
+.blue {
+  background-color: #1989fa;
+}
+
+.createdInfo {
+  justify-content: space-around;
+  margin-top: 10px;
+  font-size: 14px;
+
+  .col {
+    color: #6e6e6e;
+    padding-right: 10px;
   }
-  .title {
-    justify-content: space-between;
-    border-bottom: 1px solid #ccc;
-    padding-bottom: 5px;
-    span {
-      font-size: 16px;
+}
+
+.mt40 {
+  margin-top: 40px;
+}
+
+.custSteps {
+  margin-top: 20px;
+  margin-left: 70px;
+
+  .box {
+    width: 158px;
+    border: 1px solid #ccc;
+    padding: 10px;
+    flex-direction: row;
+    flex-wrap: wrap;
+    // justify-content: space-between;
+    font-size: 12px;
+    color: #9e9e9e;
+
+    .x {
+      width: 20px;
+      height: 15px;
+      margin-right: 5px;
     }
-    .col {
-      padding-left: 40px;
-      font-size: 14px;
-      color: #aaaaaa;
+
+    .q {
+      background-color: #d0e4d5;
     }
-  }
-  .degree {
-    margin-right: 10px;
-    padding: 0px 15px;
-    color: #fff;
-    font-size: 13px;
-    line-height: 23px;
-    border-radius: 23px;
-    display: flex;
-    align-items: center;
-    justify-content: space-between;
-    span {
-      width: 5px;
-      height: 5px;
-      border-radius: 100%;
-      margin-right: 6px;
-      background-color: #fff;
+
+    .b {
+      background-color: #1989fa;
     }
-  }
-  .red {
-    background-color: rgb(163, 0, 20);
-  }
-  .blue {
-    background-color: #1989fa;
-  }
-  .createdInfo {
-    justify-content: space-around;
-    margin-top: 10px;
-    font-size: 14px;
-    .col {
-      color: #6e6e6e;
-      padding-right: 10px;
+
+    .g {
+      background-color: #157a2c;
     }
-  }
-  .mt40 {
-    margin-top: 40px;
-  }
 
-  .custSteps {
-    margin-top: 20px;
-    margin-left: 70px;
-    .box {
-      width: 158px;
-      border: 1px solid #ccc;
-      padding: 10px;
-      flex-direction: row;
-      flex-wrap: wrap;
-      // justify-content: space-between;
-      font-size: 12px;
-      color: #9e9e9e;
-      .x {
-        width: 20px;
-        height: 15px;
-        margin-right: 5px;
-      }
-      .q {
-        background-color: #d0e4d5;
-      }
-      .b {
-        background-color: #1989fa;
-      }
-      .g {
-        background-color: #157a2c;
-      }
-      .r {
-        background-color: #a30014;
-      }
-      .a {
-        align-items: center;
-        margin-bottom: 10px;
-      }
-      .mr10 {
-        margin-right: 10px;
-      }
-      .mb0 {
-        margin-bottom: 0;
-      }
+    .r {
+      background-color: #a30014;
+    }
+
+    .a {
+      align-items: center;
+      margin-bottom: 10px;
     }
-    .stepsInfo {
-      // flex: 1;
-      width: 483px;
+
+    .mr10 {
+      margin-right: 10px;
     }
-  }
-  .mt20 {
-    margin-top: 20px;
-  }
-  .content-detail {
-    overflow: hidden;
-  }
-  .executor {
-    font-size: 14px;
-    .col {
-      color: #6e6e6e;
-      padding-right: 10px;
+
+    .mb0 {
+      margin-bottom: 0;
     }
   }
-  .result {
-    justify-content: space-around;
+
+  .stepsInfo {
+    // flex: 1;
+    width: 483px;
   }
-  .mr20 {
-    margin-right: 20px;
+}
+
+.mt20 {
+  margin-top: 20px;
+}
+
+.content-detail {
+  overflow: hidden;
+}
+
+.executor {
+  font-size: 14px;
+
+  .col {
+    color: #6e6e6e;
+    padding-right: 10px;
   }
-  .details {
-    font-size: 14px;
-    margin-bottom: 10px;
+}
+
+.result {
+  justify-content: space-around;
+}
+
+.mr20 {
+  margin-right: 20px;
+}
+
+.details {
+  font-size: 14px;
+  margin-bottom: 10px;
+}
+
+.customSteps {
+  margin-top: 40px;
+  font-size: 14px;
+  margin-left: 80px;
+
+  .time {
+    font-size: 12px;
+    color: #6e6e6e;
+    margin-right: 20px;
+    position: relative;
+
+    &::after {
+      content: '';
+      width: 1px;
+      height: 100%;
+      background-color: #157a2c;
+      position: absolute;
+      right: -26px;
+    }
   }
 
-  .customSteps {
-    margin-top: 40px;
-    font-size: 14px;
-    margin-left: 80px;
+  .flex:last-child {
     .time {
-      font-size: 12px;
-      color: #6e6e6e;
-      margin-right: 20px;
-      position: relative;
       &::after {
-        content: '';
-        width: 1px;
-        height: 100%;
-        background-color: #157a2c;
-        position: absolute;
-        right: -26px;
+        display: none;
       }
     }
-    .flex:last-child {
-      .time {
-        &::after {
-          display: none;
-        }
-      }
-    }
-    .round {
-      margin-right: 20px;
-      width: 10px;
-      height: 10px;
+  }
+
+  .round {
+    margin-right: 20px;
+    width: 10px;
+    height: 10px;
+    border-radius: 100%;
+    background-color: #157a2c;
+    position: relative;
+
+    span {
+      position: absolute;
+      top: 50%;
+      left: 50%;
+      width: 4px;
+      height: 4px;
+      background-color: #fff;
       border-radius: 100%;
-      background-color: #157a2c;
-      position: relative;
-      span {
-        position: absolute;
-        top: 50%;
-        left: 50%;
-        width: 4px;
-        height: 4px;
-        background-color: #fff;
-        border-radius: 100%;
-        transform: translate(-2px, -2px);
-      }
-    }
-    .text {
-      .info {
-        margin-top: 10px;
-        width: 955px;
-        background-color: #f0f3f3;
-        overflow: hidden;
-        padding: 10px;
-        margin-bottom: 10px;
-      }
+      transform: translate(-2px, -2px);
     }
   }
-  .switch_left li {
-    border-right: 1px solid rgba(222, 222, 222, 1);
-    border-left: 1px solid rgba(222, 222, 222, 1);
+
+  .text {
+    .info {
+      margin-top: 10px;
+      width: 955px;
+      background-color: #f0f3f3;
+      overflow: hidden;
+      padding: 10px;
+      margin-bottom: 10px;
+    }
   }
+}
+
+.switch_left li {
+  border-right: 1px solid rgba(222, 222, 222, 1);
+  border-left: 1px solid rgba(222, 222, 222, 1);
+}
 </style>

+ 1 - 0
src/views/warehouseManagement/warehouseDefinition/components/WarehouseEdit.vue

@@ -245,6 +245,7 @@ export default {
       let data = this.inventoryTypeList.find((item) => {
         return item.id == this.formData.inventoryType;
       });
+      console.log(data);
       this.formData.inventoryName = data?.name;
       console.log(this.formData.inventoryName);
     },

+ 1 - 2
vue.config.js

@@ -39,7 +39,7 @@ module.exports = {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.132:18086',
 
-        target: 'http://192.168.1.251:18086',//开发
+        target: 'http://192.168.1.116:18086',//开发
         // target: 'http://192.168.1.251:18186', //测试
 
         // target: 'http://192.168.1.116:18086',
@@ -52,7 +52,6 @@ module.exports = {
   },
   chainWebpack(config) {
     config.plugins.delete('prefetch');
-    // set svg-sprite-loader
     // config.module.rule('svg').exclude.add(resolve('./src/icons')).end();
     // config.module
     //   .rule('icons')