Browse Source

型号发布中间可以带空格

yangc 7 years ago
parent
commit
7b959b5997
1 changed files with 4 additions and 5 deletions
  1. 4 5
      components/applyPurchase/PublishApply.vue

+ 4 - 5
components/applyPurchase/PublishApply.vue

@@ -249,7 +249,6 @@
             inquiry.endDate = this.applyObj.deadline
             inquiry.sourceapp = 'MALL'
             inquiry.amount = 1
-            inquiryItem.prodTitle = this.applyObj.code
             inquiryItem.userUU = this.user.data.userUU
             inquiryItem.source = 'MALL'
             inquiryItem.userName = this.user.data.userName
@@ -257,7 +256,7 @@
             inquiryItem.needquantity = this.applyObj.amount
             inquiryItem.inbrand = this.applyObj.brand
             inquiryItem.currency = currency
-            inquiryItem.cmpCode = this.applyObj.code.toUpperCase()
+            inquiryItem.cmpCode = this.applyObj.code.trim().toUpperCase()
             inquiryItem.unitPrice = this.applyObj.unitPrice
             inquiryItem.produceDate = this.applyObj.produceDate
             inquiryItem.date = date
@@ -314,8 +313,9 @@
         }
       },
       checkCode: function () {
-        let nullStrFlag = checkNullStr(this.applyObj.code)
-        this.validObj.code = this.applyObj.code && this.applyObj.code !== '' && nullStrFlag
+        let code = this.applyObj.code.trim()
+        let nullStrFlag = checkNullStr(code)
+        this.validObj.code = code && code !== '' && nullStrFlag
         if (!this.validObj.code) {
           if (!nullStrFlag) {
             this.$message.error('型号输入不合法')
@@ -401,7 +401,6 @@
         }
       },
       onCodeChange: function () {
-        this.applyObj.code = this.applyObj.code.trim()
         if ((/[^\x00-\xff]/g).test(this.applyObj.code)) {
           let chineseIndex = -1
           for (let i = 0; i < this.applyObj.code.length; i++) {