|
@@ -1,102 +1,130 @@
|
|
|
<template>
|
|
|
<view class="content flex flex_column">
|
|
|
- <view class="p-header" @click="jumpPage('/pages/sales/chooseShelf?customerSn='+(targetSn?targetSn:''))">
|
|
|
- <text>{{ curCustomerName || '全部客户' }}</text>
|
|
|
- <u-icon name="arrow-right"></u-icon>
|
|
|
+ <view>
|
|
|
+ <view class="p-header" @click="jumpPage('/pages/sales/chooseShelf?customerSn=' + (targetSn ? targetSn : ''))">
|
|
|
+ <text>{{ curCustomerName || '全部客户' }}</text>
|
|
|
+ <u-icon name="arrow-right"></u-icon>
|
|
|
+ </view>
|
|
|
+ <u-tabs :list="tabsList" :is-scroll="false" :current="current" @change="change"></u-tabs>
|
|
|
</view>
|
|
|
- <view class="p-content" v-if="billList && billList.length>0">
|
|
|
- <view class="list" @click="jumpPage('/pages/sales/billHistoryDetail?billId='+item.verifySn)" v-for="(item,i) in billList" :key="i">
|
|
|
- <view class="list_t u-flex u-row-between">
|
|
|
- <view class="u-line-1">{{item.customer.customerName}}</view>
|
|
|
- <view>¥{{toThousands(item.settleAmount||0,2)}}</view>
|
|
|
- </view>
|
|
|
- <view class="list_b u-flex u-row-between" >
|
|
|
- <view>{{item.createDate}}</view>
|
|
|
- <view class="u-flex" v-if="item.billStatus != 'UNSETTLE'">
|
|
|
- <view>已付款</view>
|
|
|
- <u-icon name="yifukuan" custom-prefix="iscm-icon" size="40" :color="wordColor"></u-icon>
|
|
|
+ <view class="p-content">
|
|
|
+ <view v-if="billList && billList.length > 0">
|
|
|
+ <view class="list" @click="jumpPage('/pages/sales/billHistoryDetail?billId=' + item.verifySn)" v-for="(item, i) in billList" :key="i">
|
|
|
+ <view class="list_t u-flex u-row-between">
|
|
|
+ <view class="u-line-1">{{ item.customer.customerName }}</view>
|
|
|
+ <view>¥{{ toThousands(item.settleAmount || 0, 2) }}</view>
|
|
|
+ </view>
|
|
|
+ <view class="list_b u-flex u-row-between">
|
|
|
+ <view>{{ item.createDate }}</view>
|
|
|
+ <view class="u-flex" v-if="item.billStatus != 'UNSETTLE'">
|
|
|
+ <view>已付款</view>
|
|
|
+ <u-icon name="yifukuan" custom-prefix="iscm-icon" size="40" :color="wordColor"></u-icon>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view v-if="billList&&billList.length==0">
|
|
|
- <u-empty v-if="status!='loading'" :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="180" :text="noDataText" mode="list" :margin-top="50"></u-empty>
|
|
|
- </view>
|
|
|
- <view style="padding: 20upx;" v-else>
|
|
|
- <u-loadmore :status="status" v-if="status=='loading'"/>
|
|
|
+ <view v-if="billList && billList.length == 0">
|
|
|
+ <u-empty
|
|
|
+ v-if="status != 'loading'"
|
|
|
+ :src="`/static/${$config('themePath')}/def_no_data@3x.png`"
|
|
|
+ icon-size="180"
|
|
|
+ :text="noDataText"
|
|
|
+ mode="list"
|
|
|
+ :margin-top="50"
|
|
|
+ ></u-empty>
|
|
|
+ </view>
|
|
|
+ <view style="padding: 20upx;" v-else><u-loadmore :status="status" v-if="status == 'loading'" /></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { queryPage } from '@/api/verify.js';
|
|
|
- import { toThousands } from '@/libs/tools.js'
|
|
|
- export default {
|
|
|
- data(){
|
|
|
- return {
|
|
|
- toThousands,
|
|
|
- wordColor:this.$config('infoColor'),
|
|
|
- curCustomerName:'',
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 10,
|
|
|
- totalNum: 0,
|
|
|
- status: 'loadmore',
|
|
|
- noDataText: '暂无数据',
|
|
|
- billList:[],
|
|
|
- targetSn:undefined
|
|
|
- }
|
|
|
- },
|
|
|
- onLoad() {
|
|
|
- uni.$on('chooseShelfOk',(data)=>{
|
|
|
- this.pageNo=1;
|
|
|
- this.targetSn = data.customerSn ?data.customerSn :undefined
|
|
|
- this.curCustomerName=data.customerName
|
|
|
- this.getList();
|
|
|
- })
|
|
|
+import { queryPage } from '@/api/verify.js';
|
|
|
+import { toThousands } from '@/libs/tools.js';
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ toThousands,
|
|
|
+ wordColor: this.$config('infoColor'),
|
|
|
+ curCustomerName: '',
|
|
|
+ pageNo: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ totalNum: 0,
|
|
|
+ status: 'loadmore',
|
|
|
+ noDataText: '暂无数据',
|
|
|
+ billList: [],
|
|
|
+ targetSn: undefined,
|
|
|
+ tabsList: [
|
|
|
+ {
|
|
|
+ id: 1,
|
|
|
+ name: '全部'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 2,
|
|
|
+ name: '未付款'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 3,
|
|
|
+ name: '已结清'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ current: 0
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ uni.$on('chooseShelfOk', data => {
|
|
|
+ this.pageNo = 1;
|
|
|
+ this.targetSn = data.customerSn ? data.customerSn : undefined;
|
|
|
+ this.curCustomerName = data.customerName;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onReady() {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getList();
|
|
|
+ }, 500);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ change(index) {
|
|
|
+ this.current = index;
|
|
|
},
|
|
|
- onReady() {
|
|
|
- setTimeout(()=>{
|
|
|
- this.getList();
|
|
|
- },500)
|
|
|
+ jumpPage(url) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url
|
|
|
+ });
|
|
|
},
|
|
|
- methods:{
|
|
|
- jumpPage(url){
|
|
|
- uni.navigateTo({
|
|
|
- url
|
|
|
- })
|
|
|
- },
|
|
|
- getList(){
|
|
|
- let params = {targetSn:this.targetSn, pageNo: this.pageNo, pageSize: this.pageSize };
|
|
|
- this.status = 'loading';
|
|
|
- queryPage(params).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- if (this.pageNo > 1) {
|
|
|
- this.billList = this.billList.concat(res.data.list || []);
|
|
|
- } else {
|
|
|
- this.billList = res.data.list || [];
|
|
|
- }
|
|
|
- this.totalNum = res.data.count || 0;
|
|
|
+ getList() {
|
|
|
+ let params = { targetSn: this.targetSn, pageNo: this.pageNo, pageSize: this.pageSize };
|
|
|
+ this.status = 'loading';
|
|
|
+ queryPage(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ if (this.pageNo > 1) {
|
|
|
+ this.billList = this.billList.concat(res.data.list || []);
|
|
|
} else {
|
|
|
- this.billList = [];
|
|
|
- this.totalNum = 0;
|
|
|
- this.noDataText = res.message;
|
|
|
+ this.billList = res.data.list || [];
|
|
|
}
|
|
|
- this.status = 'loadmore';
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- onReachBottom() {
|
|
|
- if (this.billList.length < this.totalNum) {
|
|
|
- this.pageNo += 1;
|
|
|
- this.getList();
|
|
|
- }else{
|
|
|
- this.status = 'nomore'
|
|
|
- }
|
|
|
- },
|
|
|
- onUnload(){
|
|
|
- uni.$off('chooseShelfOk')
|
|
|
+ this.totalNum = res.data.count || 0;
|
|
|
+ } else {
|
|
|
+ this.billList = [];
|
|
|
+ this.totalNum = 0;
|
|
|
+ this.noDataText = res.message;
|
|
|
+ }
|
|
|
+ this.status = 'loadmore';
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ if (this.billList.length < this.totalNum) {
|
|
|
+ this.pageNo += 1;
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.status = 'nomore';
|
|
|
}
|
|
|
+ },
|
|
|
+ onUnload() {
|
|
|
+ uni.$off('chooseShelfOk');
|
|
|
}
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -108,29 +136,30 @@
|
|
|
text-align: center;
|
|
|
padding-bottom: 20rpx;
|
|
|
}
|
|
|
- .p-content{
|
|
|
+ .p-content {
|
|
|
flex-grow: 1;
|
|
|
- padding:20rpx;
|
|
|
- .list{
|
|
|
+ padding:20rpx 20rpx 0;
|
|
|
+ overflow-y: scroll;
|
|
|
+ .list {
|
|
|
width: 100%;
|
|
|
background: #ffffff;
|
|
|
- padding:30rpx 20rpx;
|
|
|
+ padding: 30rpx 20rpx;
|
|
|
border-radius: 20rpx;
|
|
|
box-sizing: border-box;
|
|
|
margin-bottom: 20rpx;
|
|
|
- .list_t{
|
|
|
+ .list_t {
|
|
|
margin-bottom: 20rpx;
|
|
|
- view{
|
|
|
- &:first-child{
|
|
|
+ view {
|
|
|
+ &:first-child {
|
|
|
width: calc(100% - 200rpx);
|
|
|
}
|
|
|
- &:last-child{
|
|
|
- color:$uni-color-warning;
|
|
|
+ &:last-child {
|
|
|
+ color: $uni-color-warning;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .list_b{
|
|
|
- color:$uni-text-color-grey;
|
|
|
+ .list_b {
|
|
|
+ color: $uni-text-color-grey;
|
|
|
font-size: $uni-font-size-sm;
|
|
|
font-weight: 500;
|
|
|
}
|