Преглед изворни кода

是否拆包;总重单重。

yijing пре 1 година
родитељ
комит
e53a129496
1 измењених фајлова са 245 додато и 146 уклоњено
  1. 245 146
      src/views/bpm/stockManagement/storage.vue

+ 245 - 146
src/views/bpm/stockManagement/storage.vue

@@ -314,7 +314,7 @@
               </el-table-column>
               <el-table-column label="允许拆包" prop="isUnpack">
                 <template slot-scope="{ row, $index }">
-                  {{ row.isUnpack ? '是' : '否' }}
+                  {{ row.isUnpack == 1 ? '是' : '否' }}
                 </template>
               </el-table-column>
               <el-table-column
@@ -330,13 +330,48 @@
                 :show-overflow-tooltip="true"
               ></el-table-column>
               <el-table-column
-                label="重量"
+                label="单重"
+                align="center"
+                prop="singleWeight"
+                :show-overflow-tooltip="true"
+                width="240"
+              >
+                <template slot-scope="{ row, $index }">
+                  <template v-if="row.isSave">
+                    {{ row.singleWeight }}
+                  </template>
+                  <el-input-number
+                    v-else
+                    v-model="row.singleWeight"
+                    placeholder="请输入"
+                    :precision="2"
+                    :min="0"
+                    controls-position="right"
+                    @input="inputsingleWeight(row, $index)"
+                  ></el-input-number>
+                  <template slot="append">
+                    {{ row.measureUnit }}
+                  </template>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="总重"
                 align="center"
                 prop="weight"
+                width="120"
                 :show-overflow-tooltip="true"
               >
                 <template slot-scope="{ row, $index }">
-                  {{ row.weight }}
+                  <template v-if="row.isSave">
+                    {{ row.weight }}
+                  </template>
+                  <el-input
+                    v-else
+                    v-model="row.weight"
+                    placeholder="请输入"
+                    type="number"
+                    @input="inputWeight(row, $index)"
+                  ></el-input>
                   <template slot="append">
                     {{ row.measureUnit }}
                   </template>
@@ -413,6 +448,7 @@
                     @change="selectSupplier($event, row)"
                     v-model="row.supplierId"
                     placeholder="请选择"
+                    :clearable="true"
                   >
                     <el-option
                       v-for="item in row.supplierListOptions"
@@ -424,6 +460,14 @@
                   </el-select>
                 </template>
               </el-table-column>
+              <el-table-column
+                label="供应商代号"
+                align="center"
+                prop="supplierCode"
+                width="120"
+                :show-overflow-tooltip="true"
+              >
+              </el-table-column>
               <el-table-column
                 label="仓库"
                 align="center"
@@ -991,8 +1035,6 @@
     watch: {
       packingList: {
         handler(newVal) {
-          console.log('包装列表', newVal);
-          console.log('当前包装列表加载页数7', this.pickingPageNum);
           this.showPackingList = newVal.slice(
             0,
             this.pageSize * (this.pickingPageNum > 0 ? this.pickingPageNum : 1)
@@ -1004,7 +1046,6 @@
             obj.outsourceCode = this.detailProductList[0]?.sourceCode;
             obj.taskId = this.detailList[0]?.taskId;
             obj.workOrderId = this.detailList[0]?.workOrderId;
-            console.log('obj-------------------------------------', obj);
           });
           this.pickingPageNum = Math.ceil(
             this.showPackingList.length / this.pageSize
@@ -1014,8 +1055,6 @@
       },
       materialList: {
         handler(newVal) {
-          console.log('物料列表', newVal);
-          console.log('当前物料列表加载页数', this.materielPageNum);
           this.showMaterialList = newVal.slice(
             0,
             this.pageSize *
@@ -1049,13 +1088,21 @@
         row.supplierId = val;
         row.supplierName = row.supplierListOptions.filter(
           (item) => item.id == val
-        )[0].name;
+        )[0]?.name;
+        row.supplierCode = row.supplierListOptions.filter(
+          (item) => item.id == val
+        )[0].serialNo;
+      },
+      inputsingleWeight(row, index) {
+        row.weight = row.singleWeight * row.measureQuantity;
+      },
+      inputWeight(row, index) {
+        row.singleWeight = row.measureQuantity
+          ? row.weight / row.measureQuantity
+          : 0;
       },
       // 计算最小单元数量
       computeNum(row, index, isClear) {
-        console.log(row);
-        console.log(row.packingQuantity);
-        console.log(row.packingUnit);
         // 清空仓库(包装数量输入)
         if (isClear) {
           this.$set(this.productList[index], 'warehouseId', '');
@@ -1074,19 +1121,15 @@
           // }
         }
         if (row.packingQuantity && row.packingUnit) {
-          console.log(index);
-          console.log(row.packingSpecificationOption);
           let startIndex = row.packingSpecificationOption.findIndex((ite) => {
             return (
               row.measuringUnit == ite.packingUnit &&
               ite.packingUnit != ite.conversionUnit
             );
           });
-          console.log(startIndex);
           let endIndex = row.packingSpecificationOption.findIndex(
             (ite) => row.packingUnit == ite.conversionUnit
           );
-          console.log(endIndex);
           let total = row.packingQuantity;
           for (; startIndex < endIndex; endIndex--) {
             total = this.$math.format(
@@ -1094,6 +1137,9 @@
               14
             );
           }
+          if (row.measuringUnit != 'KG') {
+            row.weight = row.singleWeight * row.measureQuantity;
+          }
           row.measureQuantity = this.changeCount(total);
           // 判断单位和计量单位是否为不拆物料层规格
           let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
@@ -1123,21 +1169,34 @@
       },
       // 初始化信息
       async initFormData() {
-        console.log(4);
-
+        console.log('this.form---------------', this.form);
         this.formData.type = 1;
         this.formData.bizType = this.bizType;
-        this.formData.extInfo.assetType = Array.from(
-          new Set(this.form.categoryLevelTopId.split(','))
-        );
-        console.log('this.form---------------', this.form);
-        console.log('this.sourceBizNo---------', this.sourceBizNo);
-        console.log('this.saleProductList---------', this.saleProductList);
+        if (
+          this.form != null &&
+          Object.keys(this.form).length > 0 &&
+          this.form.categoryLevelTopId != ''
+        ) {
+          this.formData.extInfo.assetType = Array.from(
+            new Set(this.form.categoryLevelTopId.split(','))
+          );
+        } else {
+          this.$message.warning('未获取到物品类型!');
+        }
+
         console.log('this.detailList---------', this.detailList);
-        this.formData.sourceBizNo = this.sourceBizNo;
+        if (this.sourceBizNo != null && this.sourceBizNo != '') {
+          this.formData.sourceBizNo = this.sourceBizNo;
+        } else {
+          this.$message.warning('未获取到单据来源!');
+        }
+
         // 入库登记人
         this.formData.extInfo.createUserName = this.$store.state.user.info.name;
+        this.formData.extInfo.deliveryPhone = this.$store.state.user.info.phone;
         this.formData.createUserId = this.$store.state.user.info.userId;
+        this.formData.extInfo.deptName = this.$store.state.user.info.deptName;
+
         // this.formData.extInfo.supplierName = this.form.supplierName;
         // this.formData.extInfo.supplierId = this.form.supplierId;
         if (this.saleProductList?.length > 0) {
@@ -1147,6 +1206,10 @@
           });
           storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
             console.log('res------------------', res);
+            if (res.length <= 0) {
+              this.$message.warning('未获取到物品信息!');
+              return;
+            }
             // 获取批次号
             const batchNo = await getCode('lot_number_code');
             // 获取供应商
@@ -1177,13 +1240,13 @@
                   }
                 })
                 .filter((item) => !!item);
-              console.log('filtersItem---------', filtersItem);
               let warehouseId = filtersItem.warehouseId;
               let warehouseName = filtersItem.warehouseName;
               let measureQuantity = filtersItem.totalCount || 0;
               let packingQuantity = filtersItem.totalCount || 0;
               let packingUnit = filtersItem.measuringUnit || '';
               let price = filtersItem.singlePrice || 0;
+              let singleWeight = filtersItem.singleWeight || 0; // 单重重量
               let weight = filtersItem.sendTotalWeight || 0;
               // 获取相同仓库
               let warehouseIds = [];
@@ -1203,6 +1266,7 @@
                 batchNo: batchNo, // 批次号
                 supplierListOptions: supplierList[item.id], // 供应商列表
                 supplierId: this.form.supplierId, // 供应商id
+                supplierCode: this.form.supplierCode, // 供应商代号
                 supplierName: this.form.supplierName, // 供应商名称
                 approvalNumber: item.approvalNumber, // 批准文号
                 packingSpecification: item.packingSpecification, // 包装规格
@@ -1215,7 +1279,8 @@
                 measureQuantity: measureQuantity, // 计量数量
                 measureUnit: item.measuringUnit, // 计量单位
                 netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
-                weight: weight, // 重量
+                singleWeight: singleWeight, // 单重重量
+                weight: weight, // 总重量
                 weightUnit: item.weightUnit, // 重量单位
                 totalMoney: '', // 总价
                 price: item.price || price, // 单价
@@ -1236,17 +1301,10 @@
           // 包装列表 this.detailList
           // 获取主数据物品详情
           // let { category } = await getDetails(this.form.categoryId);
-          // console.log(category);
-          console.log('this.form------------', this.form);
           let codeList = this.detailList.map((item) => {
             return item.productCode || item.categoryCode;
           });
-          console.log('codeList-----------', codeList);
           storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
-            console.log(
-              res,
-              'ddddddddddddddddddddddddddddddddddddddddddddddddres'
-            );
             // 获取批次号
             const batchNo = await getCode('lot_number_code');
             // 获取供应商
@@ -1322,6 +1380,46 @@
                       weight = 0;
                     }
                     break;
+                  case 'L':
+                    if (this.form.totalWeight > -1) {
+                      weight = this.$math.format(
+                        this.form.totalWeight * 1000,
+                        14
+                      );
+                    } else {
+                      weight = 0;
+                    }
+                    break;
+                  case 'l':
+                    if (this.form.totalWeight > -1) {
+                      weight = this.$math.format(
+                        this.form.totalWeight * 1000,
+                        14
+                      );
+                    } else {
+                      weight = 0;
+                    }
+                    break;
+                  case 'ML':
+                    if (this.form.totalWeight > -1) {
+                      weight = this.$math.format(
+                        this.form.totalWeight * 1000,
+                        14
+                      );
+                    } else {
+                      weight = 0;
+                    }
+                    break;
+                  case 'ml':
+                    if (this.form.totalWeight > -1) {
+                      weight = this.$math.format(
+                        this.form.totalWeight * 1000,
+                        14
+                      );
+                    } else {
+                      weight = 0;
+                    }
+                    break;
                 }
               }
               return {
@@ -1336,6 +1434,7 @@
                 batchNo: batchNo, // 批次号
                 supplierListOptions: supplierList[item.id], // 供应商列表
                 supplierId: '', // 供应商id
+                supplierCode: '',
                 supplierName: '', // 供应商名称
                 approvalNumber: item.approvalNumber, // 批准文号
                 packingSpecification: item.packingSpecification, // 包装规格
@@ -1355,6 +1454,7 @@
                 measureUnit: item.measuringUnit, // 计量单位
                 netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
                 weight: weight, // 重量
+                singleWeight: singleWeight,
                 weightUnit: item.weightUnit, // 重量单位
                 totalMoney: '', // 总价
                 price: item.price, // 单价
@@ -1400,7 +1500,6 @@
             // 生成包装编码
             const { data } = await storageApi.getAssetNum(getAssetNumPr);
             let packingCodeList = data;
-            console.log('包装编码-------------------------', packingCodeList);
             // 生产包装
             this.packingList = this.detailList.map((item, index) => {
               // 换算重量
@@ -1426,6 +1525,34 @@
                       weight = 0;
                     }
                     break;
+                  case 'L':
+                    if (item.weightUnit > -1) {
+                      weight = this.$math.format(item.weightUnit / 1000, 14);
+                    } else {
+                      weight = 0;
+                    }
+                    break;
+                  case 'l':
+                    if (item.weightUnit > -1) {
+                      weight = this.$math.format(item.weightUnit / 1000, 14);
+                    } else {
+                      weight = 0;
+                    }
+                    break;
+                  case 'ML':
+                    if (item.weightUnit > -1) {
+                      weight = this.$math.format(item.weightUnit / 1000, 14);
+                    } else {
+                      weight = 0;
+                    }
+                    break;
+                  case 'ml':
+                    if (item.weightUnit > -1) {
+                      weight = this.$math.format(item.weightUnit / 1000, 14);
+                    } else {
+                      weight = 0;
+                    }
+                    break;
                 }
               }
               // 代入时间
@@ -1469,12 +1596,13 @@
                     ).index
                   : this.productList[0].index, // 产品索引
                 batchNo: this.productList[0].batchNo, // 批次号
-                packageNo: packingCodeList[index].onlyCode, // 包装编码
+                packageNo: packingCodeList[index]?.onlyCode, // 包装编码
                 packingQuantity: 1, // 包装数量
                 packingUnit: item.packingUnit, // 单位
                 measureQuantity: item.quantity, // 计量数量
                 measureUnit: item.measuringUnit, // 计量单位
                 weight: item.packingWeight, // 重量
+                singleWeight: item.singleWeight,
                 weightUnit: item.weightUnit || this.productList[0].weightUnit, // 重量单位
                 packingSpecificationOption: this.isMoreProduct
                   ? this.productList.find(
@@ -1518,7 +1646,6 @@
             num: 1
           }
         ]);
-        console.log(data);
         return data[0].onlyCode;
       },
       // 获取当前时间函数
@@ -1742,7 +1869,6 @@
       // 入库
       getReturnStorage() {
         return new Promise((resolve) => {
-          console.log(this.productList);
           if (this.productList.length <= 0) {
             this.$message.error('请先添加产品信息');
             return;
@@ -1753,10 +1879,6 @@
             return;
           }
 
-          console.log('ysy_ bizType', this.bizType, this.formData.storageTime);
-          console.log('ysy_初始 detailList', this.detailList[0]);
-          console.log('ysy_初始 detailProductList', this.detailProductList[0]);
-
           // 处理包装数据
           let _packingList = [];
           _packingList = this.packingList.map((packingItem) => {
@@ -1784,7 +1906,7 @@
               )
             };
           });
-          console.log('ysy_处理后 _packingList', _packingList);
+          console.log('_处理后 _packingList', _packingList);
 
           // 处理产品数据
           this.productList = this.productList.map((productItem) => {
@@ -1800,6 +1922,11 @@
 
           // 处理物品类型assetType
           obj.extInfo.assetType = obj.extInfo.assetType.join(',');
+          obj.extInfo.documentSource = this.formData.sourceBizNo;
+          obj.extInfo.deptName = this.formData.extInfo.deptName;
+          obj.extInfo.supplierName = this.form.supplierName;
+          obj.extInfo.deliveryPhone = this.formData.extInfo.deliveryPhone;
+
           // 处理仓库id
           let warehouseId = [];
           let warehouseName = [];
@@ -1818,14 +1945,12 @@
           obj.warehouseIds = warehouseId;
           obj.warehouseNames = warehouseName;
           obj._packingList = _packingList;
-          console.log('yyyyy', obj);
           setTimeout(() => {
             resolve(obj);
           }, 1000);
         });
       },
       pickingHandleScroll() {
-        console.log('---------pickingHandleScroll------------');
         if (this.showPackingList.length < this.packingList.length) {
           if (this.packingList.length > this.pageSize) {
             this.pickingPageNum += 1;
@@ -1839,13 +1964,8 @@
         this.showPackingList = this.showPackingList.concat(
           this.packingList.slice(start, end)
         );
-        console.log(
-          this.showPackingList,
-          '999999999999999999999999999999999999'
-        );
       },
       materielHandleScroll() {
-        console.log('---------materielHandleScroll------------');
         if (this.showMaterialList.length < this.materialList.length) {
           if (this.materialList.length > this.pageSize) {
             this.materielPageNum += 1;
@@ -1859,7 +1979,6 @@
         this.showMaterialList = this.showMaterialList.concat(
           this.materialList.slice(start, end)
         );
-        console.log(this.showMaterialList);
       },
       // 日期选择
       dateConfirm() {
@@ -1885,6 +2004,11 @@
           0
         );
         this.$set(this.productList[productIndex], 'weight', totalWeight);
+        this.$set(
+          this.productList[productIndex],
+          'singleWeight',
+          totalWeight / this.productList[productIndex].measureQuantity
+        );
         // 修改拆分物料
         this.materialList.map((item, index) => {
           if (item.parentIndex === row.index) {
@@ -2005,7 +2129,6 @@
 
       // 包装维度最小包装单元改变——>总重量
       minPackingQuantityChange(row, value, index) {
-        console.log(value);
         if (row.measureUnit !== 'KG') {
           if (value.replace(/^(0+)|[^\d]+/g, '') > 9999) {
             this.$set(this.productList[index], 'minPackingQuantity', 9999);
@@ -2112,11 +2235,6 @@
             .filter((ite) => item.id == ite.categoryId)
             .sort((a, b) => a.sort - b.sort);
         });
-        console.log(
-          'this.packingSpecificationOption-------',
-          this.packingSpecificationOption
-        );
-        console.log('this.productList.length------', this.productList.length);
         let productList = data.map((item, index) => {
           // 显示规格
           let packingSpecificationLabel = this.packingSpecificationOption[index]
@@ -2142,6 +2260,7 @@
             batchNo: batchNo, // 批次号
             supplierListOptions: supplierList[item.id], // 供应商列表
             supplierId: '', // 供应商id
+            supplierCode: '',
             supplierName: '', // 供应商名称
             approvalNumber: item.approvalNumber, // 批准文号
             packingSpecification: item.packingSpecification, // 包装规格
@@ -2154,6 +2273,7 @@
             measureUnit: item.measuringUnit, // 计量单位
             netWeight: item.netWeight > -1 ? item.netWeight : 0, // 净重
             weight: 0, // 重量
+            singleWeight: item.measuringUnit != 'KG' ? item.netWeight : 0, // 单重
             weightUnit: item.weightUnit, // 重量单位
             totalMoney: '', // 总价
             price: item.price, // 单价
@@ -2174,7 +2294,6 @@
               `productList.${index}.packingUnit`,
               `productList.${index}.warehouseId`
             ];
-            console.log(fileds);
             if (row.isSave) {
               return Promise.resolve(true);
             } else {
@@ -2194,7 +2313,6 @@
               );
             }
           });
-          console.log(list);
           Promise.all(list)
             .then(() => {
               console.log('保存成功!');
@@ -2245,7 +2363,7 @@
                     num
                   };
                 } else {
-                  if (row.isUnpack) {
+                  if (row.isUnpack == 1) {
                     if (measureBoolen) {
                       // 处理单位不为KG类,计量单位为KG类的情况
                       let num = row.packingQuantity;
@@ -2289,7 +2407,7 @@
               (item) => item.assetCode
             );
             let { data } = await storageApi.getAssetNum(filterPackingCodePrams);
-            console.log('data-----11111111111111111---', data);
+
             let packingCodeList = [];
             packingCodePrams.forEach((item, index) => {
               packingCodeList[index] = data.filter(
@@ -2345,7 +2463,6 @@
       },
       // 产品编辑
       listEdit(row) {
-        console.log(row);
         this.$set(row, 'isSave', false);
         // // 重新计算重量
         // const totals = Number(
@@ -2374,8 +2491,6 @@
       },
       // 根据产品信息删除包装和物料
       deletePackingAndMaterial(row) {
-        console.log('row--------', row);
-        console.log('packingList------', this.packingList);
         // 删除包装(去掉不相同的包装)
         this.packingList = this.packingList.filter(
           (item) => item.parentIndex !== row.index
@@ -2386,8 +2501,6 @@
         this.pickingPageNum = Math.ceil(
           this.showPackingList.length / this.pageSize
         );
-        console.log('包装当前页数');
-        console.log(this.pickingPageNum);
         // 删除物料(获取相同物料)
         let packingIndexs = this.packingList.map((item) => item.index);
         this.materialList = this.materialList.filter((item) =>
@@ -2399,14 +2512,9 @@
         this.materielPageNum = Math.ceil(
           this.showMaterialList.length / this.pageSize
         );
-        console.log('物料当前页数');
-        console.log(this.showMaterialList.length);
-        console.log(this.pageSize);
-        console.log(this.materielPageNum);
       },
       // 产品保存操作
       listSave(row, index) {
-        console.log('row', row);
         this.validateFormIndividually(index).then(async () => {
           // 判断单位和计量单位是否为不拆物料层规格
           let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
@@ -2448,12 +2556,12 @@
               assetCode: row.categoryCode + row.index,
               batchNum: row.batchNo,
               num: packingBoolen
-                ? packingNum
-                : row.isUnpack
+                ? Math.floor(packingNum)
+                : Math.floor(row.isUnpack)
                 ? measureBoolen
-                  ? measureNum
-                  : row.measureQuantity
-                : row.packingQuantity
+                  ? Math.floor(measureNum)
+                  : Math.floor(row.measureQuantity)
+                : Math.floor(row.packingQuantity)
             }
           ]);
           this.generateWrappers(row, index, data);
@@ -2486,7 +2594,6 @@
                   item.packageUnit != item.conversionUnit
                 );
               });
-              console.log(filterArr);
               let num = Math.ceil(
                 row.packingQuantity / filterArr[0].packageCell
               );
@@ -2499,9 +2606,7 @@
                     item.conversionUnit == row.packingUnit &&
                     item.packageUnit != item.conversionUnit
                 );
-                console.log(splitIndex);
                 for (; splitIndex > 1; splitIndex--) {
-                  console.log(splitIndex);
                   num = this.$math.format(
                     num *
                       row.packingSpecificationOption[splitIndex].packageCell,
@@ -2562,8 +2667,6 @@
         }
       },
       wareHouseSelection(argum, idx) {
-        console.log(argum);
-        console.log(idx);
         // 方便包装遍历获取仓库id和名称
         let warehouseIds = [];
         let warehouseNames = [];
@@ -2573,8 +2676,6 @@
             warehouseNames.push(item.warehouseName);
           }
         });
-        console.log(warehouseIds);
-        console.log(warehouseNames);
         if (idx > -1) {
           this.$set(
             this.productList[idx],
@@ -2612,12 +2713,6 @@
       },
       // 生成包装
       generateWrappers(row, productIndex, packingCodeList) {
-        console.log('是否拆包----', row.isUnpack);
-        console.log('包装规格----', row.packingSpecificationOption);
-        console.log('计量单位----', row.measureUnit);
-        console.log('包装数量----', row.packingQuantity);
-        console.log('包装编码----', packingCodeList);
-        console.log('包装数据----', row);
         let packingList = [];
         let obj = this.getNowDate();
         let productionDate = '';
@@ -2636,11 +2731,10 @@
           .dictValue;
         let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
           .dictValue;
-        console.log('packingBoolen----', packingBoolen);
-        console.log('measureBoolen----', measureBoolen);
         let num = row.packingQuantity;
         let filterArr = [];
         // 处理单位为KG类的情况
+
         if (packingBoolen) {
           filterArr = row.packingSpecificationOption.filter((item) => {
             return (
@@ -2650,7 +2744,7 @@
           });
           num = Math.ceil(row.packingQuantity / filterArr[0].packageCell);
         } else {
-          if (row.isUnpack) {
+          if (row.isUnpack == 1) {
             if (measureBoolen) {
               // 处理单位不为KG类,计量单位为KG类的情况
               let splitIndex = row.packingSpecificationOption.findIndex(
@@ -2665,15 +2759,12 @@
                 );
               }
             } else {
-              console.log(row.packingSpecificationOption);
               let splitIndex = row.packingSpecificationOption.findIndex(
                 (item) =>
                   item.conversionUnit == row.packingUnit &&
                   item.packageUnit != item.conversionUnit
               );
-              console.log(splitIndex);
               for (; splitIndex > 0; splitIndex--) {
-                console.log(splitIndex);
                 num = this.$math.format(
                   num * row.packingSpecificationOption[splitIndex].packageCell,
                   14
@@ -2681,18 +2772,14 @@
               }
             }
           } else {
-            num = row.packingQuantity;
+            // num = row.packingQuantity;
+            num = this.productList.length;
           }
         }
-        console.log('num-----------', num);
         for (let index = 0; index < num; index++) {
           let measureQuantity = 1;
           // 处理单位为KG类,计算每桶KG值
           if (packingBoolen) {
-            console.log(
-              this.$math.format(filterArr[0].packageCell * (index + 1), 14)
-            );
-            console.log(row.packingQuantity);
             measureQuantity =
               Number(row.packingQuantity) >
               this.$math.format(filterArr[0].packageCell * (index + 1), 14)
@@ -2700,7 +2787,7 @@
                 : Number(row.packingQuantity) -
                   this.$math.format(filterArr[0].packageCell * index, 14);
           } else {
-            if (!row.isUnpack) {
+            if (row.isUnpack == 1) {
               if (measureBoolen) {
                 // 处理单位不为KG类,计量单位为KG类的情况
                 let splitIndex = row.packingSpecificationOption.findIndex(
@@ -2722,7 +2809,6 @@
                     item.packageUnit != item.conversionUnit
                 );
                 for (; splitIndex > 0; splitIndex--) {
-                  console.log(splitIndex);
                   measureQuantity = this.$math.format(
                     measureQuantity *
                       row.packingSpecificationOption[splitIndex].packageCell,
@@ -2730,6 +2816,8 @@
                   );
                 }
               }
+            } else {
+              measureQuantity = row.measureQuantity;
             }
           }
           let item = {
@@ -2743,36 +2831,40 @@
             brandNum: row.brandNum, // 牌号
             parentIndex: row.index, // 产品索引
             batchNo: row.batchNo, // 批次号
-            packageNo: packingCodeList[index].onlyCode, // 包装编码
+            packageNo: packingCodeList[index]?.onlyCode, // 包装编码
             packingQuantity: 1, // 包装数量
-            packingUnit: row.isUnpack
-              ? packingBoolen
+            packingUnit:
+              row.isUnpack == 1
+                ? packingBoolen
+                  ? filterArr[0].conversionUnit
+                  : measureBoolen
+                  ? row.packingSpecificationOption[1]
+                    ? row.packingSpecificationOption[1].conversionUnit
+                    : row.packingSpecificationOption[0].conversionUnit
+                  : row.measureUnit
+                : packingBoolen
                 ? filterArr[0].conversionUnit
-                : measureBoolen
-                ? row.packingSpecificationOption[1]
-                  ? row.packingSpecificationOption[1].conversionUnit
-                  : row.packingSpecificationOption[0].conversionUnit
-                : row.measureUnit
-              : packingBoolen
-              ? filterArr[0].conversionUnit
-              : row.packingUnit,
-            measureQuantity: row.isUnpack
-              ? packingBoolen
-                ? measureQuantity
-                : measureBoolen
-                ? row.packingSpecificationOption[1]
-                  ? row.packingSpecificationOption[1].packageCell
-                  : row.packingSpecificationOption[0].packageCell
-                : measureQuantity
-              : measureQuantity, // 计量数量
-            measureUnit: row.isUnpack
-              ? measureBoolen
-                ? row.packingSpecificationOption[1]
-                  ? row.packingSpecificationOption[1].packageUnit
-                  : row.packingSpecificationOption[0].packageUnit
-                : row.measureUnit
-              : row.measureUnit, // 计量单位
+                : row.packingUnit,
+            measureQuantity:
+              row.isUnpack == 1
+                ? packingBoolen
+                  ? measureQuantity
+                  : measureBoolen
+                  ? row.packingSpecificationOption[1]
+                    ? row.packingSpecificationOption[1].packageCell
+                    : row.packingSpecificationOption[0].packageCell
+                  : measureQuantity
+                : measureQuantity, // 计量数量
+            measureUnit:
+              row.isUnpack == 1
+                ? measureBoolen
+                  ? row.packingSpecificationOption[1]
+                    ? row.packingSpecificationOption[1].packageUnit
+                    : row.packingSpecificationOption[0].packageUnit
+                  : row.measureUnit
+                : row.measureUnit, // 计量单位
             weight: 0, // 重量
+            singleWeight: 0, // 单重
             packingSpecificationOption: row.packingSpecificationOption, // 包装规格
             weightUnit: row.weightUnit, // 重量单位
             netWeight: row.netWeight, // 净重
@@ -2805,24 +2897,32 @@
                 );
               }
             );
-            console.log(startIndex);
             let endIndex = item.packingSpecificationOption.findIndex(
               (ite) => item.packingUnit == ite.conversionUnit
             );
-            console.log(endIndex);
-            let total = item.packingQuantity;
-            for (; startIndex < endIndex; endIndex--) {
-              total = this.$math.format(
-                item.packingSpecificationOption[endIndex].packageCell * total,
-                14
-              );
-            }
-            if (inBoolen) {
-              // 第二层为KG类
-              item.weight = total;
-            } else {
-              // 第二层不为KG类
-              item.weight = this.$math.format(total * item.netWeight, 14);
+            if (measureBoolen) {
+              let total = item.packingQuantity;
+              for (; startIndex < endIndex; endIndex--) {
+                total = this.$math.format(
+                  item.packingSpecificationOption[endIndex].packageCell * total,
+                  14
+                );
+              }
+              if (inBoolen) {
+                // 第二层为KG类
+                item.weight = total;
+              } else {
+                // 第二层不为KG类
+                item.weight = this.$math.format(total * item.netWeight, 14);
+              }
+            } else if (!measureBoolen) {
+              if (inBoolen) {
+                // 第二层为KG类
+                item.weight = item.measureQuantity;
+              } else {
+                // 第二层不为KG类
+                item.weight = item.measureQuantity * row.singleWeight;
+              }
             }
           }
           packingList.push(item);
@@ -2915,7 +3015,6 @@
       },
       // 选择质检结果改变质检状态
       changeWrapStatus(resultValue, row, type) {
-        console.log('resultValue--------------', resultValue);
         switch (resultValue) {
           case 0:
             // 清空质检状态