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