<template>
		<uni-popup ref="popup" @change="change" :mask-click="false">
			<view class="popup_box">
				<view class="pop_title uni-flex space-between">
					<view class="" style="font-size: 35rpx;">
						扫描{{title}}
					</view>

					<view class="">
						<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg"
							@click="closeScanPopup()"></image>
					</view>
				</view>
				<view class="">
					<view class="">
						<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult"
							:isShowHistory="isShowHistory" :clearResult="true" :headerType="headerType"></win-com-scan>
					</view>
				</view>
			</view>
		</uni-popup>		
	<comMessage ref="comMessage"></comMessage>
</template>

<script>
	import winComScan from '@/mycomponents/scan/winComScan.vue'
	import {
		getBalanceByManagementPrecision,
	} from '@/common/balance.js';

	import {
		getPutawayJobList
	} from '@/api/request2.js';

	import {
		getListLocationTypeDesc,
		checkDirectoryItemExist,
		getDirectoryItemArray,
		getLocationTypeName,
		getInventoryStatusDesc
	} from '@/common/directory.js';
	export default {
		name: 'winScanPack',
		emits: ["getResult", "close", "getCountScanResult"],
		components: {
			winComScan
		},
		props: {
			title: {
				type: String,
				default: '箱标签'
			},
			isShowHistory: {
				type: Boolean,
				default: true
			},
			headerType: {
				type: String,
				default: "HPQ,HMQ"
			},
		},
		data() {
			return {
				show: false,
			}
		},
		created() {

		},
		methods: {
			// 弹出
			openScanPopup(){
				
				this.$refs.popup.open('bottom')
			},
			// 关闭
			closeScanPopup(content) {
				this.$refs.popup.close();
				this.$emit("close", '');
			},
			//扫描结果
			getScanResult(result) {
				this.$emit("getResult", result);
			},
			packGetFocus() {
				if (this.$refs.comscan != undefined) {
					this.$refs.comscan.getfocus();
				}
			},

			packLoseFocus() {
				if (this.$refs.comscan != undefined) {
					this.$refs.comscan.losefocus();
				}
			},
			showMessage(message, callback) {
				setTimeout(r => {
					this.packLoseFocus();
					this.$refs.comMessage.showMessage(message, callback);
				})
			},

			showErrorMessage(message, callback) {
				setTimeout(r => {
					this.packLoseFocus();
					this.$refs.comMessage.showErrorMessage(message, callback)
				})
			},

			change(e) {
				this.show = e.show
			},
			selectItem(item,index){
				
				
			}
		}
	}
</script>

<style lang="scss">
	.scroll-view {
		overflow-y: scroll;
		height: auto;
		max-height: 300rpx;
	}
</style>
