Explorar o código

优先判断关联商品

DELL %!s(int64=3) %!d(string=hai) anos
pai
achega
466d548fb8
Modificáronse 1 ficheiros con 4 adicións e 5 borrados
  1. 4 5
      src/views/business/ticket/create.vue

+ 4 - 5
src/views/business/ticket/create.vue

@@ -415,6 +415,10 @@ export default {
       const subForm = this.$refs["form"];
       subForm.validate((valid) => {
         if (valid) {
+          if (this.form.type != "offline" && this.goodsList.length < 1) {
+            this.$message.error("关联商品不能为空");
+            return
+          }
           // let prizeIndex = this.awardsList.findIndex((item) => {
           //   return !item.prizeList.length;
           // });
@@ -496,11 +500,6 @@ export default {
             }
           }
 
-          if (this.form.type != "offline" && this.goodsList.length < 1) {
-            this.$message.error("关联商品不能为空");
-            return
-          }
-
           let data = {
             ...this.form,
             facePrice: accMul(this.form.facePrice, 100),