summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/items-tech/table/update-items-sheet.tsx32
1 files changed, 17 insertions, 15 deletions
diff --git a/lib/items-tech/table/update-items-sheet.tsx b/lib/items-tech/table/update-items-sheet.tsx
index 91108ba0..7662884c 100644
--- a/lib/items-tech/table/update-items-sheet.tsx
+++ b/lib/items-tech/table/update-items-sheet.tsx
@@ -111,6 +111,7 @@ export function UpdateItemSheet({ item, itemType, open, onOpenChange }: UpdateIt
// 초기값 설정
const form = useForm<UpdateItemSchema>({
defaultValues: {
+ itemCode: item.itemCode,
workType: item.workType,
...getItemTypeSpecificDefaults(item, itemType),
},
@@ -152,22 +153,19 @@ export function UpdateItemSheet({ item, itemType, open, onOpenChange }: UpdateIt
case 'shipbuilding':
result = await modifyShipbuildingItem({
...data,
- id: item.id,
- itemCode: item.itemCode // itemCode는 변경 불가, 원래 값 사용
+ id: item.id
});
break;
case 'offshoreTop':
result = await modifyOffshoreTopItem({
...data,
- id: item.id,
- itemCode: item.itemCode // itemCode는 변경 불가, 원래 값 사용
+ id: item.id
});
break;
case 'offshoreHull':
result = await modifyOffshoreHullItem({
...data,
- id: item.id,
- itemCode: item.itemCode // itemCode는 변경 불가, 원래 값 사용
+ id: item.id
});
break;
default:
@@ -227,15 +225,19 @@ export function UpdateItemSheet({ item, itemType, open, onOpenChange }: UpdateIt
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-4">
- {/* Material Group을 Form 안으로 이동 */}
- <div className="mt-4">
- <div className="grid gap-2">
- <label className="text-sm font-medium leading-none">
- 자재 그룹 (수정 불가)
- </label>
- <Input value={item.itemCode} disabled readOnly />
- </div>
- </div>
+ <FormField
+ control={form.control}
+ name="itemCode"
+ render={({ field }) => (
+ <FormItem>
+ <FormLabel>자재 그룹 <span style={{ color: 'red' }}>*</span></FormLabel>
+ <FormControl>
+ <Input placeholder="자재 그룹을 입력하세요" {...field} />
+ </FormControl>
+ <FormMessage />
+ </FormItem>
+ )}
+ />
<FormField
control={form.control}