From c32d6effb4312d8964d24ad90527df184c2361db Mon Sep 17 00:00:00 2001 From: liufumingren Date: Thu, 30 Apr 2026 06:55:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(receiving):=20=E6=96=B0=E5=A2=9E=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E5=AE=A1=E6=A0=B8=E3=80=81=E6=89=B9=E9=87=8F=E9=A9=B3?= =?UTF-8?q?=E5=9B=9E=E5=8A=9F=E8=83=BD=E5=8F=8A=E5=AE=A1=E6=A0=B8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/storage_receiving/receiving.ts | 26 +++++ src/views/storage/receiving/index.vue | 102 ++++++++++++++++++ .../storage/receiving/receiving-config.ts | 1 + 3 files changed, 129 insertions(+) diff --git a/src/api/storage_receiving/receiving.ts b/src/api/storage_receiving/receiving.ts index 05e4c861..13659ae4 100644 --- a/src/api/storage_receiving/receiving.ts +++ b/src/api/storage_receiving/receiving.ts @@ -55,6 +55,32 @@ export function batchCancelReceiving(data: any): Promise { }) } +export function reviewReceiving(data: any): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.receiving.reviewReceiving', + v, + timestamp: new Date().getTime() + }, + data: data + }) +} + +export function rejectReceiving(data: any): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.receiving.rejectReceiving', + v, + timestamp: new Date().getTime() + }, + data: data + }) +} + // export function exportReceiving(data: any): Promise { // return request({ // url: '/system', diff --git a/src/views/storage/receiving/index.vue b/src/views/storage/receiving/index.vue index f4a7872e..932c0ca0 100644 --- a/src/views/storage/receiving/index.vue +++ b/src/views/storage/receiving/index.vue @@ -19,6 +19,8 @@ 完成收货 批量作废 + 批量驳回 + 批量审核 快捷入库 @@ -65,6 +67,12 @@ + + + + + + + + + + + + @@ -1113,6 +1139,82 @@ async function confirmBatchCancel() { } } +// 审核收货单相关 +const reviewLoading = ref(false) + +async function handleReviewReceiving() { + if (!selectionRows.value.length) { + ElMessage.warning('请先选择要审核的收货单') + return + } + + try { + await ElMessageBox.confirm( + `确定要批量审核 ${selectionRows.value.length} 个收货单吗?`, + '确认审核', + { type: 'warning' } + ) + } catch { + return + } + + reviewLoading.value = true + try { + const ids = selectionRows.value.map(row => row.id) + const res: any = await receivingApi.reviewReceiving({ ids }) + if (res && res.code === 200) { + ElMessage.success(`已成功审核 ${res.data?.count ?? ids.length} 个收货单`) + selectionRows.value = [] + loadData() + } else { + ElMessage.error(res?.message || '批量审核失败') + } + } catch (e) { + console.error('批量审核出错:', e) + ElMessage.error('审核操作执行失败') + } finally { + reviewLoading.value = false + } +} + +// 驳回收货单相关 +const rejectDialogVisible = ref(false) +const rejectLoading = ref(false) +const rejectRemark = ref('') + +function handleRejectReceiving() { + if (!selectionRows.value.length) { + ElMessage.warning('请先选择要驳回的收货单') + return + } + rejectRemark.value = '' + rejectDialogVisible.value = true +} + +async function submitRejectReceiving() { + rejectLoading.value = true + try { + const ids = selectionRows.value.map(row => row.id) + const payload: any = { ids } + if (rejectRemark.value) payload.remark = rejectRemark.value + + const res: any = await receivingApi.rejectReceiving(payload) + if (res && res.code === 200) { + ElMessage.success(`已成功驳回 ${res.data?.count ?? ids.length} 个收货单`) + rejectDialogVisible.value = false + selectionRows.value = [] + loadData() + } else { + ElMessage.error(res?.message || '驳回失败') + } + } catch (e) { + console.error('驳回收货单出错:', e) + ElMessage.error('驳回操作执行失败') + } finally { + rejectLoading.value = false + } +} + function printReceiving() { if (!selectionRows.value.length) { ElMessage.warning('请选择要打印的收货单') diff --git a/src/views/storage/receiving/receiving-config.ts b/src/views/storage/receiving/receiving-config.ts index 70160086..0baae985 100644 --- a/src/views/storage/receiving/receiving-config.ts +++ b/src/views/storage/receiving/receiving-config.ts @@ -102,6 +102,7 @@ export const receivingColumns = [ { prop: 'status', label: '收货状态', width: '90', align: 'center' }, { prop: 'detail_status', label: '匹配状态', width: '90', align: 'center' }, { prop: 'storage_status', label: '入库状态', width: '90', align: 'center' }, + { prop: 'is_review', label: '审核状态', width: '90', align: 'center' }, { prop: 'store_name', label: '货主', width: '100' }, { prop: 'total_items', label: '商品种类', width: '90', align: 'right', sortable: true }, { prop: 'total_quantity', label: '总数量', width: '90', align: 'right', sortable: true },