feat: 實作出貨單模組並暫時導向通用製作中頁面,同步優化盤點與調撥功能的活動日誌顯示
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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 },
|
||||
]}
|
||||
>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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 },
|
||||
]}
|
||||
>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user