fix(WEB): 건설 견적 관리 개선
- 견적 상세/수정 페이지 타입 수정 - actions.ts API 연동 개선
This commit is contained in:
@@ -69,8 +69,21 @@ interface ApiSiteBriefing {
|
||||
id: number;
|
||||
briefing_code: string;
|
||||
title: string;
|
||||
description: string | null;
|
||||
briefing_date: string;
|
||||
briefing_time: string | null;
|
||||
location: string | null;
|
||||
address: string | null;
|
||||
status: string;
|
||||
bid_status: string;
|
||||
bid_date: string | null;
|
||||
attendance_status: string;
|
||||
attendees: Array<{ name: string; department?: string }> | null;
|
||||
attendee_count: number;
|
||||
site_count: number;
|
||||
construction_start_date: string | null;
|
||||
construction_end_date: string | null;
|
||||
vat_type: string;
|
||||
partner?: {
|
||||
id: number;
|
||||
name: string;
|
||||
@@ -162,26 +175,38 @@ function mapQuoteStatusToEstimateStatus(
|
||||
*/
|
||||
function transformQuoteToEstimateDetail(apiData: ApiQuote): EstimateDetail {
|
||||
const base = transformQuoteToEstimate(apiData);
|
||||
const sb = apiData.site_briefing;
|
||||
|
||||
const siteBriefing: SiteBriefingInfo = apiData.site_briefing
|
||||
// 참석자 정보 변환
|
||||
const attendeeNames = sb?.attendees
|
||||
? sb.attendees.map((a) => a.name).join(', ')
|
||||
: '';
|
||||
|
||||
// 공사기간 문자열 생성
|
||||
const constructionPeriod =
|
||||
sb?.construction_start_date && sb?.construction_end_date
|
||||
? `${sb.construction_start_date} ~ ${sb.construction_end_date}`
|
||||
: '';
|
||||
|
||||
const siteBriefing: SiteBriefingInfo = sb
|
||||
? {
|
||||
briefingCode: apiData.site_briefing.briefing_code || '',
|
||||
partnerName: apiData.site_briefing.partner?.name || '',
|
||||
companyName: '',
|
||||
briefingDate: apiData.site_briefing.briefing_date || '',
|
||||
attendee: '',
|
||||
briefingCode: sb.briefing_code || '',
|
||||
partnerName: sb.partner?.name || '',
|
||||
companyName: sb.partner?.name || '',
|
||||
briefingDate: sb.briefing_date || '',
|
||||
attendee: attendeeNames,
|
||||
}
|
||||
: { briefingCode: '', partnerName: '', companyName: '', briefingDate: '', attendee: '' };
|
||||
|
||||
const bidInfo: BidInfo = {
|
||||
projectName: apiData.site_name || '',
|
||||
bidDate: apiData.registration_date || '',
|
||||
siteCount: 0,
|
||||
constructionPeriod: '',
|
||||
constructionStartDate: '',
|
||||
constructionEndDate: '',
|
||||
vatType: 'excluded',
|
||||
workReport: '',
|
||||
projectName: sb?.title || apiData.site_name || '',
|
||||
bidDate: sb?.bid_date || apiData.registration_date || '',
|
||||
siteCount: sb?.site_count || 0,
|
||||
constructionPeriod,
|
||||
constructionStartDate: sb?.construction_start_date || '',
|
||||
constructionEndDate: sb?.construction_end_date || '',
|
||||
vatType: (sb?.vat_type as 'excluded' | 'included') || 'excluded',
|
||||
workReport: sb?.description || '',
|
||||
documents: [],
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user