|
@@ -91,7 +91,7 @@
|
|
|
</view>
|
|
|
<view class="costList u-flex">
|
|
|
<view class="label">折让金额:</view>
|
|
|
- <u-input type="number" :custom-style="{color:'#ffa500'}" v-model="discountVal" :border="true" :height="50" />
|
|
|
+ <u-input type="number" :custom-style="{color:'#ffa500'}" placeholder="请输入折让金额(最多2位小数)" v-model="discountVal" :border="true" :height="50" />
|
|
|
</view>
|
|
|
<view class="tip" v-if="discountVal*1 > chooseTotalPayPrice*1">折让金额不能大于待收金额,请重新输入</view>
|
|
|
<view class="costText">折让后金额</view>
|
|
@@ -391,12 +391,15 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
let reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;
|
|
|
- if (this.discountVal && !reg.test(this.discountVal)) {
|
|
|
- uni.showToast({
|
|
|
- title: '折让金额格式不正确,请重新输入',
|
|
|
- icon: 'none'
|
|
|
- });
|
|
|
- return;
|
|
|
+ console.log(this.discountVal,!reg.test(this.discountVal),this.discountVal && !reg.test(this.discountVal))
|
|
|
+ if(this.discountVal!=0){
|
|
|
+ if (!reg.test(this.discountVal)) {
|
|
|
+ uni.showToast({
|
|
|
+ title: '折让金额格式不正确,请重新输入',
|
|
|
+ icon: 'none'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
this.costShow = false;
|
|
|
this.backDiscountPrice = this.settlement
|