From 79c97902cc5bae4f8202bebf7c1d4f25b6e59da8 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期二, 08 四月 2025 11:18:16 +0800
Subject: [PATCH] #更新pda

---
 pages/basics/stockCheck.vue |  111 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 100 insertions(+), 11 deletions(-)

diff --git a/pages/basics/stockCheck.vue b/pages/basics/stockCheck.vue
index 99c649c..353bc78 100644
--- a/pages/basics/stockCheck.vue
+++ b/pages/basics/stockCheck.vue
@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<scroll-view scroll-y>
-			<view class="pak-seach-box">
+<!-- 			<view class="pak-seach-box">
 				<view class="box-top">
 					<view class="color-block-blue"></view>
 					<text class="title">閫夋嫨绔欏彴</text>
@@ -12,12 +12,25 @@
 						<uni-combox @input="getCheckDetl" emptyTips="鏆傛棤鏁版嵁" :candidates="staNoList" v-model="staNo" placeholder="璇烽�夋嫨"></uni-combox>
 					</view>
 				</view>
+			</view> -->
+			
+			<view class="square-2">
+				<view class="square-title">
+					<view class="title-sign"><view class="sign"></view></view>
+					<view class="title-text"><text>鎵樼洏鏉$爜</text></view>
+				</view>
+				<view class="square-content">
+					<view class="content-input">
+						<input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" maxlength="8"placeholder-style="line-height:  85rpx;">
+						<uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode" ></uni-icons>
+					</view>
+				</view>
 			</view>
 			<view class="pak-data-box">
 				<view class="box-top">
 					<view class="color-block-blue"></view>
 					<text class="title">鍟嗗搧鍒楄〃</text>
-					<button class="cu-btn bg-blue" @click="selectMat()">+ 娣诲姞</button>
+					<!-- <button class="cu-btn bg-blue" @click="selectMat()">+ 娣诲姞</button> -->
 				</view>
 			</view>
 			<view class="pak-data-box"  v-show="matList.length === 0">
@@ -44,7 +57,7 @@
 					<button class="cu-btn lg" @click="resst()">閲嶇疆</button>
 				</view>
 				<view>
-					<button class="cu-btn lg pakin-btn bg-blue" @click="adjust()">纭</button>
+					<button class="cu-btn lg pakin-btn bg-blue" @click="confirm()">纭</button>
 				</view>
 			</view>
 		</scroll-view>
@@ -79,8 +92,10 @@
 	export default {
 		data() {
 			return {
-				matList:[{matnr:'LSH90152025',maktx:'灏奸緳澶�',batch:'',anfme:'10'}],
+				commonUrl:null,
+				matList:[],
 				staNoList:[],
+				barcode: '',
 				staNo:'',
 				matnr:'',
 				enableQty:'',
@@ -95,13 +110,20 @@
 			this.baseIP = UIP;
 			const UPORT = uni.getStorageSync('UPORT');
 			this.basePORT = UPORT
+			const PROJ = uni.getStorageSync('UPROJ');
+			this.baseUrl = PROJ
+			this.getUrl()
 			this.getOutBound();
 		},
 		methods: {
+			// 鑾峰彇url
+			getUrl() {
+				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
+			},
 			getOutBound() {         // 鑾峰彇鍑哄簱鍙�
 				let that = this
 				uni.request({
-					url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/available/take/check/site',
+					url: that.commonUrl + '/available/take/check/site',
 					method: 'POST',
 					header: {
 						'token':uni.getStorageSync('token')
@@ -126,7 +148,7 @@
 			getCheckDetl() {   // 鑾峰彇鍑哄簱鍙h揣鐗╀俊鎭�
 				let that = this
 				uni.request({
-					url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/checkDetl/auth',
+					url: that.commonUrl + '/mobile/checkDetl/auth',
 					method: 'POST',
 					data: {
 						staNo:that.staNo
@@ -174,9 +196,9 @@
 			findMat() {
 				let that = this
 				uni.request({
-				    url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mat/auth',
+				    url: that.commonUrl + '/plate/out/startFree',
 				    data: {
-						matnr:that.matnr
+						barcode:that.barcode
 				    },
 				    header: {
 						'token':uni.getStorageSync('token')
@@ -231,9 +253,73 @@
 				
 			},
 			confirm() {
-				this.matList[this.rowNum].anfme = this.count
-				this.$refs.revise.close()
+				let that = this;
+				console.log("褰撳墠鏉$爜鏄細", that.barcode);
+
+				if (!that.barcode) {
+					uni.showToast({
+						title: '璇峰厛杈撳叆鎴栨壂鐮佹墭鐩樻潯鐮�',
+						icon: 'none'
+					});
+					return;
+				}
+
+				uni.request({
+					url: that.commonUrl + '/plate/out/startFree',
+					method: 'POST',
+					data: JSON.stringify(that.barcode), // 娉ㄦ剰杩欓噷鐩存帴浼犲瓧绗︿覆
+					header: {
+						'token': uni.getStorageSync('token'),
+						'Content-Type': 'application/json' // 閲嶈锛屽憡璇夊悗绔綘鍙戠殑鏄� JSON 瀛楃涓�
+					},
+					success(result) {
+						uni.vibrateShort();
+						let res = result.data;
+
+						if (res.code === 200) {
+							uni.showToast({
+								title: res.msg || '鍑哄簱鍚姩鎴愬姛',
+								icon: 'success'
+							});
+
+							// 娓呯┖鎵樼洏鏉$爜
+							that.barcode = '';
+
+							// 濡傛灉鏈� matData 鍐嶈烦杞�
+							if (res.data) {
+								that.matData = res.data;
+
+								uni.navigateTo({
+									url: "matQuery",
+									events: {
+										matList: function(data) {
+											that.matList.push(data.data);
+										},
+									},
+									success: function(res) {
+										res.eventChannel.emit('matData', {
+											data: that.matData
+										});
+									}
+								});
+							}
+						} else {
+							uni.showToast({
+								title: res.msg || '鍑哄簱鍚姩澶辫触',
+								icon: 'none'
+							});
+						}
+					},
+					fail(err) {
+						uni.showToast({
+							title: '缃戠粶璇锋眰澶辫触',
+							icon: 'none'
+						});
+						console.error('璇锋眰澶辫触锛�', err);
+					}
+				});
 			},
+
 			resst() {
 				this.matList = []
 				this.staNo = ''
@@ -241,7 +327,7 @@
 			adjust() {
 				let that = this
 				uni.request({
-					url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/adjust/auth',
+					url: that.commonUrl + '/adjust/auth',
 					method: 'POST',
 					data: {
 						combParam: that.matList
@@ -266,6 +352,9 @@
 						}
 					},
 				});
+			},
+			removeBarcode() {
+				this.barcode = ''
 			}
 		} // methods
 	} // exprot

--
Gitblit v1.9.1