|
@@ -7,7 +7,7 @@
|
|
|
<text>客户名称</text>
|
|
|
</view>
|
|
|
<view class="list_r u-flex">
|
|
|
- <u-input v-model="customerObj.customerName" @click="jumpPage('/pages/sales/chooseCustomerBill')" disabled placeholder="请选择客户名称" />
|
|
|
+ <u-input v-model="customerObj.customerName" @click="goChooseCustomer" disabled placeholder="请选择客户名称" />
|
|
|
<u-icon name="arrow-right" color="#999" size="30"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -33,7 +33,7 @@
|
|
|
<text>¥{{totalPayPrice}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="chooseCon"><billList ref="bill" :showCheck="true" :list="bill"></billList></view>
|
|
|
+ <view class="chooseCon"><billList ref="bill" :showCheck="true" :list="bill" @allChecked="allCheckedCallback"></billList></view>
|
|
|
<view class="footer u-flex">
|
|
|
<view class="f-left">
|
|
|
<u-checkbox @change="allCheckeChange" v-model="allChecked" shape="circle">{{ allChecked ? '取消全选' : '全选' }}</u-checkbox>
|
|
@@ -43,11 +43,11 @@
|
|
|
待收:
|
|
|
<text>¥{{chooseTotalPayPrice}}</text>
|
|
|
</view>
|
|
|
- <view>
|
|
|
+ <view v-if="chooseList.length>0">
|
|
|
折后:
|
|
|
<text>¥{{settlement}}</text>
|
|
|
</view>
|
|
|
- <view class="u-flex">
|
|
|
+ <view class="u-flex" v-if="chooseList.length>0">
|
|
|
<view>
|
|
|
折让:
|
|
|
<text>¥{{discountVal || 0}}</text>
|
|
@@ -85,13 +85,13 @@
|
|
|
<view class="costPopupCon">
|
|
|
<view class="costList">
|
|
|
<text class="label">待收金额:</text>
|
|
|
- <text>¥{{totalPayPrice}}</text>
|
|
|
+ <text>¥{{chooseTotalPayPrice}}</text>
|
|
|
</view>
|
|
|
<view class="costList u-flex">
|
|
|
<view class="label">折让金额:</view>
|
|
|
<u-input v-model="discountVal" @input="onKeyInput" :border="true" :height="50"/>
|
|
|
</view>
|
|
|
- <view class="tip" v-if="discountVal>totalPayPrice">折让金额不能大于待收金额,请重新输入</view>
|
|
|
+ <view class="tip" v-if="discountVal>chooseTotalPayPrice">折让金额不能大于待收金额,请重新输入</view>
|
|
|
<view class="costText">折让后金额</view>
|
|
|
<view class="costText">¥{{settlement}}</view>
|
|
|
</view>
|
|
@@ -175,12 +175,13 @@ export default {
|
|
|
cycleName: '',
|
|
|
|
|
|
params: {
|
|
|
- targetSn: '437705264826884096',
|
|
|
+ targetSn: undefined,
|
|
|
bizBeginDate: undefined,
|
|
|
bizEndDate: undefined
|
|
|
},
|
|
|
bill: [],
|
|
|
- dateArray:''
|
|
|
+ dateArray:'',
|
|
|
+ chooseList:[]
|
|
|
};
|
|
|
},
|
|
|
onReady() {
|
|
@@ -191,16 +192,20 @@ export default {
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
//获取对账周期默认值
|
|
|
- let systemList = this.$store.state.vuex_systemSetList;
|
|
|
- let cycleObj = systemList.find(item => {
|
|
|
- return item.remarks == 'sales_bill_period';
|
|
|
- });
|
|
|
- this.curTab = this.placeTab.findIndex(con => con.name == cycleObj.valueShow);
|
|
|
+ if(uni.getStorageSync('curTab')){
|
|
|
+ this.curTab = uni.getStorageSync('curTab');
|
|
|
+ }else{
|
|
|
+ let systemList = this.$store.state.vuex_systemSetList;
|
|
|
+ let cycleObj = systemList.find(item => {
|
|
|
+ return item.remarks == 'sales_bill_period';
|
|
|
+ });
|
|
|
+ this.curTab = this.placeTab.findIndex(con => con.name == cycleObj.valueShow);
|
|
|
+ }
|
|
|
this.cycleName = this.changeShowTime();
|
|
|
// 获取选择客户
|
|
|
if (options && options.data) {
|
|
|
this.customerObj = JSON.parse(options.data);
|
|
|
- // this.params.targetSn = this.customerObj.customerSn;
|
|
|
+ this.params.targetSn = this.customerObj.customerSn;
|
|
|
}
|
|
|
this.changeTime();
|
|
|
},
|
|
@@ -212,7 +217,8 @@ export default {
|
|
|
onBackPress() {
|
|
|
if (this.showSearch) {
|
|
|
this.showSearch = false;
|
|
|
- return true;
|
|
|
+ }else{
|
|
|
+ uni.removeStorageSync('curTab')
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -222,13 +228,26 @@ export default {
|
|
|
this.bill[i].unsettleAmount = this.bill[i].unsettleAmount ? this.bill[i].unsettleAmount :0
|
|
|
totalPrice += this.bill[i].unsettleAmount;
|
|
|
}
|
|
|
- return totalPrice || 0;
|
|
|
+ return totalPrice;
|
|
|
+ },
|
|
|
+ chooseTotalPayPrice(){
|
|
|
+ let price=0;
|
|
|
+ this.chooseList.forEach(item=>{
|
|
|
+ item.unsettleAmount =item.unsettleAmount? item.unsettleAmount:0;
|
|
|
+ price += item.unsettleAmount;
|
|
|
+ })
|
|
|
+ return price;
|
|
|
},
|
|
|
- // settlement(){
|
|
|
- // return this.totalPayPrice - this.discountVal || 0;
|
|
|
- // }
|
|
|
+ settlement(){
|
|
|
+ return this.chooseTotalPayPrice - this.discountVal || 0;
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ //选择客户
|
|
|
+ goChooseCustomer(){
|
|
|
+ uni.setStorageSync('curTab',this.curTab);
|
|
|
+ this.jumpPage('/pages/sales/chooseCustomerBill');
|
|
|
+ },
|
|
|
changeTime() {
|
|
|
if (this.curTab != 6 && this.curTab != 7) {
|
|
|
this.params.bizBeginDate = this.getQueryDate().beginDate;
|
|
@@ -287,11 +306,60 @@ export default {
|
|
|
this.costShow = false
|
|
|
},
|
|
|
submitOrder(){//发送对账单
|
|
|
-
|
|
|
+ if(this.chooseList.length==0){
|
|
|
+ uni.showToast({
|
|
|
+ title:'请选择要发送的对账单',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let obj={
|
|
|
+ detailNum:this.chooseList.length,
|
|
|
+ totalAmount:this.chooseTotalPayPrice,
|
|
|
+ discountAmount:this.discountVal,
|
|
|
+ settleAmount:this.settlement,
|
|
|
+ detailList:this.chooseList
|
|
|
+ }
|
|
|
+ let ajaxData=Object.assign(this.params,obj)
|
|
|
+ insert(ajaxData).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.goShare();
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
- allCheckeChange(){
|
|
|
+ allCheckeChange(e){
|
|
|
this.$refs.bill.allSelect(e.value)
|
|
|
const list = this.$refs.bill.getAllData()
|
|
|
+ },
|
|
|
+ // 选中事件
|
|
|
+ allCheckedCallback(isAllChecked,row){
|
|
|
+ const has = this.chooseList.findIndex(k => k.bizSn == row.bizSn)
|
|
|
+ // 在已选列表中
|
|
|
+ if(has>=0){
|
|
|
+ // 取消选中
|
|
|
+ if(!row.checked){
|
|
|
+ this.chooseList.splice(has,1)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(row.checked){
|
|
|
+ this.chooseList.push(row)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 是否全选
|
|
|
+ this.allChecked = isAllChecked
|
|
|
+ },
|
|
|
+ // 分享图文
|
|
|
+ goShare(){
|
|
|
+ uni.shareWithSystem({
|
|
|
+ summary: '',
|
|
|
+ href: '',
|
|
|
+ success(){
|
|
|
+ // 分享完成,请注意此时不一定是成功分享
|
|
|
+ },
|
|
|
+ fail(){
|
|
|
+ // 分享失败
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
};
|