| | |
| | | import type { VxeTableGridOptions } from '#/adapter/vxe-table'; |
| | | import type { MesWmStockTakingResultApi } from '#/api/mes/wm/stocktaking/task/result'; |
| | | |
| | | import { computed } from 'vue'; |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { useVbenModal } from '@vben/common-ui'; |
| | | |
| | | import { message } from 'ant-design-vue'; |
| | | import { Button, Input, InputNumber, message } from 'ant-design-vue'; |
| | | |
| | | import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; |
| | | import { scanStockTaking } from '#/api/mes/wm/stocktaking/task'; |
| | | import { |
| | | deleteStockTakingResult, |
| | | getStockTakingResultPage, |
| | |
| | | }>(); |
| | | |
| | | const isExecute = computed(() => props.formType === 'execute'); // 执行盘点态可维护盘点结果 |
| | | |
| | | // PDA 扫码盘点输入 |
| | | const scanCode = ref(''); |
| | | const takingQuantity = ref<number | undefined>(undefined); |
| | | const scanning = ref(false); |
| | | |
| | | /** 扫码盘点 */ |
| | | async function handleScan() { |
| | | if (!scanCode.value) { |
| | | message.warning('请输入追溯码/袋码/托盘码/批次号'); |
| | | return; |
| | | } |
| | | if (takingQuantity.value === undefined || takingQuantity.value === null) { |
| | | message.warning('请输入盘点数量'); |
| | | return; |
| | | } |
| | | scanning.value = true; |
| | | try { |
| | | const resultId = await scanStockTaking({ |
| | | taskId: props.taskId, |
| | | scanCode: scanCode.value, |
| | | takingQuantity: takingQuantity.value, |
| | | }); |
| | | message.success(`扫码成功,盘点结果编号:${resultId}`); |
| | | scanCode.value = ''; |
| | | takingQuantity.value = undefined; |
| | | handleRefresh(); |
| | | } finally { |
| | | scanning.value = false; |
| | | } |
| | | } |
| | | |
| | | const [ResultFormModal, resultFormModalApi] = useVbenModal({ |
| | | connectedComponent: ResultForm, |
| | |
| | | <template> |
| | | <div> |
| | | <ResultFormModal @success="handleRefresh" /> |
| | | <!-- PDA 扫码盘点 --> |
| | | <div |
| | | v-if="isExecute" |
| | | class="mb-3 flex flex-wrap items-center gap-2 rounded-md border border-dashed border-yellow-300 bg-yellow-50 px-3 py-2" |
| | | > |
| | | <span class="font-medium text-yellow-700">PDA 扫码盘点:</span> |
| | | <Input |
| | | v-model:value="scanCode" |
| | | allow-clear |
| | | class="!w-56" |
| | | placeholder="追溯码/袋码/托盘码/批次号" |
| | | @press-enter="handleScan" |
| | | /> |
| | | <InputNumber |
| | | v-model:value="takingQuantity" |
| | | :min="0" |
| | | :precision="2" |
| | | class="!w-32" |
| | | placeholder="盘点数量" |
| | | @press-enter="handleScan" |
| | | /> |
| | | <Button |
| | | type="primary" |
| | | :loading="scanning" |
| | | @click="handleScan" |
| | | > |
| | | 扫码盘点 |
| | | </Button> |
| | | </div> |
| | | <Grid table-title="盘点结果"> |
| | | <template v-if="isExecute" #toolbar-tools> |
| | | <TableAction |