From 089c70ffbe2303ab5e2611a152ddd3aed0e6e718 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 1 Sep 2025 09:09:15 +0000 Subject: (최겸) 구매 pq, 기본정보 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evcp/(evcp)/vendors/[id]/info/basic/actions.ts | 44 - .../vendors/[id]/info/basic/basic-info-client.tsx | 1458 -------------------- .../(evcp)/vendors/[id]/info/basic/constants.ts | 1 - .../evcp/(evcp)/vendors/[id]/info/basic/page.tsx | 4 +- .../evcp/(evcp)/vendors/[id]/info/basic/types.ts | 180 --- .../partners/(partners)/sales-force-test/page.tsx | 32 - app/[lng]/partners/pq_new/[id]/page.tsx | 2 +- 7 files changed, 3 insertions(+), 1718 deletions(-) delete mode 100644 app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/actions.ts delete mode 100644 app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/basic-info-client.tsx delete mode 100644 app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/constants.ts delete mode 100644 app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/types.ts delete mode 100644 app/[lng]/partners/(partners)/sales-force-test/page.tsx (limited to 'app') diff --git a/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/actions.ts b/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/actions.ts deleted file mode 100644 index 866103a6..00000000 --- a/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/actions.ts +++ /dev/null @@ -1,44 +0,0 @@ -"use server"; - -import { getVendorBasicInfo } from "@/lib/vendors/service"; -import { VendorFormData } from "./types"; - -/** - * 벤더 기본정보를 가져오는 서버 액션 - */ -export async function getVendorData(vendorId: string) { - try { - const id = parseInt(vendorId); - if (isNaN(id)) { - return null; - } - - const vendorData = await getVendorBasicInfo(id); - return vendorData; - } catch (error) { - console.error("Error in getVendorData:", error); - return null; - } -} - -/** - * 벤더 기본정보를 업데이트하는 서버 액션 (향후 구현) - */ -export async function updateVendorData(vendorId: string, formData: VendorFormData) { - try { - // TODO: 실제 업데이트 로직 구현 - console.log("Updating vendor data:", { vendorId, formData }); - - // 임시로 성공 응답 반환 - return { - success: true, - message: "(개발중입니다) 벤더 정보가 성공적으로 업데이트되었습니다.", - }; - } catch (error) { - console.error("Error in updateVendorData:", error); - return { - success: false, - message: "업데이트 중 오류가 발생했습니다.", - }; - } -} \ No newline at end of file diff --git a/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/basic-info-client.tsx b/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/basic-info-client.tsx deleted file mode 100644 index 78d21719..00000000 --- a/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/basic-info-client.tsx +++ /dev/null @@ -1,1458 +0,0 @@ -"use client"; - -import React, { useState, useTransition } from "react"; -import { Button } from "@/components/ui/button"; -import { Input } from "@/components/ui/input"; -import { Label } from "@/components/ui/label"; -import { Separator } from "@/components/ui/separator"; -import { Checkbox } from "@/components/ui/checkbox"; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/components/ui/select"; -import { Edit, Save, X } from "lucide-react"; -import { toast } from "sonner"; -import { VendorData, VendorFormData, VendorAttachment } from "./types"; -import { updateVendorData } from "./actions"; -import { noDataString } from "./constants"; -import { PQSimpleDialog } from "@/components/vendor-info/pq-simple-dialog"; -import { SiteVisitDetailDialog } from "@/lib/site-visit/site-visit-detail-dialog"; -import { DocumentStatusDialog } from "@/components/vendor-regular-registrations/document-status-dialog"; -import { AdditionalInfoDialog } from "@/components/vendor-regular-registrations/additional-info-dialog"; -import { getSiteVisitRequestsByVendorId } from "@/lib/site-visit/service"; -import { fetchVendorRegistrationStatus } from "@/lib/vendor-regular-registrations/service"; -import { getVendorAttachmentsByType, getVendorPeriodicGrade, getVendorTypeInfo } from "@/lib/vendor-info/service"; -// downloadFile은 동적으로 import -import { - Table, - TableBody, - TableCell, - TableHead, - TableHeader, - TableRow, -} from "@/components/ui/table"; - -interface BasicInfoClientProps { - initialData: VendorData | null; - vendorId: string; -} - -interface DropdownOption { - value: string; - label: string; -} - -interface InfoItemProps { - title: string; - value: string | boolean; - isEditable?: boolean; - editMode?: boolean; - onChange?: (value: string | boolean) => void; - fieldKey?: string; - type?: "text" | "checkbox" | "dropdown" | "file-button" | "readonly"; - options?: DropdownOption[]; // dropdown용 옵션들 - onFileButtonClick?: () => void; // 파일 버튼 클릭 핸들러 - placeholder?: string; // input placeholder -} - -const InfoItem = ({ - title, - value, - isEditable = false, - editMode = false, - onChange, - fieldKey, - type = "text", - options = [], - onFileButtonClick, - placeholder, -}: InfoItemProps) => { - // 편집 가능 여부 결정 (readonly 타입은 항상 읽기 전용) - const canEdit = isEditable && editMode && type !== "readonly"; - - // 표시할 값 결정 (빈 값일 때 처리) - const displayValue = value || ""; - const showNoData = !value && !canEdit; - - const renderEditableField = () => { - switch (type) { - case "checkbox": - return ( -
- onChange?.(checked)} - /> - -
- ); - - case "dropdown": - return ( - - ); - - case "file-button": - return ( - - ); - - case "text": - default: - return ( - onChange?.(e.target.value)} - className="h-8" - placeholder={placeholder} - /> - ); - } - }; - - const renderReadOnlyField = () => { - switch (type) { - case "checkbox": - return ( -
- - -
- ); - - case "file-button": - return ( - - ); - - case "dropdown": - case "text": - case "readonly": - default: - return showNoData ? noDataString : displayValue; - } - }; - - return ( -
-
{title}:
-
- {canEdit ? ( -
- - {renderEditableField()} -
- ) : ( - {renderReadOnlyField()} - )} -
-
- ); -}; - -const OrganizationChart = ({ - data, - editMode = false, - onChange, -}: { - data: any; - editMode?: boolean; - onChange?: (field: string, value: string) => void; -}) => { - const organizationFields = [ - { key: "representative", label: "대표" }, - { key: "sales", label: "영업" }, - { key: "design", label: "설계" }, - { key: "procurement", label: "구매" }, - { key: "production", label: "생산" }, - { key: "quality", label: "품질" }, - ]; - - return ( -
-
조직도
-
- {organizationFields.map((field) => ( -
-
- {field.label} -
-
- {editMode ? ( - onChange?.(field.key, e.target.value)} - className="h-8 w-16 text-center" - placeholder="0" - /> - ) : ( - - {data?.[field.key]?.toString() || noDataString} - - )} -
-
- ))} -
-
- ); -}; - -const InfoSection = ({ - title, - subtitle, - column1, - column2, - column3, - additionalContent, -}: { - title: string; - subtitle?: string; - column1: React.ReactNode; - column2: React.ReactNode; - column3: React.ReactNode; - additionalContent?: React.ReactNode; -}) => ( -
-
-
-
{title}
- {subtitle && ( -
- {subtitle} -
- )} -
-
-
{column1}
-
{column2}
-
{column3}
-
-
- {additionalContent && ( -
-
-
{additionalContent}
-
- )} -
-); - -const WideInfoSection = ({ - title, - subtitle, - content, - noPadding = false, -}: { - title?: string; - subtitle?: string; - content: React.ReactNode; - noPadding?: boolean; -}) => ( -
-
-
-
{title}
- {subtitle && ( -
- {subtitle} -
- )} -
-
- {content} -
-
-
-); - -export default function BasicInfoClient({ - initialData, - vendorId, -}: BasicInfoClientProps) { - const [editMode, setEditMode] = useState(false); - const [isPending, startTransition] = useTransition(); - - // 다이얼로그 상태 - const [pqDialogOpen, setPqDialogOpen] = useState(false); - const [siteVisitDialogOpen, setSiteVisitDialogOpen] = useState(false); - const [contractDialogOpen, setContractDialogOpen] = useState(false); - const [additionalInfoDialogOpen, setAdditionalInfoDialogOpen] = useState(false); - - // 각 다이얼로그에 필요한 데이터 상태 - const [selectedSiteVisitRequest, setSelectedSiteVisitRequest] = useState(null); - const [registrationData, setRegistrationData] = useState(null); - - // 첨부파일 및 평가 정보 상태 - const [attachmentsByType, setAttachmentsByType] = useState>({}); - const [periodicGrade, setPeriodicGrade] = useState(null); - const [vendorTypeInfo, setVendorTypeInfo] = useState(null); - const [formData, setFormData] = useState({ - vendorName: initialData?.vendorName || "", - representativeName: initialData?.representativeName || "", - representativeWorkExperience: - initialData?.representativeWorkExperience || false, - representativeBirth: initialData?.representativeBirth || "", - representativePhone: initialData?.representativePhone || "", - representativeEmail: initialData?.representativeEmail || "", - phone: initialData?.phone || "", - fax: initialData?.fax || "", - email: initialData?.email || "", - address: initialData?.address || "", - addressDetail: initialData?.addressDetail || "", - postalCode: initialData?.postalCode || "", - businessSize: initialData?.businessSize || "", - country: initialData?.country || "", - website: initialData?.website || "", - businessType: initialData?.additionalInfo?.businessType || "", - employeeCount: initialData?.additionalInfo?.employeeCount || 0, - mainBusiness: initialData?.additionalInfo?.mainBusiness || "", - }); - - const handleSave = () => { - startTransition(async () => { - try { - const result = await updateVendorData(vendorId, formData); - if (result.success) { - toast.success("[개발중] 저장되지 않습니다. 업데이트는 구현중입니다."); - setEditMode(false); - } else { - toast.error(result.message || "저장에 실패했습니다."); - } - } catch { - toast.error("저장 중 오류가 발생했습니다."); - } - }); - }; - - const handleCancel = () => { - setFormData({ - vendorName: initialData?.vendorName || "", - representativeName: initialData?.representativeName || "", - representativeWorkExperience: - initialData?.representativeWorkExperience || false, - representativeBirth: initialData?.representativeBirth || "", - representativePhone: initialData?.representativePhone || "", - representativeEmail: initialData?.representativeEmail || "", - phone: initialData?.phone || "", - fax: initialData?.fax || "", - email: initialData?.email || "", - address: initialData?.address || "", - addressDetail: initialData?.addressDetail || "", - postalCode: initialData?.postalCode || "", - businessSize: initialData?.businessSize || "", - country: initialData?.country || "", - website: initialData?.website || "", - businessType: initialData?.additionalInfo?.businessType || "", - employeeCount: initialData?.additionalInfo?.employeeCount || 0, - mainBusiness: initialData?.additionalInfo?.mainBusiness || "", - }); - setEditMode(false); - }; - - const updateField = ( - field: keyof VendorFormData, - value: string | number | boolean - ) => { - setFormData((prev) => ({ ...prev, [field]: value })); - }; - - // PQ 조회 핸들러 - const handlePQView = () => { - setPqDialogOpen(true); - }; - - // 실사 정보 조회 핸들러 - const handleSiteVisitView = async () => { - try { - const siteVisitRequests = await getSiteVisitRequestsByVendorId(parseInt(vendorId)); - if (siteVisitRequests.length === 0) { - toast.info("실사 정보가 없습니다."); - return; - } - setSelectedSiteVisitRequest(siteVisitRequests[0]); // 첫 번째 실사 정보 선택 - setSiteVisitDialogOpen(true); - } catch (error) { - console.error("실사 정보 조회 오류:", error); - toast.error("실사 정보를 불러오는데 실패했습니다."); - } - }; - - // 기본계약 현황 조회 핸들러 - const handleContractView = async () => { - try { - const result = await fetchVendorRegistrationStatus(parseInt(vendorId)); - if (!result.success || !result.data) { - toast.info("기본계약 정보가 없습니다."); - return; - } - - // DocumentStatusDialog가 기대하는 형태로 데이터 구성 - const dialogData = { - // 기본 정보 - id: result.data.registration?.id || 0, - vendorId: parseInt(vendorId), - companyName: result.data.vendor.vendorName, - businessNumber: result.data.vendor.taxId, - representative: result.data.vendor.representativeName, - country: result.data.vendor.country, - status: result.data.registration?.status || "정보없음", - - // 문서 제출 현황 - documentSubmissions 속성으로 매핑 - documentSubmissions: result.data.documentStatus, - - // 문서별 파일 정보 추가 - documentFiles: result.data.documentFiles || { - businessRegistration: [], - creditEvaluation: [], - bankCopy: [], - auditResult: [] - }, - - // 기본계약 정보 - basicContracts: result.data.basicContracts || [], - - // 안전적격성 평가 - safetyQualificationContent: result.data.registration?.safetyQualificationContent || null, - - // 추가정보 완료 여부 - additionalInfo: result.data.additionalInfoCompleted, - }; - - setRegistrationData(dialogData); - setContractDialogOpen(true); - } catch (error) { - console.error("기본계약 정보 조회 오류:", error); - toast.error("기본계약 정보를 불러오는데 실패했습니다."); - } - }; - - // 추가정보 조회 핸들러 - const handleAdditionalInfoView = async () => { - try { - const result = await fetchVendorRegistrationStatus(parseInt(vendorId)); - if (!result.success || !result.data) { - toast.info("추가정보가 없습니다."); - return; - } - - // 추가정보가 있는지 확인 (업무담당자 또는 추가정보 데이터가 있는지 체크) - const { businessContacts, additionalInfo } = result.data; - const hasBusinessContacts = businessContacts && businessContacts.length > 0; - const hasAdditionalInfo = additionalInfo && Object.keys(additionalInfo).length > 0; - - if (!hasBusinessContacts && !hasAdditionalInfo) { - toast.info("추가정보가 없습니다."); - return; - } - - setAdditionalInfoDialogOpen(true); - } catch (error) { - console.error("추가정보 조회 오류:", error); - toast.error("추가정보를 불러오는데 실패했습니다."); - } - }; - - // 첨부파일 및 평가 정보 로드 - const loadVendorData = async () => { - try { - // 첨부파일 조회 - const attachmentsResult = await getVendorAttachmentsByType(parseInt(vendorId)); - if (attachmentsResult.success && attachmentsResult.data) { - setAttachmentsByType(attachmentsResult.data); - } - - // 정기평가 등급 조회 - const gradeResult = await getVendorPeriodicGrade(parseInt(vendorId)); - if (gradeResult.success && gradeResult.data) { - setPeriodicGrade(gradeResult.data.finalGrade); - } - - // 벤더 타입 정보 조회 - const typeResult = await getVendorTypeInfo(parseInt(vendorId)); - if (typeResult.success && typeResult.data) { - setVendorTypeInfo(typeResult.data); - } - } catch (error) { - console.error("벤더 데이터 로드 오류:", error); - } - }; - - // 컴포넌트 마운트 시 데이터 로드 - React.useEffect(() => { - if (vendorId) { - loadVendorData(); - } - }, [vendorId]); - - // 첨부파일 다운로드 핸들러 - const handleAttachmentDownload = async (filePath: string, fileName: string) => { - try { - // 동적으로 downloadFile 함수 import - const { downloadFile } = await import('@/lib/file-download') - - const result = await downloadFile(filePath, fileName); - if (result.success) { - toast.success(`${fileName} 파일이 다운로드되었습니다.`); - } else { - toast.error(result.error || "파일 다운로드에 실패했습니다."); - } - } catch (error) { - console.error("파일 다운로드 오류:", error); - toast.error("파일 다운로드에 실패했습니다."); - } - }; - - // 첨부파일 관리 핸들러 (타입별) - const handleAttachmentFileManagement = (attachmentType: string, typeName: string) => { - const files = attachmentsByType[attachmentType] || []; - - if (files.length === 0) { - toast.info(`${typeName} 파일이 없습니다.`); - return; - } - - // 파일이 하나인 경우 바로 다운로드 - if (files.length === 1) { - handleAttachmentDownload(files[0].filePath, files[0].fileName); - return; - } - - // 파일이 여러 개인 경우 순차적으로 모든 파일 다운로드 - toast.info(`${typeName} 파일 ${files.length}개를 다운로드합니다.`); - files.forEach((file, index) => { - setTimeout(() => { - handleAttachmentDownload(file.filePath, file.fileName); - }, index * 500); // 500ms 간격으로 순차 다운로드 - }); - }; - - if (!initialData) { - return ( -
-
-

{noDataString}

-
-
- ); - } - - // attachmentsByType는 상태로 관리되고 있으므로 제거 - - return ( -
-
-

협력업체 기본정보

-
- {editMode ? ( - <> - - - - ) : ( - - )} -
-
- -
- {/* 업체정보 */} - - updateField("vendorName", value)} - /> - {/* */} - updateField("phone", value)} - /> - {/* updateField("fax", value)} - /> */} - updateField("businessType", value)} - /> - {/* handleFileManagement("소개자료")} - /> */} - -
- } - column2={ -
- - - - - - updateField("email", value)} - /> - {/* - updateField("businessSize", value)} - placeholder="기업규모를 선택하세요" - /> */} - - {/* */} -
- } - column3={ -
- - {/* */} - updateField("country", value)} - /> - - {/* */} - - {/* */} -
- } - /> - - - - {/* 첨부파일 */} - - {/* 사업자등록증 */} -
-
사업자등록증
-
-
- {attachmentsByType.BUSINESS_REGISTRATION?.length || 0}건 -
- {attachmentsByType.BUSINESS_REGISTRATION?.length > 0 && ( - - )} -
-
- - {/* 신용평가보고서 */} -
-
신용평가보고서
-
-
- {attachmentsByType.CREDIT_REPORT?.length || 0}건 -
- {attachmentsByType.CREDIT_REPORT?.length > 0 && ( - - )} -
-
- - {/* 통장사본 */} -
-
통장사본
-
-
- {attachmentsByType.BANK_ACCOUNT_COPY?.length || 0}건 -
- {attachmentsByType.BANK_ACCOUNT_COPY?.length > 0 && ( - - )} -
-
- - {/* ISO 인증서 */} -
-
ISO 인증서
-
-
- {attachmentsByType.ISO_CERTIFICATION?.length || 0}건 -
- {attachmentsByType.ISO_CERTIFICATION?.length > 0 && ( - - )} -
-
- - {/* 기타 첨부파일 (GENERAL) */} -
-
기타 첨부파일
-
-
- {attachmentsByType.GENERAL?.length || 0}건 -
- {attachmentsByType.GENERAL?.length > 0 && ( - - )} -
-
-
- } - /> - - - - {/* 상세정보 */} - {/* - updateField("representativeName", value)} - /> - - updateField("representativeWorkExperience", value) - } - /> - - - - } - column2={ -
- updateField("representativePhone", value)} - /> - - -
- } - column3={ -
- updateField("representativeEmail", value)} - /> - -
- } - additionalContent={ -
- { - // TODO: 조직도 업데이트 로직 구현 - toast.info( - `[개발중] 조직도 ${field} 필드 업데이트 기능을 구현 예정입니다.` - ); - }} - /> -
-
- 관련 정보 -
-
- - - -
-
-
- } - /> */} - - {/* */} - - {/* 매출정보 */} - {/* - - - - 기준일 - - - 자산 구성 - - - 영업이익 -
- (백만원) -
- - 당기순이익 -
- (백만원) -
- - 부채비율 -
- (%) -
- - 차입금의존도 -
- (%) -
- - 영업이익률 -
- (%) -
- - 순이익률 -
- (%) -
- - 매출액증감 -
- (%) -
- - 유동비율 -
- (%) -
-
- - 총자산 - - 부채총계 - - - 자본총계 - - -
- - {["20231231", "20221231", "20211231"].map((dateKey) => { - const year = dateKey; - const salesData = initialData.salesInfo?.[year]; - const metricsData = initialData.calculatedMetrics?.[dateKey]; - - return ( - - - {year} - - - {salesData - ? ( - parseInt(salesData.totalDebt.replace(/,/g, "")) + - parseInt(salesData.totalEquity.replace(/,/g, "")) - ).toLocaleString() - : "-"} - - - {salesData?.totalDebt || "-"} - - - {salesData?.totalEquity || "-"} - - - {salesData?.operatingProfit || "-"} - - - {salesData?.netIncome || "-"} - - - {metricsData?.debtRatio?.toFixed(1) || "-"} - - - {metricsData?.borrowingDependency?.toFixed(1) || "-"} - - - {metricsData?.operatingMargin?.toFixed(1) || "-"} - - - {metricsData?.netMargin?.toFixed(1) || "-"} - - - {metricsData?.salesGrowth?.toFixed(1) || "-"} - - - {metricsData?.currentRatio?.toFixed(1) || "-"} - - - ); - })} - - - } - /> */} - - {/* */} - - {/* 실사정보 */} - {/* - - - - } - column2={ -
- - -
- } - column3={ -
-
- -
- -
- } - additionalContent={ -
-
-
- 공정소개자료 -
-
- {attachmentsByType.BUSINESS_REGISTRATION?.length || 0}건 -
-
-
-
- QMS Cert -
-
- {attachmentsByType.ISO_CERTIFICATION?.length || 0}건 -
-
-
-
- Product Cert -
-
- {attachmentsByType.PRODUCT_CERT?.length || 0}건 -
-
-
-
- Ex. Cert -
-
- {attachmentsByType.EX_CERT?.length || 0}건 -
-
-
-
- HSE Cert -
-
- {attachmentsByType.HSE_CERT?.length || 0}건 -
-
-
- } - /> */} - - {/* */} - - {/* 계약정보 */} - {/* - - - } - column2={ -
- -
- } - column3={ -
- -
- } - additionalContent={ -
- {[ - { - title: "준법서약", - value: - initialData.contractDetails?.compliancePledgeDate || null, - }, - { - title: "기술자료", - value: initialData.contractDetails?.technicalDataDate || null, - }, - { - title: "비밀유지", - value: - initialData.contractDetails?.confidentialityDate || null, - }, - { - title: "GTC", - value: initialData.contractDetails?.gtcDate || null, - }, - { - title: "표준하도급", - value: - initialData.contractDetails?.standardSubcontractDate || - null, - }, - { - title: "안전보건", - value: initialData.contractDetails?.safetyHealthDate || null, - }, - { - title: "직납자재", - value: - initialData.contractDetails?.directMaterialDate || null, - }, - { - title: "내국신용장", - value: initialData.contractDetails?.domesticLCDate || null, - }, - { - title: "동반성장", - value: initialData.contractDetails?.mutualGrowthDate || null, - }, - { - title: "윤리규범", - value: initialData.contractDetails?.ethicsDate || null, - }, - ].map((item, index) => ( -
-
- {item.title} -
-
- {item.value || "-"} -
-
- ))} -
- } - /> */} - - - - {/* 추가 조회 기능 버튼들 */} -
-
상세 정보 조회
-
- - - - - - - -
-
- - - {/* 다이얼로그들 */} - - - - - {registrationData && ( - - )} - - - - ); -} diff --git a/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/constants.ts b/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/constants.ts deleted file mode 100644 index d16f791f..00000000 --- a/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const noDataString = "-"; \ No newline at end of file diff --git a/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/page.tsx b/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/page.tsx index ae63d77d..629717fb 100644 --- a/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/page.tsx +++ b/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/page.tsx @@ -1,5 +1,5 @@ -import { getVendorData } from "./actions"; -import BasicInfoClient from "./basic-info-client"; +import { getVendorData } from "@/lib/vendor-basic-info/actions"; +import BasicInfoClient from "@/lib/vendor-basic-info/basic-info-client"; interface VendorBasicPageProps { params: { diff --git a/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/types.ts b/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/types.ts deleted file mode 100644 index ead3a44c..00000000 --- a/app/[lng]/evcp/(evcp)/vendors/[id]/info/basic/types.ts +++ /dev/null @@ -1,180 +0,0 @@ -export interface VendorContact { - id: number; - contactName: string; - contactPosition: string; - contactEmail: string; - contactPhone: string; - isPrimary: boolean; -} - -export interface VendorAttachment { - id: number; - fileName: string; - filePath: string; - attachmentType: string; - createdAt: string; -} - -export interface VendorProcessInfo { - processCount: number; - processPIC: string; - processApprovalDate: string; - implementationApproval: string; -} - -export interface VendorContractInfo { - contractRegistrationNumber: string; - contractPeriod: string; - lastEquipmentInspection: string; -} - -export interface VendorSalesData { - totalSales: string; - totalDebt: string; - totalEquity: string; - operatingProfit: string; - netIncome: string; -} - -export interface VendorAdditionalInfo { - postalCode: string; - detailAddress: string; - mainBusiness: string; - employeeCount: number; - businessType: string; -} - -export interface VendorOrganization { - representative: number; - sales: number; - design: number; - procurement: number; - production: number; - quality: number; -} - -export interface VendorFactoryInfo { - factoryAddress: string; - factoryEstablishmentDate: string; - factoryPIC: string; - factoryPICContact: string; - factoryPICEmail: string; -} - -export interface VendorInspectionInfo { - inspectionResult: string; - inspectionDate: string; - inspectionReportUrl?: string; -} - -export interface VendorEvaluationInfo { - regularEvaluationGrade: string; - safetyQualificationEvaluation: string; - companyTransactionRatio: string; -} - -export interface VendorClassificationInfo { - vendorClassification: string; - groupCompany: string; - preferredLanguage: string; - industryType: string; - isoCertification: string; -} - -export interface VendorContractDetails { - regularRegistrationStatus: string; - preferredContractTerms: string; - recentTransactionStatus: string; - compliancePledgeDate: string; - technicalDataDate: string; - confidentialityDate: string; - gtcDate: string; - standardSubcontractDate: string; - safetyHealthDate: string; - directMaterialDate: string; - domesticLCDate: string; - mutualGrowthDate: string; - ethicsDate: string; -} - -export interface VendorCapacityInfo { - annualSales: string; - productionCapacity: string; - mainSupplyItems: string; -} - -export interface VendorCalculatedMetrics { - debtRatio: number; - borrowingDependency: number; - operatingMargin: number; - netMargin: number; - salesGrowth: number; - currentRatio: number; -} - -export interface VendorData { - id: number; - vendorName: string; - vendorCode: string; - taxId: string; - address: string; - addressDetail: string; - postalCode: string; - businessSize: string; - country: string; - phone: string; - fax: string; - email: string; - website: string; - status: string; - representativeName: string; - representativeBirth: string; - representativeEmail: string; - representativePhone: string; - representativeWorkExperience: boolean; - corporateRegistrationNumber: string; - creditAgency: string; - creditRating: string; - cashFlowRating: string; - createdAt: string; - updatedAt: string; - contacts: VendorContact[]; - attachments: VendorAttachment[]; - processInfo: VendorProcessInfo; - contractInfo: VendorContractInfo; - salesInfo: { - [year: string]: VendorSalesData; - }; - additionalInfo: VendorAdditionalInfo; - organization: VendorOrganization; - factoryInfo: VendorFactoryInfo; - inspectionInfo: VendorInspectionInfo; - evaluationInfo: VendorEvaluationInfo; - classificationInfo: VendorClassificationInfo; - contractDetails: VendorContractDetails; - capacityInfo: VendorCapacityInfo; - calculatedMetrics: { - [year: string]: VendorCalculatedMetrics; - }; -} - -export interface VendorFormData { - vendorName: string; - representativeName: string; - representativeWorkExperience: boolean; - representativeBirth: string; - representativePhone: string; - representativeEmail: string; - addressDetail: string; - postalCode: string; - phone: string; - fax: string; - email: string; - address: string; - businessSize: string; - country: string; - website: string; - businessType: string; - employeeCount: number; - mainBusiness: string; -} \ No newline at end of file diff --git a/app/[lng]/partners/(partners)/sales-force-test/page.tsx b/app/[lng]/partners/(partners)/sales-force-test/page.tsx deleted file mode 100644 index 8d6cbfbc..00000000 --- a/app/[lng]/partners/(partners)/sales-force-test/page.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import path from "path"; -import { promises as fs } from "fs"; - -type PageProps = { - params: { lng: string }; -}; - -export default async function Page({ params }: PageProps) { - const filePath = path.join( - process.cwd(), - "app", - "[lng]", - "partners", - "(partners)", - "sales-force-test", - "AF_poc.html" - ); - - const html = await fs.readFile(filePath, "utf8"); - - return ( -
-