|  |  |  | @ -4,12 +4,16 @@ | 
		
	
		
			
				|  |  |  |  | 			<!-- 导航栏 --> | 
		
	
		
			
				|  |  |  |  | 			<view v-if="showPop"> | 
		
	
		
			
				|  |  |  |  | 				<view > | 
		
	
		
			
				|  |  |  |  | 					<text class="font-sm text-secondary px-3 py-2">ilsApi地址</text> | 
		
	
		
			
				|  |  |  |  | 					<input type="text" class="font-md border bg-white px-3" placeholder="请填写ilsApi地址" style="height: 100rpx;" v-model="ilsApi"/> | 
		
	
		
			
				|  |  |  |  | 					<text class="font-sm text-secondary px-3 py-2">ilsApi地址IP+端口</text> | 
		
	
		
			
				|  |  |  |  | 					<input type="text" class="font-md border bg-white px-3" placeholder="请填写ilsApi地址IP+端口" style="height: 100rpx;" v-model="ilsApi"/> | 
		
	
		
			
				|  |  |  |  | 				</view> | 
		
	
		
			
				|  |  |  |  | 				<view > | 
		
	
		
			
				|  |  |  |  | 					<text class="font-sm text-secondary px-3 py-2">打印机IP</text> | 
		
	
		
			
				|  |  |  |  | 					<input type="text" class="font-md border bg-white px-3" placeholder="请填写ilsApi地址" style="height: 100rpx;" v-model="printIp"/> | 
		
	
		
			
				|  |  |  |  | 					<text class="font-sm text-secondary px-3 py-2">打印机地址IP</text> | 
		
	
		
			
				|  |  |  |  | 					<input type="text" class="font-md border bg-white px-3" placeholder="请填写打印机地址IP" style="height: 100rpx;" v-model="printIp"/> | 
		
	
		
			
				|  |  |  |  | 				</view> | 
		
	
		
			
				|  |  |  |  | 				<view > | 
		
	
		
			
				|  |  |  |  | 					<text class="font-sm text-secondary px-3 py-2">打印机名称</text> | 
		
	
		
			
				|  |  |  |  | 					<input type="text" class="font-md border bg-white px-3" placeholder="请填写打印机名称" style="height: 100rpx;" v-model="printName"/> | 
		
	
		
			
				|  |  |  |  | 				</view> | 
		
	
		
			
				|  |  |  |  | 				<view > | 
		
	
		
			
				|  |  |  |  | 				        <button class="systemSty" @tap="cancelAdd">取消</button> | 
		
	
	
		
			
				
					|  |  |  | @ -27,7 +31,8 @@ | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | <script> | 
		
	
		
			
				|  |  |  |  | 	import scanCode from "@/components/scan-code/scan-code.vue"; | 
		
	
		
			
				|  |  |  |  | 	import { getCLodop } from '@/common/print/CLodopfuncs.js'; | 
		
	
		
			
				|  |  |  |  | 	// import { getCLodop } from '@/common/print/CLodopfuncs.js'; | 
		
	
		
			
				|  |  |  |  | 	// import { getPrinterList } from '@/common/print/CLodopfuncs.js'; | 
		
	
		
			
				|  |  |  |  | 	const printPdf = uni.requireNativePlugin('YanYu-PrintPDF'); | 
		
	
		
			
				|  |  |  |  | 	 | 
		
	
		
			
				|  |  |  |  | 	export default { | 
		
	
	
		
			
				
					|  |  |  | @ -35,9 +40,12 @@ | 
		
	
		
			
				|  |  |  |  | 			return { | 
		
	
		
			
				|  |  |  |  | 				codes: undefined, | 
		
	
		
			
				|  |  |  |  | 				showPop: false, | 
		
	
		
			
				|  |  |  |  | 				selectClassEnd:[], | 
		
	
		
			
				|  |  |  |  | 				httpRoot: 'http://', | 
		
	
		
			
				|  |  |  |  | 				ilsApi: '192.168.1.56:9090', | 
		
	
		
			
				|  |  |  |  | 				printIp: '192.168.1.26', | 
		
	
		
			
				|  |  |  |  | 				printIp: '192.168.1.56', | 
		
	
		
			
				|  |  |  |  | 				serviceApi: ':8080/ilsApp/print', | 
		
	
		
			
				|  |  |  |  | 				printName: 'Xprinter', | 
		
	
		
			
				|  |  |  |  | 				onLoad(option) { | 
		
	
		
			
				|  |  |  |  | 					this.$broadcastScan.init(this.getScancode); | 
		
	
		
			
				|  |  |  |  | 				}, | 
		
	
	
		
			
				
					|  |  |  | @ -55,8 +63,11 @@ | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | 		methods: { | 
		
	
		
			
				|  |  |  |  | 			pdaSystemInit: function(){ | 
		
	
		
			
				|  |  |  |  | 				this.showPop = true;	 | 
		
	
		
			
				|  |  |  |  | 				this.showPop = true; | 
		
	
		
			
				|  |  |  |  | 			}, | 
		
	
		
			
				|  |  |  |  | 			selectClass(event){ | 
		
	
		
			
				|  |  |  |  | 			      | 
		
	
		
			
				|  |  |  |  | 			     }, | 
		
	
		
			
				|  |  |  |  | 			confirmAdd() { | 
		
	
		
			
				|  |  |  |  | 				//确认 | 
		
	
		
			
				|  |  |  |  | 				this.showPop = false; | 
		
	
	
		
			
				
					|  |  |  | @ -75,30 +86,18 @@ | 
		
	
		
			
				|  |  |  |  |                 console.log("doPrinter orderCoder: " + orderCoder); | 
		
	
		
			
				|  |  |  |  | 				console.log("ilsApi:", this.ilsApi); | 
		
	
		
			
				|  |  |  |  | 				console.log("printIp:", this.printIp); | 
		
	
		
			
				|  |  |  |  | 				// LODOP.PRINT_INIT(null, "192.168.1.26"); | 
		
	
		
			
				|  |  |  |  | 				// LODOP.SET_PRINTER_INDEX(-1); | 
		
	
		
			
				|  |  |  |  | 				// LODOP.PRINT_INITA(0, 0, "100mm", "150mm", "100X150"); | 
		
	
		
			
				|  |  |  |  | 				// LODOP.SET_PRINT_PAGESIZE(1, "100mm", "150mm", ""); | 
		
	
		
			
				|  |  |  |  | 				// LODOP.SET_PRINT_MODE("POS_BASEON_PAPER", true); | 
		
	
		
			
				|  |  |  |  | 				// //LODOP.ADD_PRINT_HTM(10, 20, "100mm", "150mm", "<img src="+this.imageData+" style=\"width: 100mm; height: 100mm;\"/>"); | 
		
	
		
			
				|  |  |  |  | 				// LODOP.ADD_PRINT_PDF(0, 0, "100mm", "150mm", this.imgePdfData); | 
		
	
		
			
				|  |  |  |  | 				// LODOP.PRINT(); | 
		
	
		
			
				|  |  |  |  | 			 | 
		
	
		
			
				|  |  |  |  | 				uni.request({ | 
		
	
		
			
				|  |  |  |  | 				    url: this.httpRoot + this.ilsApi + '/jeecg-boot/front/getOrderPayStateAndPdfBase64?OrderId=' + orderCoder, | 
		
	
		
			
				|  |  |  |  | 					method: 'GET', | 
		
	
		
			
				|  |  |  |  | 				    url: this.httpRoot + this.printIp + this.serviceApi,	 | 
		
	
		
			
				|  |  |  |  | 					method: 'POST', | 
		
	
		
			
				|  |  |  |  | 					data: { | 
		
	
		
			
				|  |  |  |  | 							ilsApi: this.ilsApi, | 
		
	
		
			
				|  |  |  |  | 							printIp: this.printIp, | 
		
	
		
			
				|  |  |  |  | 							orderId: orderCoder, | 
		
	
		
			
				|  |  |  |  | 							printName: this.printName | 
		
	
		
			
				|  |  |  |  | 						}, | 
		
	
		
			
				|  |  |  |  | 				    success: (res) => { | 
		
	
		
			
				|  |  |  |  | 				        console.log( res.data.result); | 
		
	
		
			
				|  |  |  |  | 				        console.log( res); | 
		
	
		
			
				|  |  |  |  | 						if(res.data.code==200){ | 
		
	
		
			
				|  |  |  |  | 							let LODOP = getCLodop(); | 
		
	
		
			
				|  |  |  |  | 							LODOP.PRINT_INIT(null, this.printIp); | 
		
	
		
			
				|  |  |  |  | 							LODOP.SET_PRINTER_INDEX(-1); | 
		
	
		
			
				|  |  |  |  | 							LODOP.PRINT_INITA(2, 0, "100mm", "150mm", "100X150"); | 
		
	
		
			
				|  |  |  |  | 							LODOP.SET_PRINT_PAGESIZE(1, "100mm", "150mm", ""); | 
		
	
		
			
				|  |  |  |  | 							LODOP.SET_PRINT_MODE("POS_BASEON_PAPER", true); | 
		
	
		
			
				|  |  |  |  | 							// LODOP.ADD_PRINT_HTM(2, 0, "100mm", "150mm", "<img src="+ this.imgBase64Root + res.data.message+" style=\"width: 100mm; height: 100mm;\"/>"); | 
		
	
		
			
				|  |  |  |  | 							LODOP.ADD_PRINT_PDF(0, 0, "100mm", "150mm", res.data.result); | 
		
	
		
			
				|  |  |  |  | 							LODOP.PRINT(); | 
		
	
		
			
				|  |  |  |  | 							uni.showToast({ | 
		
	
		
			
				|  |  |  |  | 								title: '面单下发成功.正在打印,请稍候...', | 
		
	
		
			
				|  |  |  |  | 								icon: 'none', | 
		
	
	
		
			
				
					|  |  |  | @ -127,49 +126,55 @@ | 
		
	
		
			
				|  |  |  |  | 				uni.$on('scancodedate', function(data) { | 
		
	
		
			
				|  |  |  |  | 					console.log('你想要的code:', data.code); | 
		
	
		
			
				|  |  |  |  | 					_this.codes = data.code; | 
		
	
		
			
				|  |  |  |  | 					this.showPop = false; | 
		
	
		
			
				|  |  |  |  | 					_this.showPop = false; | 
		
	
		
			
				|  |  |  |  | 					let orderCoder = data.code; | 
		
	
		
			
				|  |  |  |  | 					console.log("onShow orderCoder: " + orderCoder); | 
		
	
		
			
				|  |  |  |  | 					console.log("ilsApi:", _this.ilsApi); | 
		
	
		
			
				|  |  |  |  | 					console.log("printIp:", _this.printIp); | 
		
	
		
			
				|  |  |  |  | 					//orderCoder = "SF1642682535344"; | 
		
	
		
			
				|  |  |  |  | 					uni.request({ | 
		
	
		
			
				|  |  |  |  | 					    url: _this.httpRoot + _this.ilsApi + '/jeecg-boot/front/getOrderPayStateAndPdfBase64?OrderId=' + orderCoder, | 
		
	
		
			
				|  |  |  |  | 						method: 'GET', | 
		
	
		
			
				|  |  |  |  | 					    success: (res) => { | 
		
	
		
			
				|  |  |  |  | 					        console.log( res.data.result); | 
		
	
		
			
				|  |  |  |  | 							if(res.data.code==200){ | 
		
	
		
			
				|  |  |  |  | 								let LODOP = getCLodop(); | 
		
	
		
			
				|  |  |  |  | 								LODOP.PRINT_INIT(null, _this.printIp); | 
		
	
		
			
				|  |  |  |  | 								LODOP.SET_PRINTER_INDEX(-1); | 
		
	
		
			
				|  |  |  |  | 								LODOP.PRINT_INITA(2, 0, "100mm", "150mm", "100X150"); | 
		
	
		
			
				|  |  |  |  | 								LODOP.SET_PRINT_PAGESIZE(1, "100mm", "150mm", ""); | 
		
	
		
			
				|  |  |  |  | 								LODOP.SET_PRINT_MODE("POS_BASEON_PAPER", true); | 
		
	
		
			
				|  |  |  |  | 								// LODOP.ADD_PRINT_HTM(2, 0, "100mm", "150mm", "<img src="+ this.imgBase64Root + res.data.message+" style=\"width: 100mm; height: 100mm;\"/>"); | 
		
	
		
			
				|  |  |  |  | 								LODOP.ADD_PRINT_PDF(0, 0, "100mm", "150mm", res.data.result); | 
		
	
		
			
				|  |  |  |  | 								LODOP.PRINT(); | 
		
	
		
			
				|  |  |  |  | 					console.log("serviceApi:", _this.httpRoot + _this.printIp + _this.serviceApi); | 
		
	
		
			
				|  |  |  |  | 					if(orderCoder.length>18){ | 
		
	
		
			
				|  |  |  |  | 						//orderCoder = "SF1642682535344"; | 
		
	
		
			
				|  |  |  |  | 						uni.request({ | 
		
	
		
			
				|  |  |  |  | 							url: _this.httpRoot + _this.printIp + _this.serviceApi, | 
		
	
		
			
				|  |  |  |  | 							method: 'POST', | 
		
	
		
			
				|  |  |  |  | 							data: { | 
		
	
		
			
				|  |  |  |  | 									ilsApi: _this.ilsApi, | 
		
	
		
			
				|  |  |  |  | 									printIp: _this.printIp, | 
		
	
		
			
				|  |  |  |  | 									orderId: orderCoder, | 
		
	
		
			
				|  |  |  |  | 									printName: _this.printName | 
		
	
		
			
				|  |  |  |  | 								}, | 
		
	
		
			
				|  |  |  |  | 							success: (res) => { | 
		
	
		
			
				|  |  |  |  | 								console.log( res); | 
		
	
		
			
				|  |  |  |  | 								if(res.data.code==200){ | 
		
	
		
			
				|  |  |  |  | 									uni.showToast({ | 
		
	
		
			
				|  |  |  |  | 										title: '下发成功.正在打印,请稍候...', | 
		
	
		
			
				|  |  |  |  | 										icon: 'none', | 
		
	
		
			
				|  |  |  |  | 										duration: 3000 | 
		
	
		
			
				|  |  |  |  | 									}); | 
		
	
		
			
				|  |  |  |  | 								}else{ | 
		
	
		
			
				|  |  |  |  | 									uni.showToast({ | 
		
	
		
			
				|  |  |  |  | 										title: res.data.message, | 
		
	
		
			
				|  |  |  |  | 										icon: 'none', | 
		
	
		
			
				|  |  |  |  | 										duration: 3000 | 
		
	
		
			
				|  |  |  |  | 									}) | 
		
	
		
			
				|  |  |  |  | 								} | 
		
	
		
			
				|  |  |  |  | 							}, | 
		
	
		
			
				|  |  |  |  | 							fail: (error) => { | 
		
	
		
			
				|  |  |  |  | 								console.log("error: ", error); | 
		
	
		
			
				|  |  |  |  | 								uni.showToast({ | 
		
	
		
			
				|  |  |  |  | 									title: '下发成功.正在打印,请稍候...', | 
		
	
		
			
				|  |  |  |  | 									title: '接口访问异常,打印失败', | 
		
	
		
			
				|  |  |  |  | 									icon: 'none', | 
		
	
		
			
				|  |  |  |  | 									duration: 3000 | 
		
	
		
			
				|  |  |  |  | 								}); | 
		
	
		
			
				|  |  |  |  | 							}else{ | 
		
	
		
			
				|  |  |  |  | 								uni.showToast({ | 
		
	
		
			
				|  |  |  |  | 								    title: res.data.message, | 
		
	
		
			
				|  |  |  |  | 								    icon: 'none', | 
		
	
		
			
				|  |  |  |  | 								    duration: 3000 | 
		
	
		
			
				|  |  |  |  | 								}) | 
		
	
		
			
				|  |  |  |  | 							} | 
		
	
		
			
				|  |  |  |  | 					    }, | 
		
	
		
			
				|  |  |  |  | 						fail: (error) => { | 
		
	
		
			
				|  |  |  |  | 							console.log("error: ", error); | 
		
	
		
			
				|  |  |  |  | 							uni.showToast({ | 
		
	
		
			
				|  |  |  |  | 							    title: '接口访问异常,打印失败', | 
		
	
		
			
				|  |  |  |  | 							    icon: 'none', | 
		
	
		
			
				|  |  |  |  | 							    duration: 3000 | 
		
	
		
			
				|  |  |  |  | 							}) | 
		
	
		
			
				|  |  |  |  | 						}, | 
		
	
		
			
				|  |  |  |  | 					}); | 
		
	
		
			
				|  |  |  |  | 							}, | 
		
	
		
			
				|  |  |  |  | 						}); | 
		
	
		
			
				|  |  |  |  | 					}else{ | 
		
	
		
			
				|  |  |  |  | 						uni.showToast({ | 
		
	
		
			
				|  |  |  |  | 								title: '非法单号', | 
		
	
		
			
				|  |  |  |  | 								icon: 'none', | 
		
	
		
			
				|  |  |  |  | 								duration: 3000 | 
		
	
		
			
				|  |  |  |  | 						}) | 
		
	
		
			
				|  |  |  |  | 					} | 
		
	
		
			
				|  |  |  |  | 				}) | 
		
	
		
			
				|  |  |  |  | 			}, | 
		
	
		
			
				|  |  |  |  | 			getScancode(code) { | 
		
	
	
		
			
				
					|  |  |  | 
 |