123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <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-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>
- </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>
- </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();
- })
- },
- onReady() {
- setTimeout(()=>{
- this.getList();
- },500)
- },
- 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;
- } 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>
- .content {
- height: 100vh;
- width: 100%;
- .p-header {
- background-color: #fff;
- text-align: center;
- padding-bottom: 20rpx;
- }
- .p-content{
- flex-grow: 1;
- padding:20rpx;
- .list{
- width: 100%;
- background: #ffffff;
- padding:30rpx 20rpx;
- border-radius: 20rpx;
- box-sizing: border-box;
- margin-bottom: 20rpx;
- .list_t{
- margin-bottom: 20rpx;
- view{
- &:first-child{
- width: calc(100% - 200rpx);
- }
- &:last-child{
- color:$uni-color-warning;
- }
- }
- }
- .list_b{
- color:$uni-text-color-grey;
- font-size: $uni-font-size-sm;
- font-weight: 500;
- }
- }
- }
- }
- </style>
|