|
@@ -43,16 +43,16 @@
|
|
|
待收:
|
|
|
<text class="fontColor">¥{{ chooseTotalPayPrice }}</text>
|
|
|
</view>
|
|
|
- <view v-if="chooseList.length > 0 && backDiscountVal&&backDiscountVal!=0">
|
|
|
+ <view v-if="chooseList.length > 0 && backDiscountVal">
|
|
|
折后:
|
|
|
<text class="fontColor">¥{{ backDiscountPrice }}</text>
|
|
|
</view>
|
|
|
<view class="u-flex" v-if="chooseList.length > 0">
|
|
|
<view>
|
|
|
折让:
|
|
|
- <text>¥{{ backDiscountVal }}</text>
|
|
|
+ <text>¥{{ Number(backDiscountVal) ? Number(backDiscountVal).toFixed(2) : 0 }}</text>
|
|
|
</view>
|
|
|
- <view class="costBtn" @click="costShow = true">打折</view>
|
|
|
+ <view class="costBtn" @click="openCostShow">打折</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="f-btns">
|
|
@@ -95,7 +95,7 @@
|
|
|
</view>
|
|
|
<view class="tip" v-if="discountVal*1 > chooseTotalPayPrice*1">折让金额不能大于待收金额,请重新输入</view>
|
|
|
<view class="costText">折让后金额</view>
|
|
|
- <view class="costText">¥{{ settlement }}</view>
|
|
|
+ <view class="costText">¥{{ settlement<0?0:settlement }}</view>
|
|
|
</view>
|
|
|
<u-button type="primary" :custom-style="customStyle" shape="circle" @click="handleDisCount">确定</u-button>
|
|
|
</view>
|
|
@@ -113,7 +113,6 @@
|
|
|
import billList from './billListComponent.vue';
|
|
|
import { queryUnsettleSaleList, insert } from '@/api/verify.js';
|
|
|
import getDate from '@/libs/getDate.js';
|
|
|
-import {formatDecimal} from '@/libs/tools.js'
|
|
|
export default {
|
|
|
components: { billList },
|
|
|
data() {
|
|
@@ -195,7 +194,7 @@ export default {
|
|
|
shareShow: false,
|
|
|
verifySn:'',
|
|
|
backDiscountPrice:null,
|
|
|
- backDiscountVal:'0.00',
|
|
|
+ backDiscountVal: 0,
|
|
|
cycleNameShow:''
|
|
|
};
|
|
|
},
|
|
@@ -272,8 +271,9 @@ export default {
|
|
|
settlement() {
|
|
|
let totalPrice=this.chooseTotalPayPrice?this.chooseTotalPayPrice:0;
|
|
|
let discountPrice=this.discountVal?this.discountVal:0
|
|
|
- let priceNum=(totalPrice - discountPrice)>0?(totalPrice - discountPrice) :0;
|
|
|
- return priceNum.toFixed(2)
|
|
|
+ let priceNum=totalPrice - discountPrice;
|
|
|
+ const ret = priceNum.toFixed(2)
|
|
|
+ return Number(this.chooseTotalPayPrice)>=Number(this.backDiscountVal) ? ret : 0
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -378,6 +378,10 @@ export default {
|
|
|
url
|
|
|
});
|
|
|
},
|
|
|
+ openCostShow(){
|
|
|
+ this.costShow = true
|
|
|
+ this.discountVal = this.backDiscountVal||''
|
|
|
+ },
|
|
|
handleDisCount() {
|
|
|
if (this.discountVal*1 > this.chooseTotalPayPrice*1) {
|
|
|
uni.showToast({
|
|
@@ -433,12 +437,16 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
if(this.settlement *1 <0){
|
|
|
- this.backDiscountVal = '0.00'
|
|
|
- this.discountVal = ''
|
|
|
+ this.backDiscountVal = 0
|
|
|
}else{
|
|
|
- this.backDiscountVal = this.discountVal?(this.discountVal).toFixed(2):'0.00'
|
|
|
+ this.backDiscountVal = this.discountVal
|
|
|
}
|
|
|
this.backDiscountPrice = this.settlement
|
|
|
+
|
|
|
+ if(Number(this.chooseTotalPayPrice)<Number(this.backDiscountVal)){
|
|
|
+ this.backDiscountVal = 0
|
|
|
+ this.discountVal = 0
|
|
|
+ }
|
|
|
// 是否全选
|
|
|
this.allChecked = isAllChecked;
|
|
|
},
|