Browse Source

补充校验

yangc 8 years ago
parent
commit
e2f6ddddfb

+ 1 - 1
components/applyPurchase/ApplyInfo.vue

@@ -224,7 +224,7 @@
               if (!this.sayPriceObj.minDay || !this.sayPriceObj.maxDay) {
                 this.$message.error('交期不能为空')
               } else {
-                if (this.sayPriceObj.minDay > 31 || this.sayPriceObj.minDay < 1 || this.sayPriceObj.minDay.indexOf('.') !== -1 || this.sayPriceObj.maxDay > 31 || this.sayPriceObj.maxDay < 1 || this.sayPriceObj.maxDay.indexOf('.') !== -1) {
+                if (this.sayPriceObj.minDay > 31 || this.sayPriceObj.minDay < 1 || this.sayPriceObj.minDay.toString().indexOf('.') !== -1 || this.sayPriceObj.maxDay > 31 || this.sayPriceObj.maxDay < 1 || this.sayPriceObj.maxDay.toString().indexOf('.') !== -1) {
                   this.$message.error('交期只能填写1-31之间的整数值')
                 } else {
                   this.$message.error('最短交期应小于等于最长交期')

+ 9 - 2
components/applyPurchase/PublishApply.vue

@@ -19,7 +19,7 @@
             <span>
               <i>*</i>型号:
             </span>
-            <input type="text" class="form-control" :class="{'error': !validObj.code}" v-model="applyObj.code" @blur="checkCode" @input="onCodeChange" />
+            <input type="text" class="form-control" :class="{'error': !validObj.code}" v-model="applyObj.code" @blur="checkCode" @input="onCodeChange" placeholder="请勿填中文符号"/>
             <ul v-show="showSimilarCodeList">
               <li v-for="sCode in similarCode" @click="setCode(sCode.code)">{{sCode.code}}</li>
             </ul>
@@ -28,7 +28,7 @@
             <span>
               <i>*</i>品牌:
             </span>
-            <input type="text" class="form-control" :class="{'error': !validObj.brand}" v-model="applyObj.brand" @blur="checkBrand" @input="onBrandChange" />
+            <input type="text" class="form-control" :class="{'error': !validObj.brand}" v-model="applyObj.brand" @blur="checkBrand" @input="onBrandChange" placeholder="请勿填中文符号" />
             <ul class="brand-similar-list" v-show="showSimilarBrandList">
               <li v-for="sBrand in similarBrand" @click="setBrand(sBrand.nameEn)">{{sBrand.nameEn}}</li>
             </ul>
@@ -270,10 +270,16 @@
       },
       checkCode: function () {
         this.validObj.code = this.applyObj.code && this.applyObj.code !== ''
+        if (!this.validObj.code) {
+          this.$message.error('型号不能为空')
+        }
         return this.validObj.code
       },
       checkBrand: function () {
         this.validObj.brand = this.applyObj.brand && this.applyObj.brand !== ''
+        if (!this.validObj.brand) {
+          this.$message.error('品牌不能为空')
+        }
         return this.validObj.brand
       },
       checkUnitPrice: function () {
@@ -522,6 +528,7 @@
               }
             }
             input {
+              font-size: 12px;
               width: 111px;
               height: 20px;
               line-height: 20px;