lilei 2 lat temu
rodzic
commit
0d5dbf84b4
2 zmienionych plików z 16 dodań i 13 usunięć
  1. 2 2
      pages/sales/chooseCustomerBill.vue
  2. 14 11
      pages/sales/customerList.vue

+ 2 - 2
pages/sales/chooseCustomerBill.vue

@@ -160,7 +160,7 @@ export default {
 			this.params.allCustomerFlag = index;
 			if(index==1){
 				this.clearTime();
-				this.$refs.customer.getList(1);
+				this.$refs.customer.refash();
 			}else{
 				this.momentTime(0)
 				this.keyword = ''
@@ -207,7 +207,7 @@ export default {
 				_this.payTypeWord = null
 			}
 			this.$nextTick(()=>{
-				_this.$refs.customer.getList(1);
+				_this.$refs.customer.refash();
 			})
 		},
 		clearTime(){

+ 14 - 11
pages/sales/customerList.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="sales-list-component">
-		<scroll-view class="sales-list-con" :scrollTop="scrollTop" :style="{ height: scrollH + 'px' }" scroll-y @scrolltolower="onreachBottom">
+		<scroll-view class="sales-list-con" :scroll-top="scrollTop" :style="{ height: scrollH + 'px' }" scroll-y @scrolltolower="onreachBottom">
 			<view class="customer-list" v-for="(item, i) in listData" :key="i" @click="getDetail(item)">
 				<view class="u-line-1">{{ item.customer.customerName }}</view>
 				<view class="customer-b u-flex">
@@ -42,12 +42,7 @@ export default {
 			totalNum: 0,
 			status: 'loadmore',
 			noDataText: '暂无数据',
-
-			auditModal: false, // 审核弹框
 			dataInfo: null,
-			outModal: false, // 出库弹框
-			delModal: false, // 删除/取消弹框
-			delText: '确认要删除吗?',
 			scrollH: 300,
 			scrollTop:0
 		};
@@ -78,7 +73,6 @@ export default {
 			if (pageNo) {
 				this.pageNo = pageNo;
 			}
-			this.scrollTop = 0;
 			let params = Object.assign(this.params, { pageNo: this.pageNo, pageSize: this.pageSize });
 			this.status = 'loading';
 			queryCustomerPage(params).then(res => {
@@ -89,12 +83,19 @@ export default {
 						this.listData = res.data.list || [];
 					}
 					this.totalNum = res.data.count || 0;
+					if (this.listData.length == res.data.count) {
+						this.status = 'nomore'
+					} else {
+						this.status = 'loadmore'
+					}
 				} else {
-					this.listData = [];
-					this.totalNum = 0;
-					this.noDataText = res.message;
+					this.status = 'loadmore'
+					this.listData = []
+					this.totalNum = 0
+					this.noDataText = res.message ? res.message : '网络似乎出错了,请稍后再试'
 				}
-				this.status = 'loadmore';
+				this.noDataText = '暂无客户'
+				this.scrollTop = 0;
 			});
 		},
 		// scroll-view到底部加载更多
@@ -102,6 +103,8 @@ export default {
 			if (this.listData.length < this.totalNum) {
 				this.pageNo += 1;
 				this.getList();
+			}else{
+				this.status = "nomore"
 			}
 		},
 		getDetail(data) {