From e1e0d48eb7ab2b305e6062f23610f8be9db3bed6 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期六, 29 八月 2026 13:46:26 +0800
Subject: [PATCH] feat(wms): 新增库存汇总统计与预警功能
---
src/views/wls/stocktaking/task/modules/result-list.vue | 65 +++++++++++++++++++++++++++++++-
1 files changed, 63 insertions(+), 2 deletions(-)
diff --git a/src/views/wls/stocktaking/task/modules/result-list.vue b/src/views/wls/stocktaking/task/modules/result-list.vue
index 0e9c315..b253a77 100644
--- a/src/views/wls/stocktaking/task/modules/result-list.vue
+++ b/src/views/wls/stocktaking/task/modules/result-list.vue
@@ -2,13 +2,14 @@
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,
@@ -24,6 +25,37 @@
}>();
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,
@@ -95,6 +127,35 @@
<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
--
Gitblit v1.9.3