From 261c45877f58af5779ef796c0c9186ed021e028e Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Tue, 21 Oct 2025 14:57:57 +0900
Subject: (김준회) SWP 'VDR List 관리' 기능 (도면리스트) DOC_CLASS 누락건 처리
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../plant/document-stage-dialogs.tsx | 31 ++++++++++++++++++++++
.../plant/document-stages-service.ts | 2 ++
.../plant/shi-buyer-system-api.ts | 12 ++++-----
3 files changed, 39 insertions(+), 6 deletions(-)
(limited to 'lib')
diff --git a/lib/vendor-document-list/plant/document-stage-dialogs.tsx b/lib/vendor-document-list/plant/document-stage-dialogs.tsx
index d40af4c3..8a7dcbc4 100644
--- a/lib/vendor-document-list/plant/document-stage-dialogs.tsx
+++ b/lib/vendor-document-list/plant/document-stage-dialogs.tsx
@@ -92,6 +92,7 @@ const getStatusText = (status: string) => {
// Form validation schema
const documentFormSchema = z.object({
documentClassId: z.string().min(1, "Document class is required"),
+ docClass: z.string().min(1, "Document class is required"),
title: z.string().min(1, "Document title is required"),
shiFieldValues: z.record(z.string()).optional(),
cpyFieldValues: z.record(z.string()).optional(),
@@ -132,6 +133,7 @@ export function AddDocumentDialog({
resolver: zodResolver(documentFormSchema),
defaultValues: {
documentClassId: '',
+ docClass: '',
title: '',
shiFieldValues: {},
cpyFieldValues: {},
@@ -378,6 +380,7 @@ export function AddDocumentDialog({
const submitData = {
contractId,
documentClassId: Number(data.documentClassId),
+ docClass: data.docClass,
title: data.title,
docNumber: shiDocNumber,
vendorDocNumber: cpyDocNumber,
@@ -615,6 +618,34 @@ export function AddDocumentDialog({
)}
+ {/* Document Class Selection (B3, B4, B5) */}
+
+
+
(
+
+ )}
+ />
+ {form.formState.errors.docClass && (
+
+ {form.formState.errors.docClass.message}
+
+ )}
+
+
{/* Document Class Options with Plan Dates */}
{documentClassOptions.length > 0 && (
diff --git a/lib/vendor-document-list/plant/document-stages-service.ts b/lib/vendor-document-list/plant/document-stages-service.ts
index cff448d5..ae9ea314 100644
--- a/lib/vendor-document-list/plant/document-stages-service.ts
+++ b/lib/vendor-document-list/plant/document-stages-service.ts
@@ -869,6 +869,7 @@ interface CreateDocumentData {
contractId: number
documentNumberTypeId: number
documentClassId: number
+ docClass: string
title: string
docNumber: string
fieldValues: Record
@@ -915,6 +916,7 @@ export async function createDocument(data: CreateDocumentData) {
contractId: data.contractId,
docNumber: data.docNumber,
title: data.title,
+ docClass: data.docClass, // 문서 분류 추가
status: "ACTIVE" as const,
createdAt: new Date(),
updatedAt: new Date(),
diff --git a/lib/vendor-document-list/plant/shi-buyer-system-api.ts b/lib/vendor-document-list/plant/shi-buyer-system-api.ts
index 9256eaf4..f82151cd 100644
--- a/lib/vendor-document-list/plant/shi-buyer-system-api.ts
+++ b/lib/vendor-document-list/plant/shi-buyer-system-api.ts
@@ -289,8 +289,8 @@ export class ShiBuyerSystemAPI {
SHI_DOC_NO: doc.docNumber,
CATEGORY: 'SHIP',
// 김준식 프로 요청으로 RESPONSIBLE_CD / RESPONSIBLE 값 변경 (251002,김준회)
- RESPONSIBLE_CD: 'C00001',
- RESPONSIBLE: 'SHI',
+ RESPONSIBLE_CD: 'C00001', // 고정
+ RESPONSIBLE: 'SHI', // 고정
VNDR_CD: doc.vendorCode || '',
VNDR_NM: doc.vendorName || '',
DSN_SKL: 'B3',
@@ -300,13 +300,13 @@ export class ShiBuyerSystemAPI {
CG_EMPNM1: '',
OWN_DOC_NO: doc.vendorDocNumber || doc.docNumber,
DSC: doc.title,
- DOC_CLASS: 'B3',
+ DOC_CLASS: doc.docClass || '', // 선택한 DOC_CLASS 사용
COMMENT: doc.buyerSystemComment || '', // 실제 코멘트 전송
// 조민정 프로 요청으로 'ACTIVE' --> '생성요청' 값으로 변경 (251002,김준회)
- STATUS: '생성요청',
- CRTER: 'EVCP_SYSTEM',
+ STATUS: '생성요청', // 고정
+ CRTER: 'EVCP_SYSTEM', // 고정
CRTE_DTM: new Date().toISOString(),
- CHGR: 'EVCP_SYSTEM',
+ CHGR: 'EVCP_SYSTEM', // 고정
CHG_DTM: new Date().toISOString(),
}));
--
cgit v1.2.3