diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-12-01 00:58:23 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-12-01 00:58:23 +0000 |
| commit | 8440ac29c7dcbef992039678ecc0fabff2fd04ec (patch) | |
| tree | 59092b8dcd22135009bf70d5863ffde444e5bed2 /components/form-data-plant/import-excel-form.tsx | |
| parent | 748f68bb7b5d02450664651ae5025c9a38fb71a5 (diff) | |
(대표님) S-EDP 관련 대표님 작업사항
Diffstat (limited to 'components/form-data-plant/import-excel-form.tsx')
| -rw-r--r-- | components/form-data-plant/import-excel-form.tsx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/components/form-data-plant/import-excel-form.tsx b/components/form-data-plant/import-excel-form.tsx index ffc6f2f9..8ac70c59 100644 --- a/components/form-data-plant/import-excel-form.tsx +++ b/components/form-data-plant/import-excel-form.tsx @@ -23,7 +23,8 @@ export interface ImportExcelOptions { tableData: GenericData[]; columnsJSON: DataTableColumnJSON[]; formCode?: string; - contractItemId?: number; + projectCode: string; + packageCode: string; editableFieldsMap?: Map<string, string[]>; // 새로 추가 onPendingChange?: (isPending: boolean) => void; onDataUpdate?: (updater: ((prev: GenericData[]) => GenericData[]) | GenericData[]) => void; @@ -218,7 +219,8 @@ export async function importExcelData({ tableData, columnsJSON, formCode, - contractItemId, + projectCode, + packageCode, editableFieldsMap = new Map(), // 새로 추가 onPendingChange, onDataUpdate @@ -527,14 +529,14 @@ export async function importExcelData({ } }); - // If formCode and contractItemId are provided, save directly to DB // importExcelData 함수에서 DB 저장 부분 - if (formCode && contractItemId) { + if (formCode && projectCode && packageCode) { try { // 배치 업데이트 함수 호출 const result = await updateFormDataBatchInDB( formCode, - contractItemId, + projectCode, + packageCode, importedData // 모든 imported rows를 한번에 전달 ); @@ -633,7 +635,6 @@ export async function importExcelData({ } } else { - // formCode나 contractItemId가 없는 경우 - 로컬 업데이트만 if (onDataUpdate) { onDataUpdate(() => mergedData); } |
