From 56de90bb134581c2d7cb2551616e377449c7623f Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期三, 12 四月 2023 07:02:09 +0800
Subject: [PATCH] #

---
 pages/basics/changePallet.vue |  163 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 152 insertions(+), 11 deletions(-)

diff --git a/pages/basics/changePallet.vue b/pages/basics/changePallet.vue
index ac5573c..9f8b1d0 100644
--- a/pages/basics/changePallet.vue
+++ b/pages/basics/changePallet.vue
@@ -21,22 +21,46 @@
 				</view>
 				<view class="square-content">
 					<view class="content-input">
-						<input v-model="matnrId" type="text" placeholder="鎵爜 / 杈撳叆" @input="findMat()"
-						:focus="focus"@focus="empty()">
-						 <!-- :focus="focus" @blur="clear "> -->
-						<!-- @focus="focuss" -->
+						<input v-model="tBarcode" type="text" placeholder="鎵爜 / 杈撳叆" :focus="focus">
 						<uni-icons type="closeempty" size="20" color="#dadada" @click="foucss()"></uni-icons>
 					</view>
 				</view>
 			</view>
+			<view class="square-1">
+				<view class="square-title">
+					<view class="title-sign"><view class="sign"></view></view>
+					<view class="title-text"><text>鍟嗗搧鍒楄〃</text></view>
+				</view>
+			</view>
+			<view class="square-none"  v-show="matList.length === 0">
+				<view class="v-show">鏆傛棤鏇村鏁版嵁...</view>
+			</view>
+			<checkbox-group >
+				<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">No:{{listLen-index}} <text style="margin-left: 4em;font-size: 10px;">{{item.memo}}</text></view>
+						<view class="matnr">{{item.matnr}}-{{item.batch}}</view>
+					</view>
+					<!-- <view class="data-list-right">
+						<label><uni-icons type="compose" size="20" color="#a5a5a5" @click="revise(item,index)"></uni-icons></label>
+						<label style="margin-left: 10%;"><uni-icons type="trash" size="21" color="#a5a5a5" @click="remove(item,index)"></uni-icons></label>
+					</view> -->
+				</view>
+			</checkbox-group>
+			<view class="footer flex justify-around">
+				<view>
+					<button class="cu-btn lg" @click="resst()">閲嶇疆</button>
+				</view>
+				<view>
+					<button class="cu-btn lg pakin-btn bg-blue" @click="changePallet()">鎹㈡澘</button>
+				</view>
+			</view>
 		</scroll-view>
-		<view class="footer flex justify-around">
-			<view>
-				<button class="cu-btn lg" @click="resst()">閲嶇疆</button>
-			</view>
-			<view>
-				<button class="cu-btn lg pakin-btn bg-blue" @click="comb()">缁勬墭</button>
-			</view>
+		<view>
+			<!-- 鎻愮ず淇℃伅寮圭獥 -->
+			<uni-popup ref="message" type="message">
+				<uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
+			</uni-popup>
 		</view>
 	</view>
 </template>
@@ -48,9 +72,12 @@
 			return {
 				commonUrl:null,
 				barcode: '',
+				tBarcode: '',
+				matList:[],
 				barcodeFocus:true,
 				focus:false,
 				hide:true,
+				listLen:0,
 				msgType: 'success',
 				messageText: '杩欐槸涓�鏉℃垚鍔熸彁绀�',
 				
@@ -81,6 +108,72 @@
 			getUrl() {
 				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
 			},
+			nextInput() {
+				let that = this 
+				if (that.barcode.length == 8) {
+					uni.request({
+						url: that.commonUrl + '/mobile/piking/auth',
+						header: {
+							'token':uni.getStorageSync('token')
+						},
+						data: {barcode:that.barcode},
+						success(res) {
+							res = res.data
+							if(res.code===200) {
+								that.matList = res.data
+								that.listLen = that.matList.length;
+								that.foucss()
+							} 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'})
+						}
+						}
+					})
+					
+				}
+			},
+			foucss() {
+				// #ifdef APP
+				let that = this;
+				that.focus = false;
+				setTimeout(()=>{
+					that.focus = true;
+				}, 100);
+				// #endif
+			},
+			removeBarcode() {
+				this.barcode = ''
+				this.barcodeFocus = false;
+				this.$nextTick(function() {
+					this.barcodeFocus = true;
+				});
+			},
+			changePallet() {
+				let that = this
+				uni.request({
+					url: that.commonUrl + '/mobile/piking/to/full',
+					header: {
+						'token':uni.getStorageSync('token')
+					},
+					data: {sBarcode:that.barcode,tBarcode:that.tBarcode},
+					success(res) {
+						console.log(res.data);
+						res = res.data
+						if (res.code === 200) {
+							that.barcode = ''
+							that.matList = []
+							that.tBarcode = ''
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+						}
+					}
+				})
+			}
 		}
 	}
 </script>
@@ -91,4 +184,52 @@
 	.pakin-btn {
 		background-color: #1E9FFF;
 	}
+	.bg-false {
+		background-color: #FFFFFF;
+	}
+	.bg-true {
+		background-color: #ebebeb;
+	}
+	.data-list {
+		border-bottom: 1px solid #d8d8d8;
+		height: 130rpx;
+		margin: 15rpx;
+		border-radius: 20rpx;
+	}
+	.data-list:first-child {
+		margin-top: 20rpx;
+	}
+	.data-list:last-child {
+		margin-bottom: 200rpx;
+	}
+	/* .data-list-left {
+		display: inline-block;
+		float: left;
+		text-align: center;
+		width: 100rpx;
+		height: 180rpx;
+		line-height: 180rpx;
+	} */
+	.data-list-left {
+		display: inline-block;
+		float: left;
+		margin-left: 6%;
+		height: 130rpx;
+		/* line-height: 100rpx; */
+		color: #676767;
+	}
+	.matnr {
+		font-size: 14px;
+		font-weight: 700;
+		/* padding-top: 15rpx; */
+		padding-top: 15rpx;
+	}
+	.data-list-right {
+		display: inline-block;
+		float: right;
+		height: 130rpx;
+		line-height: 130rpx;
+		margin-right: 2%;
+		width: 20%;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1