|
|
@@ -88,11 +88,19 @@
|
|
|
})
|
|
|
},
|
|
|
setPrice() {
|
|
|
- if (Number(this.form.riseAmount)<=0) {
|
|
|
+ const riseAmount = this.form.riseAmount
|
|
|
+ const isRiseOn = this.form.riseSwitch != 0
|
|
|
+ const amountText = riseAmount === null || riseAmount === undefined ? '' : String(riseAmount).trim()
|
|
|
+ const amountNumber = Number(amountText)
|
|
|
+ if (isRiseOn && (amountText === '' || isNaN(amountNumber) || amountNumber < 0)) {
|
|
|
this.$msg('请填写金额或比例')
|
|
|
return false
|
|
|
}
|
|
|
- updateRise(this.form).then(res => {
|
|
|
+ const params = {
|
|
|
+ ...this.form,
|
|
|
+ riseAmount: isRiseOn ? amountNumber : 0
|
|
|
+ }
|
|
|
+ updateRise(params).then(res => {
|
|
|
this.$msg('已更新')
|
|
|
setTimeout(function(){
|
|
|
uni.navigateBack()
|