Ver Fonte

价格跟条码 设置成必填项
首营跟审核说明设置成非必填,或者隐藏

Guos há 2 semanas atrás
pai
commit
1f993a27a0
1 ficheiros alterados com 21 adições e 9 exclusões
  1. 21 9
      src/views/store/storeProduct/index.vue

+ 21 - 9
src/views/store/storeProduct/index.vue

@@ -1657,9 +1657,12 @@ export default {
         manufacturerAddress: [
           {required: true, message: "生产企业地址不能为空", trigger: "blur"}
         ],
-        reviewAudit: [
-          {required: true, message: "审核资质不能为空!", trigger: "blur"}
-        ],
+        // reviewAudit: [
+        //   {required: true, message: "审核资质不能为空!", trigger: "blur"}
+        // ],
+        // businessLink: [
+        //   { required: true, message: "非首营链接不能为空!", trigger: "change" }
+        // ],
         business: [
           { required: true, message: "营业执照不能为空!", trigger: "blur" }
         ],
@@ -1690,9 +1693,6 @@ export default {
         gmpAuthExpire: [
           { required: true, message: "GMP认证有效期不能为空!", trigger: "change" }
         ],
-        businessLink: [
-          { required: true, message: "非首营链接不能为空!", trigger: "change" }
-        ],
         indications: [
           { required: true, message: "功能主治不能为空", trigger: "blur" }
         ],
@@ -2396,6 +2396,7 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           let checkBoolean = false
+          let itemErrMsg = ''
           if (this.form.specType === 0) {
             this.form.items = [];
             this.form.values = this.oneFormValidate;
@@ -2403,17 +2404,28 @@ export default {
             this.form.items = this.attrs;
             this.form.values = this.manyFormValidate;
           }
-
           //验证是否填写商品编码
           this.form.values.forEach(item => {
             if (item.barCode == null || item.barCode === '') {
+              itemErrMsg = "规格/型号,商品条码不能为空!";
+              return checkBoolean = true;
+            }
+            if(item.price == null || item.price === '' || item.price === 0){
+              itemErrMsg = "规格/型号,商品售价不能为空且不能为0!";
+              return checkBoolean = true;
+            }
+            if(item.cost == null || item.cost === ''){
+              itemErrMsg = "规格/型号,商品成本价不能为空!";
+              return checkBoolean = true;
+            }
+            if(item.otPrice == null || item.otPrice === ''){
+              itemErrMsg = "规格/型号,商品原价不能为空!";
               return checkBoolean = true;
             }
           })
           if (checkBoolean) {
-            return this.$message.warning("规格/型号,商品条码不能为空!");
+            return this.$message.warning(itemErrMsg);
           }
-
           if (this.form.specType === 1 && this.manyFormValidate.length === 0) {
             return this.$message.warning('请点击生成规格!');
           }