From 8a19a6fa336768d8b6712752c9d713360067ecb0 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 8 Dec 2025 08:45:20 +0000 Subject: (최겸) 구매 피드백 수정, 안전담당자, pq항목 내 첨부, 내외자 구분, 도로명주소 api 반영(운영기준) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/compliance/services.ts | 5 + .../table/compliance-survey-templates-toolbar.tsx | 2 +- lib/compliance/table/red-flag-managers-dialog.tsx | 149 ++++++++++++++------- 3 files changed, 110 insertions(+), 46 deletions(-) (limited to 'lib/compliance') diff --git a/lib/compliance/services.ts b/lib/compliance/services.ts index 2856cb0a..03c19952 100644 --- a/lib/compliance/services.ts +++ b/lib/compliance/services.ts @@ -1148,6 +1148,7 @@ export async function getRedFlagManagers() { with: { purchasingManager: true, complianceManager: true, + hseManager: true, }, orderBy: [desc(redFlagManagers.createdAt)], }); @@ -1163,6 +1164,7 @@ export async function getRedFlagManagers() { export async function createRedFlagManagers(data: { purchasingManagerId: number | null; complianceManagerId: number | null; + hseManagerId: number | null; }) { try { const [newManager] = await db @@ -1170,6 +1172,7 @@ export async function createRedFlagManagers(data: { .values({ purchasingManagerId: data.purchasingManagerId, complianceManagerId: data.complianceManagerId, + hseManagerId: data.hseManagerId, }) .returning(); @@ -1187,6 +1190,7 @@ export async function updateRedFlagManagers( data: { purchasingManagerId?: number | null; complianceManagerId?: number | null; + hseManagerId?: number | null; } ) { try { @@ -1220,6 +1224,7 @@ export async function getOrCreateRedFlagManagers() { await createRedFlagManagers({ purchasingManagerId: null, complianceManagerId: null, + hseManagerId: null, }); // 다시 relations를 포함해서 조회 diff --git a/lib/compliance/table/compliance-survey-templates-toolbar.tsx b/lib/compliance/table/compliance-survey-templates-toolbar.tsx index 3e5f7f4d..31231d45 100644 --- a/lib/compliance/table/compliance-survey-templates-toolbar.tsx +++ b/lib/compliance/table/compliance-survey-templates-toolbar.tsx @@ -35,7 +35,7 @@ export function ComplianceSurveyTemplatesToolbarActions({ table }: ComplianceSur {/** 2) 레드플래그 담당자 관리 */} - + {/** 3) Export 버튼 */} - 레드플래그 담당자 관리 + {mode === "hse" ? "안전(HSE) 담당자 관리" : "레드플래그 담당자 관리"} - 레드플래그 발생 시 알림을 받을 담당자를 지정합니다. + {mode === "hse" + ? "PQ 제출 및 안전 관련 알림을 받을 담당자를 지정합니다." + : "레드플래그 발생 시 알림을 받을 담당자를 지정합니다."} @@ -139,43 +174,67 @@ export function RedFlagManagersDialog() { ) : (
- {/* 구매기획 담당자 */} -
- - -

- 레드플래그 발생 시 알림을 받을 구매기획 담당자를 지정합니다. -

-
+ {mode === "redflag" && ( + <> + {/* 구매기획 담당자 */} +
+ + +

+ 레드플래그 발생 시 알림을 받을 구매기획 담당자를 지정합니다. +

+
- {/* 준법 담당자 */} -
- - -

- 레드플래그 발생 시 알림을 받을 준법 담당자를 지정합니다. -

-
+ {/* 준법 담당자 */} +
+ + +

+ 레드플래그 발생 시 알림을 받을 준법 담당자를 지정합니다. +

+
+ + )} + + {mode === "hse" && ( +
+ + +

+ PQ 제출 및 안전 관련 알림을 받을 담당자를 지정합니다. +

+
+ )}
)} -- cgit v1.2.3