Kaynağa Gözat

入库申请,输入单价算总重;

yijing 1 yıl önce
ebeveyn
işleme
9e6ebca57d

+ 32 - 17
src/views/warehouseManagement/stockManagement/add.vue

@@ -173,14 +173,15 @@
               <el-table-column label="单重" align="center" prop="singleWeight" :show-overflow-tooltip="true" width="180">
                 <template slot-scope="{ row, $index }">
                   <el-input :disabled="row.isSave" v-model="row.singleWeight" placeholder="请输入" :min="0"
-                    style="width: 100%">
+                    style="width: 100%" @input="inputSingleWeight(row, $index)">
                     <template slot="append"> {{ row.weightUnit + '/' + row.measureUnit }} </template>
                   </el-input>
                 </template>
               </el-table-column>
               <el-table-column label="总重" align="center" prop="weight" width="150" :show-overflow-tooltip="true">
                 <template slot-scope="{ row, $index }">
-                  <el-input :disabled="row.isSave" v-model="row.weight" placeholder="请输入">
+                  <el-input :disabled="row.isSave" v-model="row.weight" placeholder="请输入"
+                    @input="inputAllweight(row, $index)">
                   </el-input>
                 </template>
               </el-table-column>
@@ -753,20 +754,31 @@ export default {
         (item) => item.id == val
       )[0].serialNo;
     },
+    inputSingleWeight(row, index) {
+      if (row.singleWeight < 0) {
+        this.$set(this.productList[index], 'singleWeight', 1);
+      } else if (row.packingQuantity > 9999) {
+        this.$set(this.productList[index], 'singleWeight', 9999);
+      }
+      console.log(row.singleWeight)
+      console.log(row.measureQuantity)
+
+      const weight = Number(row.measureQuantity) * Number(row.singleWeight);
+      this.$set(this.productList[index], 'weight', weight)
 
-    // inputWeight(row, index) {
-    //   if (
-    //     row.weight === null ||
-    //     row.weight === undefined ||
-    //     isNaN(row.weight) ||
-    //     row.weight < 0
-    //   ) {
-    //     row.weight = 0;
-    //   }
-    //   row.singleWeight = row.measureQuantity
-    //     ? Number(row.weight) / row.measureQuantity
-    //     : 0;
-    // },
+    },
+    inputAllweight(row, index) {
+      if (row.weight < 0) {
+        this.$set(this.productList[index], 'weight', 1);
+      }
+      const singleWeight = Number(row.weight) / Number(row.measureQuantity);
+      this.$set(this.productList[index], 'singleWeight', singleWeight)
+    },
+    // 仓库选择
+    wareHouseSelection(val, index) {
+      console.log('仓库选择', val);
+      let arr = this.productList[index].outInDetail
+    },
     // 计算最小单元数量
     async computeNum(row, index, isClear) {
       console.log('row, index', row, index);
@@ -840,6 +852,7 @@ export default {
 
         //计量数量
         row.measureQuantity = this.changeCount(total);
+
         // 判断单位和计量单位是否为不拆物料层规格
         let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
           .dictValue;
@@ -849,10 +862,12 @@ export default {
         console.log(measureBoolen, 'measureBoolen')
 
         if (packingBoolen && measureBoolen && row.packingUnit != 'L') {
-          row.weight = total;
+          // row.weight = total;
           console.log(total, '6')
+          this.$set(this.productList[index], 'weight', total);
         } else {
-          row.weight = this.$math.format(total * row.netWeight, 14);
+          this.$set(this.productList[index], 'weight', total * Number(row.singleWeight));
+          // row.weight = this.$math.format(total * row.netWeight, 14);
           console.log(total, '7')
         }
       }

+ 3 - 1
src/views/warehouseManagement/stockManagement/index.vue

@@ -392,7 +392,9 @@
             showOverflowTooltip: true,
             width: 100,
             formatter: (row, column, cellValue) => {
-              return row.outInStatus == 1 ? '预入库' :row.outInStatus == 2 ? '部分入库' :row.outInStatus == 3 ? '已出库' :'';
+              if(row.verifyStatus==2){
+                return row.outInStatus == 1 ? '预入库' :row.outInStatus == 2 ? '部分入库' :row.outInStatus == 3 ? '已出库' :'';
+              }
             }
           },
           {

+ 1 - 1
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.116:18086',//开发
+        target: 'http://192.168.1.251:18186',//开发
         // target: 'http://192.168.1.251:18186', //测试
 
         // target: 'http://192.168.1.116:18086',