|  | @@ -18,15 +18,17 @@
 | 
	
		
			
				|  |  |  		<view class="uni-common-mt" style="padding: 5px;">
 | 
	
		
			
				|  |  |  			<view class="uni-form-item uni-column">
 | 
	
		
			
				|  |  |  				<view class="uni-input-wrapper table-title">
 | 
	
		
			
				|  |  | -					<view class="tab-tr" style="width: 36%;">容器码</view>
 | 
	
		
			
				|  |  | -					<view class="tab-tr" style="width: 11%;">数量</view>
 | 
	
		
			
				|  |  | -					<view class="tab-tr-end" style="width: 16%;">状态</view>
 | 
	
		
			
				|  |  | +					<view class="tab-tr" style="width: 40%;">物料码</view>
 | 
	
		
			
				|  |  | +					<view class="tab-tr" style="width: 40%;">容器码</view>
 | 
	
		
			
				|  |  | +					<!-- <view class="tab-tr" style="width: 10%;">数量</view> -->
 | 
	
		
			
				|  |  | +					<view class="tab-tr-end" style="width: 20%;">状态</view>
 | 
	
		
			
				|  |  |  				</view>
 | 
	
		
			
				|  |  |  				<view style="min-height:400px;overflow-y:auto;max-height:400px;font-size: 13px;">
 | 
	
		
			
				|  |  |  					<view class="uni-input-wrapper table-data" v-for="(item,index) in tableData" :key="index">
 | 
	
		
			
				|  |  | -						<view class="tab-tr" style="width: 36%;">{{item.container_code}}</view>
 | 
	
		
			
				|  |  | -						<view class="tab-tr" style="width: 11%;text-align:right">{{item.num}}</view>
 | 
	
		
			
				|  |  | -						<view class="tab-tr-end" style="width: 16%;">{{item.status}}</view>
 | 
	
		
			
				|  |  | +						<view class="tab-tr" style="width: 40%;" @click="DeleteItem(item)">{{item.receipt_num}}</view>
 | 
	
		
			
				|  |  | +						<view class="tab-tr" style="width: 40%;">{{item.container_code}}</view>
 | 
	
		
			
				|  |  | +						<!-- <view class="tab-tr" style="width: 10%;text-align:right">{{item.num}}</view> -->
 | 
	
		
			
				|  |  | +						<view class="tab-tr-end" style="width: 20%;">{{item.status}}</view>
 | 
	
		
			
				|  |  |  					</view>
 | 
	
		
			
				|  |  |  				</view>
 | 
	
		
			
				|  |  |  			</view>
 | 
	
	
		
			
				|  | @@ -34,7 +36,7 @@
 | 
	
		
			
				|  |  |  		<view>
 | 
	
		
			
				|  |  |  			<!-- 提示窗示例 -->
 | 
	
		
			
				|  |  |  			<uni-popup ref="alertDialog" type="dialog">
 | 
	
		
			
				|  |  | -				<uni-popup-dialog type="info" cancelText="取消" confirmText="确定" title="提示" :content="container_code"
 | 
	
		
			
				|  |  | +				<uni-popup-dialog type="info" cancelText="取消" confirmText="确定" title="提示" :content="tips"
 | 
	
		
			
				|  |  |  					@confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
 | 
	
		
			
				|  |  |  			</uni-popup>
 | 
	
		
			
				|  |  |  		</view>
 | 
	
	
		
			
				|  | @@ -43,14 +45,33 @@
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  |  	let _this = null;
 | 
	
		
			
				|  |  |  	var reqRootUrl = plus.storage.getItem("reqRootUrl");
 | 
	
		
			
				|  |  | +	import {
 | 
	
		
			
				|  |  | +		mapGetters,
 | 
	
		
			
				|  |  | +		mapActions
 | 
	
		
			
				|  |  | +	} from 'vuex';
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	import {
 | 
	
		
			
				|  |  | +		GET_INFODATA,
 | 
	
		
			
				|  |  | +		GET_CONNECTBLEDATA
 | 
	
		
			
				|  |  | +	} from "@/store/gettersType.js";
 | 
	
		
			
				|  |  | +	import {
 | 
	
		
			
				|  |  | +		SET_CONNECTBLEDATA
 | 
	
		
			
				|  |  | +	} from '@/store/actionsType.js';
 | 
	
		
			
				|  |  | +	// #ifdef APP-PLUS
 | 
	
		
			
				|  |  | +	const modal = uni.requireNativePlugin('modal');
 | 
	
		
			
				|  |  | +	const printModule = uni.requireNativePlugin('PrintModuleCPCL');
 | 
	
		
			
				|  |  | +	// #endif
 | 
	
		
			
				|  |  | +	let print;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  	export default {
 | 
	
		
			
				|  |  |  		data() {
 | 
	
		
			
				|  |  |  			return {
 | 
	
		
			
				|  |  |  				url: '',
 | 
	
		
			
				|  |  |  				tableData: [],
 | 
	
		
			
				|  |  | -				container_code: "",
 | 
	
		
			
				|  |  | +				receipt_num: "",
 | 
	
		
			
				|  |  |  				sn: "",
 | 
	
		
			
				|  |  |  				timer: null, // 定时器
 | 
	
		
			
				|  |  | +				tips: ""
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  		methods: {
 | 
	
	
		
			
				|  | @@ -96,8 +117,8 @@
 | 
	
		
			
				|  |  |  			},
 | 
	
		
			
				|  |  |  			// TODO 已不使用 有空去掉删除相关
 | 
	
		
			
				|  |  |  			DeleteItem(item) {
 | 
	
		
			
				|  |  | -				console.log("item", item)
 | 
	
		
			
				|  |  | -				this.container_code = "确定删除容器" + item.container_code + "?";
 | 
	
		
			
				|  |  | +				this.tips = "确定打印物料码" + item.receipt_num + "?";
 | 
	
		
			
				|  |  | +				this.receipt_num = item.receipt_num;
 | 
	
		
			
				|  |  |  				this.sn = item.sn;
 | 
	
		
			
				|  |  |  				this.$refs.alertDialog.open()
 | 
	
		
			
				|  |  |  			},
 | 
	
	
		
			
				|  | @@ -106,29 +127,7 @@
 | 
	
		
			
				|  |  |  			},
 | 
	
		
			
				|  |  |  			dialogConfirm() {
 | 
	
		
			
				|  |  |  				setTimeout(() => {
 | 
	
		
			
				|  |  | -					uni.request({
 | 
	
		
			
				|  |  | -						url: reqRootUrl + '/wms/api',
 | 
	
		
			
				|  |  | -						method: 'POST',
 | 
	
		
			
				|  |  | -						headers: {
 | 
	
		
			
				|  |  | -							'Content-Type': 'application/json'
 | 
	
		
			
				|  |  | -						},
 | 
	
		
			
				|  |  | -						data: JSON.stringify({
 | 
	
		
			
				|  |  | -							"method": "GroupInventoryDelete",
 | 
	
		
			
				|  |  | -							"param": {
 | 
	
		
			
				|  |  | -								[_this.sn]: {},
 | 
	
		
			
				|  |  | -							}
 | 
	
		
			
				|  |  | -						}),
 | 
	
		
			
				|  |  | -						success: (ret) => {
 | 
	
		
			
				|  |  | -							_this.getList()
 | 
	
		
			
				|  |  | -							//处理成功逻辑
 | 
	
		
			
				|  |  | -						},
 | 
	
		
			
				|  |  | -						fail: (err) => {
 | 
	
		
			
				|  |  | -							// console.log('request fail', err);
 | 
	
		
			
				|  |  | -						},
 | 
	
		
			
				|  |  | -						complete: () => {
 | 
	
		
			
				|  |  | -							// console.log('complete');
 | 
	
		
			
				|  |  | -						}
 | 
	
		
			
				|  |  | -					})
 | 
	
		
			
				|  |  | +					this.handlePrint(this.receipt_num)
 | 
	
		
			
				|  |  |  					// 关闭窗口后,恢复默认内容
 | 
	
		
			
				|  |  |  					this.$refs.alertDialog.close()
 | 
	
		
			
				|  |  |  				}, 30)
 | 
	
	
		
			
				|  | @@ -191,7 +190,89 @@
 | 
	
		
			
				|  |  |  			isEmpty(obj) {
 | 
	
		
			
				|  |  |  				return typeof obj === undefined || obj == null || obj === "" || obj === "000000000000000000000000" || obj
 | 
	
		
			
				|  |  |  					.length === 0;
 | 
	
		
			
				|  |  | -			}
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +			// 打印机相关
 | 
	
		
			
				|  |  | +			...mapActions([SET_CONNECTBLEDATA]),
 | 
	
		
			
				|  |  | +			// 连接打印机
 | 
	
		
			
				|  |  | +			confirm_bluetooth(item) {
 | 
	
		
			
				|  |  | +				// let {
 | 
	
		
			
				|  |  | +				// 	name,
 | 
	
		
			
				|  |  | +				// 	mac
 | 
	
		
			
				|  |  | +				// } = item;
 | 
	
		
			
				|  |  | +				uni.showLoading({
 | 
	
		
			
				|  |  | +					title: "连接中...",
 | 
	
		
			
				|  |  | +					mask: true
 | 
	
		
			
				|  |  | +				})
 | 
	
		
			
				|  |  | +				let mac = item.mac;
 | 
	
		
			
				|  |  | +				try {
 | 
	
		
			
				|  |  | +					printModule.connectionBT({
 | 
	
		
			
				|  |  | +						'address': mac
 | 
	
		
			
				|  |  | +					}, result => {
 | 
	
		
			
				|  |  | +						// console.log("result ",result)
 | 
	
		
			
				|  |  | +						const msg = JSON.stringify(result);
 | 
	
		
			
				|  |  | +						this.result = JSON.parse(msg).result;
 | 
	
		
			
				|  |  | +						modal.toast({
 | 
	
		
			
				|  |  | +							message: msg,
 | 
	
		
			
				|  |  | +							duration: 6
 | 
	
		
			
				|  |  | +						});
 | 
	
		
			
				|  |  | +						uni.hideLoading()
 | 
	
		
			
				|  |  | +						printModule.setDisConnectBTListener((ret) => {
 | 
	
		
			
				|  |  | +							modal.toast({
 | 
	
		
			
				|  |  | +								message: '蓝牙断开',
 | 
	
		
			
				|  |  | +								duration: 6
 | 
	
		
			
				|  |  | +							});
 | 
	
		
			
				|  |  | +						})
 | 
	
		
			
				|  |  | +					})
 | 
	
		
			
				|  |  | +				} catch (e) {
 | 
	
		
			
				|  |  | +					console.log(e)
 | 
	
		
			
				|  |  | +				}
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			//搜索没匹配的蓝牙设备
 | 
	
		
			
				|  |  | +			search_bluetooth(address) {
 | 
	
		
			
				|  |  | +				let _this = this;
 | 
	
		
			
				|  |  | +				//检查蓝牙是否开启
 | 
	
		
			
				|  |  | +				this.$check_bluetooth_open().then(ores => {
 | 
	
		
			
				|  |  | +					if (ores) {
 | 
	
		
			
				|  |  | +						console.log(ores);
 | 
	
		
			
				|  |  | +						//搜索蓝牙
 | 
	
		
			
				|  |  | +						_this.$search_bluetooth().then(bres => {
 | 
	
		
			
				|  |  | +							console.log(bres);
 | 
	
		
			
				|  |  | +							if (bres.code) {
 | 
	
		
			
				|  |  | +								_this.$search_pipei().then(pres => {
 | 
	
		
			
				|  |  | +									console.log(pres);
 | 
	
		
			
				|  |  | +								})
 | 
	
		
			
				|  |  | +							}
 | 
	
		
			
				|  |  | +						})
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				})
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			handlePrint(code) {
 | 
	
		
			
				|  |  | +				printModule.printAreaSize({
 | 
	
		
			
				|  |  | +					'height': '500',
 | 
	
		
			
				|  |  | +					'number': '1'
 | 
	
		
			
				|  |  | +				}, result => {})
 | 
	
		
			
				|  |  | +				printModule.printBarCode({
 | 
	
		
			
				|  |  | +					'x_pos': '10',
 | 
	
		
			
				|  |  | +					'y_pos': '100',
 | 
	
		
			
				|  |  | +					'code_type': '128',
 | 
	
		
			
				|  |  | +					'ratio': '1',
 | 
	
		
			
				|  |  | +					'height': '250',
 | 
	
		
			
				|  |  | +					'width': '2',
 | 
	
		
			
				|  |  | +					'rotation': 'BARCODE',
 | 
	
		
			
				|  |  | +					'undertext': false,
 | 
	
		
			
				|  |  | +					'number': '4',
 | 
	
		
			
				|  |  | +					'offset': '5',
 | 
	
		
			
				|  |  | +					"textAlign": "right",
 | 
	
		
			
				|  |  | +					'code_data': code
 | 
	
		
			
				|  |  | +				});
 | 
	
		
			
				|  |  | +				printModule.printForm()
 | 
	
		
			
				|  |  | +				printModule.print()
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			closeBT() {
 | 
	
		
			
				|  |  | +				printModule.closeBT();
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  		},
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  </script>
 |