feat: 實作出貨單模組並暫時導向通用製作中頁面,同步優化盤點與調撥功能的活動日誌顯示
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Successful in 1m11s
Koori-ERP-Deploy-System / deploy-production (push) Has been skipped

This commit is contained in:
2026-02-05 09:33:36 +08:00
parent 4299e985e9
commit 04f3891275
23 changed files with 1410 additions and 30 deletions

View File

@@ -28,6 +28,17 @@ import { Can } from '@/Components/Permission/Can';
export default function Show({ doc }: any) {
// Get query parameters for dynamic back button
const urlParams = new URLSearchParams(window.location.search);
const fromSource = urlParams.get('from');
const adjustId = urlParams.get('adjust_id');
const backUrl = fromSource === 'adjust' && adjustId
? route('inventory.adjust.show', [adjustId])
: route('inventory.count.index');
const backLabel = fromSource === 'adjust' ? '返回盤調單' : '返回盤點單列表';
// Transform items to form data structure
const { data, setData, put, delete: destroy, processing, transform } = useForm({
items: doc.items.map((item: any) => ({
@@ -77,21 +88,28 @@ export default function Show({ doc }: any) {
<AuthenticatedLayout
breadcrumbs={[
{ label: '商品與庫存管理', href: '#' },
{ label: '庫存盤點', href: route('inventory.count.index') },
{
label: fromSource === 'adjust' ? '庫存盤調' : '庫存盤點',
href: fromSource === 'adjust' ? route('inventory.adjust.index') : route('inventory.count.index')
},
fromSource === 'adjust' && adjustId ? {
label: `盤調單詳情`,
href: route('inventory.adjust.show', [adjustId])
} : null,
{ label: `盤點單: ${doc.doc_no}`, href: route('inventory.count.show', [doc.id]), isPage: true },
]}
].filter(Boolean) as any}
>
<Head title={`盤點單 ${doc.doc_no}`} />
<div className="container mx-auto p-6 max-w-7xl animate-in fade-in duration-500 space-y-6">
<div>
<Link href={route('inventory.count.index')}>
<Link href={backUrl}>
<Button
variant="outline"
className="gap-2 button-outlined-primary mb-6"
>
<ArrowLeft className="h-4 w-4" />
{backLabel}
</Button>
</Link>