|
@@ -73,7 +73,7 @@
|
|
|
class="form-input"
|
|
|
type="number"
|
|
|
v-model="handlePostageVal"
|
|
|
- @input="handleInputPostage"
|
|
|
+ @input="$event => (handlePostageVal = checkedInput($event))"
|
|
|
placeholder="请填写运费"
|
|
|
maxlength="20"
|
|
|
/>
|
|
@@ -148,7 +148,7 @@ export default {
|
|
|
return {
|
|
|
popupShow: false,
|
|
|
isColdChina: false,
|
|
|
- handleColdChain:0,// 记录冷链费
|
|
|
+ handleColdChain: 0, // 记录冷链费
|
|
|
handlePostage: 0, // 记录原始运费
|
|
|
handlePostageVal: 0, // 记录修改的运费
|
|
|
handlePostageFlag: 0, // 记录运费类型
|
|
@@ -223,11 +223,11 @@ export default {
|
|
|
break
|
|
|
}
|
|
|
},
|
|
|
- handleInputPostage(e) {
|
|
|
- //处理邮费显示
|
|
|
- // if (e.detail.value == '') {
|
|
|
- // this.handleSupplier.postage = 0
|
|
|
- // }
|
|
|
+ //处理格式
|
|
|
+ checkedInput(e) {
|
|
|
+ const value = e.detail.value
|
|
|
+ const pattern = /[^0-9.]/g
|
|
|
+ return Number(value.replace(pattern, ''))
|
|
|
},
|
|
|
// 勾选冷链费
|
|
|
handleChangeColdChina() {
|
|
@@ -257,22 +257,33 @@ export default {
|
|
|
// 确定运费
|
|
|
handleComfirm() {
|
|
|
if (this.handlePostageFlag === 0) {
|
|
|
- let handleTotalPrice = this.isColdChina ? this.handleTotalPrice : Number(this.repiceNumSub(this.handleTotalPrice, this.handleColdChain))
|
|
|
- this.handleSupplier.totalPrice = Number(this.repiceNumSub(handleTotalPrice, this.handleSupplier.postage))
|
|
|
+ let handleTotalPrice = this.isColdChina
|
|
|
+ ? this.handleTotalPrice
|
|
|
+ : Number(this.repiceNumSub(this.handleTotalPrice, this.handleColdChain))
|
|
|
+ this.handleSupplier.totalPrice = Number(
|
|
|
+ this.repiceNumSub(handleTotalPrice, this.handleSupplier.postage)
|
|
|
+ )
|
|
|
this.$emit('changePostage', this.handleSupplier, this.index)
|
|
|
} else if (this.handlePostageFlag === 1) {
|
|
|
if (this.handlePostageVal == 0 || !this.handlePostageVal) {
|
|
|
this.$util.msg('请填写运费', 2000)
|
|
|
return
|
|
|
}
|
|
|
+ let handleTotalPrice = this.isColdChina
|
|
|
+ ? this.handleTotalPrice
|
|
|
+ : Number(this.repiceNumSub(this.handleTotalPrice, this.handleColdChain))
|
|
|
this.handleSupplier.totalPrice = Number(
|
|
|
- (this.handleTotalPrice * 100 - this.handlePostage * 100 + this.handlePostageVal * 100) / 100
|
|
|
+ (handleTotalPrice * 100 - this.handlePostage * 100 + this.handlePostageVal * 100) / 100
|
|
|
)
|
|
|
this.handleSupplier.postage = this.handlePostageVal
|
|
|
this.$emit('changePostage', this.handleSupplier, this.index)
|
|
|
} else {
|
|
|
- let handleTotalPrice = this.isColdChina ? this.handleTotalPrice : Number(this.repiceNumSub(this.handleTotalPrice, this.handleColdChain))
|
|
|
- this.handleSupplier.totalPrice = Number(this.repiceNumSub(handleTotalPrice, this.handleSupplier.postage))
|
|
|
+ let handleTotalPrice = this.isColdChina
|
|
|
+ ? this.handleTotalPrice
|
|
|
+ : Number(this.repiceNumSub(this.handleTotalPrice, this.handleColdChain))
|
|
|
+ this.handleSupplier.totalPrice = Number(
|
|
|
+ this.repiceNumSub(handleTotalPrice, this.handleSupplier.postage)
|
|
|
+ )
|
|
|
this.$emit('changePostage', this.handleSupplier, this.index)
|
|
|
}
|
|
|
this.popupShow = false
|