1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
|
"use client"
import * as React from "react"
import { type Project } from "@/db/schema/projects"
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog"
import {
Table,
TableBody,
TableCell,
TableRow,
} from "@/components/ui/table"
import { Badge } from "@/components/ui/badge"
import { formatDate } from "@/lib/utils"
interface ProjectDetailDialogProps {
project: Project
open: boolean
onOpenChange: (open: boolean) => void
}
export function ProjectDetailDialog({
project,
open,
onOpenChange,
}: ProjectDetailDialogProps) {
const formatValue = (value: string | null | undefined) => {
return value || "-"
}
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-6xl h-[90vh] flex flex-col">
<DialogHeader className="flex-shrink-0">
<DialogTitle className="flex items-center gap-2">
프로젝트 상세 정보
<Badge variant="outline">{project.code}</Badge>
</DialogTitle>
<DialogDescription>
프로젝트코드: {project.code} | {project.name}
</DialogDescription>
</DialogHeader>
<div className="flex-1 overflow-y-auto min-h-0">
<div className="space-y-6 p-4">
<h3 className="text-lg font-semibold mb-3">프로젝트 전체 정보</h3>
<Table>
<TableBody>
{/* 기본 프로젝트 정보 */}
<TableRow>
<TableCell className="font-medium w-1/4">프로젝트 코드</TableCell>
<TableCell>{formatValue(project.code)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">프로젝트명</TableCell>
<TableCell>{formatValue(project.name)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">프로젝트 타입</TableCell>
<TableCell>
<Badge variant={project.type === "ship" ? "default" : "secondary"}>
{project.type === "ship" ? "조선" : "해양"}
</Badge>
</TableCell>
</TableRow>
{/* 선주 및 기본 정보 */}
<TableRow>
<TableCell className="font-medium">선주명</TableCell>
<TableCell>{formatValue(project.OWN_NM)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">선주약어</TableCell>
<TableCell>{formatValue(project.OWN_AB)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">선주1</TableCell>
<TableCell>{formatValue(project.OWN_1)}</TableCell>
</TableRow>
{/* 선급 정보 */}
<TableRow>
<TableCell className="font-medium">선급1</TableCell>
<TableCell>{formatValue(project.CLS_1)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">선급2</TableCell>
<TableCell>{formatValue(project.CLS_2)}</TableCell>
</TableRow>
{/* 선박 정보 */}
<TableRow>
<TableCell className="font-medium">선종</TableCell>
<TableCell>{formatValue(project.SKND)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">선형</TableCell>
<TableCell>{formatValue(project.SHTYPE)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">선형코드</TableCell>
<TableCell>{formatValue(project.SHTYPE_CD)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">선형군</TableCell>
<TableCell>{formatValue(project.SHTYPE_GRP)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">선형단위</TableCell>
<TableCell>{formatValue(project.SHTYPE_UOM)}</TableCell>
</TableRow>
{/* 도크 및 건조 정보 */}
<TableRow>
<TableCell className="font-medium">도크</TableCell>
<TableCell>{formatValue(project.DOCK_CD)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">기준호선</TableCell>
<TableCell>{formatValue(project.MSHIP_NO)}</TableCell>
</TableRow>
{/* 계약 정보 */}
<TableRow>
<TableCell className="font-medium">계약일자</TableCell>
<TableCell>{formatValue(project.CNRT_DT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">계약인도일자</TableCell>
<TableCell>{formatValue(project.CNRT_DL_DT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">실인도일자</TableCell>
<TableCell>{formatValue(project.RL_DL_DT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">선표인도일자</TableCell>
<TableCell>{formatValue(project.BP_DL_DT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">Sail Away Date</TableCell>
<TableCell>{formatValue(project.SA_DT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">고객발주번호</TableCell>
<TableCell>{formatValue(project.CSTM_PO_NO)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">계약존속여부</TableCell>
<TableCell>{formatValue(project.CNRT_CNTN_YN)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">계약유보여부</TableCell>
<TableCell>{formatValue(project.CNRT_RESV_YN)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">전체 계약 대수</TableCell>
<TableCell>{formatValue(project.TOT_CNRT_CNT)}</TableCell>
</TableRow>
{/* 프로젝트 상태 */}
<TableRow>
<TableCell className="font-medium">진행상태</TableCell>
<TableCell>{formatValue(project.PRGS_STAT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">공사진행여부</TableCell>
<TableCell>{formatValue(project.PROJ_PRGS_YN)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">시작일자</TableCell>
<TableCell>{formatValue(project.STDT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">인터페이스 진행단계</TableCell>
<TableCell>{formatValue(project.IF_STAT)}</TableCell>
</TableRow>
{/* 기술 정보 */}
<TableRow>
<TableCell className="font-medium">IMO 번호</TableCell>
<TableCell>{formatValue(project.IMO_NO)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">국적</TableCell>
<TableCell>{formatValue(project.NTTP)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">Main engine type code</TableCell>
<TableCell>{formatValue(project.MN_ENGN_TP_CD)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">관청명</TableCell>
<TableCell>{formatValue(project.GOV)}</TableCell>
</TableRow>
{/* 조직 정보 */}
<TableRow>
<TableCell className="font-medium">사업부</TableCell>
<TableCell>{formatValue(project.BIZCLS)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">사업장코드</TableCell>
<TableCell>{formatValue(project.BIZLOC_CD)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">사업영역</TableCell>
<TableCell>{formatValue(project.BIZ_DMN)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">영업그룹</TableCell>
<TableCell>{formatValue(project.SALE_GRP)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">영업조직</TableCell>
<TableCell>{formatValue(project.SALE_ORG_CD)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">손익센터</TableCell>
<TableCell>{formatValue(project.PRCTR)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">설계담당자</TableCell>
<TableCell>{formatValue(project.DSN_CHRGR)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">회사코드</TableCell>
<TableCell>{formatValue(project.CO_CD)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">플랜트 코드</TableCell>
<TableCell>{formatValue(project.PLNT_CD)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">관리회계영역</TableCell>
<TableCell>{formatValue(project.MNG_ACOT_DMN)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">품질사업부</TableCell>
<TableCell>{formatValue(project.QM_CLS)}</TableCell>
</TableRow>
{/* 프로젝트 세부 정보 */}
<TableRow>
<TableCell className="font-medium">프로젝트 세부타입</TableCell>
<TableCell>{formatValue(project.PROJ_DTL_TP)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">프로젝트 기타타입</TableCell>
<TableCell>{formatValue(project.PROJ_ETC_TP)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">프로젝트구분</TableCell>
<TableCell>{formatValue(project.PROJ_GB)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">프로젝트 프로파일</TableCell>
<TableCell>{formatValue(project.PROJ_PROF)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">프로젝트범위</TableCell>
<TableCell>{formatValue(project.PROJ_SCP)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">프로젝트 WBS타입</TableCell>
<TableCell>{formatValue(project.PROJ_WBS_TP)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">원본 TYPE</TableCell>
<TableCell>{formatValue(project.TYPE)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">(중국)프로젝트타입</TableCell>
<TableCell>{formatValue(project.CHN_PROJ_TP)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">(풍력)프로젝트타입</TableCell>
<TableCell>{formatValue(project.WP_PROJ_TP)}</TableCell>
</TableRow>
{/* 시리즈 정보 */}
<TableRow>
<TableCell className="font-medium">시리즈여부</TableCell>
<TableCell>{formatValue(project.SERS_YN)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">시리즈첫공사번호</TableCell>
<TableCell>{formatValue(project.SERS_NO)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">시리즈번호</TableCell>
<TableCell>{formatValue(project.REF_NO)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">세대수/시리즈</TableCell>
<TableCell>{formatValue(project.GENT_CNT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">연관프로젝트</TableCell>
<TableCell>{formatValue(project.RLTD_PROJ)}</TableCell>
</TableRow>
{/* 제품 정보 */}
<TableRow>
<TableCell className="font-medium">제품 Level 4</TableCell>
<TableCell>{formatValue(project.PDT_LVL_4)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">전기전자 제품군</TableCell>
<TableCell>{formatValue(project.DIGT_PDT_GRP)}</TableCell>
</TableRow>
{/* 프로젝트 관리 정보 */}
<TableRow>
<TableCell className="font-medium">프로젝트 생성요청일</TableCell>
<TableCell>{formatValue(project.PROJ_CRTE_REQ_DT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">프로젝트 생성요청자</TableCell>
<TableCell>{formatValue(project.PROJ_CRTE_REQ_EMPNO)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">모프로젝트 인도계획일</TableCell>
<TableCell>{formatValue(project.PROJ_DL_PLN_DT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">모프로젝트 인도실적일</TableCell>
<TableCell>{formatValue(project.PROJ_DL_RT_DT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">프로포절 프로젝트</TableCell>
<TableCell>{formatValue(project.PRO_PROJ_NO)}</TableCell>
</TableRow>
{/* 안건 정보 */}
<TableRow>
<TableCell className="font-medium">안건번호</TableCell>
<TableCell>{formatValue(project.INQY_NO)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">안건순번</TableCell>
<TableCell>{formatValue(project.INQY_SEQ)}</TableCell>
</TableRow>
{/* 보증 정보 */}
<TableRow>
<TableCell className="font-medium">A/S 보증기간</TableCell>
<TableCell>{formatValue(project.AS_GRNT_PRD)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">Project Warranty Start Date</TableCell>
<TableCell>{formatValue(project.GRNT_STDT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">주문주 보증기간</TableCell>
<TableCell>{formatValue(project.ORDR_GRNT_PRD)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">주문주 보증종료일</TableCell>
<TableCell>{formatValue(project.ORDR_GRNT_FN_DT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">최종수요자 보증종료일</TableCell>
<TableCell>{formatValue(project.FIN_GRNT_FN_DT)}</TableCell>
</TableRow>
{/* 기타 정보 */}
<TableRow>
<TableCell className="font-medium">MC YN</TableCell>
<TableCell>{formatValue(project.NEW_MC_YN)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">사내외 구분</TableCell>
<TableCell>{formatValue(project.IO_GB)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">유통경로</TableCell>
<TableCell>{formatValue(project.DIST_PATH)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">인도전선명</TableCell>
<TableCell>{formatValue(project.DL_BF_PROJ_NM)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">인도고객 ID</TableCell>
<TableCell>{formatValue(project.DL_CSTM_CD)}</TableCell>
</TableRow>
{/* 시스템 정보 */}
<TableRow>
<TableCell className="font-medium">시스템회계마감일자</TableCell>
<TableCell>{formatValue(project.SYS_ACOT_CLSD_DT)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">Source System</TableCell>
<TableCell>{formatValue(project.SRC_SYS_ID)}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">삭제 여부</TableCell>
<TableCell>
{project.DEL_YN ? (
<Badge variant="destructive">삭제됨</Badge>
) : (
<Badge variant="secondary">활성</Badge>
)}
</TableCell>
</TableRow>
{/* 생성/수정 정보 */}
<TableRow>
<TableCell className="font-medium">생성일시</TableCell>
<TableCell>{formatDate(project.createdAt, "KR")}</TableCell>
</TableRow>
<TableRow>
<TableCell className="font-medium">수정일시</TableCell>
<TableCell>{formatDate(project.updatedAt, "KR")}</TableCell>
</TableRow>
</TableBody>
</Table>
</div>
</div>
</DialogContent>
</Dialog>
)
}
|