luobang %!s(int64=2) %!d(string=hai) anos
pai
achega
d6f95d3c18

+ 54 - 2
src/views/WMS/components/steel/bar1_steel/bar1_addSteelInbound.vue

@@ -15,6 +15,18 @@
       <span class="text">件数:</span>
       <el-input class="input" v-model="materialNumber"> </el-input>
     </div>
+    <div class="materialNumber from">
+      <span class="text">理重(磅重)</span>
+      <el-input class="input" v-model="materialTheWeight" disabled> </el-input>
+    </div>
+    <div class="materialNumber from">
+      <span class="text">实重</span>
+      <el-input class="input" v-model="actuallyWeight"> </el-input>
+    </div>
+    <div class="materialNumber from">
+      <span class="text">备注</span>
+      <el-input class="input" v-model="remark"> </el-input>
+    </div>
     <!-- 模态窗口 -->
     <el-drawer :visible.sync="drawer" :direction="direction" size="40%">
       <div style="margin-bottom: 10px">
@@ -88,7 +100,10 @@ export default {
       second: {
         requestUrl: "",
         selectionType: "radio"
-      }
+      },
+      materialTheWeight: 0,
+      actuallyWeight: 0,
+      remark: null
     };
   },
   watch: {
@@ -96,6 +111,9 @@ export default {
       if (!val) {
         this.input = null;
       }
+    },
+    materialNumber() {
+      this.getTheoreticalByInfo();
     }
   },
   created() {
@@ -104,6 +122,30 @@ export default {
     this.endTime = new Date(this.startTime + 86400000);
   },
   methods: {
+    getTheoreticalByInfo() {
+      this.axios
+        .post(
+          "/api/v1/wms/getTheoreticalByInfo?warehouseId=" +
+            1 +
+            "&materialCode=" +
+            this.materialCode +
+            "&materialSpecification=" +
+            this.materialSpecification +
+            "&materialModel=" +
+            this.materialModel +
+            "&num=" +
+            this.materialNumber +
+            "&status=1"
+        )
+        .then(res => {
+          if (res.data.data == -1) {
+            this.$message.error("数量超出");
+            this.materialTheWeight = null;
+          } else {
+            this.materialTheWeight = parseFloat(res.data.data);
+          }
+        });
+    },
     formatDate(date, fmt) {
       if (/(y+)/.test(fmt)) {
         fmt = fmt.replace(
@@ -188,6 +230,10 @@ export default {
     },
     // 确认
     onClickConfirm() {
+      if (!isNumber(this.actuallyWeight)) {
+        this.$message.error("实重填写不正确");
+        return;
+      }
       // console.log(this.warehouseId,this.materialCode,this.materialNumber);
       this.disabled = true;
       this.axios
@@ -201,7 +247,13 @@ export default {
             "&materialModel=" +
             this.materialModel +
             "&quantity=" +
-            this.materialNumber
+            this.materialNumber +
+            "&actuallyWeight=" +
+            Number(parseFloat(this.actuallyWeight)) +
+            "&materialTheWeight=" +
+            Number(parseFloat(this.materialTheWeight)) +
+            "&remark=" +
+            this.remark
         )
         .then(res => {
           console.log(res.data);

+ 54 - 2
src/views/WMS/components/steel/bar2_steel/bar2_addSteelInbound.vue

@@ -15,6 +15,18 @@
       <span class="text">件数:</span>
       <el-input class="input" v-model="materialNumber"> </el-input>
     </div>
+    <div class="materialNumber from">
+      <span class="text">理重(磅重)</span>
+      <el-input class="input" v-model="materialTheWeight" disabled> </el-input>
+    </div>
+    <div class="materialNumber from">
+      <span class="text">实重</span>
+      <el-input class="input" v-model="actuallyWeight"> </el-input>
+    </div>
+    <div class="materialNumber from">
+      <span class="text">备注</span>
+      <el-input class="input" v-model="remark"> </el-input>
+    </div>
     <!-- 模态窗口 -->
     <el-drawer :visible.sync="drawer" :direction="direction" size="40%">
       <div style="margin-bottom: 10px">
@@ -88,7 +100,10 @@ export default {
       second: {
         requestUrl: "",
         selectionType: "radio"
-      }
+      },
+      materialTheWeight: 0,
+      actuallyWeight: 0,
+      remark: null
     };
   },
   watch: {
@@ -96,6 +111,9 @@ export default {
       if (!val) {
         this.input = null;
       }
+    },
+    materialNumber() {
+      this.getTheoreticalByInfo();
     }
   },
   created() {
@@ -104,6 +122,30 @@ export default {
     this.endTime = new Date(this.startTime + 86400000);
   },
   methods: {
+    getTheoreticalByInfo() {
+      this.axios
+        .post(
+          "/api/v1/wms/getTheoreticalByInfo?warehouseId=" +
+            2 +
+            "&materialCode=" +
+            this.materialCode +
+            "&materialSpecification=" +
+            this.materialSpecification +
+            "&materialModel=" +
+            this.materialModel +
+            "&num=" +
+            this.materialNumber +
+            "&status=1"
+        )
+        .then(res => {
+          if (res.data.data == -1) {
+            this.$message.error("数量超出");
+            this.materialTheWeight = null;
+          } else {
+            this.materialTheWeight = parseFloat(res.data.data);
+          }
+        });
+    },
     formatDate(date, fmt) {
       if (/(y+)/.test(fmt)) {
         fmt = fmt.replace(
@@ -189,6 +231,10 @@ export default {
     // 确认
     onClickConfirm() {
       // console.log(this.warehouseId,this.materialCode,this.materialNumber);
+      if (!isNumber(this.actuallyWeight)) {
+        this.$message.error("实重填写不正确");
+        return;
+      }
       this.disabled = true;
       this.axios
         .post(
@@ -201,7 +247,13 @@ export default {
             "&materialModel=" +
             this.materialModel +
             "&quantity=" +
-            this.materialNumber
+            this.materialNumber +
+            "&actuallyWeight=" +
+            Number(parseFloat(this.actuallyWeight)) +
+            "&materialTheWeight=" +
+            Number(parseFloat(this.materialTheWeight)) +
+            "&remark=" +
+            this.remark
         )
         .then(res => {
           console.log(res.data);