|
@@ -100,10 +100,10 @@
|
|
|
<li v-for="(item, index) in chooseItem.prices" v-bind:key="index">
|
|
<li v-for="(item, index) in chooseItem.prices" v-bind:key="index">
|
|
|
<div class="clearfix">
|
|
<div class="clearfix">
|
|
|
<div class="pull-left">
|
|
<div class="pull-left">
|
|
|
- <input type="number" placeholder="数量" class="otherNumber" :class="{firstNumber: index === 0}" @change="startpriceBlur(item, index)" v-model="item.start" :disabled="index === 0" :readonly="index === 0" @blur="startpriceBlur(item, index)" maxlength="9"/>
|
|
|
|
|
|
|
+ <input type="number" placeholder="数量" class="otherNumber" :class="{firstNumber: index === 0}" v-model.lazy.trim="item.start" :disabled="index === 0" :readonly="index === 0" @blur="startpriceBlur(item, index)" maxlength="9"/>
|
|
|
<label v-if="index !== chooseItem.prices.length - 1">-</label>
|
|
<label v-if="index !== chooseItem.prices.length - 1">-</label>
|
|
|
<label v-if="index === chooseItem.prices.length - 1">以上</label>
|
|
<label v-if="index === chooseItem.prices.length - 1">以上</label>
|
|
|
- <input type="number" placeholder="数量" class="otherNumber" v-model="item.end" v-if="index !== chooseItem.prices.length - 1" @blur="endpriceBlur(item, index)" maxlength="9" @change="endpriceBlur(item, index)"/>
|
|
|
|
|
|
|
+ <input type="number" placeholder="数量" class="otherNumber" v-model.lazy.trim="item.end" v-if="index !== chooseItem.prices.length - 1" @blur="endpriceBlur(item, index)" maxlength="9"/>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="pull-right">
|
|
<div class="pull-right">
|
|
|
<template v-if="chooseItem.currencyName == 'RMB'">
|
|
<template v-if="chooseItem.currencyName == 'RMB'">
|
|
@@ -274,9 +274,6 @@
|
|
|
startpriceBlur(item, index) {
|
|
startpriceBlur(item, index) {
|
|
|
if (index > 0) {
|
|
if (index > 0) {
|
|
|
if (item.start === '' || toString(item.start).trim() === '') {
|
|
if (item.start === '' || toString(item.start).trim() === '') {
|
|
|
- this.timeoutCount++
|
|
|
|
|
- this.collectResult = '输入值不能为空'
|
|
|
|
|
- item.start = ''
|
|
|
|
|
return false
|
|
return false
|
|
|
} else if (Math.abs(item.start) <= Math.abs(this.chooseItem.prices[index - 1].start)) {
|
|
} else if (Math.abs(item.start) <= Math.abs(this.chooseItem.prices[index - 1].start)) {
|
|
|
this.timeoutCount++
|
|
this.timeoutCount++
|
|
@@ -300,14 +297,16 @@
|
|
|
},
|
|
},
|
|
|
// 结束价格阶段失去焦点
|
|
// 结束价格阶段失去焦点
|
|
|
endpriceBlur(item, index) {
|
|
endpriceBlur(item, index) {
|
|
|
- if (item.end === '' && toString(item.end).trim() === '') {
|
|
|
|
|
|
|
+ if (item.end === '') {
|
|
|
|
|
+ return false
|
|
|
|
|
+ } else if (this.chooseItem.prices[index + 1].start !== '' && toString(this.chooseItem.prices[index + 1].start).trim() !== '' && Math.abs(item.end) + 1 >= Math.abs(this.chooseItem.prices[index + 1].start)) {
|
|
|
this.timeoutCount++
|
|
this.timeoutCount++
|
|
|
- this.collectResult = `输入值不能为空`
|
|
|
|
|
|
|
+ this.collectResult = `输入值不能大于${this.chooseItem.prices[index + 1].start - 1}`
|
|
|
item.end = ''
|
|
item.end = ''
|
|
|
return false
|
|
return false
|
|
|
- } else if (this.chooseItem.prices[index + 1].end !== '' && toString(this.chooseItem.prices[index + 1].end).trim() !== '' && Math.abs(item.end) + 1 >= Math.abs(this.chooseItem.prices[index + 1].end)) {
|
|
|
|
|
|
|
+ } else if (this.chooseItem.prices[index + 1].end !== '' && toString(this.chooseItem.prices[index + 1].end).trim() !== '' && Math.abs(item.end) + 1 > Math.abs(this.chooseItem.prices[index + 1].end)) {
|
|
|
this.timeoutCount++
|
|
this.timeoutCount++
|
|
|
- this.collectResult = `输入值不能大于${this.chooseItem.prices[index + 1].end - 1}`
|
|
|
|
|
|
|
+ this.collectResult = `输入值不能大于${this.chooseItem.prices[index + 1].end}`
|
|
|
item.end = ''
|
|
item.end = ''
|
|
|
return false
|
|
return false
|
|
|
} else if (Math.abs(item.end) + 1 <= Math.abs(item.start)) {
|
|
} else if (Math.abs(item.end) + 1 <= Math.abs(item.start)) {
|
|
@@ -411,7 +410,7 @@
|
|
|
} else {
|
|
} else {
|
|
|
let isHas = false
|
|
let isHas = false
|
|
|
for (let i = 0; i < this.chooseItem.prices.length; i++) {
|
|
for (let i = 0; i < this.chooseItem.prices.length; i++) {
|
|
|
- if (!this.chooseItem.prices[i].start || (this.chooseItem.prices[i].end !== '' && !this.chooseItem.prices[i].end)) {
|
|
|
|
|
|
|
+ if (!this.chooseItem.prices[i].start || (this.chooseItem.prices[i].end === '' && i !== this.chooseItem.prices.length - 1)) {
|
|
|
this.timeoutCount++
|
|
this.timeoutCount++
|
|
|
this.collectResult = '分段数量必须填写'
|
|
this.collectResult = '分段数量必须填写'
|
|
|
isHas = true
|
|
isHas = true
|