diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-08-04 09:41:06 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-08-04 09:41:06 +0000 |
| commit | 4dc27e9495b005b29b4d7a2ad404c8c0644769eb (patch) | |
| tree | 1d74ddd3bea33ea67745aeb4f092b7df6c6ef5cb /lib/vendor-investigation | |
| parent | 459873f983cf1468f778109df4c7953c5d40743d (diff) | |
(최겸) 실사 컬럼 수정 및 업데이트 변경, 협력업체 PQ 초대 로직 변경
Diffstat (limited to 'lib/vendor-investigation')
4 files changed, 24 insertions, 16 deletions
diff --git a/lib/vendor-investigation/table/investigation-table-columns.tsx b/lib/vendor-investigation/table/investigation-table-columns.tsx index 6146d940..88b6644f 100644 --- a/lib/vendor-investigation/table/investigation-table-columns.tsx +++ b/lib/vendor-investigation/table/investigation-table-columns.tsx @@ -295,10 +295,14 @@ function formatStatus(status: string): string { function formatEnumValue(value: string): string { switch (value) { // Evaluation types - case "SITE_AUDIT": - return "실사의뢰평가" - case "QM_SELF_AUDIT": - return "QM자체평가" + case "PURCHASE_SELF_EVAL": + return "구매자체평가" + case "DOCUMENT_EVAL": + return "서류평가" + case "PRODUCT_INSPECTION": + return "제품검사평가" + case "SITE_VISIT_EVAL": + return "방문실사평가" // Evaluation results case "APPROVED": diff --git a/lib/vendor-investigation/table/investigation-table.tsx b/lib/vendor-investigation/table/investigation-table.tsx index d5dc05ac..660a8507 100644 --- a/lib/vendor-investigation/table/investigation-table.tsx +++ b/lib/vendor-investigation/table/investigation-table.tsx @@ -102,8 +102,10 @@ export function VendorsInvestigationTable({ promises }: VendorsTableProps) { label: "평가 유형", type: "select", options: [ - { label: "실사의뢰평가", value: "SITE_AUDIT" }, - { label: "QM자체평가", value: "QM_SELF_AUDIT" }, + { label: "구매자체평가", value: "PURCHASE_SELF_EVAL" }, + { label: "서류평가", value: "DOCUMENT_EVAL" }, + { label: "제품검사평가", value: "PRODUCT_INSPECTION" }, + { label: "방문실사평가", value: "SITE_VISIT_EVAL" }, ] }, { diff --git a/lib/vendor-investigation/table/update-investigation-sheet.tsx b/lib/vendor-investigation/table/update-investigation-sheet.tsx index 29f0fa92..fbaf000e 100644 --- a/lib/vendor-investigation/table/update-investigation-sheet.tsx +++ b/lib/vendor-investigation/table/update-investigation-sheet.tsx @@ -125,7 +125,7 @@ export function UpdateVendorInvestigationSheet({ investigationStatus: investigation?.investigationStatus ?? "PLANNED", evaluationType: investigation?.evaluationType ?? undefined, investigationAddress: investigation?.investigationAddress ?? "", - investigationMethod: investigation?.investigationMethod ?? "", + investigationMethod: investigation?.investigationMethod ?? undefined, forecastedAt: investigation?.forecastedAt ?? undefined, requestedAt: investigation?.requestedAt ?? undefined, confirmedAt: investigation?.confirmedAt ?? undefined, @@ -145,7 +145,7 @@ export function UpdateVendorInvestigationSheet({ investigationStatus: investigation.investigationStatus || "PLANNED", evaluationType: investigation.evaluationType ?? undefined, investigationAddress: investigation.investigationAddress ?? "", - investigationMethod: investigation.investigationMethod ?? "", + investigationMethod: investigation.investigationMethod ?? undefined, forecastedAt: investigation.forecastedAt ?? undefined, requestedAt: investigation.requestedAt ?? undefined, confirmedAt: investigation.confirmedAt ?? undefined, @@ -573,8 +573,10 @@ export function UpdateVendorInvestigationSheet({ </SelectTrigger> <SelectContent> <SelectGroup> - <SelectItem value="SITE_AUDIT">실사의뢰평가</SelectItem> - <SelectItem value="QM_SELF_AUDIT">QM자체평가</SelectItem> + <SelectItem value="PURCHASE_SELF_EVAL">구매자체평가</SelectItem> + <SelectItem value="DOCUMENT_EVAL">서류평가</SelectItem> + <SelectItem value="PRODUCT_INSPECTION">제품검사평가</SelectItem> + <SelectItem value="SITE_VISIT_EVAL">방문실사평가</SelectItem> </SelectGroup> </SelectContent> </Select> diff --git a/lib/vendor-investigation/validations.ts b/lib/vendor-investigation/validations.ts index d04f100f..e4ec2b52 100644 --- a/lib/vendor-investigation/validations.ts +++ b/lib/vendor-investigation/validations.ts @@ -33,8 +33,8 @@ export const searchParamsInvestigationCache = createSearchParamsCache({ // Fields specific to vendor investigations // ----------------------------------------------------------------- - // investigationStatus: PLANNED, IN_PROGRESS, COMPLETED, CANCELED - investigationStatus: parseAsStringEnum(["PLANNED", "IN_PROGRESS", "COMPLETED", "CANCELED"]), + // investigationStatus: PLANNED, IN_PROGRESS, COMPLETED, CANCELED, RESULT_SENT + investigationStatus: parseAsStringEnum(["PLANNED", "IN_PROGRESS", "COMPLETED", "CANCELED", "RESULT_SENT"]), // In case you also want to filter by vendorName, vendorCode, etc. vendorName: parseAsString.withDefault(""), @@ -64,12 +64,12 @@ export const updateVendorInvestigationSchema = z.object({ investigationId: z.number({ required_error: "Investigation ID is required", }), - investigationStatus: z.enum(["PLANNED", "IN_PROGRESS", "COMPLETED", "CANCELED"], { + investigationStatus: z.enum(["PLANNED", "IN_PROGRESS", "COMPLETED", "CANCELED", "RESULT_SENT"], { required_error: "실사 상태를 선택해주세요.", }), - evaluationType: z.enum(["SITE_AUDIT", "QM_SELF_AUDIT"]).optional(), + evaluationType: z.enum(["PURCHASE_SELF_EVAL", "DOCUMENT_EVAL", "PRODUCT_INSPECTION", "SITE_VISIT_EVAL"]).optional(), investigationAddress: z.string().optional(), - investigationMethod: z.string().max(100, "실사 방법은 100자 이내로 입력해주세요.").optional(), + investigationMethod: z.enum(["PURCHASE_SELF_EVAL", "DOCUMENT_EVAL", "PRODUCT_INSPECTION", "SITE_VISIT_EVAL"]).optional(), // 날짜 필드들을 string에서 Date로 변환하도록 수정 forecastedAt: z.union([ @@ -97,7 +97,7 @@ export const updateVendorInvestigationSchema = z.object({ .min(0, "평가 점수는 0점 이상이어야 합니다.") .max(100, "평가 점수는 100점 이하여야 합니다.") .optional(), - evaluationResult: z.enum(["APPROVED", "SUPPLEMENT", "REJECTED"]).optional(), + evaluationResult: z.enum(["APPROVED", "SUPPLEMENT", "REJECTED", "RESULT_SENT"]).optional(), investigationNotes: z.string().max(1000, "QM 의견은 1000자 이내로 입력해주세요.").optional(), attachments: z.any().optional(), // File 업로드를 위한 필드 }) |
