From ccceb635ca6fe2a602f4cef4beb2051d81f90f25 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期三, 24 八月 2022 12:16:50 +0800
Subject: [PATCH] #

---
 pages/basics/outPakin.vue |   44 +++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/pages/basics/outPakin.vue b/pages/basics/outPakin.vue
index 80d97bf..2b42673 100644
--- a/pages/basics/outPakin.vue
+++ b/pages/basics/outPakin.vue
@@ -120,6 +120,8 @@
 			this.baseIP = UIP;
 			const UPORT = uni.getStorageSync('UPORT');
 			this.basePORT = UPORT
+			const PROJ = uni.getStorageSync('UPROJ');
+			this.baseUrl = PROJ
 			this.getUrl()
 		},
 		onLoad() {
@@ -132,7 +134,7 @@
 		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++) {
@@ -279,6 +281,7 @@
 			},
 			// 娣诲姞鎵弿鏃ュ織
 			addLog(matCode,userName) {
+				
 				let that = this;
 				uni.request({
 					url: that.commonUrl + "/mobile/addLog/auth",
@@ -291,6 +294,10 @@
 					},
 					// method:"POST",
 					success(result) {
+						var res = result.data
+						if(res.code === 200) {
+							// uni.showToast({title: "娣诲姞鎴愬姛", icon: "none",position: 'center'})
+						}
 					}
 				})
 				
@@ -304,6 +311,12 @@
 				that.addLog(matCode,userName)
 				// 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 = '鍟嗗搧缂栫爜瓒呴暱锛岃閲嶈瘯';
@@ -314,6 +327,31 @@
 				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 = '鍟嗗搧缂栫爜鏈夎锛岃閲嶈瘯锛�';
@@ -332,9 +370,9 @@
 				// 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