Pārlūkot izejas kodu

fix: 数量不能为空或者小于0

zh 2 gadi atpakaļ
vecāks
revīzija
90d3adb4dc
1 mainītis faili ar 6 papildinājumiem un 5 dzēšanām
  1. 6 5
      src/views/supply/engin/components/engin_form.vue

+ 6 - 5
src/views/supply/engin/components/engin_form.vue

@@ -859,9 +859,9 @@ export default {
 
       this.goodsList = this.goodsList.concat(this.rightGoodsList)
       this.goodsList.forEach(k => {
-        if (k.qty) {
-          k.qty = 1
-        }
+        // if (k.qty) {
+        //   k.qty = 1
+        // }
         if (!k.cid) {
           k.cid = ''
         }
@@ -905,8 +905,9 @@ export default {
               this.$errorMsg('请选择销售类型')
               return
             }
-            if (!this.goodsList[i].qty || Number(this.goodsList[i].qty) < 0) {
-              this.$errorMsg('数量不能小于0')
+            console.log(this.goodsList[i].qty );
+            if (this.goodsList[i].qty == null || Number(this.goodsList[i].qty) < 0) {
+              this.$errorMsg('数量不能为空或者小于0')
               return
             }
             if (!this.goodsList[i].materialNumber) {