lilei 3 роки тому
батько
коміт
531a3eb17b
1 змінених файлів з 20 додано та 15 видалено
  1. 20 15
      src/views/salesManagement/salesQuery/edit.vue

+ 20 - 15
src/views/salesManagement/salesQuery/edit.vue

@@ -459,24 +459,29 @@ export default {
           centered: true,
           closable: true,
           onOk () {
-            if (row.putCost > row.price) {
-              // 销售价低于成本价
-              _this.$confirm({
-                title: '提示',
-                content: '售价低于成本价,确认要添加吗?',
-                centered: true,
-                closable: true,
-                onOk () {
-                  _this.saveNewProduct(row)
-                }
-              })
-            } else {
-              _this.saveNewProduct(row)
-            }
+            _this.isPutCostDyPrice(row)
+          }
+        })
+      } else {
+        _this.isPutCostDyPrice(row)
+      }
+    },
+    // 判断售价低于成本价
+    isPutCostDyPrice (row) {
+      const _this = this
+      if (row.putCost > row.price) {
+        // 销售价低于成本价
+        _this.$confirm({
+          title: '提示',
+          content: '售价低于成本价,确认要添加吗?',
+          centered: true,
+          closable: true,
+          onOk () {
+            _this.saveNewProduct(row)
           }
         })
       } else {
-        this.saveNewProduct(row)
+        _this.saveNewProduct(row)
       }
     },
     // 保存添加的产品到销售列表