diff options
| -rw-r--r-- | app/[lng]/partners/pq_new/[id]/page.tsx | 12 | ||||
| -rw-r--r-- | components/pq-input/pq-input-tabs.tsx | 2 | ||||
| -rw-r--r-- | components/vendor-regular-registrations/additional-info-dialog.tsx | 124 |
3 files changed, 104 insertions, 34 deletions
diff --git a/app/[lng]/partners/pq_new/[id]/page.tsx b/app/[lng]/partners/pq_new/[id]/page.tsx index 3c2858f2..5a8313cc 100644 --- a/app/[lng]/partners/pq_new/[id]/page.tsx +++ b/app/[lng]/partners/pq_new/[id]/page.tsx @@ -103,7 +103,7 @@ export default async function PQEditPage(props: PQEditPageProps) { const pqData = await getPQDataByVendorId(idAsNumber, pqSubmission.projectId || undefined); // 상태에 따른 읽기 전용 모드 결정 - const isReadOnly = ["SUBMITTED", "APPROVED"].includes(pqSubmission.status); + const isReadOnly = [ "APPROVED"].includes(pqSubmission.status); const statusText = pqSubmission.status === "SUBMITTED" ? "제출됨" : pqSubmission.status === "APPROVED" ? "승인됨" : pqSubmission.status === "REJECTED" ? "거부됨" : "작성 중"; @@ -140,7 +140,7 @@ export default async function PQEditPage(props: PQEditPageProps) { </h2> <p className="text-muted-foreground"> 상태: {statusText} - {pqSubmission.rejectReason && ( + {pqSubmission.status === "REJECTED" && pqSubmission.rejectReason && ( <span className="text-destructive ml-2"> (거부 사유: {pqSubmission.rejectReason}) </span> @@ -151,16 +151,15 @@ export default async function PQEditPage(props: PQEditPageProps) { </div> {/* 읽기 전용 모드 알림 */} - {isReadOnly && ( + {/* {isReadOnly && ( <Alert> <AlertDescription> - 이 PQ는 이미 제출되었습니다. 내용을 확인만 할 수 있습니다. + 이 PQ는 현재 제출된 상태입니다. SHI 코멘트를 확인 후 재제출이 가능합니다. </AlertDescription> </Alert> - )} + )} */} {/* PQ 입력 컴포넌트 */} - <div className={isReadOnly ? "opacity-60" : ""}> <PQInputTabs data={pqData} vendorId={idAsNumber} @@ -173,7 +172,6 @@ export default async function PQEditPage(props: PQEditPageProps) { type: pqSubmission.type }} /> - </div> </Shell> ); } catch (error) { diff --git a/components/pq-input/pq-input-tabs.tsx b/components/pq-input/pq-input-tabs.tsx index 4e6b7ed2..9cdb5e8d 100644 --- a/components/pq-input/pq-input-tabs.tsx +++ b/components/pq-input/pq-input-tabs.tsx @@ -1300,7 +1300,7 @@ export function PQInputTabs({ {projectId ? `${projectData?.projectCode} 프로젝트의 PQ 응답을 제출하시겠습니까?` : "일반 PQ 응답을 제출하시겠습니까?" - } 제출 후에는 수정이 불가능합니다. + } </DialogDescription> </DialogHeader> diff --git a/components/vendor-regular-registrations/additional-info-dialog.tsx b/components/vendor-regular-registrations/additional-info-dialog.tsx index 303c6d7e..82751749 100644 --- a/components/vendor-regular-registrations/additional-info-dialog.tsx +++ b/components/vendor-regular-registrations/additional-info-dialog.tsx @@ -16,6 +16,14 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
+import {
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+} from "@/components/ui/select";
+import { DatePicker } from "@/components/ui/date-picker"
import {
Form,
@@ -80,6 +88,34 @@ const contactTypes = [ { value: "tax_invoice", label: "세금계산서", required: true },
];
+// 드롭다운 옵션들
+const businessTypeOptions = [
+ "건설업외",
+ "기타숙박업외",
+ "산업기계외",
+ "선박",
+ "선박건조외",
+ "선박산업기기",
+ "임대",
+ "철구조물외"
+];
+
+const industryTypeOptions = [
+ "건설업외",
+ "부동산",
+ "산업",
+ "숙박음식",
+ "제조도매외",
+ "제조업"
+];
+
+const companySizeOptions = [
+ "소기업",
+ "중소기업",
+ "중견기업",
+ "대기업"
+];
+
export function AdditionalInfoDialog({
@@ -349,13 +385,24 @@ export function AdditionalInfoDialog({ render={({ field }) => (
<FormItem>
<FormLabel>사업유형 {!readonly && "*"}</FormLabel>
- <FormControl>
- <Input
- placeholder={readonly ? "" : "사업유형 입력"}
- readOnly={readonly}
- {...field}
- />
- </FormControl>
+ <Select
+ onValueChange={field.onChange}
+ defaultValue={field.value}
+ disabled={readonly}
+ >
+ <FormControl>
+ <SelectTrigger>
+ <SelectValue placeholder={readonly ? "" : "사업유형을 선택하세요"} />
+ </SelectTrigger>
+ </FormControl>
+ <SelectContent>
+ {businessTypeOptions.map((option) => (
+ <SelectItem key={option} value={option}>
+ {option}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
<FormMessage />
</FormItem>
)}
@@ -366,13 +413,24 @@ export function AdditionalInfoDialog({ render={({ field }) => (
<FormItem>
<FormLabel>산업유형 {!readonly && "*"}</FormLabel>
- <FormControl>
- <Input
- placeholder={readonly ? "" : "산업유형 입력"}
- readOnly={readonly}
- {...field}
- />
- </FormControl>
+ <Select
+ onValueChange={field.onChange}
+ defaultValue={field.value}
+ disabled={readonly}
+ >
+ <FormControl>
+ <SelectTrigger>
+ <SelectValue placeholder={readonly ? "" : "산업유형을 선택하세요"} />
+ </SelectTrigger>
+ </FormControl>
+ <SelectContent>
+ {industryTypeOptions.map((option) => (
+ <SelectItem key={option} value={option}>
+ {option}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
<FormMessage />
</FormItem>
)}
@@ -385,13 +443,24 @@ export function AdditionalInfoDialog({ render={({ field }) => (
<FormItem>
<FormLabel>기업규모 {!readonly && "*"}</FormLabel>
- <FormControl>
- <Input
- placeholder={readonly ? "" : "기업규모 입력"}
- readOnly={readonly}
- {...field}
- />
- </FormControl>
+ <Select
+ onValueChange={field.onChange}
+ defaultValue={field.value}
+ disabled={readonly}
+ >
+ <FormControl>
+ <SelectTrigger>
+ <SelectValue placeholder={readonly ? "" : "기업규모를 선택하세요"} />
+ </SelectTrigger>
+ </FormControl>
+ <SelectContent>
+ {companySizeOptions.map((option) => (
+ <SelectItem key={option} value={option}>
+ {option}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
<FormMessage />
</FormItem>
)}
@@ -423,11 +492,14 @@ export function AdditionalInfoDialog({ <FormItem>
<FormLabel>공장설립일 {!readonly && "*"}</FormLabel>
<FormControl>
- <Input
- placeholder={readonly ? "" : "YYYY-MM-DD"}
- type="date"
- readOnly={readonly}
- {...field}
+ {/* datepicker 라이브러리를 사용하는 방식으로 수정 (예: react-datepicker) */}
+ <DatePicker
+ date={field.value ? new Date(field.value) : undefined}
+ onSelect={(date) => {
+ field.onChange(date ? date.toISOString().slice(0, 10) : "");
+ }}
+ placeholder={readonly ? "" : "YYYY-MM-DD"}
+ disabled={readonly}
/>
</FormControl>
<FormMessage />
|
