Jelajahi Sumber

新增入库,单重总重。

yijing 1 tahun lalu
induk
melakukan
5d16d26c57

+ 30 - 27
src/views/warehouseManagement/stockManagement/add.vue

@@ -348,41 +348,41 @@
                 :show-overflow-tooltip="true"
               ></el-table-column>
               <el-table-column
-                label="重"
+                label="重"
                 align="center"
-                prop="weight"
-                width="160"
+                prop="singleWeight"
                 :show-overflow-tooltip="true"
+                width="240"
               >
                 <template slot-scope="{ row, $index }">
-                  <el-input
+                  <el-input-number
                     :disabled="row.isSave"
-                    v-model="row.weight"
+                    v-model="row.singleWeight"
                     placeholder="请输入"
-                    @input="inputWeight(row, $index)"
-                  ></el-input>
+                    :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="重"
+                label="重"
                 align="center"
-                width="160"
-                prop=""
+                prop="weight"
+                width="120"
                 :show-overflow-tooltip="true"
               >
                 <template slot-scope="{ row, $index }">
-                  <el-input-number
+                  <el-input
                     :disabled="row.isSave"
-                    v-model="row.singleWeight"
+                    v-model="row.weight"
                     placeholder="请输入"
-                    :precision="2"
-                    :step="0.1"
-                    :min="0"
-                    @input="inputsingleWeight(row, $index)"
-                  ></el-input-number>
+                    @input="inputWeight(row, $index)"
+                  ></el-input>
                   <template slot="append">
                     {{ row.measureUnit }}
                   </template>
@@ -1296,15 +1296,9 @@
               ite.packingUnit != ite.conversionUnit
             );
           });
-          console.log('startIndex-----', startIndex);
           let endIndex = row.packingSpecificationOption.findIndex(
             (ite) => row.packingUnit == ite.conversionUnit
           );
-          console.log('endIndex-----', endIndex);
-          // 除了计量单位是KG以外计算总重  总重量 = 单重singleWeight * 数量measureQuantity(计量数量);
-          if (row.measuringUnit == 'KG') {
-            row.weight = row.singleWeight * row.measureQuantity;
-          }
           // packingQuantity 包装数量
           let total = row.packingQuantity;
           for (; startIndex < endIndex; endIndex--) {
@@ -1313,6 +1307,10 @@
               14
             );
           }
+          // 除了计量单位是KG以外计算总重  总重量 = 单重singleWeight * 数量measureQuantity(计量数量);
+          if (row.measuringUnit != 'KG') {
+            row.weight = row.singleWeight * row.measureQuantity;
+          }
           //计量数量
           row.measureQuantity = this.changeCount(total);
           // 判断单位和计量单位是否为不拆物料层规格
@@ -1908,8 +1906,9 @@
           obj.isSkip = 0;
         }
         // obj.isSkip = 1;
-        console.log(this.productList);
         this.saveLoading = true;
+        console.log(obj, 'objobjobjobjobjobj');
+
         storageApi
           .storage(obj)
           .then(async (res) => {
@@ -2582,6 +2581,7 @@
               );
             }
           }
+
           // 获取包装编码列表
           const { data } = await storageApi.getAssetNum([
             {
@@ -2805,7 +2805,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(
@@ -2836,7 +2836,8 @@
               }
             }
           } else {
-            num = row.packingQuantity;
+            // num = row.packingQuantity;
+            num = this.productList.length;
           }
         }
         console.log('num-----------', num);
@@ -2851,7 +2852,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(
@@ -2881,6 +2882,8 @@
                   );
                 }
               }
+            } else {
+              measureQuantity = row.measureQuantity;
             }
           }
           let item = {

+ 9 - 2
src/views/warehouseManagement/stockManagement/details.vue

@@ -189,7 +189,14 @@
             <el-table-column label="计量单位" prop="measureUnit" align="center">
             </el-table-column>
             <el-table-column
-              label="重量"
+              label="单重"
+              prop="singleWeight"
+              align="center"
+              :show-overflow-tooltip="true"
+            >
+            </el-table-column>
+            <el-table-column
+              label="总重"
               prop="weight"
               align="center"
               :show-overflow-tooltip="true"
@@ -366,7 +373,7 @@
             >
             </el-table-column>
             <el-table-column
-              label="重"
+              label="重"
               prop="weight"
               :show-overflow-tooltip="true"
             >