Browse Source

Merge remote-tracking branch 'origin/release-201845-wangcz' into release-201845-wangcz

shenjunjie 7 years ago
parent
commit
d45d52dc67

+ 9 - 7
components/applyPurchase/SayPrice.vue

@@ -62,11 +62,11 @@
           <div class="content-line">
             <div class="form-item form-left">
               <span><i>*</i>交期(天):</span>
-              <input type="number" class="form-control" placeholder="最长交期" @input="onLeadtimeInput" @blur="onLeadtimeBlur" v-model="sayPriceObj.leadtime">
+              <input type="text" class="form-control" placeholder="最长交期" @input="onLeadtimeInput" @blur="onLeadtimeBlur" v-model="sayPriceObj.leadtime">
             </div>
             <div class="form-item form-right">
               <span><i>*</i>税率:</span>
-              <input type="number" class="form-control" placeholder="税率" @input="onTaxrateInput" @blur="onTaxrateBlur" v-model="sayPriceObj.taxrate">%
+              <input type="text" class="form-control" placeholder="税率" @input="onTaxrateInput" @blur="onTaxrateBlur" v-model="sayPriceObj.taxrate">%
             </div>
             <!--<div class="form-item form-upload">
               <label>
@@ -83,7 +83,7 @@
           <div class="content-line" v-for="(reply, index) in sayPriceObj.replies">
             <div class="form-item form-left">
               <span><i>*</i>价格梯度:</span>
-              <input type="number" class="form-control" @blur="onReplyLapQtyBlur(index)" @input="onReplyLapQtyInput(index)" v-model="reply.lapQty" placeholder="分段数量">
+              <input type="text" class="form-control" @blur="onReplyLapQtyBlur(index)" @input="onReplyLapQtyInput(index)" v-model="reply.lapQty" placeholder="分段数量">
               <!-- -
                <input type="text" class="form-control" placeholder="数量">-->
             </div>
@@ -94,7 +94,7 @@
                 <option value="RMB">¥</option>
                 <option value="USD">$</option>
               </select>
-              <input type="number" class="form-control" @input="onReplyPriceInput(index)" @blur="onReplyPriceBlur(index)" placeholder="分段单价" v-model="reply.price">
+              <input type="text" class="form-control" @input="onReplyPriceInput(index)" @blur="onReplyPriceBlur(index)" placeholder="分段单价" v-model="reply.price">
               <i class="fa fa-minus-circle" v-if="sayPriceObj.replies.length > 1" @click="setReplies('sub', index)"></i>
               <i class="fa fa-plus-circle" v-if="sayPriceObj.replies.length < 5" @click="setReplies('add', index)"></i>
             </div>
@@ -211,7 +211,7 @@
             if (response.data.success === false) {
               this.$message.error(response.data.message)
             } else {
-              this.$message.success('感谢您参与报价,敬请期待回复')
+              this.$message.success('感谢您参与报价,敬请期待回复!')
               this.resetSayPrice()
               this.resetList()
             }
@@ -244,7 +244,7 @@
         }
       },
       onLeadtimeInput: function () {
-        this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.replace(/[^\d]/g, '')
+        this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.replace(/[^0-9]*$/g, '')
         if (this.sayPriceObj.leadtime.length > 3) {
           this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.substring(0, 3)
         }
@@ -258,7 +258,7 @@
         }
       },
       onTaxrateInput () {
-        this.sayPriceObj.taxrate = this.sayPriceObj.taxrate.replace(/[^\d]/g, '')
+        this.sayPriceObj.taxrate = this.sayPriceObj.taxrate.replace(/[^0-9]*$/g, '')
         if (this.sayPriceObj.taxrate.length > 2) {
           this.sayPriceObj.taxrate = this.sayPriceObj.taxrate.substring(0, 2)
         }
@@ -272,6 +272,7 @@
         }
       },
       onReplyPriceInput: function (index) {
+        this.sayPriceObj.replies[index].price = this.sayPriceObj.replies[index].price.replace(/[^0-9.]*$/g, '')
         let price = this.sayPriceObj.replies[index].price
         if (price >= 10000) {
           this.sayPriceObj.replies[index].price = price.substring(0, 4)
@@ -318,6 +319,7 @@
         }
       },
       onReplyLapQtyInput: function (index) {
+        this.sayPriceObj.replies[index].lapQty = this.sayPriceObj.replies[index].lapQty.replace(/[^0-9]*$/g, '')
         let lapQty = this.sayPriceObj.replies[index].lapQty
         if (lapQty.length > 9) {
           this.sayPriceObj.replies[index].lapQty = lapQty.substring(0, 9)

+ 5 - 5
components/mobile/applyPurchase/SayPrice.vue

@@ -245,7 +245,7 @@
             }
           }, error => {
             console.log(error)
-            this.onRemind('请勿重复报价或报价自己的求购')
+            this.onRemind('请勿重复报价或报价自己的求购!')
 //            this.showLoading = false
           })
         } else {
@@ -253,7 +253,7 @@
         }
       },
       onLeadtimeInput: function () {
-        this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.replace(/[^\d]/g, '')
+        this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.replace(/[^0-9]*$/g, '')
         if (this.sayPriceObj.leadtime.length > 3) {
           this.sayPriceObj.leadtime = this.sayPriceObj.leadtime.substring(0, 3)
         }
@@ -267,7 +267,7 @@
         }
       },
       onTaxrateInput () {
-        this.sayPriceObj.taxrate = this.sayPriceObj.taxrate.replace(/[^\d]/g, '')
+        this.sayPriceObj.taxrate = this.sayPriceObj.taxrate.replace(/[^0-9]*$/g, '')
         if (this.sayPriceObj.taxrate.length > 2) {
           this.sayPriceObj.taxrate = this.sayPriceObj.taxrate.substring(0, 2)
         }
@@ -281,7 +281,7 @@
         }
       },
       onReplyPriceInput: function (index) {
-        this.sayPriceObj.replies[index].price = this.sayPriceObj.replies[index].price.replace(/[^\-?\d.]/g, '')
+        this.sayPriceObj.replies[index].price = this.sayPriceObj.replies[index].price.replace(/[^0-9.]*$/g, '')
         let price = this.sayPriceObj.replies[index].price
         if (price >= 10000) {
           this.sayPriceObj.replies[index].price = price.substring(0, 4)
@@ -328,7 +328,7 @@
         }
       },
       onReplyLapQtyInput: function (index) {
-        this.sayPriceObj.replies[index].lapQty = this.sayPriceObj.replies[index].lapQty.replace(/[^\-?\d.]/g, '')
+        this.sayPriceObj.replies[index].lapQty = this.sayPriceObj.replies[index].lapQty.replace(/[^0-9]*$/g, '')
         let lapQty = this.sayPriceObj.replies[index].lapQty
         if (lapQty.length > 9) {
           this.sayPriceObj.replies[index].lapQty = lapQty.substring(0, 9)