From fbbbc66329808249c7a0689f2efca6c79a6bf892 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期四, 28 八月 2025 08:37:11 +0800
Subject: [PATCH] #

---
 pages/basics/pakStore.vue |  101 ++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 89 insertions(+), 12 deletions(-)

diff --git a/pages/basics/pakStore.vue b/pages/basics/pakStore.vue
index 0a1e5aa..02f14c4 100644
--- a/pages/basics/pakStore.vue
+++ b/pages/basics/pakStore.vue
@@ -7,12 +7,10 @@
 			</view>
 			<view class="square-content">
 				<view class="content-input-btn">
-					<input v-model="matnr" type="text" placeholder="鎵爜 / 杈撳叆" @input="findMat()"
-					:focus="focus" placeholder-style="line-height:  85rpx;">
-					<uni-icons type="closeempty" size="20" color="#dadada" @click="remove('matnr')"></uni-icons>
+					<input v-model="barcode" placeholder="璇疯緭鍏ユ潯鐮�"  placeholder-style="line-height:  85rpx;">
 				</view>
 				<view class="content-btn">
-					<button class="cu-btn bg-blue pda-btn" @click="selectMat()">+鎻愬彇</button>
+					<button class="cu-btn bg-blue pda-btn" @click="fetchProductList()">+鎻愬彇</button>
 				</view>
 			</view>
 		</view>
@@ -49,9 +47,37 @@
 			
 		</view>
 		
-		<view class="square-none" v-show="matList.length === 0">
+		<view class="square-none" v-show="productList.length === 0">
 			<view class="v-show">鏆傛棤鏇村鏁版嵁...</view>
 		</view>
+			<checkbox-group @change="checkbox">
+				<view v-for="(item,index) in productList" :key="index" class="data-list bg-false"
+					:class="'bg-'+item.checked">
+					<view class="data-list-left">
+						<!-- <view>
+							<checkbox :value="item.id+''" :checked="item.checked" style="display: block;" />
+						</view> -->
+						<view class="matnr"><text style="width: 400rpx;">缂栫爜锛歿{item.matnr}}</text></view>
+						<view><text style="width: 400rpx;">鍝佸悕锛歿{item.maktx}}</text></view>
+						<view><text style="width: 400rpx;">宸ヤ綔鍙凤細{{item.workNo}}</text></view>
+<!-- 						<view><text style="width: 400rpx;">寮�濮嬫椂闂达細{{item.startTime}}</text></view>
+						<view><text style="width: 400rpx;">缁撴潫鏃堕棿锛歿{item.endTime}}</text></view> -->
+						<view>
+							<text style="width: 400rpx;">鏁伴噺锛歿{item.anfme}}</text>
+<!-- 							<text style="margin-left: 100rpx;">鍗曚綅锛歿{item.unit}}</text> -->
+						</view>
+					</view>
+					<view class="data-list-right">
+						<label>
+							<uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons>
+						</label>
+						<label>
+							<uni-icons type="trash" size="25" color="#a5a5a5" @click="remove(item,index)"></uni-icons>
+						</label>
+					</view>
+				</view>
+			</checkbox-group>
+		</scroll-view>
 		
 		<view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" >
 			<view class="data-list-left">
@@ -76,7 +102,7 @@
         		<button class="cu-btn" @click="resst()">閲嶇疆</button>
         	</label>
         	<label class="label-btn">
-        		<button class="cu-btn bg-blue " @click="comb()">鍚姩鍏ュ簱</button>
+        		<button class="cu-btn bg-blue " @click="startPutIn()">鍚姩鍏ュ簱</button>
         	</label>
         </view>
         <!-- 寮圭獥 -->
@@ -112,7 +138,10 @@
                 matList: [],
                 sites: [],
                 siteId: '',
-				count:0
+				count:0,
+				barcode: '',       // 鎵弿鎴栬緭鍏ユ潯鐮�
+				productList: [],   // 鎻愬彇鍒扮殑鍟嗗搧鍒楄〃
+				workNo: '',        // 宸ュ彿锛堢敤浜庤皟鐢ㄥ叆搴撴帴鍙o級
             }
         },
         mounted(){
@@ -219,6 +248,31 @@
 					},
 				});
 			},
+			fetchProductList() {
+			  if (!this.barcode) {
+				uni.showToast({ title: '璇疯緭鍏ユ潯鐮�', icon: 'none' });
+				return;
+			  }
+
+			  uni.request({
+				url: this.commonUrl + "/mobile/pickIn/auth?barcode=" + this.barcode,
+				method: 'GET',
+				success: (res) => {
+				console.log(res.data.data);
+				  if (res.data.data && res.data.data.length > 0) {
+					this.productList = res.data.data;
+					this.siteId = res.data.data[0].staNo;
+					this.workNo = res.data.data[0].workNo;
+				  } else {
+					uni.showToast({ title: '鏈壘鍒板晢鍝�', icon: 'none' });
+				  }
+				},
+				fail: () => {
+				  uni.showToast({ title: '鎻愬彇澶辫触', icon: 'none' });
+				}
+			  });
+			},
+
 			// 鑾峰彇鍙敤鍏ュ簱绔欑偣
             getInBound() {
                 let that = this;
@@ -245,6 +299,25 @@
                     }
                 })
             },
+			// 鍚姩鍏ュ簱
+			startPutIn() {
+			  if (!this.siteId || !this.workNo) {
+			    uni.showToast({ title: '淇℃伅涓嶅畬鏁�', icon: 'none' });
+			    return;
+			  }
+			
+			  uni.request({
+			    url:this.baseHttp + this.baseIP + ':' +"9090" + "/" +"tzglwcs" + "/console/site/pickIn?siteId=" + this.siteId + "&workNo=" + this.workNo,
+			    method: 'POST',
+			    success: (res) => {
+			      uni.showToast({ title: '鍏ュ簱鎴愬姛', icon: 'success' });
+				  this.resst();
+			    },
+			    fail: () => {
+			      uni.showToast({ title: '鍏ュ簱澶辫触', icon: 'none' });
+			    }
+			  });
+			},
             // 鍚姩鍏ュ簱
 			comb() {
                 let that = this
@@ -278,11 +351,15 @@
                     }
                 })
             },
-            resst() {
-                this.matnr = '';
-                this.siteId = '';
-				this.matList = [];
-            },
+			resst() {
+			  this.matnr = '';
+			  this.siteId = '';
+			  this.workNo = '';
+			  this.barcode = '';
+			  this.productList = [];
+			  this.matList = [];
+			},
+
 			// 淇敼鏁伴噺
 			revise(item,index) {
 				this.count = this.matList[index].anfme

--
Gitblit v1.9.1