|
|
@@ -81,9 +81,9 @@
|
|
|
</div>
|
|
|
<div class="pull-right">
|
|
|
<span class="name">交期:</span>
|
|
|
- <input type="tel" placeholder="天数" v-model="chooseItem.minDelivery" class="input startInput" maxlength="3" @blur="minDeliveryBlur()" />
|
|
|
+ <input type="tel" placeholder="天数" v-model="chooseItem.minDelivery" class="input startInput" maxlength="3" @blur="minDeliveryBlur(chooseItem.minDelivery)" />
|
|
|
-
|
|
|
- <input type="tel" placeholder="天数" v-model="chooseItem.maxDelivery" class="input endInput" maxlength="3" @blur="minDeliveryBlur()"/>
|
|
|
+ <input type="tel" placeholder="天数" v-model="chooseItem.maxDelivery" class="input endInput" maxlength="3" @blur="minDeliveryBlur(chooseItem.maxDelivery)"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="list" style="border-bottom: 0px">
|
|
|
@@ -374,7 +374,13 @@
|
|
|
console.log(this.chooseItem.prices)
|
|
|
},
|
|
|
// 交期失去焦点
|
|
|
- minDeliveryBlur() {
|
|
|
+ minDeliveryBlur(str) {
|
|
|
+ if (Math.abs(str) === 0) {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = `交期天数不能为0`
|
|
|
+ this.chooseItem.maxDelivery = ''
|
|
|
+ return false
|
|
|
+ }
|
|
|
if (Math.abs(this.chooseItem.minDelivery) > Math.abs(this.chooseItem.maxDelivery)) {
|
|
|
this.timeoutCount++
|
|
|
this.collectResult = `最短交期应小于等于最长交期`
|
|
|
@@ -384,9 +390,15 @@
|
|
|
// 单价失去焦点
|
|
|
rMBPriceBlur(item) {
|
|
|
if (item.rMBPrice === '' || !item.rMBPrice) { return false }
|
|
|
- if (!/^[0-9]+([.]{1}[0-9]+)?$/.test(item.rMBPrice)) {
|
|
|
+ if (!/^[0-9]+([.]{1}[0-9]{1,6})?$/.test(item.rMBPrice)) {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '单价只能输入数字带6位小数'
|
|
|
+ } else if (Math.abs(item.rMBPrice) === 0) {
|
|
|
+ return false
|
|
|
+ } else if (Math.abs(item.rMBPrice) > 10000) {
|
|
|
this.timeoutCount++
|
|
|
- this.collectResult = '单价只能输入数字'
|
|
|
+ item.rMBPrice = 10000
|
|
|
+ this.collectResult = '单价不能高于10000'
|
|
|
return false
|
|
|
}
|
|
|
item.rMBPrice = item.rMBPrice.toString()
|
|
|
@@ -465,7 +477,7 @@
|
|
|
return false
|
|
|
} else if (!this.chooseItem.packaging || this.chooseItem.packaging === '' ) {
|
|
|
this.timeoutCount++
|
|
|
- this.collectResult = '请选择规格信息'
|
|
|
+ this.collectResult = '请选择包装方式'
|
|
|
return false
|
|
|
} else {
|
|
|
let isHas = false
|