feat: 補齊生產管理與進貨單權限、功能實作及 UI 優化
This commit is contained in:
@@ -71,10 +71,13 @@ export default function RoleCreate({ groupedPermissions }: Props) {
|
||||
'edit': '編輯',
|
||||
'delete': '刪除',
|
||||
'publish': '發布',
|
||||
'adjust': '新增 / 調整',
|
||||
'adjust': '調整',
|
||||
'transfer': '調撥',
|
||||
'safety_stock': '安全庫存設定',
|
||||
'export': '匯出',
|
||||
'complete': '完成',
|
||||
'view_cost': '檢視成本',
|
||||
'view_logs': '檢視日誌',
|
||||
};
|
||||
|
||||
return map[action] || action;
|
||||
|
||||
@@ -78,10 +78,13 @@ export default function RoleEdit({ role, groupedPermissions, currentPermissions
|
||||
'edit': '編輯',
|
||||
'delete': '刪除',
|
||||
'publish': '發布',
|
||||
'adjust': '新增 / 調整',
|
||||
'adjust': '調整',
|
||||
'transfer': '調撥',
|
||||
'safety_stock': '安全庫存設定',
|
||||
'export': '匯出',
|
||||
'complete': '完成',
|
||||
'view_cost': '檢視成本',
|
||||
'view_logs': '檢視日誌',
|
||||
};
|
||||
|
||||
return map[action] || action;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { Plus, Factory, Search, RotateCcw, Eye, Pencil } from 'lucide-react';
|
||||
import { Plus, Factory, Search, RotateCcw, Eye, Pencil, Trash2 } from 'lucide-react';
|
||||
import { Button } from "@/Components/ui/button";
|
||||
import AuthenticatedLayout from "@/Layouts/AuthenticatedLayout";
|
||||
import { Head, router, Link } from "@inertiajs/react";
|
||||
@@ -266,6 +266,21 @@ export default function ProductionIndex({ productionOrders, filters }: Props) {
|
||||
</Button>
|
||||
</Link>
|
||||
</Can>
|
||||
<Can permission="production_orders.delete">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="button-outlined-error"
|
||||
title="刪除"
|
||||
onClick={() => {
|
||||
if (confirm('確定要刪除此生產工單嗎?')) {
|
||||
router.delete(route('production-orders.destroy', order.id));
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
</Button>
|
||||
</Can>
|
||||
</div>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
@@ -298,6 +313,6 @@ export default function ProductionIndex({ productionOrders, filters }: Props) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</AuthenticatedLayout>
|
||||
</AuthenticatedLayout >
|
||||
);
|
||||
}
|
||||
|
||||
@@ -110,12 +110,14 @@ export default function RecipeIndex({ recipes, filters }: Props) {
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Link href={route('recipes.create')}>
|
||||
<Button className="gap-2 button-filled-primary">
|
||||
<Plus className="h-4 w-4" />
|
||||
新增配方
|
||||
</Button>
|
||||
</Link>
|
||||
<Can permission="recipes.create">
|
||||
<Link href={route('recipes.create')}>
|
||||
<Button className="gap-2 button-filled-primary">
|
||||
<Plus className="h-4 w-4" />
|
||||
新增配方
|
||||
</Button>
|
||||
</Link>
|
||||
</Can>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user