From ad7e1146d1cd5a900ea592d7c1f63bf7863f00e4 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期四, 18 八月 2022 13:59:09 +0800
Subject: [PATCH] #

---
 pages/basics/checkout.vue |   59 +++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 39 insertions(+), 20 deletions(-)

diff --git a/pages/basics/checkout.vue b/pages/basics/checkout.vue
index 32ecde1..dd4f473 100644
--- a/pages/basics/checkout.vue
+++ b/pages/basics/checkout.vue
@@ -73,6 +73,7 @@
 	export default {
 		data() {
 			return {
+				commonUrl:null,
 				barcode: '',
 				barcodeFocus:true,
 				focus:false,
@@ -100,21 +101,28 @@
 				// this.getMatListLen()
 			},1000)
 		},
+		onLoad() {
+			// #ifdef APP
+			setInterval(()=>{
+				uni.hideKeyboard()
+			},20)
+			// #endif
+		},
 		mounted(){
 			const UIP = uni.getStorageSync('UIP');
 			this.baseIP = UIP;
 			const UPORT = uni.getStorageSync('UPORT');
 			this.basePORT = UPORT
-			
+			const PROJ = uni.getStorageSync('UPROJ');
+			this.baseUrl = PROJ
+			this.getUrl()
 		},
 		methods: {
-			huanghang() {
-					this.focus = false;
-					this.$nextTick(function() {
-						this.focus = true;
-					});
-					this.matnr = ''
+			// 鑾峰彇url
+			getUrl() {
+				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
 			},
+			// 鍑哄簱鍒嗕负涓ょ 涓�:鍏ㄦ澘鍑哄簱 鎵弿鎵樼洏鐮佹樉绀哄叏鏉垮晢鍝� 鍙互鐩存帴纭 浜屾槸鍑忔枡鍑哄簱 鎵弿鎵樼洏鐮佹彁绀洪渶瑕佸嚭搴撴暟閲�  鎵弿璐у搧鏉$爜杈惧埌鏈�澶у嚭搴撴暟閲忓嵆鍙�
 			messageToggle(type) {
 				this.msgType = type
 				this.messageText = `杩欐槸涓�鏉�${type}娑堟伅鎻愮ず`
@@ -130,7 +138,10 @@
 				this.matList = []
 				this.barcode = ''
 				this.matnr = ''
+				this.matCount = ''
+				this.removeBarcode();
 				uni.vibrateShort();
+				
 			},
 			removeBarcode() {
 				this.barcode = ''
@@ -139,6 +150,16 @@
 				this.$nextTick(function() {
 					this.barcodeFocus = true;
 				});
+			},
+			foucss() {
+				// #ifdef APP
+				let that = this;
+				that.focus = false;
+				setTimeout(()=>{
+					that.matnr = '';
+					that.focus = true;
+				}, 100);
+				// #endif
 			},
 			removeMatnr() {
 				this.matnr = ''
@@ -179,7 +200,7 @@
 			findBarcode() {
 				let that = this
 				uni.request({
-				    url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/confirm/barcode/auth',
+				    url: that.commonUrl + '/mobile/pakout/confirm/barcode/auth',
 				    data: {
 						barcode:that.barcode
 				    },
@@ -187,22 +208,20 @@
 						'token':uni.getStorageSync('token'),
 				    },
 					success(result) {
-						console.log(result)
 						let res = result.data;
 						if (res.code === 200) {
 							if (res.data.ioType === 101) {
 								that.matList = res.data.list.concat(that.matList)
 								that.listLen = that.matList.length;
+								that.foucss();
 								return;
 							}
-							if (res.data.ioType === 103) {
+							if (res.data.ioType === 103 || res.data.ioType === 104 || res.data.ioType === 107) {
 								that.matCount = res.data.list.length
 								that.wrkNo = res.data.list[0].wrkNo
+								that.foucss();
 								return;
 							}
-							// if (res.data) {
-							// 	that.matCount = res.data.length
-							// }
 						} else if (res.code === 403) {
 							uni.showToast({title: res.msg, icon: "none", position: 'top'})
 								setTimeout(() => {
@@ -221,7 +240,7 @@
 			findMat() {
 				let that = this
 				uni.request({
-				    url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/confirm/pick/auth',
+				    url: that.commonUrl + '/mobile/pakout/confirm/pick/auth',
 				    data: {
 						wrkNo:that.wrkNo,
 						matnr:that.matnr
@@ -230,14 +249,13 @@
 						'token':uni.getStorageSync('token')
 				    },
 					success(result) {
-						console.log(result)
 						var res = result.data;
 						if(res.code === 200 ) {
 							if(res.data) {
 								if (that.matList.length == 0) {
 									that.matList.push(res.data)
 									that.listLen = that.matList.length;
-									that.huanghang();
+									that.foucss();
 									return;
 								}
 								for(let i = 0;i<that.matList.length;i++) {
@@ -245,18 +263,18 @@
 										if(JSON.stringify(that.matList[i]) === JSON.stringify(res.data)) {
 											that.messageToggle('warn');
 											that.messageText = '璇ュ晢鍝佸凡娣诲姞';
-											that.huanghang();
+											that.foucss();
 											return;
 										} else {
 											that.matList.unshift(res.data);
 											that.listLen = that.matList.length;
-											that.huanghang();
+											that.foucss();
 											return;
 										}
 									} else {
 										that.messageToggle('warn');
 										that.messageText = '宸插嚭鍏ㄩ儴鍟嗗搧锛岃纭鍑哄簱';
-										that.huanghang();
+										that.foucss();
 										return;
 									}
 								}
@@ -270,6 +288,7 @@
 							}, 1000);
 						} else {
 							uni.showToast({title: res.msg, icon: "none",position: 'top'})
+							that.foucss();
 						}
 						
 					}
@@ -301,7 +320,7 @@
 				}
 				uni.showLoading();
 				uni.request({
-				    url: that.baseHttp + that.baseIP + ':' +that.basePORT + that.baseUrl + '/mobile/pakout/confirm/auth',
+				    url: that.commonUrl + '/mobile/pakout/confirm/auth',
 				    data: that.matList,
 					method: 'POST',
 				    header: {

--
Gitblit v1.9.1