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

@@ -253,7 +253,7 @@ export default function Show({ doc }: { auth: any, doc: AdjDoc }) {
<>
<span className="mx-1">|</span>
<Link
href={route('inventory.count.show', [doc.count_doc_id])}
href={route('inventory.count.show', [doc.count_doc_id]) + `?from=adjust&adjust_id=${doc.id}`}
className="flex items-center gap-1 text-primary-main hover:underline"
>
: {doc.count_doc_no}

View File

@@ -157,7 +157,7 @@ export default function Index({ docs, warehouses, filters }: any) {
return (
<AuthenticatedLayout
breadcrumbs={[
{ label: '商品與庫存管理', href: '#' },
{ label: '商品與庫存管理', href: '#' },
{ label: '庫存盤點', href: route('inventory.count.index'), isPage: true },
]}
>

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>

View File

@@ -173,7 +173,7 @@ export default function Index({ warehouses, orders, filters }: any) {
return (
<AuthenticatedLayout
breadcrumbs={[
{ label: '商品與庫存管理', href: '#' },
{ label: '商品與庫存管理', href: '#' },
{ label: '庫存調撥', href: route('inventory.transfer.index'), isPage: true },
]}
>

View File

@@ -154,7 +154,7 @@ export default function Show({ order }: any) {
items: items,
remarks: remarks,
}, {
onSuccess: () => toast.success("儲存成功"),
onSuccess: () => { },
onError: () => toast.error("儲存失敗,請檢查輸入"),
});
} finally {
@@ -168,7 +168,6 @@ export default function Show({ order }: any) {
}, {
onSuccess: () => {
setIsPostDialogOpen(false);
toast.success("過帳成功");
}
});
};
@@ -177,7 +176,6 @@ export default function Show({ order }: any) {
router.delete(route('inventory.transfer.destroy', [order.id]), {
onSuccess: () => {
setDeleteId(null);
toast.success("已成功刪除");
}
});
};
@@ -469,7 +467,9 @@ export default function Show({ order }: any) {
<TableHead className="w-[50px] text-center font-medium text-grey-600">#</TableHead>
<TableHead className="font-medium text-grey-600"> / </TableHead>
<TableHead className="font-medium text-grey-600"></TableHead>
<TableHead className="text-right w-32 font-medium text-grey-600"></TableHead>
<TableHead className="text-right w-32 font-medium text-grey-600">
{order.status === 'completed' ? '過帳時庫存' : '可用庫存'}
</TableHead>
<TableHead className="text-right w-40 font-medium text-grey-600">調</TableHead>
<TableHead className="font-medium text-grey-600"></TableHead>
<TableHead className="font-medium text-grey-600"></TableHead>