Browse Source

bug修复,编辑销售单 销售数量校验库存

chenrui 3 years ago
parent
commit
8fec2e875a
1 changed files with 4 additions and 5 deletions
  1. 4 5
      src/views/salesManagement/salesQuery/edit.vue

+ 4 - 5
src/views/salesManagement/salesQuery/edit.vue

@@ -84,7 +84,6 @@
             </a-col>
             <a-col :span="6">
               <div style="float:right;overflow: hidden;">
-                <!-- <a-button size="small" id="salesEdit-dru">导入明细</a-button> -->
                 <a-button
                   size="small"
                   type="primary"
@@ -242,8 +241,10 @@ export default {
         this.spinning = true
         //  校验库存
         stockByProductSn({ productSn: record.productSn }).then(res => {
-          if (res.status == 200 && res.data) {
-            if (res.data.currentStockQty != undefined && val > res.data.currentStockQty) {
+          if (res.status == 200) {
+            if (res.data && (!res.data.currentStockQty || val <= res.data.currentStockQty)) {
+              _this.changeQty(record)
+            } else {
               this.$confirm({
                 title: '提示',
                 content: '库存不足,确认添加为急件吗?',
@@ -257,8 +258,6 @@ export default {
                   _this.spinning = false
                 }
               })
-            } else {
-              _this.changeQty(record)
             }
           } else {
             this.spinning = false