From 36fc4fa64ba5a7fd9f23b33c94c918d4b3ca70e3 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期三, 24 八月 2022 12:17:37 +0800
Subject: [PATCH] Merge branch 'jkwms' of http://47.97.1.152:5880/r/~whycq/wms-app into jkwms

---
 pages/basics/outPakin.vue |   76 ++++++++++++++++++++++++++++++++------
 1 files changed, 64 insertions(+), 12 deletions(-)

diff --git a/pages/basics/outPakin.vue b/pages/basics/outPakin.vue
index 918f388..2b42673 100644
--- a/pages/basics/outPakin.vue
+++ b/pages/basics/outPakin.vue
@@ -111,7 +111,8 @@
 				messageText: '杩欐槸涓�鏉℃垚鍔熸彁绀�',
 				origins: [{value:'1288'},{value:'5055'}],
 				origin: null, // 浠撳簱
-				current: 0
+				current: 0,
+				isNum:false
 			}
 		},
 		mounted(){
@@ -119,19 +120,21 @@
 			this.baseIP = UIP;
 			const UPORT = uni.getStorageSync('UPORT');
 			this.basePORT = UPORT
+			const PROJ = uni.getStorageSync('UPROJ');
+			this.baseUrl = PROJ
 			this.getUrl()
 		},
 		onLoad() {
 			// #ifdef APP
 			setInterval(()=>{
-				// uni.hideKeyboard()
+				uni.hideKeyboard()
 			},20)
 			// #endif
 		},
 		methods: {
 			// 鑾峰彇url
 			getUrl() {
-				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + this.baseUrl
+				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
 			},
 			radioChange(evt) {
 				for (let i = 0; i < this.origins.length; i++) {
@@ -262,14 +265,23 @@
 			checkNum(theObj) {
 				var reg = /^[0-9]*$/;
 				if (!reg.test(theObj)) {
-					this.messageToggle('warn');
-					this.messageText = '鍟嗗搧缂栫爜鏈夎锛岃閲嶈瘯';
-					this.foucss();
-					return;
+					this.isNum = false;
+					return ;
 				}
+				var year = theObj.substring(0,2)
+				//鑾峰彇褰撳墠骞翠唤
+				var dt = new Date();
+				var thisYear = new Date().getFullYear() + ''
+				thisYear = thisYear.substring(2,4)
+				if(year > thisYear) {
+					this.isNum = false;
+					return ;
+				}
+				this.isNum = true;
 			},
 			// 娣诲姞鎵弿鏃ュ織
 			addLog(matCode,userName) {
+				
 				let that = this;
 				uni.request({
 					url: that.commonUrl + "/mobile/addLog/auth",
@@ -282,6 +294,10 @@
 					},
 					// method:"POST",
 					success(result) {
+						var res = result.data
+						if(res.code === 200) {
+							// uni.showToast({title: "娣诲姞鎴愬姛", icon: "none",position: 'center'})
+						}
 					}
 				})
 				
@@ -293,8 +309,14 @@
 				let matCode = that.matnrId
 				// 寮�鍚壂鎻忔棩蹇�
 				that.addLog(matCode,userName)
-				that.foucss();
-				return;
+				// that.foucss();
+				// return;
+				if(that.matList.length > 15) {
+					that.messageToggle('warn');
+					that.messageText = '缁勬墭鍟嗗搧鏁伴噺宸茶秴杩�16浠讹紝璇峰畬鎴愬綋鍓嶇粍鎵�';
+					that.foucss();
+					return;
+				}
 				if (that.matnrId.length > 25){
 					that.messageToggle('warn');
 					that.messageText = '鍟嗗搧缂栫爜瓒呴暱锛岃閲嶈瘯';
@@ -305,6 +327,37 @@
 				let matnr = str[0] + '-' + str[1]
 				// 妫�鏌ユ潯鐮佷腑闈炴暟瀛�
 				that.checkNum(str[2])
+				// 妫�鏌ュ簭鍒楃爜闀垮害
+				if (str[2].length != 11) {
+					that.messageToggle('warn');
+					that.messageText = '鍟嗗搧搴忓垪鐮侀暱搴︽湁璇紝璇烽噸璇曪紒';
+					that.foucss();
+					return;
+				}
+				// 妫�鏌ュ勾浠�
+				var dt = new Date();
+				var year = (dt.getFullYear() + '').substring(2,4)
+				var month = (dt.getMonth()+1) < 10 ? '0'+ (dt.getMonth()+1) : (dt.getMonth()+1);
+				if (str[2].substring(0,2) > year) {
+					that.messageToggle('warn');
+					that.messageText = '鍟嗗搧搴忓垪鐮佸勾浠芥湁璇紝璇烽噸璇曪紒';
+					that.foucss();
+					return;
+				}
+				// 妫�鏌ユ湀浠� 
+				if (str[2].substring(2,4) > 12) {
+					that.messageToggle('warn');
+					that.messageText = '鍟嗗搧搴忓垪鐮佹湀浠芥湁璇紝璇烽噸璇曪紒';
+					that.foucss();
+					return;
+				}
+				if (str)
+				if (that.isNum == false) {
+					that.messageToggle('warn');
+					that.messageText = '鍟嗗搧缂栫爜鏈夎锛岃閲嶈瘯锛�';
+					that.foucss();
+					return;
+				}
 				for (let k = 0; k < that.matList.length;k++) {
 					if (that.matList[k].matnr != matnr) {
 						that.messageToggle('warn');
@@ -314,13 +367,12 @@
 					}
 				}
 				
-				
 				// return;
 				// uni.showLoading();
 				uni.request({
-				    url: that.commonUrl + '/mat/auth',
+				    url: that.commonUrl + '/barcode/check/auth',
 				    data: {
-						matnr:matnr
+						barcode:that.matnrId
 				    },
 				    header: {
 						'token':uni.getStorageSync('token')

--
Gitblit v1.9.1