summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-10-21 14:57:57 +0900
committerjoonhoekim <26rote@gmail.com>2025-10-21 14:57:57 +0900
commit261c45877f58af5779ef796c0c9186ed021e028e (patch)
tree804ae05274268b6a6a3e3d5942def114422eb6c0 /lib
parent110919f19e1d42465e2438f668587293c66da733 (diff)
(김준회) SWP 'VDR List 관리' 기능 (도면리스트) DOC_CLASS 누락건 처리
Diffstat (limited to 'lib')
-rw-r--r--lib/vendor-document-list/plant/document-stage-dialogs.tsx31
-rw-r--r--lib/vendor-document-list/plant/document-stages-service.ts2
-rw-r--r--lib/vendor-document-list/plant/shi-buyer-system-api.ts12
3 files changed, 39 insertions, 6 deletions
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({
)}
</div>
+ {/* Document Class Selection (B3, B4, B5) */}
+ <div className="space-y-2">
+ <Label htmlFor="docClass">
+ Document Class <span className="text-red-500">*</span>
+ </Label>
+ <Controller
+ name="docClass"
+ control={form.control}
+ render={({ field }) => (
+ <Select value={field.value} onValueChange={field.onChange}>
+ <SelectTrigger>
+ <SelectValue placeholder="Select document class (B3, B4, B5)" />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="B3">B3 - Basic Engineering Document</SelectItem>
+ <SelectItem value="B4">B4 - Detail Engineering Document</SelectItem>
+ <SelectItem value="B5">B5 - Vendor Document</SelectItem>
+ </SelectContent>
+ </Select>
+ )}
+ />
+ {form.formState.errors.docClass && (
+ <p className="text-xs text-red-500">
+ {form.formState.errors.docClass.message}
+ </p>
+ )}
+ </div>
+
{/* Document Class Options with Plan Dates */}
{documentClassOptions.length > 0 && (
<Card>
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<string, string>
@@ -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(),
}));