|
|
@ -1,9 +1,9 @@ |
|
|
|
<template> |
|
|
|
<view> |
|
|
|
<u-popup v-model="show" mode="bottom" :mask-close-able="false"> |
|
|
|
<u-popup v-model="show" mode="bottom"> |
|
|
|
<view class="popup_box"> |
|
|
|
<view class="pop_title uni-flex space-between"> |
|
|
|
<view class="" style="font-size: 35rpx"> 扫描{{ title }} </view> |
|
|
|
<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()"> |
|
|
@ -12,7 +12,7 @@ |
|
|
|
</view> |
|
|
|
<view class="uni-flex uni-row" |
|
|
|
style="align-items: center; background-color: #fff; margin-left: 20rpx; margin-right: 20rpx; border-radius: 8rpx"> |
|
|
|
<view class="uni-center" style="width: 25%; font-size: 32rpx; font-weight: bold"> 优先级 </view> |
|
|
|
<view class="uni-center" style="width: 25%; font-size: 32rpx; font-weight: bold"> 优先级</view> |
|
|
|
<view style="width: 100%"> |
|
|
|
<uni-data-select style="padding: 20rpx;" v-model="priorityCode" :localdata="priorityList" @change="change" |
|
|
|
:clear="false"></uni-data-select> |
|
|
@ -26,17 +26,17 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</u-popup> |
|
|
|
<com-message ref="comMessageRef" /> |
|
|
|
<com-message ref="comMessageRef"/> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
|
import { ref, getCurrentInstance, nextTick } from 'vue' |
|
|
|
import { onLoad, onNavigationBarButtonTap, onPullDownRefresh } from '@dcloudio/uni-app' |
|
|
|
import { getLabelInfo } from '@/common/label.js' |
|
|
|
import winComScan from '@/mycomponents/scan/winComScan.vue' |
|
|
|
import {ref, getCurrentInstance, nextTick} from 'vue' |
|
|
|
import {onLoad, onNavigationBarButtonTap, onPullDownRefresh} from '@dcloudio/uni-app' |
|
|
|
import {getLabelInfo} from '@/common/label.js' |
|
|
|
import winComScan from '@/mycomponents/scan/winComScan.vue' |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
const props = defineProps({ |
|
|
|
title: { |
|
|
|
type: String, |
|
|
|
default: '箱标签' |
|
|
@ -49,10 +49,11 @@ |
|
|
|
type: String, |
|
|
|
default: 'HPQ' |
|
|
|
} |
|
|
|
}) |
|
|
|
const emit = defineEmits(['close']) |
|
|
|
const show = ref(false) |
|
|
|
const priorityList = ref([ |
|
|
|
}) |
|
|
|
const emit = defineEmits(['close']) |
|
|
|
const show = ref(false) |
|
|
|
const comMessageRef = ref(null) |
|
|
|
const priorityList = ref([ |
|
|
|
{ |
|
|
|
value: 0, |
|
|
|
text: '低' |
|
|
@ -65,10 +66,10 @@ |
|
|
|
value: 2, |
|
|
|
text: '高' |
|
|
|
} |
|
|
|
]) |
|
|
|
const priorityCode = ref(1) |
|
|
|
const comscan = ref() |
|
|
|
const simulateScan = (scanMessage) => { |
|
|
|
]) |
|
|
|
const priorityCode = ref(1) |
|
|
|
const comscan = ref() |
|
|
|
const simulateScan = (scanMessage) => { |
|
|
|
getLabelInfo(scanMessage, headerType.value, (callback) => { |
|
|
|
if (callback.success) { |
|
|
|
getScanResult(callback) |
|
|
@ -76,68 +77,80 @@ |
|
|
|
showMessage(callback.message) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
const openScanPopup = () => { |
|
|
|
} |
|
|
|
const openScanPopup = () => { |
|
|
|
show.value = true |
|
|
|
setTimeout((res) => { |
|
|
|
getfocus() |
|
|
|
}, 200) |
|
|
|
} |
|
|
|
const closeScanPopup = () => { |
|
|
|
} |
|
|
|
const closeScanPopup = () => { |
|
|
|
losefocus() |
|
|
|
show.value = false |
|
|
|
emit('close', '') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const scanClick = () => { |
|
|
|
const scanClick = () => { |
|
|
|
if (comscan.value) { |
|
|
|
comscan.value.clickScanMsg() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const cancelClick = () => { |
|
|
|
const cancelClick = () => { |
|
|
|
if (comscan.value) { |
|
|
|
comscan.value.clearScanValue() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getScanResult = (result) => { |
|
|
|
const getScanResult = (result) => { |
|
|
|
if (result.success) { |
|
|
|
result.priorityCode = priorityCode.value |
|
|
|
emit('getResult', result) |
|
|
|
} else { |
|
|
|
showMessage(result.message) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getfocus = () => { |
|
|
|
const getfocus = () => { |
|
|
|
if (comscan.value) { |
|
|
|
comscan.value.getfocus() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const losefocus = () => { |
|
|
|
const losefocus = () => { |
|
|
|
if (comscan.value) { |
|
|
|
comscan.value.losefocus() |
|
|
|
} |
|
|
|
} |
|
|
|
const showMessage = (message) => { |
|
|
|
} |
|
|
|
const showMessage = (message) => { |
|
|
|
comMessageRef.value.showMessage(message) |
|
|
|
} |
|
|
|
const change = (e) => { |
|
|
|
} |
|
|
|
const change = (e) => { |
|
|
|
console.log(e) |
|
|
|
} |
|
|
|
} |
|
|
|
defineExpose({ |
|
|
|
simulateScan, |
|
|
|
openScanPopup, |
|
|
|
closeScanPopup, |
|
|
|
scanClick, |
|
|
|
cancelClick, |
|
|
|
getScanResult, |
|
|
|
getfocus, |
|
|
|
losefocus, |
|
|
|
showMessage, |
|
|
|
change |
|
|
|
}) |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
.scroll-view { |
|
|
|
.scroll-view { |
|
|
|
overflow-y: scroll; |
|
|
|
height: auto; |
|
|
|
max-height: 300rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |