|
|
@@ -96,7 +96,7 @@
|
|
|
<input v-else oninput="if(value.length>5)value=value.slice(0,9)"
|
|
|
type="tel" placeholder="数量" class="otherNumber"
|
|
|
:class="{firstNumber: index === 0}"
|
|
|
- v-model.lazy.trim="chooseItem.goods.minBuyQty"
|
|
|
+ v-model.lazy.trim="item.start"
|
|
|
:disabled="index === 0" :readonly="index === 0"
|
|
|
@blur="startpriceBlur(item, index)" maxlength="9"
|
|
|
/>
|
|
|
@@ -115,14 +115,14 @@
|
|
|
class="priceM" type="text"
|
|
|
placeholder="单价(¥)"
|
|
|
v-model.lazy="item.rMBPrice"
|
|
|
- @blur="rMBPriceBlur(item)"/>
|
|
|
+ @blur="rMBPriceBlur(item, 'rMBPrice')"/>
|
|
|
<input v-show="chooseItem.currencyName !== 'RMB'"
|
|
|
class="priceM" type="text"
|
|
|
placeholder="单价($)"
|
|
|
- v-model.lazy="item.rMBPrice"
|
|
|
- @blur="rMBPriceBlur(item)"/>
|
|
|
+ v-model.lazy="item.uSDPrice"
|
|
|
+ @blur="rMBPriceBlur(item, 'uSDPrice')"/>
|
|
|
<span @click="miuPrice(index)" class="clearfix"><img class="pull-left" src="/images/mobile/product/mui_icon.png"/></span>
|
|
|
- <span @click="addPrice()" class="clearfix"><img class="pull-left"src="/images/mobile/product/add_icon.png"/></span>
|
|
|
+ <span @click="addPrice()" class="clearfix"><img class="pull-left" src="/images/mobile/product/add_icon.png"/></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</li>
|
|
|
@@ -147,6 +147,10 @@
|
|
|
chooseItem: {
|
|
|
type: Object,
|
|
|
default: {}
|
|
|
+ },
|
|
|
+ firstPrice: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -161,7 +165,7 @@
|
|
|
ShowShopshelfOff: false,
|
|
|
showDrop: false,
|
|
|
storeObj: ['寄售', '自营'],
|
|
|
- showUpoff: false
|
|
|
+ showUpoff: false,
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -203,7 +207,12 @@
|
|
|
this.collectResult = '分段数量必须填写'
|
|
|
isHas = true
|
|
|
break
|
|
|
- } else if (Math.abs(this.chooseItem.goods.prices[i].rMBPrice) <= 0) {
|
|
|
+ } else if (Math.abs(this.chooseItem.goods.prices[i].rMBPrice) <= 0 && this.storeInfoStore.enType !== 'HK') {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '单价必须是大于0的数字'
|
|
|
+ isHas = true
|
|
|
+ break
|
|
|
+ } else if (Math.abs(this.chooseItem.goods.prices[i].uSDPrice) <= 0 && this.storeInfoStore.enType === 'HK') {
|
|
|
this.timeoutCount++
|
|
|
this.collectResult = '单价必须是大于0的数字'
|
|
|
isHas = true
|
|
|
@@ -213,7 +222,12 @@
|
|
|
this.collectResult = '分段数量必须是正整数'
|
|
|
isHas = true
|
|
|
break
|
|
|
- } else if (!/^[0-9]+([.]{1}[0-9]{1,6})?$/.test(this.chooseItem.goods.prices[i].rMBPrice)) {
|
|
|
+ } else if (!/^[0-9]+([.]{1}[0-9]{1,6})?$/.test(this.chooseItem.goods.prices[i].rMBPrice) && this.storeInfoStore.enType !== 'HK') {
|
|
|
+ this.timeoutCount++
|
|
|
+ this.collectResult = '单价只能输入数字'
|
|
|
+ isHas = true
|
|
|
+ break
|
|
|
+ } else if (!/^[0-9]+([.]{1}[0-9]{1,6})?$/.test(this.chooseItem.goods.prices[i].uSDPrice) && this.storeInfoStore.enType === 'HK') {
|
|
|
this.timeoutCount++
|
|
|
this.collectResult = '单价只能输入数字'
|
|
|
isHas = true
|
|
|
@@ -236,6 +250,12 @@
|
|
|
}
|
|
|
}
|
|
|
this.chooseItem.goods.prices[this.chooseItem.goods.prices.length - 1].end = '9999999999'
|
|
|
+ // if (this.storeInfoStore.enType === 'HK') {
|
|
|
+ // for (let i = 0; i < this.chooseItem.goods.prices.length; i++) {
|
|
|
+ // this.chooseItem.goods.prices[i].uSDPrice = this.chooseItem.goods.prices[i].rMBPrice
|
|
|
+ // this.chooseItem.goods.prices[i].uSDNTPrice = ''
|
|
|
+ // }
|
|
|
+ // }
|
|
|
this.$http.put('/trade/goods', this.chooseItem.goods).then(res => {
|
|
|
if (res.data.success) {
|
|
|
this.timeoutCount++
|
|
|
@@ -262,7 +282,7 @@
|
|
|
this.timeoutCount++
|
|
|
this.collectResult = '起订量必须是大于0的整数'
|
|
|
this.chooseItem.goods.minBuyQty = 1
|
|
|
- } else if ((!this.chooseItem.breakUp && this.chooseItem.goods.minBuyQty) && this.chooseItem.goods.minBuyQty % this.chooseItem.minPackQty !== 0) {
|
|
|
+ } else if ((!this.chooseItem.goods.breakUp && this.chooseItem.goods.minBuyQty) && this.chooseItem.goods.minBuyQty % this.chooseItem.minPackQty !== 0) {
|
|
|
this.timeoutCount++
|
|
|
this.collectResult = '不可拆卖时,起订量必须是包装数量的倍数'
|
|
|
if (!this.chooseItem.minPackQty) {
|
|
|
@@ -275,7 +295,11 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- this.chooseItem.goods.prices[0].start = this.chooseItem.goods.minBuyQty
|
|
|
+ if (Number(this.firstPrice) <= Number(this.chooseItem.goods.minBuyQty)) {
|
|
|
+ this.chooseItem.goods.prices[0].start = this.firstPrice
|
|
|
+ } else {
|
|
|
+ this.chooseItem.goods.prices[0].start = this.chooseItem.goods.minBuyQty
|
|
|
+ }
|
|
|
},
|
|
|
changeautoPublish() {
|
|
|
this.chooseItem.goods.autoPublish = !this.chooseItem.goods.autoPublish
|
|
|
@@ -327,27 +351,27 @@
|
|
|
}
|
|
|
},
|
|
|
// 单价失去焦点
|
|
|
- rMBPriceBlur(item) {
|
|
|
- if (item.rMBPrice === '' || !item.rMBPrice) { return false }
|
|
|
- if (!/^[0-9]+([.]{1}[0-9]{1,6})?$/.test(item.rMBPrice)) {
|
|
|
+ rMBPriceBlur(item, key) {
|
|
|
+ if (item[key] === '' || !item[key]) { return false }
|
|
|
+ if (!/^[0-9]+([.]{1}[0-9]{1,6})?$/.test(item[key])) {
|
|
|
this.timeoutCount++
|
|
|
this.collectResult = '单价只能输入数字带6位小数'
|
|
|
- } else if (Math.abs(item.rMBPrice) === 0) {
|
|
|
+ } else if (Math.abs(item[key]) === 0) {
|
|
|
return false
|
|
|
- } else if (Math.abs(item.rMBPrice) >= 10000) {
|
|
|
+ } else if (Math.abs(item[key]) >= 10000) {
|
|
|
this.timeoutCount++
|
|
|
- item.rMBPrice = 9999
|
|
|
+ item[key] = 9999
|
|
|
this.collectResult = '单价不能高于10000'
|
|
|
return false
|
|
|
}
|
|
|
- item.rMBPrice = item.rMBPrice.toString()
|
|
|
- let splits = item.rMBPrice.split('.')
|
|
|
+ item[key] = item[key].toString()
|
|
|
+ let splits = item[key].split('.')
|
|
|
if (splits[0].length >= 4) {
|
|
|
splits[0] = splits[0].substr(0, 4)
|
|
|
- item.rMBPrice = splits[0]
|
|
|
+ item[key] = splits[0]
|
|
|
}
|
|
|
if (splits[1]) {
|
|
|
- item.rMBPrice = splits[0] + '.' + splits[1]
|
|
|
+ item[key] = splits[0] + '.' + splits[1]
|
|
|
}
|
|
|
if (splits[1] && splits[1].length > 6) {
|
|
|
splits[1] = splits[1].substr(0, 7)
|
|
|
@@ -356,7 +380,7 @@
|
|
|
str = splits[1].substr(0, 6)
|
|
|
str = Math.abs(str) + 1
|
|
|
}
|
|
|
- item.rMBPrice = splits[0] + '.' + Math.ceil(str)
|
|
|
+ item[key] = splits[0] + '.' + Math.ceil(str)
|
|
|
}
|
|
|
},
|
|
|
addPrice() {
|
|
|
@@ -373,6 +397,8 @@
|
|
|
end: '',
|
|
|
rMBNTPrice: '',
|
|
|
rMBPrice: '',
|
|
|
+ uSDNTPrice: '',
|
|
|
+ uSDPrice: '',
|
|
|
start: ''
|
|
|
})
|
|
|
},
|
|
|
@@ -380,21 +406,25 @@
|
|
|
if (index === 0) {
|
|
|
if (this.chooseItem.goods.prices.length === 3) {
|
|
|
this.chooseItem.goods.prices[0].rMBPrice = this.chooseItem.goods.prices[1].rMBPrice
|
|
|
+ this.chooseItem.goods.prices[0].uSDPrice = this.chooseItem.goods.prices[1].uSDPrice
|
|
|
this.chooseItem.goods.prices[0].end = this.chooseItem.goods.prices[1].end
|
|
|
this.chooseItem.goods.prices[1].start = this.chooseItem.goods.prices[2].start
|
|
|
this.chooseItem.goods.prices[1].rMBPrice = this.chooseItem.goods.prices[2].rMBPrice
|
|
|
+ this.chooseItem.goods.prices[1].uSDPrice = this.chooseItem.goods.prices[2].uSDPrice
|
|
|
this.chooseItem.goods.prices[1].end = '9999999999'
|
|
|
this.chooseItem.goods.prices.splice(2, 1)
|
|
|
} else {
|
|
|
index++
|
|
|
if (this.chooseItem.goods.prices.length === 1) return
|
|
|
this.chooseItem.goods.prices[0].rMBPrice = this.chooseItem.goods.prices[1].rMBPrice
|
|
|
+ this.chooseItem.goods.prices[0].uSDPrice = this.chooseItem.goods.prices[1].uSDPrice
|
|
|
this.chooseItem.goods.prices[0].end = '9999999999'
|
|
|
this.chooseItem.goods.prices.splice(index, 1)
|
|
|
}
|
|
|
} else if (index === 1) {
|
|
|
if (this.chooseItem.prices.goods.length === 3) {
|
|
|
this.chooseItem.goods.prices[1].rMBPrice = this.chooseItem.goods.prices[2].rMBPrice
|
|
|
+ this.chooseItem.goods.prices[1].uSDPrice = this.chooseItem.goods.prices[2].uSDPrice
|
|
|
this.chooseItem.goods.prices[1].end = '9999999999'
|
|
|
this.chooseItem.goods.prices.splice(2, 1)
|
|
|
} else {
|