浏览代码

fix:"修复扫码查询失败的问题"

soobin 7 月之前
父节点
当前提交
bef6269168

+ 22 - 22
pages/Insert/addMachine.vue

@@ -782,70 +782,70 @@
 						console.log('条码类型:' + res.scanType);
 						console.log('条码内容:' + res.result);
 						if (cod == 'coding') {
-							that.coding = res.result;
+							that.coding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'lutouCoding') {
-							that.lutouCoding = res.result;
+							that.lutouCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'jiashiqiCoding') {
-							that.jiashiqiCoding = res.result;
+							that.jiashiqiCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'shuibengCoding') {
-							that.shuibengCoding = res.result;
+							that.shuibengCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'chugunCoding') {
-							that.chugunCoding = res.result;
+							that.chugunCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'dianguiCoding') {
-							that.dianguiCoding = res.result;
+							that.dianguiCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'zidongdoorCoding') {
-							that.zidongdoorCoding = res.result;
+							that.zidongdoorCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'jixieshouCoding') {
-							that.jixieshouCoding = res.result;
+							that.jixieshouCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'yaxingdaoCoding') {
-							that.yaxingdaoCoding = res.result;
+							that.yaxingdaoCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'qibengCoding') {
-							that.qibengCoding = res.result;
+							that.qibengCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'songtangCoding') {
-							that.songtangCoding = res.result;
+							that.songtangCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'shoudongdoorCoding') {
-							that.shoudongdoorCoding = res.result;
+							that.shoudongdoorCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'anzhuopingCoding') {
-							that.anzhuopingCoding = res.result;
+							that.anzhuopingCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'plcCoding') {
-							that.plcCoding = res.result;
+							that.plcCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'jiarebanCoding') {
-							that.jiarebanCoding = res.result;
+							that.jiarebanCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'jikeCoding') {
-							that.jikeCoding = res.result;
+							that.jikeCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'circulationFan1Coding') {
-							that.circulationFan1Coding = res.result;
+							that.circulationFan1Coding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'circulationFan2Coding') {
-							that.circulationFan2Coding = res.result;
+							that.circulationFan2Coding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'circulationFan3Coding') {
-							that.circulationFan3Coding = res.result;
+							that.circulationFan3Coding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'xiazaiCoding') {
-							that.xiazaiCoding = res.result;
+							that.xiazaiCoding = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'orderNo') {
-							that.orderNo = res.result;
+							that.orderNo = res.result.replace(/\s+/g, '');
 						}
 						if (cod == 'cardReader') {
-							that.cardReader = res.result;
+							that.cardReader = res.result.replace(/\s+/g, '');
 						}
 					},
 					fail(err) {

+ 2 - 2
pages/Insert/addModules.vue

@@ -76,7 +76,7 @@
 					success(res) {
 						// console.log('条码类型:' + res.scanType);
 						// console.log('条码内容:' + res.result);
-						that.coding = res.result;
+						that.coding = res.result.replace(/\s+/g, '');
 					}
 				});
 			},
@@ -86,7 +86,7 @@
 				var serverUrl = that.serverurl;
 				var token = uni.getStorageSync("token");
 				uni.request({
-					url: serverUrl + "/TModules/getMessage?coding=" + coding,
+					url: serverUrl + "/TModules/getMessage?coding=" + coding.replace(/\s+/g, ''),
 					method: "GET",
 					header: {
 						'token': token

+ 2 - 2
pages/select/selectMachine.vue

@@ -118,7 +118,7 @@
 				// 允许从相机和相册扫码
 				uni.scanCode({
 					success(res) {
-						that.code = res.result;
+						that.code = res.result.replace(/\s+/g, '');
 					}
 				});
 			},
@@ -150,7 +150,7 @@
 				var serverUrl = that.serverurl;
 				var token = uni.getStorageSync("token");
 				uni.request({
-					url: serverUrl + "/TMachine/selectMachine?coding=" + coding,
+					url: serverUrl + "/TMachine/selectMachine?coding=" + coding.replace(/\s+/g, ''),
 					method: "GET",
 					header: {
 						'token': token

+ 2 - 2
pages/select/selectModules.vue

@@ -156,7 +156,7 @@
 				// 允许从相机和相册扫码
 				uni.scanCode({
 					success(res) {
-						that.coding = res.result;
+						that.coding = res.result.replace(/\s+/g, '');
 					}
 				});
 			},
@@ -251,7 +251,7 @@
 				var serverUrl = that.serverurl;
 				var token = uni.getStorageSync("token");
 				uni.request({
-					url: serverUrl + "/TModules/getModules?coding=" + coding,
+					url: serverUrl + "/TModules/getModules?coding=" + coding.replace(/\s+/g, ''),
 					method: "GET",
 					header: {
 						'token': token

+ 3 - 3
pages/select/update.vue

@@ -73,7 +73,7 @@
 				// 允许从相机和相册扫码
 				uni.scanCode({
 					success(res) {
-						that.machineCoding = res.result;
+						that.machineCoding = res.result.replace(/\s+/g, '');
 					}
 				});
 			},
@@ -82,7 +82,7 @@
 				// 允许从相机和相册扫码
 				uni.scanCode({
 					success(res) {
-						that.oldCoding = res.result;
+						that.oldCoding = res.result.replace(/\s+/g, '');
 					}
 				});
 			},
@@ -91,7 +91,7 @@
 				// 允许从相机和相册扫码
 				uni.scanCode({
 					success(res) {
-						that.coding = res.result;
+						that.coding = res.result.replace(/\s+/g, '');
 					}
 				});
 			},

+ 3 - 3
pages/update/update.vue

@@ -67,7 +67,7 @@
 				// 允许从相机和相册扫码
 				uni.scanCode({
 					success(res) {
-						that.machineCoding = res.result;
+						that.machineCoding = res.result.replace(/\s+/g, '');
 					}
 				});
 			},
@@ -76,7 +76,7 @@
 				// 允许从相机和相册扫码
 				uni.scanCode({
 					success(res) {
-						that.oldCoding = res.result;
+						that.oldCoding = res.result.replace(/\s+/g, '');
 					}
 				});
 			},
@@ -85,7 +85,7 @@
 				// 允许从相机和相册扫码
 				uni.scanCode({
 					success(res) {
-						that.coding = res.result;
+						that.coding = res.result.replace(/\s+/g, '');
 					}
 				});
 			},