| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <template>
- <div class="picking-no-container">
- <van-dialog v-model:show="pickingNoTrueFalseBy"
- :beforeClose="beforeClose"
- title="拣货任务号" show-cancel-button>
- <van-field class="code-input"
- v-model="pickingCode"
- ref="pickingNoRef"
- clearable
- @keydown.enter="onKeydown"
- placeholder="请扫描拣货任务号" />
- </van-dialog>
- </div>
- </template>
- <script setup lang="ts">
- import { ref } from 'vue'
- import { showToast } from 'vant'
- const store = useStore()
- const warehouse = store.warehouse
- import { useStore } from '@/store/modules/user'
- const pickingNoTrueFalseBy=ref(false)
- const pickingNoRef=ref(null)
- const pickingCode=ref('');
- const show = () => {
- pickingNoTrueFalseBy.value = true
- pickingCode.value=''
- setTimeout(()=>{
- pickingNoRef.value.focus()
- },300)
- }
- //输入拣货任务号查询任务
- const emit = defineEmits()
- const beforeClose= (action) =>
- new Promise(async (resolve) => {
- if (action === 'confirm') {
- if (pickingCode.value == '') {
- showToast('请输入拣货任务号')
- return resolve(false)
- }
- emit('loadData', pickingCode.value)
- // const { taskList } = await getPickingTask(warehouse, pickingCode.value)
- // if (taskList.value.length > 0) {
- //
- // resolve(true)
- // } else {
- // showToast('当前拣货任务号暂未查询到任务,请重新输入')
- // return resolve(false)
- // }
- }
- resolve(true)
- });
- const onKeydown=()=>{
- setTimeout(()=>{
- pickingNoRef.value.blur()
- },300)
- }
- defineExpose({show})
- </script>
- <style scoped lang="sass">
- .picking-no-container
- .code-input
- font-size: 22px
- font-weight: bold
- border-bottom: 2px solid #0077ff
- </style>
|