From bfcfe9e8227ff2d0d2f54345ca72043b1522f056 Mon Sep 17 00:00:00 2001
From: whycq <123456>
Date: 星期六, 23 四月 2022 09:04:54 +0800
Subject: [PATCH] #

---
 pages/basics/pakin.vue |   51 ++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 38 insertions(+), 13 deletions(-)

diff --git a/pages/basics/pakin.vue b/pages/basics/pakin.vue
index 08239b7..b5772b1 100644
--- a/pages/basics/pakin.vue
+++ b/pages/basics/pakin.vue
@@ -9,7 +9,7 @@
 				<view class="box-buttom">
 					<input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆">
 					<view class="search-icon">
-						<uni-icons type="closeempty" size="25" color="#a5a5a5" @click="removeBarcode()"></uni-icons>
+						<uni-icons type="closeempty" size="20" color="#a5a5a5" @click="removeBarcode()"></uni-icons>
 					</view>
 				</view>
 			</view>
@@ -21,7 +21,7 @@
 				<view class="box-buttom">
 					<input v-model="matnr" type="text" placeholder="鎵爜 / 杈撳叆" @input="findMat()">
 					<view class="search-icon">
-						<uni-icons type="closeempty" size="25" color="#a5a5a5" @click="removeMatnr()"></uni-icons>
+						<uni-icons type="closeempty" size="20" color="#a5a5a5" @click="removeMatnr()"></uni-icons>
 					</view>
 				</view>
 				<button class="cu-btn bg-blue" @click="selectMat()">+鎻愬彇</button>
@@ -51,16 +51,17 @@
 		</scroll-view>
 		<view class="footer flex justify-around">
 			<view>
-				<button class="cu-btn" @click="resst()">閲嶇疆</button>
+				<button class="cu-btn lg" @click="resst()">閲嶇疆</button>
 			</view>
 			<view>
-				<button class="cu-btn pakin-btn bg-blue" @click="comb()">缁勬墭</button>
+				<button class="cu-btn lg pakin-btn bg-blue" @click="comb()">缁勬墭</button>
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
+	import permision from "@/common/permission.js"
 	export default {
 		data() {
 			return {
@@ -70,6 +71,7 @@
 				pick:'hide',
 				matnr:'',
 				matList:[],
+				result: ''
 			}
 		},
 		mounted(){
@@ -83,17 +85,22 @@
 				this.matList = []
 				this.barcode = ''
 				this.matnr = ''
+				uni.vibrateShort();
 			},
 			removeBarcode() {
 				this.barcode = ''
+				uni.vibrateShort();
 			},
 			removeMatnr() {
 				this.matnr = ''
+				uni.vibrateShort();
 			},
-			remove() {
+			remove(item,index) {
 				this.matList.splice(index,1)
+				uni.vibrateShort();
 			},
 			comb() {
+				uni.vibrateShort();
 				let that = this;
 				if (that.barcode === '') {
 					uni.showToast({title: '璇锋壂鎻忔墭鐩樻潯鐮�', icon: "none", position: 'top'});
@@ -115,7 +122,7 @@
 						'token':uni.getStorageSync('token')
 				    },
 					success(result) {
-						uni.hideLoading();
+						uni.showLoading();
 						var res = result.data
 						if (res.code === 200) {
 							uni.showToast({
@@ -129,7 +136,7 @@
 								uni.reLaunch({
 									url: '../login/login'
 								});
-							}, 500);
+							}, 1000);
 						} else {
 							uni.showToast({title: res.msg, icon: "none",position: 'top'})
 						}
@@ -137,7 +144,23 @@
 				});
 			},
 			selectMat() {
-				
+				let that = this
+				uni.vibrateShort();
+				uni.navigateTo({
+					url: "matSelect",
+					events: {
+					    // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+					    acceptDataFromOpenedPage: function(data) {
+							that.matnr = data.data
+							that.findMat(that.matnr)
+					    },
+					  },
+					  success: function(res) {
+					    // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+					    res.eventChannel.emit('acceptDataFromOpenerPage', {baseIP:that.baseIP, basePORT:that.basePORT })
+					  }
+				});
+				that.matnr = ''
 			},
 			findMat() {
 				let that = this
@@ -150,6 +173,7 @@
 						'token':uni.getStorageSync('token')
 				    },
 					success(result) {
+						uni.vibrateShort();
 						let res = result.data
 						if (res.code === 200 && res.data) {
 							that.matData = res.data
@@ -157,13 +181,13 @@
 								url: "matQuery",
 								events: {
 								    // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
-								    acceptDataFromOpenedPage: function(data) {
+								    matList: function(data) {
 										that.matList.push(data.data)
 								    },
 								  },
 								  success: function(res) {
 								    // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
-								    res.eventChannel.emit('acceptDataFromOpenerPage', { data: that.matData })
+								    res.eventChannel.emit('matData', { data: that.matData })
 								  }
 							});
 						}
@@ -243,12 +267,13 @@
 	.box-buttom {
 		display: inline-block;
 		background-color: #ededed;
-		width: 70%;
+		width: 65%;
 		height: 60rpx;
 		border-radius: 20rpx;
 		margin: 15rpx 15rpx 0rpx 15rpx;
 	}
 	.box-buttom input {
+		width: 75%;
 		float: left;
 		margin: 8rpx 10rpx 0rpx 25rpx;
 	}
@@ -276,7 +301,7 @@
 		color: #ffffff;
 		display: inline-block;
 		float: right;
-		width: 150rpx;
+		width: 180rpx;
 		height: 60rpx;
 		margin: 15rpx 15rpx 0rpx 15rpx;
 		line-height: 60rpx;
@@ -339,4 +364,4 @@
 		line-height: 180rpx;
 		margin-right: 10%;
 	}
-</style>
+</style>
\ No newline at end of file

--
Gitblit v1.9.1