From 4fe733d7d9d3d873fa395133e9a42cf9fc8c44dc Mon Sep 17 00:00:00 2001 From: dujinkim Date: Wed, 24 Sep 2025 07:59:35 +0000 Subject: (최겸) 구매 피드백 반영(용어 수정, 견적유형, 조건설정, 첨부파일 선택사항 등) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/rfq-last/table/create-general-rfq-dialog.tsx | 67 +++--------- lib/rfq-last/table/rfq-table-columns.tsx | 4 +- .../vendor-quotations-table-columns.tsx | 56 +++++----- .../vendor/batch-update-conditions-dialog.tsx | 59 ++++++++--- lib/rfq-last/vendor/rfq-vendor-table.tsx | 118 +++++++++++++++------ lib/rfq-last/vendor/send-rfq-dialog.tsx | 9 +- lib/rfq-last/vendor/vendor-detail-dialog.tsx | 4 +- 7 files changed, 181 insertions(+), 136 deletions(-) diff --git a/lib/rfq-last/table/create-general-rfq-dialog.tsx b/lib/rfq-last/table/create-general-rfq-dialog.tsx index 2c69f4b7..f7515787 100644 --- a/lib/rfq-last/table/create-general-rfq-dialog.tsx +++ b/lib/rfq-last/table/create-general-rfq-dialog.tsx @@ -70,22 +70,13 @@ const itemSchema = z.object({ // 일반견적 생성 폼 스키마 const createGeneralRfqSchema = z.object({ rfqType: z.string().min(1, "견적 종류를 선택해주세요"), - customRfqType: z.string().optional(), rfqTitle: z.string().min(1, "견적명을 입력해주세요"), dueDate: z.date({ - required_error: "마감일을 선택해주세요", + required_error: "제출마감일을 선택해주세요", }), - picUserId: z.number().min(1, "구매 담당자를 선택해주세요"), + picUserId: z.number().min(1, "견적담당자를 선택해주세요"), remark: z.string().optional(), items: z.array(itemSchema).min(1, "최소 하나의 아이템을 추가해주세요"), -}).refine((data) => { - if (data.rfqType === "기타") { - return data.customRfqType && data.customRfqType.trim().length > 0 - } - return true -}, { - message: "견적 종류를 직접 입력해주세요", - path: ["customRfqType"], }) type CreateGeneralRfqFormValues = z.infer @@ -120,7 +111,6 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp resolver: zodResolver(createGeneralRfqSchema), defaultValues: { rfqType: "", - customRfqType: "", rfqTitle: "", dueDate: undefined, picUserId: userId || undefined, @@ -142,12 +132,9 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp name: "items", }) - // 견적 종류 변경 시 customRfqType 필드 초기화 + // 견적 종류 변경 const handleRfqTypeChange = (value: string) => { form.setValue("rfqType", value) - if (value !== "기타") { - form.setValue("customRfqType", "") - } } // RFQ 코드 미리보기 생성 @@ -233,7 +220,6 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp if (!newOpen) { form.reset({ rfqType: "", - customRfqType: "", rfqTitle: "", dueDate: undefined, picUserId: userId || undefined, @@ -269,12 +255,9 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp setIsLoading(true) try { - // 견적 종류가 "기타"인 경우 customRfqType 사용 - const finalRfqType = data.rfqType === "기타" ? data.customRfqType || "기타" : data.rfqType - // 서버 액션 호출 const result = await createGeneralRfqAction({ - rfqType: finalRfqType, + rfqType: data.rfqType, rfqTitle: data.rfqTitle, dueDate: data.dueDate, picUserId: data.picUserId, @@ -325,7 +308,6 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp }) } - const isCustomRfqType = form.watch("rfqType") === "기타" return ( @@ -360,7 +342,7 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp control={form.control} name="rfqType" render={({ field }) => ( - + 견적 종류 * @@ -371,50 +353,25 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp - 정기견적 - 긴급견적 단가계약 - 기술견적 - 예산견적 - 기타 + 매각계약 + 일반계약 )} /> - - {/* 기타 견적 종류 입력 필드 */} - {isCustomRfqType && ( - ( - - - 견적 종류 직접 입력 * - - - - - - - )} - /> - )} - {/* 마감일 */} + {/* 제출마감일 */} ( - 마감일 * + 제출마감일 * @@ -429,7 +386,7 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp {field.value ? ( format(field.value, "yyyy-MM-dd") ) : ( - 마감일을 선택하세요 + 제출마감일을 선택하세요 (미선택 시 생성일 +7일) )} @@ -483,7 +440,7 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp render={({ field }) => ( - 구매 담당자 * + 견적담당자 * @@ -503,7 +460,7 @@ export function CreateGeneralRfqDialog({ onSuccess }: CreateGeneralRfqDialogProp ) : ( <> - {selectedUser ? selectedUser.name : "구매 담당자를 선택하세요"} + {selectedUser ? selectedUser.name : "견적담당자를 선택하세요"} diff --git a/lib/rfq-last/table/rfq-table-columns.tsx b/lib/rfq-last/table/rfq-table-columns.tsx index eaf00660..fc7f4415 100644 --- a/lib/rfq-last/table/rfq-table-columns.tsx +++ b/lib/rfq-last/table/rfq-table-columns.tsx @@ -501,8 +501,8 @@ export function getRfqColumns({ cell: ({ row }) => { const series = row.original.series; if (!series) return "-"; - const label = series === "SS" ? "시리즈 통합" : series === "II" ? "품목 통합" : series; - return {label}; + // const label = series === "SS" ? "시리즈 통합" : series === "II" ? "품목 통합" : series; + return {series}; }, size: 100, }, diff --git a/lib/rfq-last/vendor-response/vendor-quotations-table-columns.tsx b/lib/rfq-last/vendor-response/vendor-quotations-table-columns.tsx index a7135ea5..11b6bdaf 100644 --- a/lib/rfq-last/vendor-response/vendor-quotations-table-columns.tsx +++ b/lib/rfq-last/vendor-response/vendor-quotations-table-columns.tsx @@ -254,11 +254,16 @@ export function getColumns({ const rfqCode = row.original.rfqCode const value = row.getValue("rfqType") - // F로 시작하지 않으면 빈 값 반환 - if (!rfqCode?.startsWith('F')) { - return null + // RFQ 코드의 앞자리에 따라 유형 결정 + if (rfqCode?.startsWith('I')) { + return "ITB" + } else if (rfqCode?.startsWith('R')) { + return "RFQ" + } else if (rfqCode?.startsWith('F')) { + return "일반견적" } + // 기존 rfqType 값이 있는 경우 (백업) const typeMap: Record = { "ITB": "ITB", "RFQ": "RFQ", @@ -270,30 +275,29 @@ export function getColumns({ minSize: 80, maxSize: 120, enableResizing: true, - // F로 시작하지 않을 때 컬럼 숨기기 enableHiding: true, }, - { - accessorKey: "rfqTitle", - header: ({ column }) => ( - - ), - cell: ({ row }) => { - const rfqCode = row.original.rfqCode - const value = row.getValue("rfqTitle") + // { + // accessorKey: "rfqTitle", + // header: ({ column }) => ( + // + // ), + // cell: ({ row }) => { + // const rfqCode = row.original.rfqCode + // const value = row.getValue("rfqTitle") - // F로 시작하지 않으면 빈 값 반환 - if (!rfqCode?.startsWith('F')) { - return null - } + // // F로 시작하지 않으면 빈 값 반환 + // if (!rfqCode?.startsWith('F')) { + // return null + // } - return value || "-" - }, - minSize: 200, - maxSize: 400, - enableResizing: true, - enableHiding: true, - }, + // return value || "-" + // }, + // minSize: 200, + // maxSize: 400, + // enableResizing: true, + // enableHiding: true, + // }, { accessorKey: "projectName", header: ({ column }) => ( @@ -301,10 +305,10 @@ export function getColumns({ ), cell: ({ row }) => (
- + {row.original.projectCode} - + {row.original.projectName || "-"}
@@ -453,7 +457,7 @@ export function getColumns({ { accessorKey: "rfqSendDate", header: ({ column }) => ( - + ), cell: ({ row }) => { const value = row.getValue("rfqSendDate") diff --git a/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx b/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx index af38ff45..893fd9a3 100644 --- a/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx +++ b/lib/rfq-last/vendor/batch-update-conditions-dialog.tsx @@ -128,6 +128,7 @@ export function BatchUpdateConditionsDialog({ const [shippingOpen, setShippingOpen] = React.useState(false); const [destinationOpen, setDestinationOpen] = React.useState(false); const [calendarOpen, setCalendarOpen] = React.useState(false); + const [currencyOpen, setCurrencyOpen] = React.useState(false); // 체크박스로 각 필드 업데이트 여부 관리 const [fieldsToUpdate, setFieldsToUpdate] = React.useState({ @@ -381,7 +382,28 @@ export function BatchUpdateConditionsDialog({ {/* 기본 조건 설정 */} - 기본 조건 +
+ 기본 조건 + +
{/* 통화 */} @@ -405,11 +427,12 @@ export function BatchUpdateConditionsDialog({
- + + + {/* RFQ 발송 버튼 */} + + {/* Short List 확정 버튼 */} {rfqCode?.startsWith("I") && - - {/* 정보 일괄 입력 버튼 */} - - - {/* RFQ 발송 버튼 */} - )} @@ -1679,6 +1719,18 @@ export function RfqVendorTable({ }} /> )} + + {/* AVL 벤더 연동 다이얼로그 */} + { + setIsAvlDialogOpen(false); + router.refresh(); + }} + /> ); } \ No newline at end of file diff --git a/lib/rfq-last/vendor/send-rfq-dialog.tsx b/lib/rfq-last/vendor/send-rfq-dialog.tsx index 34777864..ed43d87f 100644 --- a/lib/rfq-last/vendor/send-rfq-dialog.tsx +++ b/lib/rfq-last/vendor/send-rfq-dialog.tsx @@ -653,10 +653,7 @@ export function SendRfqDialog({ return; } - if (selectedAttachments.length === 0) { - toast.warning("최소 하나 이상의 첨부파일을 선택해주세요."); - return; - } + // 첨부파일은 선택사항 - 없어도 발송 가능 // 재발송 업체 확인 const resendVendors = vendorsWithRecipients.filter(v => v.sendVersion && v.sendVersion > 0); @@ -1350,12 +1347,12 @@ export function SendRfqDialog({
-- cgit v1.2.3