yusheng преди 2 седмици
родител
ревизия
66c371f9fc
променени са 1 файла, в които са добавени 74 реда и са изтрити 87 реда
  1. 74 87
      src/views/bpm/stockManagement/storage.vue

+ 74 - 87
src/views/bpm/stockManagement/storage.vue

@@ -3860,7 +3860,7 @@
         }
         }
 
 
         // 判断单位和计量单位是否为不拆物料层规格
         // 判断单位和计量单位是否为不拆物料层规格
-        let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
+        let packingBoolen = !!this.getDict('不拆物料层规格', row.unit)
           .dictValue;
           .dictValue;
         let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
         let measureBoolen = !!this.getDict('不拆物料层规格', row.measureUnit)
           .dictValue;
           .dictValue;
@@ -3938,19 +3938,6 @@
               measureQuantity =
               measureQuantity =
                 Math.trunc((row.weight / packingCodeList.length) * 10000) /
                 Math.trunc((row.weight / packingCodeList.length) * 10000) /
                 10000;
                 10000;
-            } else if (measureBoolen) {
-              let splitIndex = row.packingSpecificationOption.findIndex(
-                (item) =>
-                  item.conversionUnit == row.unit &&
-                  item.packageUnit != item.conversionUnit
-              );
-              for (; splitIndex > 0; splitIndex--) {
-                measureQuantity = this.$math.format(
-                  measureQuantity *
-                    row.packingSpecificationOption[splitIndex].packageCell,
-                  14
-                );
-              }
             } else {
             } else {
               measureQuantity = row.packingSpecificationOption[1].packageCell;
               measureQuantity = row.packingSpecificationOption[1].packageCell;
             }
             }
@@ -4042,90 +4029,90 @@
            *                     : row.packingSpecificationOption[1].conversionUnit: row.measureUnit: packingBoolen ? filterArr[0].conversionUnit : row.packingUnit,
            *                     : row.packingSpecificationOption[1].conversionUnit: row.measureUnit: packingBoolen ? filterArr[0].conversionUnit : row.packingUnit,
            */
            */
           if (row.isUnpack) {
           if (row.isUnpack) {
-            // 第二层条件: packingBoolen
-            if (packingBoolen) {
-              // 空值保护: 确保 filterArr[0] 存在
               item.packingUnit =
               item.packingUnit =
                 row.packingSpecificationOption[1].conversionUnit;
                 row.packingSpecificationOption[1].conversionUnit;
-            } else {
-              // 第三层条件: measureBoolen
-              if (measureBoolen) {
-                // 处理 packingSpecificationOption 的索引
-                const option =
-                  row.packingSpecificationOption?.[1] ||
-                  row.packingSpecificationOption?.[0];
-                item.packingUnit = option?.conversionUnit;
-              } else {
-                item.packingUnit =
-                  row.packingSpecificationOption[1].conversionUnit;
-              }
-            }
+            // // 第二层条件: packingBoolen
+            // if (packingBoolen) {
+            //   // 空值保护: 确保 filterArr[0] 存在
+            //   item.packingUnit =
+            //     row.packingSpecificationOption[1].conversionUnit;
+            // } else {
+            //   // 第三层条件: measureBoolen
+            //   if (measureBoolen) {
+            //     // 处理 packingSpecificationOption 的索引
+            //     const option =
+            //       row.packingSpecificationOption?.[1] ||
+            //       row.packingSpecificationOption?.[0];
+            //     item.packingUnit = option?.conversionUnit;
+            //   } else {
+            //     item.packingUnit =
+            //       row.packingSpecificationOption[1].conversionUnit;
+            //   }
+            // }
           }
           }
           let outBoolen = !!this.getDict('不拆物料层规格', item.measureUnit)
           let outBoolen = !!this.getDict('不拆物料层规格', item.measureUnit)
             .dictValue;
             .dictValue;
           //计量单位等于重量单位
           //计量单位等于重量单位
           if (row.weightUnit == row.measureUnit) {
           if (row.weightUnit == row.measureUnit) {
-            item.weight = item.measureQuantity
-              ? Number(item.measureQuantity)
-              : 0;
-          } else if (outBoolen) {
-            // 计量单位为KG类,直接替换
-
             item.weight = item.measureQuantity
             item.weight = item.measureQuantity
               ? Number(item.measureQuantity)
               ? Number(item.measureQuantity)
               : 0;
               : 0;
           } else {
           } else {
-            console.log('计量单位为不为KG类======================');
-            // 计量单位为不为KG类,重新统计计算
-            let inBoolen = !!this.getDict(
-              '不拆物料层规格',
-              item.packingSpecificationOption[0].packageUnit
-            ).dictValue;
-            let startIndex = item.packingSpecificationOption.findIndex(
-              (ite) => {
-                return (
-                  item.measureUnit == ite.packingUnit &&
-                  ite.packingUnit != ite.conversionUnit
-                );
-              }
-            );
-
-            let endIndex = item.packingSpecificationOption.findIndex(
-              (ite) => item.packingUnit == ite.conversionUnit
-            );
-            if (measureBoolen) {
-              let total = item.packingQuantity
-                ? Number(item.packingQuantity)
-                : 0;
-              for (; startIndex < endIndex; endIndex--) {
-                total = this.$math.format(
-                  item.packingSpecificationOption[endIndex].packageCell * total,
-                  14
-                );
-              }
-              if (inBoolen) {
-                // 第二层为KG类
-                item.weight = total ? Number(total) : 0;
-              } else {
-                // 第二层不为KG类
-                item.weight = this.$math.format(total * item.netWeight, 14);
-              }
-            } else if (!measureBoolen) {
-              if (inBoolen) {
-                // 第二层为KG类
-                item.weight = item.measureQuantity
-                  ? Number(item.measureQuantity)
-                  : 0;
-              } else {
-                // 第二层不为KG类
-                if (row.singleWeight && item.measureQuantity) {
-                  item.weight =
-                    Number(item.measureQuantity) * Number(row.singleWeight);
-                } else {
-                  item.weight = 0;
-                }
-              }
-            }
+                 item.weight = this.$math.format(
+                (row.singleWeight || 0) * item.measureQuantity,
+                14
+              );
+            // console.log('计量单位为不为KG类======================');
+            // // 计量单位为不为KG类,重新统计计算
+            // let inBoolen = !!this.getDict(
+            //   '不拆物料层规格',
+            //   item.packingSpecificationOption[0].packageUnit
+            // ).dictValue;
+            // let startIndex = item.packingSpecificationOption.findIndex(
+            //   (ite) => {
+            //     return (
+            //       item.measureUnit == ite.packingUnit &&
+            //       ite.packingUnit != ite.conversionUnit
+            //     );
+            //   }
+            // );
+
+            // let endIndex = item.packingSpecificationOption.findIndex(
+            //   (ite) => item.packingUnit == ite.conversionUnit
+            // );
+            // if (measureBoolen) {
+            //   let total = item.packingQuantity
+            //     ? Number(item.packingQuantity)
+            //     : 0;
+            //   for (; startIndex < endIndex; endIndex--) {
+            //     total = this.$math.format(
+            //       item.packingSpecificationOption[endIndex].packageCell * total,
+            //       14
+            //     );
+            //   }
+            //   if (inBoolen) {
+            //     // 第二层为KG类
+            //     item.weight = total ? Number(total) : 0;
+            //   } else {
+            //     // 第二层不为KG类
+            //     item.weight = this.$math.format(total * item.netWeight, 14);
+            //   }
+            // } else if (!measureBoolen) {
+            //   if (inBoolen) {
+            //     // 第二层为KG类
+            //     item.weight = item.measureQuantity
+            //       ? Number(item.measureQuantity)
+            //       : 0;
+            //   } else {
+            //     // 第二层不为KG类
+            //     if (row.singleWeight && item.measureQuantity) {
+            //       item.weight =
+            //         Number(item.measureQuantity) * Number(row.singleWeight);
+            //     } else {
+            //       item.weight = 0;
+            //     }
+            //   }
+            // }
           }
           }
           packingList.push(item);
           packingList.push(item);
           console.log(
           console.log(