diff --git a/frontend/src/modules/inventory/components/PurchaseOrdersTab.vue b/frontend/src/modules/inventory/components/PurchaseOrdersTab.vue index dcc5a48..712d55b 100644 --- a/frontend/src/modules/inventory/components/PurchaseOrdersTab.vue +++ b/frontend/src/modules/inventory/components/PurchaseOrdersTab.vue @@ -10,6 +10,8 @@ const { formatDateTime, formatDate, getPurchaseOrderStatusLabel, + getReceiptStatusLabel, + getPaymentStatusLabel, isPurchaseOrderLocked, loadPurchaseOrders, loadSuppliers, @@ -218,6 +220,23 @@ async function markAsPaid(orderId: number) { } } +async function updateStatus(orderId: number, status: string) { + const label = status === 'cancelled' ? '作废' : status + if (!confirm(`确认${label}该订单?`)) return + try { + await apiRequest(`/api/purchase-orders/${orderId}/status`, { + method: 'PATCH', + body: JSON.stringify({ status }) + }) + addNotification(`订单已${label}`, 'success') + loadPurchaseOrders() + loadMovements() + loadInventory() + } catch (e) { + handleApiError(e, '更新状态') + } +} + function closeModal() { showModal.value = false editingItem.value = null @@ -267,9 +286,16 @@ onMounted(() => { @@ -309,7 +335,7 @@ onMounted(() => { 删除 { 到货入库 标记为已付款 + + 作废 + diff --git a/frontend/src/modules/inventory/components/SalesOrdersTab.vue b/frontend/src/modules/inventory/components/SalesOrdersTab.vue index 1269259..45f106d 100644 --- a/frontend/src/modules/inventory/components/SalesOrdersTab.vue +++ b/frontend/src/modules/inventory/components/SalesOrdersTab.vue @@ -10,6 +10,8 @@ const { formatDateTime, formatDate, getSalesOrderStatusLabel, + getDeliveryStatusLabel, + getPaymentStatusLabel, loadProductionOrders, loadFinishedProducts, loadCustomers, @@ -309,30 +311,36 @@ onMounted(() => { - +