|
@@ -18,51 +18,74 @@
|
|
|
<text>{{ billInfo.billStatus == 'UNSETTLE' ? '未付款' : billInfo.settleStyleSnDictValue ? '已结清(' + billInfo.settleStyleSnDictValue + ')' : '已结清' }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="b_detail">
|
|
|
+ <view class="b_detail" v-if="billInfo.billStatus == 'UNSETTLE'">
|
|
|
<view class="detail_list u-flex">
|
|
|
<view class="detail_box">
|
|
|
<text>总单数:</text>
|
|
|
<text>{{ billInfo.detailNum }}</text>
|
|
|
</view>
|
|
|
<view class="detail_box">
|
|
|
- <text>待收金额合计:</text>
|
|
|
- <text>¥{{ billInfo.totalAmount ||billInfo.totalAmount == 0 ? toThousands(billInfo.totalAmount,2):'--' }}</text>
|
|
|
+ <text>待收:</text>
|
|
|
+ <text>¥{{dueAmount}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="detail_list u-flex">
|
|
|
<view class="detail_box">
|
|
|
- <text>折让金额:</text>
|
|
|
+ <text>折让:</text>
|
|
|
<text>¥{{ billInfo.discountAmount||billInfo.discountAmount==0? toThousands(billInfo.discountAmount,2):'--'}}</text>
|
|
|
</view>
|
|
|
<view class="detail_box">
|
|
|
- <text>折让后待收金额:</text>
|
|
|
+ <text>折后:</text>
|
|
|
<text>¥{{ billInfo.settleAmount||billInfo.settleAmount ==0? toThousands(billInfo.settleAmount,2):'--' }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="detail_list u-flex" v-if="billInfo.billStatus != 'UNSETTLE'">
|
|
|
+ </view>
|
|
|
+ <view class="b_detail" v-else>
|
|
|
+ <view class="detail_list u-flex">
|
|
|
+ <view class="detail_box">
|
|
|
+ <text>总单数:</text>
|
|
|
+ <text>{{ billInfo.detailNum }}</text>
|
|
|
+ </view>
|
|
|
<view class="detail_box">
|
|
|
- <text>实际折让金额:</text>
|
|
|
+ <text>折让:</text>
|
|
|
<text>¥{{ billInfo.discountAmount||billInfo.discountAmount==0? toThousands(billInfo.discountAmount,2):'--'}}</text>
|
|
|
</view>
|
|
|
+ </view>
|
|
|
+ <view class="detail_list u-flex">
|
|
|
<view class="detail_box">
|
|
|
- <text>实际收款金额:</text>
|
|
|
+ <text>折后:</text>
|
|
|
<text>¥{{ billInfo.settleAmount||billInfo.settleAmount ==0? toThousands(billInfo.settleAmount,2):'--' }}</text>
|
|
|
</view>
|
|
|
+ <view class="detail_box">
|
|
|
+ <text>实收:</text>
|
|
|
+ <text>¥{{ billInfo.settleRealAmount||billInfo.settleRealAmount ==0? toThousands(billInfo.settleRealAmount,2):'--' }}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="detail_con"><billList ref="billBox" :list="billArr"></billList></view>
|
|
|
- <view class="footer flex align_center" v-if="billInfo.billStatus == 'UNSETTLE'">
|
|
|
- <navigator style="flex:1;" :url="'/pages/sales/billHistoryEdit?billId=' + verifySn" hover-class="none">
|
|
|
- <view style="color:#00aaff;">编辑</view>
|
|
|
- </navigator>
|
|
|
- <view class="flex" style="width: 78%;">
|
|
|
+ <view class="detail_con"><billList ref="billBox" :showCheck="isShowEdit" :list="billArr" @allChecked="chooseBillList"></billList></view>
|
|
|
+ <view v-if="!isShowEdit">
|
|
|
+ <view class="footer u-flex u-col-bottom u-row-right" v-if="billInfo.billStatus == 'UNSETTLE'&& billArr&&billArr.length!=0">
|
|
|
+ <view class="u-flex u-col-center" >
|
|
|
<u-button type="warning" shape="circle" @click="openPaymentModal">确认收款</u-button>
|
|
|
- <u-button type="primary" shape="circle" :loading="btnLoading" @click="submitOrder" :custom-style="customStyle">再次发送对账单</u-button>
|
|
|
+ <u-button type="primary" shape="circle" :loading="btnLoading" @click="submitOrder" style="margin-left:20rpx;" :custom-style="customStyle">再次发送对账单</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="footer" v-else>
|
|
|
+ <view class="footer" v-else-if="billInfo.billStatus != 'UNSETTLE'&& billArr&&billArr.length!=0">
|
|
|
<u-button type="primary" shape="circle" :loading="btnLoading" @click="submitOrder" :custom-style="customStyle">再次发送对账单</u-button>
|
|
|
</view>
|
|
|
+ </view>
|
|
|
+ <view v-else>
|
|
|
+ <view class="footer flex align_center" v-if="billInfo.billStatus == 'UNSETTLE' && billArr&&billArr.length!=0">
|
|
|
+ <u-checkbox-group style="flex:1;">
|
|
|
+ <u-checkbox v-model="checkedAll" shape="circle" @change="chooseAll">{{checkedAll?'取消全选':'全选'}}</u-checkbox>
|
|
|
+ </u-checkbox-group>
|
|
|
+ <view class="u-flex u-row-right">
|
|
|
+ <u-button type="error" shape="circle" :loading="btnLoading" @click="handleEvents('del')" :custom-style="customDelStyle">删除</u-button>
|
|
|
+ <u-button type="warning" shape="circle" style="margin-left: 30rpx;" @click="handleEvents('update')">一键刷新</u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <u-modal v-model="modalShow" :show-title="false" :content="modalCon" :show-cancel-button="true" @confirm="handleConfirm"></u-modal>
|
|
|
<!-- 确认收款弹窗 -->
|
|
|
<u-popup v-model="showPayment" mode="center" :border-radius="20" width="82%">
|
|
|
<view class="slot-content">
|
|
@@ -81,7 +104,7 @@
|
|
|
<u-form-item :border-bottom ="false" label="折让金额:" prop="discountAmount"><u-input type="number" placeholder="请输入实际收款金额(最多2位小数)" :border="true" :height="60" v-model="form.discountAmount"/></u-form-item>
|
|
|
</u-form>
|
|
|
</view>
|
|
|
- <view class="costText">折让后金额</view>
|
|
|
+ <view class="costText">实收金额</view>
|
|
|
<view class="costText1">¥{{settlement<0?0:settlement}}</view>
|
|
|
<view class="paymentFooter flex algin-center">
|
|
|
<view @click="closePopup">取消</view>
|
|
@@ -100,7 +123,7 @@
|
|
|
|
|
|
<script>
|
|
|
import billList from './billListComponent.vue';
|
|
|
-import { findBySn, insert,settleVerify,settle } from '@/api/verify.js';
|
|
|
+import { findBySn, insert,settleVerify,settle,flushBill,deleteDetails } from '@/api/verify.js';
|
|
|
import getDate from '@/libs/getDate.js';
|
|
|
import { toThousands } from '@/libs/tools.js'
|
|
|
import { getLookUpDatas } from '@/api/data';
|
|
@@ -113,6 +136,10 @@ export default {
|
|
|
backgroundColor: this.$config('primaryColor'),
|
|
|
color: '#fff'
|
|
|
},
|
|
|
+ customDelStyle: {
|
|
|
+ width:'200rpx',
|
|
|
+ color: '#fff'
|
|
|
+ },
|
|
|
verifySn: '',
|
|
|
billInfo: null,
|
|
|
billArr: [],
|
|
@@ -153,7 +180,11 @@ export default {
|
|
|
modalContent:'',
|
|
|
enableFundAccount:false,
|
|
|
accountList:[],//结算账户列表
|
|
|
- settleAccount:false
|
|
|
+ settleAccount:false,
|
|
|
+ orderList:[],
|
|
|
+ modalShow:false,
|
|
|
+ modalCon:'刷新后,将删除对账单中已收款的订单,更新待收款单据。确定刷新吗?',
|
|
|
+ eventsType:'' //打开弹窗类型 del删除 update更新
|
|
|
};
|
|
|
},
|
|
|
onReady() {
|
|
@@ -168,6 +199,27 @@ export default {
|
|
|
this.loadData({ verifySn: options.billId });
|
|
|
}
|
|
|
},
|
|
|
+ //编辑事件
|
|
|
+ onNavigationBarButtonTap(e){
|
|
|
+ this.isShowEdit = !this.isShowEdit
|
|
|
+ var pages = getCurrentPages();
|
|
|
+ var page = pages[pages.length - 1];
|
|
|
+ var currentWebview = page.$getAppWebview();
|
|
|
+ var tn = currentWebview.getStyle().titleNView;
|
|
|
+
|
|
|
+ let _this = this
|
|
|
+ if(_this.isShowEdit){
|
|
|
+ tn.buttons[0].text = '\ue601 取消';
|
|
|
+ }else{
|
|
|
+ tn.buttons[0].text = '\ue601 编辑';
|
|
|
+ }
|
|
|
+ _this.$nextTick(()=>{
|
|
|
+ currentWebview.setStyle({
|
|
|
+ titleNView: tn
|
|
|
+ });
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
computed: {
|
|
|
//经销商信息
|
|
|
userData() {
|
|
@@ -181,6 +233,18 @@ export default {
|
|
|
let endPay=Number(totalPrice)>=Number(discountPrice) ? ret : 0
|
|
|
this.form.receiptAmount = endPay
|
|
|
return endPay
|
|
|
+ },
|
|
|
+ dueAmount(){
|
|
|
+ let totalAmount = this.billInfo.totalAmount?this.billInfo.totalAmount:0
|
|
|
+ let settleRealAmount = this.billInfo.settleRealAmount?this.billInfo.settleRealAmount:0
|
|
|
+ let duePrice = totalAmount - settleRealAmount // 待收金额
|
|
|
+ duePrice=Number(duePrice)>0 ? duePrice : 0
|
|
|
+ const resPrice = duePrice.toFixed(2)
|
|
|
+ return resPrice
|
|
|
+ },
|
|
|
+ //经销商信息
|
|
|
+ userData() {
|
|
|
+ return this.$store.state.vuex_userData;
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -202,7 +266,7 @@ export default {
|
|
|
closePopup(){
|
|
|
this.form={
|
|
|
receiptAmount:0,
|
|
|
- discountAmount:undefined,
|
|
|
+ discountAmount:this.billInfo.discountAmount,
|
|
|
settleType:'',
|
|
|
settleTypeName:'',
|
|
|
settleAccountSn:'',
|
|
@@ -223,20 +287,16 @@ export default {
|
|
|
})
|
|
|
}else{
|
|
|
// 判断是否显示结算类型
|
|
|
- queryFunctionState().then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- _this.enableFundAccount = res.data.functionEnableFlag == 1
|
|
|
- }
|
|
|
- })
|
|
|
- // if(this.$hasPermissions('M_fundAccountList')&&this.$hasPermissions('B_fundAccountEnable')){
|
|
|
- // queryFunctionState().then(res => {
|
|
|
- // if (res.status == 200) {
|
|
|
- // _this.enableFundAccount = res.data.functionEnableFlag == 1
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
+ if(this.$hasPermissions('M_fundAccountList')&&this.$hasPermissions('B_fundAccountEnable')){
|
|
|
+ queryFunctionState().then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.enableFundAccount = res.data.functionEnableFlag == 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
_this.getPayType();
|
|
|
_this.showPayment = true
|
|
|
+ _this.form.discountAmount=_this.billInfo.discountAmount
|
|
|
_this.$nextTick(()=>{
|
|
|
_this.$refs.uForm.setRules(_this.rules);
|
|
|
})
|
|
@@ -370,6 +430,72 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ },
|
|
|
+ //一键刷新
|
|
|
+ handleUpdate(){
|
|
|
+ this.checkedAll = false
|
|
|
+ this.$refs.billBox.allSelect(false);
|
|
|
+ flushBill({verifySn:this.verifySn}).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.loadData({ verifySn: this.verifySn })
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //删除
|
|
|
+ deleteOrder(){
|
|
|
+ let that=this
|
|
|
+ deleteDetails({verifySn:that.verifySn,detailSnList:that.orderList}).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ uni.showToast({
|
|
|
+ title:res.message,
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ that.loadData({ verifySn: that.verifySn });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleEvents(type){
|
|
|
+ this.eventsType=type
|
|
|
+ if(type == 'del'){
|
|
|
+ let allList=this.$refs.billBox.getAllData();
|
|
|
+ let newChooseList = []
|
|
|
+ let num = 0
|
|
|
+ allList.forEach(item=>{
|
|
|
+ if(item.checked){
|
|
|
+ newChooseList.push(item.detailSn)
|
|
|
+ num+=item.unsettleAmount
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(newChooseList.length == 0){
|
|
|
+ uni.showToast({
|
|
|
+ title:'请先选择要删除的销售单',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.orderList=newChooseList
|
|
|
+ let newNum=toThousands(num,2)
|
|
|
+
|
|
|
+ this.modalCon = '选中'+newChooseList.length+'项,待收金额¥'+newNum+',确认删除吗?'
|
|
|
+ }
|
|
|
+ let that=this
|
|
|
+ that.$nextTick(()=>{
|
|
|
+ that.modalShow = true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //确定提交删除、刷新
|
|
|
+ handleConfirm(){
|
|
|
+ if(this.eventsType=='del'){
|
|
|
+ this.deleteOrder();
|
|
|
+ }else{
|
|
|
+ this.handleUpdate();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ chooseBillList(flag){
|
|
|
+ this.checkedAll = flag
|
|
|
+ },
|
|
|
+ chooseAll(){
|
|
|
+ this.$refs.billBox.allSelect(!this.checkedAll);
|
|
|
}
|
|
|
}
|
|
|
};
|