diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-30 06:41:26 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-30 06:41:26 +0000 |
| commit | 9e3458481a65bb5572b7f1916e7c068b54a434c5 (patch) | |
| tree | 27cc8dfd5fc0ed2efba4b87998caf6b2747ad312 /lib/basic-contract/template/create-revision-dialog.tsx | |
| parent | f9afa89a4f27283f5b115cd89ececa08145b5c89 (diff) | |
(최겸) 구매 협력업체 정기평가, 가입승인, 기본계약 리비전 등
Diffstat (limited to 'lib/basic-contract/template/create-revision-dialog.tsx')
| -rw-r--r-- | lib/basic-contract/template/create-revision-dialog.tsx | 112 |
1 files changed, 1 insertions, 111 deletions
diff --git a/lib/basic-contract/template/create-revision-dialog.tsx b/lib/basic-contract/template/create-revision-dialog.tsx index 6ae03cc2..f1a48c46 100644 --- a/lib/basic-contract/template/create-revision-dialog.tsx +++ b/lib/basic-contract/template/create-revision-dialog.tsx @@ -41,7 +41,6 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com import { Separator } from "@/components/ui/separator"; import { Badge } from "@/components/ui/badge"; import { useRouter } from "next/navigation"; -import { BUSINESS_UNITS } from "@/config/basicContractColumnsConfig"; import { BasicContractTemplate } from "@/db/schema"; // 템플릿 이름 옵션 정의 @@ -115,14 +114,7 @@ export function CreateRevisionDialog({ return { revision: suggestedRevision, legalReviewRequired: baseTemplate.legalReviewRequired, - shipBuildingApplicable: baseTemplate.shipBuildingApplicable, - windApplicable: baseTemplate.windApplicable, - pcApplicable: baseTemplate.pcApplicable, - nbApplicable: baseTemplate.nbApplicable, - rcApplicable: baseTemplate.rcApplicable, - gyApplicable: baseTemplate.gyApplicable, - sysApplicable: baseTemplate.sysApplicable, - infraApplicable: baseTemplate.infraApplicable, + }; }, [baseTemplate, suggestedRevision]); @@ -149,26 +141,6 @@ export function CreateRevisionDialog({ } }; - // 모든 적용 범위 선택/해제 - const handleSelectAllScopes = (checked: boolean) => { - BUSINESS_UNITS.forEach(unit => { - form.setValue(unit.key as keyof CreateRevisionFormValues, checked); - }); - }; - - // 이전 설정 복사 - const handleCopyPreviousSettings = () => { - if (!baseTemplate) return; - - BUSINESS_UNITS.forEach(unit => { - const value = baseTemplate[unit.key as keyof BasicContractTemplate] as boolean; - form.setValue(unit.key as keyof CreateRevisionFormValues, value); - }); - - form.setValue("legalReviewRequired", baseTemplate.legalReviewRequired); - toast.success("이전 설정이 복사되었습니다."); - }; - // 청크 크기 설정 (1MB) const CHUNK_SIZE = 1 * 1024 * 1024; @@ -248,14 +220,6 @@ export function CreateRevisionDialog({ templateName: baseTemplate.templateName, revision: formData.revision, legalReviewRequired: formData.legalReviewRequired, - shipBuildingApplicable: formData.shipBuildingApplicable, - windApplicable: formData.windApplicable, - pcApplicable: formData.pcApplicable, - nbApplicable: formData.nbApplicable, - rcApplicable: formData.rcApplicable, - gyApplicable: formData.gyApplicable, - sysApplicable: formData.sysApplicable, - infraApplicable: formData.infraApplicable, fileName: uploadResult.fileName, filePath: uploadResult.filePath, }), @@ -293,11 +257,6 @@ export function CreateRevisionDialog({ } }, [open, form]); - // 현재 선택된 적용 범위 수 - const selectedScopesCount = BUSINESS_UNITS.filter(unit => - form.watch(unit.key as keyof CreateRevisionFormValues) - ).length; - if (!baseTemplate) return null; return ( @@ -386,74 +345,6 @@ export function CreateRevisionDialog({ </CardContent> </Card> - {/* 적용 범위 */} - <Card> - <CardHeader> - <CardTitle className="text-lg"> - 적용 범위 <span className="text-red-500">*</span> - </CardTitle> - <CardDescription> - 이 리비전이 적용될 사업부를 선택하세요. ({selectedScopesCount}개 선택됨) - </CardDescription> - </CardHeader> - <CardContent className="space-y-4"> - <div className="flex items-center justify-between"> - <div className="flex items-center space-x-2"> - <Checkbox - id="select-all" - checked={selectedScopesCount === BUSINESS_UNITS.length} - onCheckedChange={handleSelectAllScopes} - /> - <label htmlFor="select-all" className="text-sm font-medium"> - 전체 선택 - </label> - </div> - <Button - type="button" - variant="outline" - size="sm" - onClick={handleCopyPreviousSettings} - > - <Copy className="h-4 w-4 mr-1" /> - 이전 설정 복사 - </Button> - </div> - - <Separator /> - - <div className="grid grid-cols-2 md:grid-cols-4 gap-4"> - {BUSINESS_UNITS.map((unit) => ( - <FormField - key={unit.key} - control={form.control} - name={unit.key as keyof CreateRevisionFormValues} - render={({ field }) => ( - <FormItem className="flex flex-row items-start space-x-3 space-y-0"> - <FormControl> - <Checkbox - checked={field.value as boolean} - onCheckedChange={field.onChange} - /> - </FormControl> - <div className="space-y-1 leading-none"> - <FormLabel className="text-sm font-normal"> - {unit.label} - </FormLabel> - </div> - </FormItem> - )} - /> - ))} - </div> - - {form.formState.errors.shipBuildingApplicable && ( - <p className="text-sm text-destructive"> - {form.formState.errors.shipBuildingApplicable.message} - </p> - )} - </CardContent> - </Card> - {/* 파일 업로드 */} <Card> <CardHeader> @@ -529,7 +420,6 @@ export function CreateRevisionDialog({ disabled={ isLoading || !form.watch("file") || - !BUSINESS_UNITS.some(unit => form.watch(unit.key as keyof CreateRevisionFormValues)) || form.watch("revision") <= baseTemplate.revision } > |
