Kaynağa Gözat

修改分页查询数据

chenrui 2 yıl önce
ebeveyn
işleme
aaeac666af

+ 17 - 3
pages/vinAnalyse/fitProductlist.vue

@@ -27,7 +27,7 @@
 					<view class="bot u-flex u-row-between">
 						<view>
 							适配有货
-							<text>{{ item.isStockCount || 0 }}</text>
+							<text>{{ item.inStockCount || 0 }}</text>
 						</view>
 						<view>
@@ -204,7 +204,6 @@ export default {
 				ajaxData.orderBy = 'xvfp.not_stock_count desc,xp.code asc';
 			}
 			this.sortShow = false;
-			console.log('11111:',ajaxData);
 			this.loadData(ajaxData);
 		}
 	},
@@ -212,11 +211,26 @@ export default {
 	onReachBottom() {
 		if (this.list.length < this.totalNum) {
 			this.pageNo += 1;
-			let ajaxData = {
+			var ajaxData = {
 				shelfSn: this.shelfSn,
 				pageNo: this.pageNo,
 				pageSize: this.pageSize
 			};
+			if (this.keyword) {
+				var reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
+				if (reg.test(this.keyword)) {
+					ajaxData.productName=this.keyword.trim();
+				}else{
+					ajaxData.productCode=this.keyword.trim();
+				}
+			}
+			if (this.isSortFlag == 0) {
+				ajaxData.orderBy = 'xvfp.scan_vin_date desc,xp.code asc';
+			} else if (this.isSortFlag == 1) {
+				ajaxData.orderBy = 'xvfp.in_stock_count desc,xp.code asc';
+			} else {
+				ajaxData.orderBy = 'xvfp.not_stock_count desc,xp.code asc';
+			}
 			this.loadData(ajaxData);
 		} else {
 			this.status = 'nomore';

+ 4 - 4
pages/vinAnalyse/shelfAnalyse.vue

@@ -101,7 +101,7 @@
 												{{item.productCode}}
 											</view>
 											<!-- 判断是否铺货 -->
-											<view class="flex justify_end" v-if="item.isShelfProduct">
+											<view class="flex justify_end" v-if="item.isShelfProduct != '否'">
 												<text class="item-detail-text">
 													库存:{{item.currQty?item.currQty:0}}
 												</text>
@@ -498,11 +498,11 @@
 								color: #999;
 								margin-left: 20upx;
 							}
-							.isShelf{
-								color:coral;
-							}
 						}
 					}
+					.isShelf{
+						color:#ff5500;
+					}
 				}
 				.loadmoreStyle{
 					margin-top:20rpx;