feat: 優化商品管理規格顯示與修復重複通知問題
This commit is contained in:
@@ -80,7 +80,6 @@ export default function ProductDialog({
|
||||
if (product) {
|
||||
put(route("products.update", product.id), {
|
||||
onSuccess: () => {
|
||||
toast.success("商品已更新");
|
||||
onOpenChange(false);
|
||||
reset();
|
||||
},
|
||||
@@ -91,7 +90,6 @@ export default function ProductDialog({
|
||||
} else {
|
||||
post(route("products.store"), {
|
||||
onSuccess: () => {
|
||||
toast.success("商品已新增");
|
||||
onOpenChange(false);
|
||||
reset();
|
||||
},
|
||||
|
||||
@@ -9,6 +9,12 @@ import {
|
||||
import { Button } from "@/Components/ui/button";
|
||||
import { Badge } from "@/Components/ui/badge";
|
||||
import { Pencil, Trash2, ArrowUpDown, ArrowUp, ArrowDown } from "lucide-react";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipProvider,
|
||||
TooltipTrigger,
|
||||
} from "@/Components/ui/tooltip";
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
@@ -90,6 +96,7 @@ export default function ProductTable({
|
||||
基本單位 <SortIcon field="base_unit_id" />
|
||||
</button>
|
||||
</TableHead>
|
||||
<TableHead className="w-[200px]">規格</TableHead>
|
||||
<TableHead>換算率</TableHead>
|
||||
<TableHead className="text-center">操作</TableHead>
|
||||
</TableRow>
|
||||
@@ -125,6 +132,22 @@ export default function ProductTable({
|
||||
</Badge>
|
||||
</TableCell>
|
||||
<TableCell>{product.baseUnit?.name || '-'}</TableCell>
|
||||
<TableCell className="max-w-[200px]">
|
||||
<TooltipProvider delayDuration={300}>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<div className="truncate text-gray-600 cursor-help">
|
||||
{product.specification || '-'}
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
{product.specification && (
|
||||
<TooltipContent className="max-w-xs break-all">
|
||||
<p>{product.specification}</p>
|
||||
</TooltipContent>
|
||||
)}
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
{product.largeUnit ? (
|
||||
<span className="text-sm text-gray-500">
|
||||
|
||||
@@ -50,7 +50,6 @@ export default function EditSafetyStockDialog({
|
||||
};
|
||||
|
||||
onSave(updatedSetting);
|
||||
toast.success("安全庫存設定已更新");
|
||||
onOpenChange(false);
|
||||
};
|
||||
|
||||
|
||||
@@ -93,7 +93,6 @@ export default function UtilityFeeDialog({
|
||||
|
||||
put(route("utility-fees.update", fee.id), {
|
||||
onSuccess: () => {
|
||||
toast.success("紀錄已更新");
|
||||
onOpenChange(false);
|
||||
reset();
|
||||
},
|
||||
@@ -110,7 +109,6 @@ export default function UtilityFeeDialog({
|
||||
|
||||
post(route("utility-fees.store"), {
|
||||
onSuccess: () => {
|
||||
toast.success("公共事業費已記錄");
|
||||
onOpenChange(false);
|
||||
reset();
|
||||
},
|
||||
|
||||
@@ -67,7 +67,6 @@ export default function VendorDialog({
|
||||
if (vendor) {
|
||||
put(route("vendors.update", vendor.id), {
|
||||
onSuccess: () => {
|
||||
toast.success("廠商資料已更新");
|
||||
onOpenChange(false);
|
||||
reset();
|
||||
},
|
||||
@@ -78,7 +77,6 @@ export default function VendorDialog({
|
||||
} else {
|
||||
post(route("vendors.store"), {
|
||||
onSuccess: () => {
|
||||
toast.success("廠商已新增");
|
||||
onOpenChange(false);
|
||||
reset();
|
||||
},
|
||||
|
||||
@@ -69,7 +69,6 @@ export default function InventoryAdjustmentDialog({
|
||||
product: item.productId // 這裡後端接收 product (或可用 inventory ID 擴充)
|
||||
}), {
|
||||
onSuccess: () => {
|
||||
toast.success("庫存調整成功");
|
||||
onClose();
|
||||
},
|
||||
onError: () => {
|
||||
|
||||
Reference in New Issue
Block a user