王志国
2 weeks ago
16 changed files with 158 additions and 152 deletions
@ -1,143 +1,156 @@ |
|||
<template> |
|||
<view> |
|||
<u-popup v-model="show" mode="bottom" :mask-close-able="false"> |
|||
<view class="popup_box"> |
|||
<view class="pop_title uni-flex space-between"> |
|||
<view class="" style="font-size: 35rpx"> 扫描{{ title }} </view> |
|||
<view> |
|||
<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=""> |
|||
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg" @click="closeScanPopup()"> |
|||
</image> |
|||
</view> |
|||
</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 style="width: 100%"> |
|||
<uni-data-select style="padding: 20rpx;" v-model="priorityCode" :localdata="priorityList" @change="change" |
|||
:clear="false"></uni-data-select> |
|||
</view> |
|||
</view> |
|||
<view class=""> |
|||
<view class=""> |
|||
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType" |
|||
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</u-popup> |
|||
<com-message ref="comMessageRef" /> |
|||
</view> |
|||
<view class=""> |
|||
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg" @click="closeScanPopup()"> |
|||
</image> |
|||
</view> |
|||
</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 style="width: 100%"> |
|||
<uni-data-select style="padding: 20rpx;" v-model="priorityCode" :localdata="priorityList" @change="change" |
|||
:clear="false"></uni-data-select> |
|||
</view> |
|||
</view> |
|||
<view class=""> |
|||
<view class=""> |
|||
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" :headerType="headerType" |
|||
:isShowHistory="isShowHistory" :clearResult="true"></win-com-scan> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</u-popup> |
|||
<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({ |
|||
title: { |
|||
type: String, |
|||
default: '箱标签' |
|||
}, |
|||
isShowHistory: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
headerType: { |
|||
type: String, |
|||
default: 'HPQ' |
|||
} |
|||
}) |
|||
const emit = defineEmits(['close']) |
|||
const show = ref(false) |
|||
const priorityList = ref([ |
|||
{ |
|||
value: 0, |
|||
text: '低' |
|||
}, |
|||
{ |
|||
value: 1, |
|||
text: '中' |
|||
}, |
|||
{ |
|||
value: 2, |
|||
text: '高' |
|||
} |
|||
]) |
|||
const priorityCode = ref(1) |
|||
const comscan = ref() |
|||
const simulateScan = (scanMessage) => { |
|||
getLabelInfo(scanMessage, headerType.value, (callback) => { |
|||
if (callback.success) { |
|||
getScanResult(callback) |
|||
} else { |
|||
showMessage(callback.message) |
|||
} |
|||
}) |
|||
} |
|||
const openScanPopup = () => { |
|||
show.value = true |
|||
setTimeout((res) => { |
|||
getfocus() |
|||
}, 200) |
|||
} |
|||
const closeScanPopup = () => { |
|||
losefocus() |
|||
show.value = false |
|||
emit('close', '') |
|||
} |
|||
const props = defineProps({ |
|||
title: { |
|||
type: String, |
|||
default: '箱标签' |
|||
}, |
|||
isShowHistory: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
headerType: { |
|||
type: String, |
|||
default: 'HPQ' |
|||
} |
|||
}) |
|||
const emit = defineEmits(['close']) |
|||
const show = ref(false) |
|||
const comMessageRef = ref(null) |
|||
const priorityList = ref([ |
|||
{ |
|||
value: 0, |
|||
text: '低' |
|||
}, |
|||
{ |
|||
value: 1, |
|||
text: '中' |
|||
}, |
|||
{ |
|||
value: 2, |
|||
text: '高' |
|||
} |
|||
]) |
|||
const priorityCode = ref(1) |
|||
const comscan = ref() |
|||
const simulateScan = (scanMessage) => { |
|||
getLabelInfo(scanMessage, headerType.value, (callback) => { |
|||
if (callback.success) { |
|||
getScanResult(callback) |
|||
} else { |
|||
showMessage(callback.message) |
|||
} |
|||
}) |
|||
} |
|||
const openScanPopup = () => { |
|||
show.value = true |
|||
setTimeout((res) => { |
|||
getfocus() |
|||
}, 200) |
|||
} |
|||
const closeScanPopup = () => { |
|||
losefocus() |
|||
show.value = false |
|||
emit('close', '') |
|||
} |
|||
|
|||
|
|||
const scanClick = () => { |
|||
if (comscan.value) { |
|||
comscan.value.clickScanMsg() |
|||
} |
|||
} |
|||
const scanClick = () => { |
|||
if (comscan.value) { |
|||
comscan.value.clickScanMsg() |
|||
} |
|||
} |
|||
|
|||
|
|||
const cancelClick = () => { |
|||
if (comscan.value) { |
|||
comscan.value.clearScanValue() |
|||
} |
|||
} |
|||
const cancelClick = () => { |
|||
if (comscan.value) { |
|||
comscan.value.clearScanValue() |
|||
} |
|||
} |
|||
|
|||
|
|||
const getScanResult = (result) => { |
|||
if (result.success) { |
|||
result.priorityCode = priorityCode.value |
|||
emit('getResult', result) |
|||
} else { |
|||
showMessage(result.message) |
|||
} |
|||
} |
|||
const getScanResult = (result) => { |
|||
if (result.success) { |
|||
result.priorityCode = priorityCode.value |
|||
emit('getResult', result) |
|||
} else { |
|||
showMessage(result.message) |
|||
} |
|||
} |
|||
|
|||
|
|||
const getfocus = () => { |
|||
if (comscan.value) { |
|||
comscan.value.getfocus() |
|||
} |
|||
} |
|||
const getfocus = () => { |
|||
if (comscan.value) { |
|||
comscan.value.getfocus() |
|||
} |
|||
} |
|||
|
|||
|
|||
const losefocus = () => { |
|||
if (comscan.value) { |
|||
comscan.value.losefocus() |
|||
} |
|||
} |
|||
const showMessage = (message) => { |
|||
comMessageRef.value.showMessage(message) |
|||
} |
|||
const change = (e) => { |
|||
console.log(e) |
|||
} |
|||
const losefocus = () => { |
|||
if (comscan.value) { |
|||
comscan.value.losefocus() |
|||
} |
|||
} |
|||
const showMessage = (message) => { |
|||
comMessageRef.value.showMessage(message) |
|||
} |
|||
const change = (e) => { |
|||
console.log(e) |
|||
} |
|||
defineExpose({ |
|||
simulateScan, |
|||
openScanPopup, |
|||
closeScanPopup, |
|||
scanClick, |
|||
cancelClick, |
|||
getScanResult, |
|||
getfocus, |
|||
losefocus, |
|||
showMessage, |
|||
change |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.scroll-view { |
|||
overflow-y: scroll; |
|||
height: auto; |
|||
max-height: 300rpx; |
|||
} |
|||
.scroll-view { |
|||
overflow-y: scroll; |
|||
height: auto; |
|||
max-height: 300rpx; |
|||
} |
|||
</style> |
Loading…
Reference in new issue