From fd73fca2d3eaf5f53e81d634ecdea408604e798f Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期四, 17 七月 2025 17:30:14 +0800
Subject: [PATCH] 核磅录入代码层次错误

---
 pages/wareHouse/nuclearScale/nuclearscalerecord.vue |  253 +++++++++++++++++++++++++-------------------------
 1 files changed, 128 insertions(+), 125 deletions(-)

diff --git a/pages/wareHouse/nuclearScale/nuclearscalerecord.vue b/pages/wareHouse/nuclearScale/nuclearscalerecord.vue
index b4b0834..09b4a22 100644
--- a/pages/wareHouse/nuclearScale/nuclearscalerecord.vue
+++ b/pages/wareHouse/nuclearScale/nuclearscalerecord.vue
@@ -267,7 +267,7 @@
 			// 妫�鏌ヨ摑鐗欒繛鎺ョ姸鎬�
 			async checkBluetoothConnection() {
 				if (!this.connectedDevice) return false;
-				
+
 				// 灏濊瘯鍙戦�佷竴涓畝鍗曞懡浠ゆ鏌ヨ繛鎺ョ姸鎬�
 				return new Promise(resolve => {
 					jcapi.checkPrinterStatus(this.connectedDevice.address, r => {
@@ -346,131 +346,133 @@
 					rwMatlBindId: item.id
 				};
 				try {
-				let res = await this.$u.api.dailyPaper.zongjianLabelInfo(params)
-				if (!res.data) {
-					this.$refs.uToast.show({
-						title: '鏈煡璇㈠埌璇ユ爣绛句俊鎭紒',
-						type: 'warning '
-					})
-					return
-				}
-				// const res = {
-				// 	ht: 'HT20250717995352665',
-				// 	lj: '88.118.1/A0611091',
-				// 	ljms: '閾滃崟绾� 瑁搁摐-TY-鍦嗗舰-3.0',
-				// 	fh: '1083.6',
-				// 	scdt: '2025-07-14 13:46:55.0',
-				// 	scph: '2025071273-3',
-				// 	fhdw: '姹熶笢鍚堥噾鎶�鏈湁闄愬叕鍙�',
-				// 	shdw: '鏄嗗北娉板痉閫氶摐涓氭湁闄愬叕鍙�',
-				// }
-				// 浠嶢PI鍝嶅簲涓彁鍙栨墍闇�鏁版嵁
-				const {
-					ht,
-					lj,
-					ljms,
-					fh,
-					scdt,
-					scph,
-					fhdw,
-					shdw
-				} = res.data
-				// const jsonString = JSON.stringify(res.data)
-
-				// 鍒濆鍖栫敾鏉�
-				jcapi.initDrawingBoard({
-					width: 70,
-					height: 49,
-					rotate: 90
-				});
-
-				// 缁樺埗浜岀淮鐮�
-				const qrContent =
-					`ht:${ht}\nlj:${lj}\nljms:${ljms}\nfh:${fh}\nscdt:${scdt}\nscph:${scph}\nfhdw:${fhdw}\nshdw:${shdw}`;
-				jcapi.drawLabelQrCode({
-					x: 43.5,
-					y: 2,
-					width: 24,
-					height: 24,
-					value: qrContent,
-					rotate: 0,
-					codeType: QrCodeType.QrCode,
-				});
-				// getDrawLabelLine	锛坸鍧愭爣锛寉鍧愭爣锛岀嚎鏉″搴︼紝绾挎潯楂樺害锛屾棆杞搴︼紝绾挎潯绫诲瀷锛�
-				// 缁樺埗妯嚎 瀹炵嚎8鏉�
-				this.getDrawLabelLine(1, 1, 67, 0.5, 0, LineType.Solid)
-				this.getDrawLabelLine(1, 6, 42, 0.3, 0, LineType.Solid)
-				this.getDrawLabelLine(1, 11, 42, 0.3, 0, LineType.Solid)
-				this.getDrawLabelLine(1, 16, 42, 0.3, 0, LineType.Solid)
-				this.getDrawLabelLine(1, 21, 42, 0.3, 0, LineType.Solid)
-				this.getDrawLabelLine(1, 27, 67, 0.3, 0, LineType.Solid)
-				this.getDrawLabelLine(1, 32, 67,0.3, 0, LineType.Solid)
-				this.getDrawLabelLine(1, 37, 67, 0.3, 0, LineType.Solid)
-				this.getDrawLabelLine(1, 42, 67, 0.3, 0, LineType.Solid)
-				this.getDrawLabelLine(1, 47, 67, 0.5, 0, LineType.Solid)
-				//缁樺埗绔栫嚎
-				this.getDrawLabelLine(1, 1, 0.5, 46, 0, LineType.Solid) // 绔栫嚎1
-				this.getDrawLabelLine(43, 1, 0.3, 26, 0, LineType.Solid) // 绔栫嚎2
-				this.getDrawLabelLine(68, 1, 0.5, 46, 0, LineType.Solid) // 绔栫嚎2
-				// getDrawLabelText	锛�1.x鍧愭爣锛�2.y鍧愭爣锛�3.鏂囨湰妗嗗搴︼紝4.鏂囨湰妗嗛珮搴︼紝5.缁樺埗鏂囧瓧鍐呭锛�6.瀛椾綋澶у皬锛堥粯璁ら珮搴�4mm锛�,7.鏃嬭浆瑙掑害,8.鎹㈣鏂瑰紡,9.饩忛棿闅�,10.瀛楅棿闅�,11.鏂囧瓧姘村钩甯冨眬,12鏂囧瓧鍨傜洿甯冨眬)
-				// 鏍囬
-				this.getDrawLabelText(3, 2.5, 40, 8, '涓ぉ绉戞妧瑁呯娓呭崟', 2.5, 0, LineModeType.AutoHeight, 0, 0, 1, 1,1)
-				// 濉啿鏂囧瓧鏍囬
-				this.getDrawLabelText(2, 7, 25, 8, '鍚堝悓鍙�:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
-				this.getDrawLabelText(2, 12, 25, 8, '闆朵欢鍙�:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
-				this.getDrawLabelText(2, 17, 25, 8, '闆朵欢鎻忚堪:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
-				this.getDrawLabelText(2, 22.5, 25, 8, '鍙戣揣/瑁呯鏁�:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
-				this.getDrawLabelText(2, 27.5, 25, 8, '鐢熶骇鏃ユ湡:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
-				this.getDrawLabelText(2, 32.5, 25, 8, '鐢熶骇鎵瑰彿:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
-				this.getDrawLabelText(2, 37.5, 25, 8, '鍙戣揣鍗曚綅:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
-				this.getDrawLabelText(2, 42.5, 25, 8, '鏀惰揣鍗曚綅:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1,1)
-				// 濉啿鍙傛暟鍊�
-				this.getDrawLabelText(11, 7, 30, 8, ht, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
-				this.getDrawLabelText(11, 12, 32, 8, lj, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
-				this.getDrawLabelText(14, 17, 30, 8, ljms, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
-				this.getDrawLabelText(17, 22.5, 27, 8, fh, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
-				this.getDrawLabelText(14, 27.5, 55, 8, scdt, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
-				this.getDrawLabelText(14, 32.5, 55, 8, scph, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
-				this.getDrawLabelText(14, 37.5,55, 8, fhdw, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
-				this.getDrawLabelText(14, 42.5, 55, 8, shdw, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0,1)
-
-				// 鐢熸垚鎵撳嵃鏁版嵁
-				let imageJsonObj = jcapi.generateLabelJson()
-				let imageJsonObj111 = jcapi.generatePrintPreviewImage(imageJsonObj)
-				console.log('棰勮', imageJsonObj111)
-				// // 璁剧疆鎵撳嵃浠诲姟
-				jcapi.startJob({
-					totalCount: 1,
-					density: this.printDensity,
-					labelType: this.labelType,
-					printMode: this.printMode,
-				}, function(r) {
-					console.log('鎵撳嵃', r)
-					if (r.code == 0) {
-						// 鎵撳嵃鏁版嵁
-						jcapi.printData(imageJsonObj, {
-							"printQuantity": 1,
-						}, function(r) {
-							if (r.code == 0) {
-								console.log("鎵撳嵃鎴愬姛")
-								uni.showToast({
-									title: '鎵撳嵃鎴愬姛',
-									icon: 'success'
-								})
-							} else {
-								console.log("鎵撳嵃澶辫触")
-								uni.showToast({
-									title: '鎵撳嵃澶辫触: ' + (r.msg || '鏈煡閿欒'),
-									icon: 'none'
-								})
-							}
+					let res = await this.$u.api.dailyPaper.zongjianLabelInfo(params)
+					if (!res.data) {
+						this.$refs.uToast.show({
+							title: '鏈煡璇㈠埌璇ユ爣绛句俊鎭紒',
+							type: 'warning '
 						})
-					} else {
-						console.log("璁剧疆鎵撳嵃浠诲姟澶辫触")
+						return
 					}
+					// const res = {
+					// 	ht: 'HT20250717995352665',
+					// 	lj: '88.118.1/A0611091',
+					// 	ljms: '閾滃崟绾� 瑁搁摐-TY-鍦嗗舰-3.0',
+					// 	fh: '1083.6',
+					// 	scdt: '2025-07-14 13:46:55.0',
+					// 	scph: '2025071273-3',
+					// 	fhdw: '姹熶笢鍚堥噾鎶�鏈湁闄愬叕鍙�',
+					// 	shdw: '鏄嗗北娉板痉閫氶摐涓氭湁闄愬叕鍙�',
+					// }
+					// 浠嶢PI鍝嶅簲涓彁鍙栨墍闇�鏁版嵁
+					const {
+						ht,
+						lj,
+						ljms,
+						fh,
+						scdt,
+						scph,
+						fhdw,
+						shdw
+					} = res.data
+					// const jsonString = JSON.stringify(res.data)
 
-				})
+					// 鍒濆鍖栫敾鏉�
+					jcapi.initDrawingBoard({
+						width: 70,
+						height: 49,
+						rotate: 90
+					});
 
+					// 缁樺埗浜岀淮鐮�
+					const qrContent =
+						`ht:${ht}\nlj:${lj}\nljms:${ljms}\nfh:${fh}\nscdt:${scdt}\nscph:${scph}\nfhdw:${fhdw}\nshdw:${shdw}`;
+					jcapi.drawLabelQrCode({
+						x: 43.5,
+						y: 2,
+						width: 24,
+						height: 24,
+						value: qrContent,
+						rotate: 0,
+						codeType: QrCodeType.QrCode,
+					});
+					// getDrawLabelLine	锛坸鍧愭爣锛寉鍧愭爣锛岀嚎鏉″搴︼紝绾挎潯楂樺害锛屾棆杞搴︼紝绾挎潯绫诲瀷锛�
+					// 缁樺埗妯嚎 瀹炵嚎8鏉�
+					this.getDrawLabelLine(1, 1, 67, 0.5, 0, LineType.Solid)
+					this.getDrawLabelLine(1, 6, 42, 0.3, 0, LineType.Solid)
+					this.getDrawLabelLine(1, 11, 42, 0.3, 0, LineType.Solid)
+					this.getDrawLabelLine(1, 16, 42, 0.3, 0, LineType.Solid)
+					this.getDrawLabelLine(1, 21, 42, 0.3, 0, LineType.Solid)
+					this.getDrawLabelLine(1, 27, 67, 0.3, 0, LineType.Solid)
+					this.getDrawLabelLine(1, 32, 67, 0.3, 0, LineType.Solid)
+					this.getDrawLabelLine(1, 37, 67, 0.3, 0, LineType.Solid)
+					this.getDrawLabelLine(1, 42, 67, 0.3, 0, LineType.Solid)
+					this.getDrawLabelLine(1, 47, 67, 0.5, 0, LineType.Solid)
+					//缁樺埗绔栫嚎
+					this.getDrawLabelLine(1, 1, 0.5, 46, 0, LineType.Solid) // 绔栫嚎1
+					this.getDrawLabelLine(43, 1, 0.3, 26, 0, LineType.Solid) // 绔栫嚎2
+					this.getDrawLabelLine(68, 1, 0.5, 46, 0, LineType.Solid) // 绔栫嚎2
+					// getDrawLabelText	锛�1.x鍧愭爣锛�2.y鍧愭爣锛�3.鏂囨湰妗嗗搴︼紝4.鏂囨湰妗嗛珮搴︼紝5.缁樺埗鏂囧瓧鍐呭锛�6.瀛椾綋澶у皬锛堥粯璁ら珮搴�4mm锛�,7.鏃嬭浆瑙掑害,8.鎹㈣鏂瑰紡,9.饩忛棿闅�,10.瀛楅棿闅�,11.鏂囧瓧姘村钩甯冨眬,12鏂囧瓧鍨傜洿甯冨眬)
+					// 鏍囬
+					this.getDrawLabelText(3, 2.5, 40, 8, '涓ぉ绉戞妧瑁呯娓呭崟', 2.5, 0, LineModeType.AutoHeight, 0, 0, 1, 1, 1)
+					// 濉啿鏂囧瓧鏍囬
+					this.getDrawLabelText(2, 7, 25, 8, '鍚堝悓鍙�:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1, 1)
+					this.getDrawLabelText(2, 12, 25, 8, '闆朵欢鍙�:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1, 1)
+					this.getDrawLabelText(2, 17, 25, 8, '闆朵欢鎻忚堪:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1, 1)
+					this.getDrawLabelText(2, 22.5, 25, 8, '鍙戣揣/瑁呯鏁�:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1, 1)
+					this.getDrawLabelText(2, 27.5, 25, 8, '鐢熶骇鏃ユ湡:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1, 1)
+					this.getDrawLabelText(2, 32.5, 25, 8, '鐢熶骇鎵瑰彿:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1, 1)
+					this.getDrawLabelText(2, 37.5, 25, 8, '鍙戣揣鍗曚綅:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1, 1)
+					this.getDrawLabelText(2, 42.5, 25, 8, '鏀惰揣鍗曚綅:', 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 1, 1)
+					// 濉啿鍙傛暟鍊�
+					this.getDrawLabelText(11, 7, 30, 8, ht, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0, 1)
+					this.getDrawLabelText(11, 12, 32, 8, lj, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0, 1)
+					this.getDrawLabelText(14, 17, 30, 8, ljms, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0, 1)
+					this.getDrawLabelText(17, 22.5, 27, 8, fh, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0, 1)
+					this.getDrawLabelText(14, 27.5, 55, 8, scdt, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0, 1)
+					this.getDrawLabelText(14, 32.5, 55, 8, scph, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0, 1)
+					this.getDrawLabelText(14, 37.5, 55, 8, fhdw, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0, 1)
+					this.getDrawLabelText(14, 42.5, 55, 8, shdw, 2.5, 0, LineModeType.AutoHeight, 0, 0, 0, 0, 1)
+
+					// 鐢熸垚鎵撳嵃鏁版嵁
+					let imageJsonObj = jcapi.generateLabelJson()
+					let imageJsonObj111 = jcapi.generatePrintPreviewImage(imageJsonObj)
+					console.log('棰勮', imageJsonObj111)
+					// // 璁剧疆鎵撳嵃浠诲姟
+					jcapi.startJob({
+						totalCount: 1,
+						density: this.printDensity,
+						labelType: this.labelType,
+						printMode: this.printMode,
+					}, function(r) {
+						console.log('鎵撳嵃', r)
+						if (r.code == 0) {
+							// 鎵撳嵃鏁版嵁
+							jcapi.printData(imageJsonObj, {
+								"printQuantity": 1,
+							}, function(r) {
+								if (r.code == 0) {
+									console.log("鎵撳嵃鎴愬姛")
+									uni.showToast({
+										title: '鎵撳嵃鎴愬姛',
+										icon: 'success'
+									})
+								} else {
+									console.log("鎵撳嵃澶辫触")
+									uni.showToast({
+										title: '鎵撳嵃澶辫触: ' + (r.msg || '鏈煡閿欒'),
+										icon: 'none'
+									})
+								}
+							})
+						} else {
+							console.log("璁剧疆鎵撳嵃浠诲姟澶辫触")
+						}
+
+					})
+				} catch (error) {
+					console.log(error)
+				}
 			},
 			tapQuery(item) {
 				this.maskShow = false
@@ -517,7 +519,8 @@
 							// 鎼滅储鍒拌澶囧洖璋�
 							uni.hideLoading()
 							// 濡傛灉涔嬪墠鏈夎繛鎺ョ殑璁惧浣嗕笉鍦ㄦ悳绱㈢粨鏋滀腑锛岃鏄庤澶囧凡鏇存崲
-							if (_this.connectedDevice && !r.some(dev => dev.address === _this.connectedDevice.address)) {
+							if (_this.connectedDevice && !r.some(dev => dev.address === _this
+									.connectedDevice.address)) {
 								_this.connectedDevice = null;
 								uni.showToast({
 									icon: 'none',
@@ -552,7 +555,7 @@
 			},
 			// 濉啿鏂囧瓧鏍囬
 			getDrawLabelText(x, y, width, height, value, fontSize, rotate, lineMode, lineSpace, letterSpace,
-				textAlignHorizontal, textAlignVertical,bold) {
+				textAlignHorizontal, textAlignVertical, bold) {
 
 				jcapi.drawLabelText({
 					x: x,
@@ -567,7 +570,7 @@
 					letterSpace: letterSpace,
 					textAlignHorizontal: textAlignHorizontal,
 					textAlignVertical: textAlignVertical,
-					bold:bold
+					bold: bold
 				})
 			},
 

--
Gitblit v1.9.3