From 687cf225be540a32222f5761a105b05eab1c13c4 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 26 三月 2026 16:23:20 +0800
Subject: [PATCH] #成品直送

---
 pages/listing/itemSelect.vue |  229 +++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 172 insertions(+), 57 deletions(-)

diff --git a/pages/listing/itemSelect.vue b/pages/listing/itemSelect.vue
index ddecb64..5bf6d7b 100644
--- a/pages/listing/itemSelect.vue
+++ b/pages/listing/itemSelect.vue
@@ -2,12 +2,12 @@
 	<view>
 		<!-- 鎼滅储妗� -->
 		<view class="search-bar">
-			<uni-search-bar v-model="condition" placeholder=" 杈撳叆鎵规" bgColor="#EEEEEE"  />
+			<uni-search-bar v-model="condition" placeholder=" 杈撳叆鎵规/缂栫爜/鍗曞彿" bgColor="#EEEEEE"  @confirm="search()"/>
 		</view>
 		
 		 
 		<view>
-			<view class="padding-lr margin-top-sm">
+			<view class="padding-lr margin-top-sm" style="padding-bottom: 120upx;">
 				<block v-for="(item, index) in matList" :key="index">
 					<view class="cu-list det menu sm-border margin-bottom-sm " :class="[item.selected === true &&'act']" @click="selectedItem(index)">
 						<view class="cu-bar bg-white solid-bottom " >
@@ -16,7 +16,7 @@
 									{{index+1}}
 								</view>
 								<view class="text-blue">
-									缂栫爜:
+									鐗╂枡缂栫爜:
 									{{`${item.matnrCode}`}}
 								</view>
 							</view>
@@ -27,7 +27,13 @@
 						</view>
 						<view class="cu-item">
 							<view class="content">
-								<text class="text-black">ASN:</text>
+								<text class="text-black">鐗╂枡鍚嶇О:</text>
+								<text class="text-grey">{{ item.maktx }}</text>
+							</view>
+						</view>
+						<view class="cu-item">
+							<view class="content">
+								<text class="text-black">鍗曟嵁缂栧彿:</text>
 							</view>
 							<view class="action">
 								<text class="text-grey ">{{item.asnCode}}</text>
@@ -35,15 +41,15 @@
 						</view>
 						<view class="cu-item">
 							<view class="content">
-								<text class="text-black">鐗╂枡鏉$爜:</text>
+								<text class="text-black">璁″垝璺熻釜鍙�:</text>
 							</view>
 							<view class="action">
-								<text class="text-grey ">{{item.trackCode}}</text>
+								<text class="text-grey ">{{item.platWorkCode}}</text>
 							</view>
 						</view>
 						<view class="cu-item">
 							<view class="content">
-								<text class="text-black">渚涘簲鍟嗘壒娆�:</text>
+								<text class="text-black">鎵规:</text>
 							</view>
 							<view class="action">
 								<text class="text-grey ">{{item.splrBatch}}</text>
@@ -51,52 +57,43 @@
 						</view>
 						<view class="cu-item">
 							<view class="content">
-								<text class="text-black">搴撳瓨鎵规:</text>
-							</view>
-							<view class="action">
-								<text class="text-grey ">{{item.batch}}</text>
-							</view>
-						</view>
-						<!-- <view class="cu-item">
-							<view class="content">
-								<text class="text-black">骞冲彴琛屽彿: <text class="text-grey ">{{item.platformId}}</text></text>
-							</view>
-							<view class="content">
-								<text class="text-black">璐ㄦ缁撴灉: <text class="text-grey ">{{item.inspect}}</text></text>
-							</view>
-						</view> -->
-			
-						<view class="cu-item">
-							<view class="content">
-								<text class="text-black">搴撳瓨鍗曚綅: <text class="text-grey ">{{item.stockUnit}}</text></text>
+								<text class="text-black">鍗曚綅: <text class="text-grey ">{{item.stockUnit}}</text></text>
 							</view>
 							<view class="content">
 								<text class="text-black">鏀惰揣鏁伴噺: <text class="text-grey ">{{item.anfme}}</text></text>
-							</view>
-							<view class="content">
-								<text class="text-black">宸蹭笂鏋舵暟閲�: <text
-										class="text-grey ">{{item.workQty + item.qty}}</text></text>
 							</view>
 						</view>
 						<view class="cu-item">
 							<view class="content">
 								<text class="text-black">鍙粍鐩樻暟閲�: <text
-										class="text-grey ">{{item.anfme - item.workQty}}</text></text>
+										class="text-grey ">{{item.ableQty}}</text></text>
 							</view>							
 						</view>
 						
 					</view>
 				</block>
+				
+				<!-- 绌虹姸鎬� -->
+				<view class="empty-state" v-if="matList.length === 0 && !loading">
+					<uni-icons type="search" size="60" color="#CCCCCC"></uni-icons>
+					<text class="empty-text">鏆傛棤鏁版嵁</text>
+					<text class="empty-hint">涓嬫媺鍒锋柊璇曡瘯</text>
+				</view>
+				
+				<!-- 鍔犺浇鏇村 -->
+				<uni-load-more v-show="matList.length !== 0" :status="status" :icon-size="16" :content-text="contentText" />
 			</view>
 		</view>
 		<view class="cu-bar btn-group foot">			
 			<button class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="back">纭畾</button>
 		</view>
-		<!-- <uni-load-more v-show="matList.length != 0" :status="status" :icon-size="16" :content-text="contentText" /> -->
 	</view>
 </template>
 
 <script>
+	import {
+		request
+	} from '../../common/request.js'
 	export default {
 		data() {
 			return {				
@@ -110,14 +107,32 @@
 				selectedList:[],
 				repeatClick: false,
 				matnrCode:'',
-				asnCode:''
-				
+				asnCode:'',
+				// 鍒嗛〉鐩稿叧
+				curr: 1,
+				pageSize: 5,
+				loading: false,
+				status: 'more',
+				contentText: {
+					contentdown: '涓婃媺鍔犺浇鏇村',
+					contentrefresh: '鍔犺浇涓�',
+					contentnomore: '娌℃湁鏇村'
+				},
+				// 淇濆瓨鏌ヨ鍙傛暟
+				lastReq: null
 			}
 		},
-		// onReachBottom() {
-		// 	this.status = 'more';
-		// 	this.showMat(this.tagIdNow);
-		// },
+		// 涓嬫媺鍒锋柊
+		onPullDownRefresh() {
+			this.refreshData();
+		},
+		// 涓婃媺鍔犺浇鏇村
+		onReachBottom() {
+			if (this.status !== 'noMore' && !this.loading) {
+				this.status = 'loading';
+				this.loadMoreData();
+			}
+		},
 		onLoad() {
 			// 娌″暐鐢ㄤ簡
 			let that = this
@@ -126,8 +141,7 @@
 			
 			// 鐩戝惉acceptDataFromOpenerPage浜嬩欢锛岃幏鍙栦笂涓�椤甸潰閫氳繃eventChannel浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
 			eventChannel.on('data', function(data) {
-				console.log(data.item)
-				that.matList = data.item
+				that.getDet(data)
 			})
 		},
 		onShow() {
@@ -136,6 +150,35 @@
 			
 		},
 		methods: {
+			// 鍒锋柊鏁版嵁
+			refreshData() {
+				this.curr = 1;
+				this.matList = [];
+				this.status = 'more';
+				if (this.lastReq) {
+					this.getDet(this.lastReq, true);
+				}
+				uni.stopPullDownRefresh();
+			},
+			// 鍔犺浇鏇村鏁版嵁
+			loadMoreData() {
+				if (this.lastReq) {
+					this.getDet(this.lastReq, false);
+				}
+			},
+			search(){
+				let req = {
+					matnrCode: this.condition,
+					asnCode: this.condition,
+					code: this.condition,
+					batch: this.condition
+				}
+				// 鎼滅储鏃堕噸缃垎椤�
+				this.curr = 1;
+				this.matList = [];
+				this.status = 'more';
+				this.getDet(req, true);
+			},
 			back() {
 				for (var i = 0; i < this.matList.length; i++) {
 					if(this.matList[i].selected === true){
@@ -155,28 +198,79 @@
 					this.matList[index].selected = !this.matList[index].selected
 				}				
 			},
-			async getDet() {
+			async getDet(req, isRefresh = true) {
 				let that = this;
-				const {
-					code,
-					data,
-					msg
-				} = await request('/asnOrderItem/trackCode', {
-					matnrCode: that.matnrCode,
-					asnCode: that.asnCode
-				}, "post")
-				if (code === 200) {
-					for (var i = 0; i < data.length; i++) {
-						data[i].receiptQty =0;
-						data[i].selected = false;							
-					}	
-					this.list = data
-				} else {
+				// 淇濆瓨鏌ヨ鍙傛暟渚涘埛鏂板拰鍔犺浇鏇村浣跨敤
+				this.lastReq = req;
+				this.loading = true;
+				
+				if (isRefresh) {
+					uni.showLoading({
+						title:'鍔犺浇涓�...'
+					})
+				}
+				
+				try {
+					const {
+						code,
+						data,
+						msg
+					} = await request('/asnOrderItem/trackCode', {
+						matnrCode: req.matnrCode,
+						asnCode: req.asnCode,
+						code: req.code,
+						batch: req.batch,
+						curr: this.curr,
+						pageSize: this.pageSize
+					}, "post")
+					
+					if (code === 200) {
+						let records = data.records || [];
+						let currentPage = data.current || 1;
+						let totalPages = data.pages || 1;
+						
+						// 澶勭悊鏁版嵁
+						for (var i = 0; i < records.length; i++) {
+							records[i].receiptQty = 0;
+							records[i].selected = false;							
+						}
+						
+						if (records.length > 0) {
+							if (isRefresh) {
+								this.matList = records;
+							} else {
+								this.matList = this.matList.concat(records);
+							}
+							this.curr = this.curr + 1;
+							// 鍒ゆ柇鏄惁杩樻湁鏇村鏁版嵁
+							if (this.curr > totalPages) {
+								this.status = 'noMore';
+							} else {
+								this.status = 'more';
+							}
+						} else {
+							if (isRefresh) {
+								this.matList = [];
+							}
+							this.status = 'noMore';
+						}
+					} else {
+						uni.showToast({
+							title: msg,
+							icon: "none",
+							position: 'top'
+						})
+					}
+				} catch (err) {
 					uni.showToast({
-						title: msg,
+						title: '缃戠粶璇锋眰澶辫触',
 						icon: "none",
 						position: 'top'
 					})
+				} finally {
+					this.loading = false;
+					uni.hideLoading();
+					uni.stopPullDownRefresh();
 				}
 			},
 			
@@ -213,5 +307,26 @@
 		display: flex;
 		min-height: 80upx;
 		align-items: center;
-	}	
+	}
+	
+	/* 绌虹姸鎬� */
+	.empty-state {
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		justify-content: center;
+		padding: 120rpx 0;
+	}
+	
+	.empty-text {
+		font-size: 30rpx;
+		color: #909399;
+		margin-top: 30rpx;
+	}
+	
+	.empty-hint {
+		font-size: 24rpx;
+		color: #c0c4cc;
+		margin-top: 12rpx;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1