summaryrefslogtreecommitdiff
path: root/lib/rfq-last/table/create-general-rfq-dialog.tsx
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-09-29 11:33:37 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-09-29 11:33:37 +0000
commit8438c05efc7a141e349c5d6416ad08156b4c0775 (patch)
treed90080c294140db8082d0861c649845ec36c4cea /lib/rfq-last/table/create-general-rfq-dialog.tsx
parentc17b495c700dcfa040abc93a210727cbe72785f1 (diff)
(최겸) 구매 견적 이메일 추가, 미리보기, 첨부삭제, 기타 수정 등
Diffstat (limited to 'lib/rfq-last/table/create-general-rfq-dialog.tsx')
-rw-r--r--lib/rfq-last/table/create-general-rfq-dialog.tsx32
1 files changed, 31 insertions, 1 deletions
diff --git a/lib/rfq-last/table/create-general-rfq-dialog.tsx b/lib/rfq-last/table/create-general-rfq-dialog.tsx
index 023c9f2a..1d369648 100644
--- a/lib/rfq-last/table/create-general-rfq-dialog.tsx
+++ b/lib/rfq-last/table/create-general-rfq-dialog.tsx
@@ -57,6 +57,7 @@ import { toast } from "sonner"
import { ScrollArea } from "@/components/ui/scroll-area"
import { Separator } from "@/components/ui/separator"
import { createGeneralRfqAction, getPUsersForFilter, previewGeneralRfqCode } from "../service"
+import { ProjectSelector } from "@/components/ProjectSelector"
// 아이템 스키마
const itemSchema = z.object({
@@ -75,6 +76,7 @@ const createGeneralRfqSchema = z.object({
required_error: "제출마감일을 선택해주세요",
}),
picUserId: z.number().min(1, "견적담당자를 선택해주세요"),
+ projectId: z.number().optional(),
remark: z.string().optional(),
items: z.array(itemSchema).min(1, "최소 하나의 자재를 추가해주세요"),
})
@@ -114,6 +116,7 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp
rfqTitle: "",
dueDate: undefined,
picUserId: userId || undefined,
+ projectId: undefined,
remark: "",
items: [
{
@@ -223,6 +226,7 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp
rfqTitle: "",
dueDate: undefined,
picUserId: userId || undefined,
+ projectId: undefined,
remark: "",
items: [
{
@@ -261,8 +265,15 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp
rfqTitle: data.rfqTitle,
dueDate: data.dueDate,
picUserId: data.picUserId,
+ projectId: data.projectId,
remark: data.remark || "",
- items: data.items,
+ items: data.items as Array<{
+ itemCode: string;
+ itemName: string;
+ quantity: number;
+ uom: string;
+ remark?: string;
+ }>,
createdBy: userId,
updatedBy: userId,
})
@@ -433,6 +444,25 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp
)}
/>
+ {/* 프로젝트 선택 */}
+ <FormField
+ control={form.control}
+ name="projectId"
+ render={({ field }) => (
+ <FormItem className="flex flex-col">
+ <FormLabel>프로젝트</FormLabel>
+ <FormControl>
+ <ProjectSelector
+ selectedProjectId={field.value}
+ onProjectSelect={(project) => field.onChange(project.id)}
+ placeholder="프로젝트 선택 (선택사항)..."
+ />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
+
{/* 구매 담당자 - 검색 가능한 셀렉터로 변경 */}
<FormField
control={form.control}