統一庫存盤點與盤調 UI 及邏輯:修正狀態顯示、操作權限與列表樣式
This commit is contained in:
@@ -13,7 +13,6 @@ import {
|
||||
} from '@/Components/ui/table';
|
||||
import { Button } from '@/Components/ui/button';
|
||||
import { Input } from '@/Components/ui/input';
|
||||
import { Card, CardContent } from '@/Components/ui/card';
|
||||
import { Badge } from '@/Components/ui/badge';
|
||||
import {
|
||||
Dialog,
|
||||
@@ -141,6 +140,8 @@ export default function Index({ auth, docs, warehouses, filters }: any) {
|
||||
return <Badge className="bg-blue-500 hover:bg-blue-600">盤點中</Badge>;
|
||||
case 'completed':
|
||||
return <Badge className="bg-green-500 hover:bg-green-600">已核准</Badge>;
|
||||
case 'adjusted':
|
||||
return <Badge className="bg-purple-500 hover:bg-purple-600">已盤調庫存</Badge>;
|
||||
case 'cancelled':
|
||||
return <Badge variant="destructive">已取消</Badge>;
|
||||
default:
|
||||
@@ -307,16 +308,16 @@ export default function Index({ auth, docs, warehouses, filters }: any) {
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="button-outlined-primary"
|
||||
title={doc.status === 'completed' ? '查閱' : '盤點'}
|
||||
title={['completed', 'adjusted'].includes(doc.status) ? '查閱' : '盤點'}
|
||||
>
|
||||
{doc.status === 'completed' ? (
|
||||
{['completed', 'adjusted'].includes(doc.status) ? (
|
||||
<Eye className="w-4 h-4 ml-0.5" />
|
||||
) : (
|
||||
<Pencil className="w-4 h-4 ml-0.5" />
|
||||
)}
|
||||
</Button>
|
||||
</Link>
|
||||
{doc.status !== 'completed' && (
|
||||
{!['completed', 'adjusted'].includes(doc.status) && (
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
|
||||
Reference in New Issue
Block a user