fix(admin): remove crm datagrid interop
TaxBaik CI/CD / build-and-deploy (push) Successful in 3m24s

This commit is contained in:
2026-07-05 18:54:14 +09:00
parent 8799fe250b
commit 6a44272f25
3 changed files with 99 additions and 160 deletions
@@ -46,61 +46,44 @@ else
}
else
{
<MudDataGrid T="Contract"
Items="@contracts"
Dense="true"
Hover="true"
Striped="true"
RowsPerPage="30"
SelectedItem="@selectedContract"
SelectedItemChanged="OnRowSelected"
Class="admin-grid">
<Columns>
<PropertyColumn Property="x => x.Id" Title="ID" Sortable="true" />
<TemplateColumn Title="고객">
<CellTemplate>
@if (clientMap.TryGetValue(context.Item.ClientId, out var clientName))
<table class="admin-grid table">
<thead>
<tr>
<th>ID</th>
<th>고객</th>
<th>계약번호</th>
<th>서비스 유형</th>
<th>월 수수료</th>
<th>계약기간</th>
<th>상태</th>
<th>작업</th>
</tr>
</thead>
<tbody>
@foreach (var item in contracts)
{
@clientName
}
</CellTemplate>
</TemplateColumn>
<PropertyColumn Property="x => x.ContractNumber" Title="계약번호" />
<PropertyColumn Property="x => x.ServiceType" Title="서비스 유형" />
<PropertyColumn Property="x => x.MonthlyFee" Title="월 수수료" Format="C" />
<TemplateColumn Title="계약기간">
<CellTemplate>
@context.Item.StartDate.ToString("yyyy-MM-dd")
@if (context.Item.EndDate.HasValue)
var isActive = !item.EndDate.HasValue || item.EndDate.Value >= DateTime.Today;
<tr @onclick="() => OnRowSelected(item)" style="cursor:pointer;">
<td>@item.Id</td>
<td>@clientMap.GetValueOrDefault(item.ClientId)</td>
<td>@item.ContractNumber</td>
<td>@item.ServiceType</td>
<td>@(item.MonthlyFee?.ToString("C") ?? string.Empty)</td>
<td>
@item.StartDate.ToString("yyyy-MM-dd")
@if (item.EndDate.HasValue)
{
<span>~@context.Item.EndDate.Value.ToString("yyyy-MM-dd")</span>
<span>~@item.EndDate.Value.ToString("yyyy-MM-dd")</span>
}
</CellTemplate>
</TemplateColumn>
<TemplateColumn Title="상태">
<CellTemplate>
@{
var isActive = !context.Item.EndDate.HasValue || context.Item.EndDate.Value >= DateTime.Today;
</td>
<td>@(isActive ? "활성" : "만료")</td>
<td>
<button type="button" class="mud-button-root mud-button mud-button-text mud-ripple" @onclick:stopPropagation="true" @onclick="@(async () => await DeleteContract(item.Id))">삭제</button>
</td>
</tr>
}
@if (isActive)
{
<MudChip Size="Size.Small" Color="Color.Success" Variant="Variant.Filled">활성</MudChip>
}
else
{
<MudChip Size="Size.Small" Color="Color.Default" Variant="Variant.Outlined">만료</MudChip>
}
</CellTemplate>
</TemplateColumn>
<TemplateColumn Title="작업" Sortable="false">
<CellTemplate>
<MudIconButton Icon="@Icons.Material.Filled.Delete" Color="Color.Error" Size="Size.Small"
OnClick="@(async () => await DeleteContract(context.Item.Id))" />
</CellTemplate>
</TemplateColumn>
</Columns>
</MudDataGrid>
</tbody>
</table>
}
</MudItem>
@@ -40,35 +40,28 @@ else
}
else
{
<MudDataGrid T="TaxFilingSchedule"
Items="@schedules"
Dense="true"
Hover="true"
Striped="true"
RowsPerPage="30"
SelectedItem="@selectedSchedule"
SelectedItemChanged="OnRowSelected"
Class="admin-grid">
<Columns>
<PropertyColumn Property="x => x.Id" Title="ID" Sortable="true" />
<TemplateColumn Title="고객">
<CellTemplate>
@if (clientMap.TryGetValue(context.Item.ClientId, out var clientName))
<table class="admin-grid table">
<thead>
<tr>
<th>ID</th>
<th>고객</th>
<th>신고 유형</th>
<th>마감일</th>
<th>신고연도</th>
<th>상태</th>
<th>작업</th>
</tr>
</thead>
<tbody>
@foreach (var item in schedules)
{
@clientName
}
</CellTemplate>
</TemplateColumn>
<PropertyColumn Property="x => x.FilingType" Title="신고 유형" />
<TemplateColumn Title="마감일">
<CellTemplate>
@{
var effectiveDueDate = BusinessDayCalculator.GetEffectiveDueDate(DateOnly.FromDateTime(context.Item.DueDate));
var daysLeft = BusinessDayCalculator.GetDday(DateOnly.FromDateTime(context.Item.DueDate));
var statusColor = daysLeft < 0 ? Color.Error : daysLeft <= 7 ? Color.Warning : Color.Success;
}
<MudChip Size="Size.Small" Color="@statusColor" Variant="Variant.Filled">
var effectiveDueDate = BusinessDayCalculator.GetEffectiveDueDate(DateOnly.FromDateTime(item.DueDate));
var daysLeft = BusinessDayCalculator.GetDday(DateOnly.FromDateTime(item.DueDate));
<tr @onclick="() => OnRowSelected(item)" style="cursor:pointer;">
<td>@item.Id</td>
<td>@clientMap.GetValueOrDefault(item.ClientId)</td>
<td>@item.FilingType</td>
<td>
@effectiveDueDate.ToDateTime(TimeOnly.MinValue).ToString("yyyy-MM-dd")
@if (daysLeft >= 0)
{
@@ -78,41 +71,20 @@ else
{
<span class="ms-1">(마감 @Math.Abs(daysLeft)일 경과)</span>
}
</MudChip>
</CellTemplate>
</TemplateColumn>
<PropertyColumn Property="x => x.FilingYear" Title="신고연도" />
<TemplateColumn Title="상태">
<CellTemplate>
@if (context.Item.Status == "completed")
</td>
<td>@item.FilingYear</td>
<td>@(item.Status == "completed" ? "완료" : "대기")</td>
<td>
<button type="button" class="mud-button-root mud-button mud-button-text mud-ripple" @onclick:stopPropagation="true" @onclick="@(async () => await DeleteSchedule(item.Id))">삭제</button>
@if (item.Status != "completed")
{
<MudChip Size="Size.Small" Color="Color.Success" Variant="Variant.Filled">완료</MudChip>
<button type="button" class="mud-button-root mud-button mud-button-text mud-ripple ms-2" @onclick:stopPropagation="true" @onclick="@(async () => await CompleteSchedule(item.Id))">완료</button>
}
else
{
<MudChip Size="Size.Small" Color="Color.Default" Variant="Variant.Outlined">대기</MudChip>
</td>
</tr>
}
</CellTemplate>
</TemplateColumn>
<TemplateColumn Title="작업" Sortable="false">
<CellTemplate>
<MudButtonGroup Size="Size.Small" Variant="Variant.Outlined">
@if (context.Item.Status != "completed")
{
<MudIconButton Icon="@Icons.Material.Filled.CheckCircle"
Color="Color.Success"
OnClick="@(async () => await CompleteSchedule(context.Item.Id))"
Title="완료" />
}
<MudIconButton Icon="@Icons.Material.Filled.Delete"
Color="Color.Error"
OnClick="@(async () => await DeleteSchedule(context.Item.Id))"
Title="삭제" />
</MudButtonGroup>
</CellTemplate>
</TemplateColumn>
</Columns>
</MudDataGrid>
</tbody>
</table>
}
</MudItem>
@@ -36,49 +36,33 @@ else
}
else
{
<MudDataGrid T="TaxProfile"
Items="@profiles"
Dense="true"
Hover="true"
Striped="true"
RowsPerPage="30"
SelectedItem="@selectedProfile"
SelectedItemChanged="OnRowSelected"
Class="admin-grid">
<Columns>
<PropertyColumn Property="x => x.Id" Title="ID" Sortable="true" />
<TemplateColumn Title="고객">
<CellTemplate>
@if (clientMap.TryGetValue(context.Item.ClientId, out var clientName))
<table class="admin-grid table">
<thead>
<tr>
<th>ID</th>
<th>고객</th>
<th>사업 유형</th>
<th>위험도</th>
<th>다음 신고</th>
<th>작업</th>
</tr>
</thead>
<tbody>
@foreach (var item in profiles)
{
@clientName
<tr @onclick="() => OnRowSelected(item)" style="cursor:pointer;">
<td>@item.Id</td>
<td>@clientMap.GetValueOrDefault(item.ClientId)</td>
<td>@item.BusinessType</td>
<td>@item.TaxRiskLevel</td>
<td>@(item.NextFilingDueDate?.ToString("yyyy-MM-dd") ?? string.Empty)</td>
<td>
<button type="button" class="mud-button-root mud-button mud-button-text mud-ripple" @onclick:stopPropagation="true" @onclick="@(async () => await DeleteProfile(item.Id))">삭제</button>
</td>
</tr>
}
</CellTemplate>
</TemplateColumn>
<PropertyColumn Property="x => x.BusinessType" Title="사업 유형" />
<TemplateColumn Title="위험도">
<CellTemplate>
<MudChip Size="Size.Small" Color="@GetRiskColor(context.Item.TaxRiskLevel)" Variant="Variant.Filled">
@context.Item.TaxRiskLevel
</MudChip>
</CellTemplate>
</TemplateColumn>
<TemplateColumn Title="다음 신고">
<CellTemplate>
@if (context.Item.NextFilingDueDate.HasValue)
{
@context.Item.NextFilingDueDate.Value.ToString("yyyy-MM-dd")
}
</CellTemplate>
</TemplateColumn>
<TemplateColumn Title="작업" Sortable="false">
<CellTemplate>
<MudIconButton Icon="@Icons.Material.Filled.Delete" Color="Color.Error" Size="Size.Small" OnClick="@(async () => await DeleteProfile(context.Item.Id))" />
</CellTemplate>
</TemplateColumn>
</Columns>
</MudDataGrid>
</tbody>
</table>
}
</MudItem>