You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
1.7 KiB

10 months ago
<template>
<view class="">
<uni-popup ref="popup" @change="change">
<view class="popup_box">
<view class="pop_title uni-flex space-between">
<view class="">
扫描{{title}}
</view>
<view class="">
<image class=" icons_scan_close" src="/static/icons/icons_scan_close.svg"
@click="closeScanPopup()"></image>
</view>
</view>
<view class="">
<view class="">
<win-com-scan ref="scan" @getResult="getScanResult" :placeholder='title' :clearResult="false" :isShowHistory="false">
</win-com-scan>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import winComScan from '@/mycomponents/scan/winComScan.vue'
export default {
name: 'winScanJobNumber',
components: {
winComScan
},
props: {
title: {
type: String,
default: ''
},
isShowRecord: {
type: Boolean,
default: true
}
},
data() {
return {
code: '',
isShow: false,
expand: false,
scanList: [],
expendIcon: 'arrow-down'
}
},
created() {
},
methods: {
openScanPopup() {
this.$refs.popup.open('bottom')
},
closeScanPopup() {
this.$refs.popup.close()
},
getfocus() {
if (this.isShow) {
this.$refs.scan.getfocus()
}
},
scanClick() {
this.$refs.scan.handelScanMsg();
},
cancelClick() {
this.$refs.scan.clearScanValue();
},
getScanResult(result) {
if (result.label.barType === 'BarCode') {
this.code = result.label.code;
}
this.callBack();
},
callBack() {
this.$refs.scan.clear();
this.$emit("getScanCode", this.code);
},
change(e) {
this.isShow = e.show
}
}
}
</script>
<style>
</style>