|
@@ -50,7 +50,7 @@
|
|
|
<view class="u-flex" v-if="chooseList.length > 0">
|
|
|
<view>
|
|
|
折让:
|
|
|
- <text>¥{{ backDiscountVal || 0 }}</text>
|
|
|
+ <text>¥{{ backDiscountVal }}</text>
|
|
|
</view>
|
|
|
<view class="costBtn" @click="costShow = true">打折</view>
|
|
|
</view>
|
|
@@ -81,7 +81,7 @@
|
|
|
<!-- 选择日期范围 -->
|
|
|
<u-calendar v-model="showDate" ref="rangeDate" @change="dateChange" mode="range"></u-calendar>
|
|
|
<!-- 打折弹窗 -->
|
|
|
- <u-popup v-model="costShow" mode="center" :border-radius="20" closeable width="82%">
|
|
|
+ <u-popup v-model="costShow" mode="center" @close="closeCost" :border-radius="20" closeable width="82%">
|
|
|
<view class="costPopup">
|
|
|
<view class="costPopupTit">东莞市京步车证汽车服务中心</view>
|
|
|
<view class="costPopupCon">
|
|
@@ -113,7 +113,7 @@
|
|
|
import billList from './billListComponent.vue';
|
|
|
import { queryUnsettleSaleList, insert } from '@/api/verify.js';
|
|
|
import getDate from '@/libs/getDate.js';
|
|
|
-import { toThousands,formatDecimal} from '@/libs/tools.js'
|
|
|
+import {formatDecimal} from '@/libs/tools.js'
|
|
|
export default {
|
|
|
components: { billList },
|
|
|
data() {
|
|
@@ -195,7 +195,7 @@ export default {
|
|
|
shareShow: false,
|
|
|
verifySn:'',
|
|
|
backDiscountPrice:null,
|
|
|
- backDiscountVal:null,
|
|
|
+ backDiscountVal:'0.00',
|
|
|
cycleNameShow:''
|
|
|
};
|
|
|
},
|
|
@@ -218,7 +218,7 @@ export default {
|
|
|
this.curTab = this.placeTab.findIndex(con => con.name == cycleObj.valueShow);
|
|
|
}
|
|
|
}
|
|
|
- this.cycleName = this.changeShowTime();
|
|
|
+
|
|
|
// 获取选择客户
|
|
|
if (options && options.data) {
|
|
|
this.customerObj = JSON.parse(options.data);
|
|
@@ -229,6 +229,7 @@ export default {
|
|
|
this.params.targetSn = res.customerSn;
|
|
|
this.changeTime();
|
|
|
});
|
|
|
+ this.cycleName = this.changeShowTime();
|
|
|
},
|
|
|
onReady() {
|
|
|
setTimeout(()=>{
|
|
@@ -258,7 +259,7 @@ export default {
|
|
|
this.bill[i].unsettleAmount = this.bill[i].unsettleAmount ? this.bill[i].unsettleAmount : 0;
|
|
|
totalPrice += this.bill[i].unsettleAmount;
|
|
|
}
|
|
|
- return formatDecimal(totalPrice,2);
|
|
|
+ return totalPrice.toFixed(2);
|
|
|
},
|
|
|
chooseTotalPayPrice() {
|
|
|
let price = 0;
|
|
@@ -266,16 +267,20 @@ export default {
|
|
|
item.unsettleAmount = item.unsettleAmount ? item.unsettleAmount : 0;
|
|
|
price += item.unsettleAmount;
|
|
|
});
|
|
|
- return formatDecimal(price,2);
|
|
|
+ return price.toFixed(2);
|
|
|
},
|
|
|
settlement() {
|
|
|
let totalPrice=this.chooseTotalPayPrice?this.chooseTotalPayPrice:0;
|
|
|
let discountPrice=this.discountVal?this.discountVal:0
|
|
|
- let priceNum=totalPrice - discountPrice;
|
|
|
- return formatDecimal(priceNum,2)
|
|
|
+ let priceNum=(totalPrice - discountPrice)>0?(totalPrice - discountPrice) :0;
|
|
|
+ return priceNum.toFixed(2)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ closeCost(){
|
|
|
+ this.costShow = false
|
|
|
+ this.discountVal= ''
|
|
|
+ },
|
|
|
chooseCycleData() {
|
|
|
uni.setStorageSync('chooseList', this.chooseList);
|
|
|
this.showSearch = true;
|
|
@@ -391,7 +396,7 @@ export default {
|
|
|
}
|
|
|
this.costShow = false;
|
|
|
this.backDiscountPrice = this.settlement
|
|
|
- this.backDiscountVal = this.discountVal
|
|
|
+ this.backDiscountVal = Number(this.discountVal).toFixed(2)
|
|
|
},
|
|
|
submitOrder() {
|
|
|
//发送对账单
|
|
@@ -429,8 +434,9 @@ export default {
|
|
|
}
|
|
|
if(this.settlement *1 <0){
|
|
|
this.backDiscountVal = '0.00'
|
|
|
+ this.discountVal = ''
|
|
|
}else{
|
|
|
- this.backDiscountVal = this.discountVal
|
|
|
+ this.backDiscountVal = this.discountVal?(this.discountVal).toFixed(2):'0.00'
|
|
|
}
|
|
|
this.backDiscountPrice = this.settlement
|
|
|
// 是否全选
|
|
@@ -439,7 +445,8 @@ export default {
|
|
|
// 分享图文
|
|
|
handleShare() {
|
|
|
this.submitLoading = false;
|
|
|
- let url = 'http://p.iscm.360arrow.com/dzd/index.html?userSn=' + this.userData.orgSn + '&verifySn='+this.verifySn + '&name='+this.userData.orgName;
|
|
|
+ let verifyId = Date.now()+this.nanoid();
|
|
|
+ let url = 'http://p.iscm.360arrow.com/dzd/index.html?userSn=' + this.userData.orgSn + '&verifySn='+verifyId + '&name='+this.userData.orgName;
|
|
|
if (uni.getSystemInfoSync().platform == 'ios') {
|
|
|
uni.share({
|
|
|
provider: 'weixin',
|
|
@@ -478,13 +485,14 @@ export default {
|
|
|
totalAmount: this.chooseTotalPayPrice,
|
|
|
discountAmount: this.backDiscountVal || 0,
|
|
|
settleAmount: this.chooseTotalPayPrice - this.backDiscountVal ,
|
|
|
- detailList: this.chooseList
|
|
|
+ detailList: this.chooseList,
|
|
|
+ verifySn:Date.now()+this.nanoid()
|
|
|
};
|
|
|
let ajaxData = Object.assign(this.params, obj);
|
|
|
insert(ajaxData).then(res => {
|
|
|
this.shareShow = false;
|
|
|
if (res.status == 200) {
|
|
|
- this.verifySn = res.data.verifySn
|
|
|
+ console.log('生成历史对账单成功')
|
|
|
} else {
|
|
|
uni.showToast({
|
|
|
title: res.message,
|
|
@@ -492,6 +500,16 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
+ },
|
|
|
+ // 生成随机对账单id
|
|
|
+ nanoid (size = 5) {
|
|
|
+ let urlAlphabet ='0123456789'
|
|
|
+ let id = ''
|
|
|
+ let i = size
|
|
|
+ while (i--) {
|
|
|
+ id += urlAlphabet[(Math.random() * 10) | 0]
|
|
|
+ }
|
|
|
+ return id
|
|
|
}
|
|
|
}
|
|
|
};
|