From e4dc67055ea0c21e72815054c044b56a76ec625e Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 17 四月 2024 13:08:36 +0800
Subject: [PATCH] #

---
 pages/stock/stockCheck.vue |  159 +++++++++++++++++++++++++++-------------------------
 1 files changed, 82 insertions(+), 77 deletions(-)

diff --git a/pages/stock/stockCheck.vue b/pages/stock/stockCheck.vue
index cd83df3..58dbaa5 100644
--- a/pages/stock/stockCheck.vue
+++ b/pages/stock/stockCheck.vue
@@ -2,9 +2,9 @@
 	<view>
 		<view class="code">
 			<view class="item">
-				<view class="code-decs">鎵樼洏鐮�:</view>
-				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="barcode" :focus="barcodeFocus"
-					@confirm="barcodeInput()">
+				<view class="code-decs">鐩樼偣鍗�:</view>
+				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="orderNo" :focus="barcodeFocus"
+					@input="search()">
 			</view>
 			<view class="item">
 				<view class="code-decs">鐗╂枡鐮�:</view>
@@ -37,8 +37,8 @@
 						<view class="left-item">{{item.maktx}}</view>
 					</view>
 					<view class="list-left-item">
-						<view class="desc">瑙勬牸锛�</view>
-						<view class="left-item">{{item.specs}}</view>
+						<view class="desc">搴撲綅锛�</view>
+						<view class="left-item">{{item.locNo}}</view>
 					</view>
 					<view class="list-left-item">
 						<view class="desc">鎵瑰彿锛�</view>
@@ -53,14 +53,14 @@
 				</view>
 				<view class="list-right">
 					<uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons>
-					<uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons>
+					<!-- <uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons> -->
 				</view>
 			</view>
 		</scroll-view>
 		<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
 		<view class="buttom">
 			<button size="mini" @click="reset('warn')">閲嶇疆</button>
-			<button size="mini" type="primary" @click="combConfirm('warn')">缁勬墭</button>
+			<button size="mini" type="primary" @click="combConfirm('warn')">纭</button>
 		</view>
 		<!-- 寮圭獥 -->
 		<!-- 淇敼鏁伴噺 -->
@@ -77,7 +77,11 @@
 						</view>
 					</view>
 					<view class="popup-item">
-						<view class="popup-item-left">鍚堝悓鍙�:</view>
+						<view class="popup-item-left">搴撲綅:</view>
+						<view class="popup-item-right"><input type="text" v-model="locNo"></view>
+					</view>
+					<view class="popup-item">
+						<view class="popup-item-left">鎵瑰彿:</view>
 						<view class="popup-item-right"><input type="text" v-model="batch"></view>
 					</view>
 					<view class="popup-item">
@@ -111,7 +115,7 @@
 		<view>
 			<uni-popup ref="combConfirm" type="dialog">
 				<uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content"
-					@confirm="comb" @close="combClose"></uni-popup-dialog>
+					@confirm="adjust" @close="combClose"></uni-popup-dialog>
 			</uni-popup>
 		</view>
 		<!-- 纭閲嶇疆 -->
@@ -143,7 +147,9 @@
 				content: '',
 				barcodeFocus: true,
 				matFocus: false,
-				matData: ''
+				matData: '',
+				orderNo:'',
+				locNo:''
 
 			}
 		},
@@ -159,23 +165,38 @@
 				this.msgType1 = type
 				this.$refs.message.open()
 			},
-			// barcode input 浜嬩欢
-			barcodeInput() {
-				// 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
-				setTimeout(() => {
-					var len = this.barcode.length
-					if (len != 8) {
-						uni.showToast({
-							title: '鎵樼洏鐮佹湁璇閲嶈瘯',
-							icon: "none",
-							position: 'top'
-						});
-						this.barcodeFocuss()
-						return;
+			// 鏍规嵁鎵樼洏鐮佹悳绱�
+			search() {
+				let that = this
+				uni.request({
+					url: that.baseUrl + '/manlocDetl/orderNo',
+					header: {
+						'token':uni.getStorageSync('token')
+					},
+					data: {orderNo: that.orderNo},
+					method:'GET',
+					success(res) {
+						console.log(res);
+						res = res.data
+						if(res.code === 200){
+							for(var i = 0; i < res.data.length;i++){
+								that.dataList.push(res.data[i])
+							}
+						} else if (res.code == 403) {
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '../login/login'
+								});
+							}, 1000);
+						} else {
+							uni.showToast({title: res.msg, icon: "none",position: 'top'})
+						}
 					}
-					this.focuss()
-				}, 200)
+					
+				})
 			},
+			
 			// 鎵樼洏鐮佹湁璇噸缃�
 			barcodeFocuss() {
 				let that = this;
@@ -310,6 +331,7 @@
 				this.matnr = this.dataList[i].matnr
 				this.count = this.dataList[i].anfme
 				this.batch = this.dataList[i].batch
+				this.locNo = this.dataList[i].locNo
 				this.rowNum = i
 				this.eject()
 			},
@@ -337,6 +359,7 @@
 			reviseConfirm() {
 				this.dataList[this.rowNum].anfme = this.count
 				this.dataList[this.rowNum].batch = this.batch
+				this.dataList[this.rowNum].locNo = this.locNo
 				this.messageText = "淇敼鎴愬姛"
 				this.messageToggle('success')
 				this.$refs.revise.close()
@@ -350,62 +373,11 @@
 			combConfirm(type) {
 				this.msgType = type
 				this.title = '璀﹀憡'
-				this.content = '鏄惁鐜板湪缁勬墭!'
+				this.content = '鏄惁纭鐩樼偣!'
 				this.$refs.combConfirm.open()
 			},
 			combClose() {
 				this.$refs.combConfirm.close()
-			},
-			comb() {
-				uni.vibrateShort();
-				let that = this;
-				if (that.barcode === '') {
-					this.messageText = "璇锋壂鎻忔墭鐩樻潯鐮�"
-					this.messageToggle('error')
-					return;
-				}
-				if (that.dataList.length === 0) {
-					this.messageText = "璇锋坊鍔犲晢鍝佸垪琛�"
-					this.messageToggle('error')
-					return;
-				}
-				for (var i = 0; i < that.dataList.length; i++) {
-					if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') {
-						this.messageText = that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0'
-						this.messageToggle('error')
-						return;
-					}
-				}
-				uni.request({
-					url: that.baseUrl + '/mobile/comb/auth',
-					data: JSON.stringify({
-						barcode: that.barcode,
-						combMats: that.dataList
-					}),
-					method: 'POST',
-					header: {
-						'token': uni.getStorageSync('token')
-					},
-					success(result) {
-						var res = result.data
-						if (res.code === 200) {
-							that.resst();
-							that.messageText = "缁勬墭鎴愬姛"
-							that.messageToggle('success')
-						} else if (res.code == 403) {
-							that.messageText = res.msg
-							that.messageToggle('error')
-							setTimeout(() => {
-								uni.reLaunch({
-									url: '../login/login'
-								});
-							}, 1000);
-						} else {
-							that.messageText = res.msg
-							that.messageToggle('error')
-						}
-					}
-				});
 			},
 			reset(type) {
 				this.msgType = type
@@ -416,6 +388,7 @@
 			// 纭閲嶇疆
 			resetConfirm() {
 				this.dataList = []
+				this.barcode = ''
 				this.messageText = "閲嶇疆瀹屾垚"
 				this.messageToggle('success')
 			},
@@ -429,6 +402,38 @@
 				this.barcode = ''
 				this.barcodeFocuss()
 			},
+			adjust() {
+				let that = this
+				var combMats = []
+				var combParam = {}
+				combParam['orderNo'] = that.orderNo
+				combParam['wrkDetls'] = that.dataList
+				uni.request({
+					url: that.baseUrl + '/mobile/adjustNew/auth',
+					method: 'POST',
+					data: JSON.stringify(combParam),
+					header: {
+						'token':uni.getStorageSync('token')
+					},
+					success(result) {
+						var res = result.data
+						if (res.code === 200) {
+							that.dataList = []
+							that.barcode = ''
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+						} else if (res.code == 403) {
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '../login/login'
+								});
+							}, 1000);
+						} else {
+							uni.showToast({title: res.msg, icon: "none",position: 'top'})
+						}
+					},
+				});
+			},
 		}
 	}
 </script>

--
Gitblit v1.9.1