From c0b24b804539df3a40a0be613b44562c7e073005 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期四, 20 四月 2023 10:43:46 +0800
Subject: [PATCH] #

---
 pages/basics/piking.vue |  124 ++++++++++++++++++++++++++++++++++------
 1 files changed, 104 insertions(+), 20 deletions(-)

diff --git a/pages/basics/piking.vue b/pages/basics/piking.vue
index f5f363b..7e52d73 100644
--- a/pages/basics/piking.vue
+++ b/pages/basics/piking.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,7 +12,7 @@
 						<uni-combox @input="getCheckDetl" emptyTips="鏆傛棤鏁版嵁" :candidates="staNoList" v-model="staNo" placeholder="璇烽�夋嫨"></uni-combox>
 					</view>
 				</view>
-			</view>
+			</view> -->
 			
 			<view class="square-2">
 				<view class="square-title">
@@ -21,7 +21,7 @@
 				</view>
 				<view class="square-content">
 					<view class="content-input">
-						<input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" maxlength="8"placeholder-style="line-height:  85rpx;">
+						<input v-model="barcode" @input="search" type="text" placeholder="鎵爜 / 杈撳叆" maxlength="8"placeholder-style="line-height:  85rpx;">
 						<uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode" ></uni-icons>
 					</view>
 				</view>
@@ -40,10 +40,13 @@
 				<view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" >
 					<view class="data-list-left">
 						<view class="matnr"><text style="width: 400rpx;">缂栫爜锛歿{item.matnr}}</text></view>
+						<view><text style="width: 400rpx;">瑙勬牸锛歿{item.specs}}</text></view>
 						<view><text style="width: 400rpx;">鍝佸悕锛歿{item.maktx}}</text></view>
 						<view><text style="width: 400rpx;">鎵瑰彿锛歿{item.batch}}</text></view>
+						<view><text style="width: 400rpx;">瀹㈡埛淇℃伅锛歿{item.cstmr}}</text></view>
 						<view>
-							<text style="width: 400rpx;">鏁伴噺锛歿{item.anfme}}</text>
+							<text style="width: 400rpx;">澶囨敞锛歿{item.memo}}</text>
+							<text style="width: 400rpx;margin-left: 100rpx">鏁伴噺锛歿{item.anfme}}</text>
 						</view>
 					</view>
 					<view class="data-list-right">
@@ -57,26 +60,28 @@
 					<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="pickingToFull()">杞叏鏉垮嚭搴�</button>
 				</view>
 			</view>
 		</scroll-view>
 		
 		<view>
 			<!-- 淇敼鏁伴噺 -->
-			<uni-popup ref="revise" background-color="#fff" @change="change">
+			<uni-popup ref="revise" @change="change">
 				<view class="revise-box">
 					<view class="revise-box-top">
 						<view class="color-block-blue"></view>
 						<text class="title">淇敼</text>
 					</view>
-					<view class="text-box">
-						<text>鍙粍鏁伴噺锛歿{enableQty}}</text>
-					</view>
-					<view class="changeBox">
-						<view class="num-box">
-							<uni-number-box v-model="count" :min="minCount" :max="maxCount" color="#747474"  @change="changeValue"/>
-						</view> 
+					<view class="change">
+						<view class="text-box">
+							<text>鏁伴噺锛歿{enableQty}}</text>
+						</view>
+						<view class="changeBox">
+							<view class="num-box">
+								<uni-number-box v-model="count" :min="minCount" :max="maxCount" color="#747474"  @change="changeValue"/>
+							</view> 
+						</view>
 					</view>
 					<view class="revise-box-buttom">
 						<view>
@@ -94,7 +99,7 @@
 		data() {
 			return {
 				commonUrl:null,
-				matList:[{}],
+				matList:[],
 				staNoList:[],
 				barcode: '',
 				staNo:'',
@@ -120,6 +125,66 @@
 			// 鑾峰彇url
 			getUrl() {
 				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
+			},
+			// 鏍规嵁鎵樼洏鐮佹悳绱�
+			search() {
+				let that = this
+				uni.request({
+					url: that.commonUrl + '/mobile/piking/auth',
+					header: {
+						'token':uni.getStorageSync('token')
+					},
+					data: {barcode: that.barcode},
+					method:'GET',
+					success(result) {
+						let res = result.data
+						if(res.code === 200){
+							for(var i = 0; i < res.data.length;i++){
+								that.matList.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'})
+						}
+					}
+					
+				})
+			},
+			// 杞叏鏉垮嚭搴�
+			pickingToFull() {
+				console.log(this.barcode);
+				let that = this
+				uni.request({
+					url: that.commonUrl + '/mobile/piking/to/full',
+					header: {
+						'token':uni.getStorageSync('token')
+					},
+					data: {barcode: that.barcode},
+					method: 'GET',
+					success(result){
+						let res = result.data
+						if (res.code === 200) {
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+							that.matList = []
+							that.barcode = ''
+						} 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'})
+						}
+					}
+				})
 			},
 			getOutBound() {         // 鑾峰彇鍑哄簱鍙�
 				let that = this
@@ -259,7 +324,7 @@
 			},
 			resst() {
 				this.matList = []
-				this.staNo = ''
+				this.barcode = ''
 			},
 			adjust() {
 				let that = this
@@ -297,6 +362,25 @@
 	} // exprot
 </script>
 <style>
+	.revise-box {
+		width: 500rpx;
+		height: 300rpx;
+		display: flex;
+		flex-direction: column;
+		border-radius: 20rpx;
+		background-color: #fff;
+	}
+	.change {
+		height: 150rpx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+	.revise-box-buttom {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
 	.pak-seach-box {
 		background-color: #FFFFFF;
 		margin: 15rpx 15rpx 0rpx 15rpx;
@@ -374,7 +458,7 @@
 	}
 	.data-list {
 		border-bottom: 1px solid #d8d8d8;
-		height: 180rpx;
+		height: 240rpx;
 		margin: 15rpx;
 		border-radius: 20rpx;
 	}
@@ -382,13 +466,13 @@
 		margin-top: 20rpx;
 	}
 	.data-list:last-child {
-		margin-bottom: 160rpx;
+		margin-bottom: 180rpx;
 	}
 	.data-list-left {
 		display: inline-block;
 		float: left;
 		margin-left: 6%;
-		height: 180rpx;
+		height: 240rpx;
 		color: #676767;
 	}
 	.matnr {
@@ -398,8 +482,8 @@
 		display: inline-block;
 		float: right;
 		width: 200rpx;
-		height: 180rpx;
-		line-height: 180rpx;
+		height: 240rpx;
+		line-height: 240rpx;
 	}
 	.data-list-right label {
 		display: inline-block;

--
Gitblit v1.9.1