revert: rollback Fluent UI and Blazor homepage to last successful state (3be3794)
This commit is contained in:
@@ -1,66 +1,60 @@
|
||||
@using TaxBaik.Web.Services
|
||||
@using TaxBaik.Domain.Entities
|
||||
@inject ITaxFilingBrowserClient FilingClient
|
||||
@inject IJSRuntime JS
|
||||
@inject ISnackbar Snackbar
|
||||
|
||||
@if (Filings == null || Filings.Count == 0)
|
||||
{
|
||||
<div class="muted">항목이 없습니다.</div>
|
||||
<MudText Class="pa-4" Color="Color.Secondary">항목이 없습니다.</MudText>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="admin-table-wrap">
|
||||
<table class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>고객</th>
|
||||
<th>신고 유형</th>
|
||||
<th>기한</th>
|
||||
<th>D-day</th>
|
||||
<th>메모</th>
|
||||
<th>처리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var filing in Filings)
|
||||
{
|
||||
var dday = (filing.DueDate.Date - DateTime.Today).Days;
|
||||
<tr>
|
||||
<td>@filing.ClientName</td>
|
||||
<td>@filing.FilingType</td>
|
||||
<td>@filing.DueDate.ToString("yyyy-MM-dd")</td>
|
||||
<td>
|
||||
@if (dday < 0)
|
||||
{
|
||||
<span class="status-pill danger">D+@(-dday)</span>
|
||||
}
|
||||
else if (dday <= 7)
|
||||
{
|
||||
<span class="status-pill warning">D-@dday</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>D-@dday</span>
|
||||
}
|
||||
</td>
|
||||
<td>@(filing.Memo ?? "")</td>
|
||||
<td>
|
||||
<div class="admin-row-actions">
|
||||
@if (filing.Status == "pending")
|
||||
{
|
||||
<button type="button" class="site-button secondary" @onclick="@(() => MarkFiled(filing))">완료</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="status-pill success">완료</span>
|
||||
}
|
||||
<button type="button" class="admin-icon-button danger" @onclick="@(() => DeleteFiling(filing.Id))">✕</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<MudTable Items="Filings" Hover="true" Dense="true" Class="mt-2">
|
||||
<HeaderContent>
|
||||
<MudTh>고객</MudTh>
|
||||
<MudTh>신고 유형</MudTh>
|
||||
<MudTh>기한</MudTh>
|
||||
<MudTh>D-day</MudTh>
|
||||
<MudTh>메모</MudTh>
|
||||
<MudTh>처리</MudTh>
|
||||
</HeaderContent>
|
||||
<RowTemplate>
|
||||
<MudTd>@context.ClientName</MudTd>
|
||||
<MudTd>@context.FilingType</MudTd>
|
||||
<MudTd>@context.DueDate.ToString("yyyy-MM-dd")</MudTd>
|
||||
<MudTd>
|
||||
@{
|
||||
var dday = (context.DueDate.Date - DateTime.Today).Days;
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if (dday < 0)
|
||||
{
|
||||
<MudChip T="string" Size="Size.Small" Color="Color.Error">D+@(-dday)</MudChip>
|
||||
}
|
||||
else if (dday <= 7)
|
||||
{
|
||||
<MudChip T="string" Size="Size.Small" Color="Color.Warning">D-@dday</MudChip>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudText Typo="Typo.body2">D-@dday</MudText>
|
||||
}
|
||||
</MudTd>
|
||||
<MudTd>@(context.Memo ?? "")</MudTd>
|
||||
<MudTd>
|
||||
@if (context.Status == "pending")
|
||||
{
|
||||
<MudButton Size="Size.Small" Variant="Variant.Filled" Color="Color.Success"
|
||||
OnClick="@(() => MarkFiled(context))">완료</MudButton>
|
||||
}
|
||||
else if (context.Status == "filed")
|
||||
{
|
||||
<MudChip T="string" Size="Size.Small" Color="Color.Success">완료</MudChip>
|
||||
}
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete" Size="Size.Small" Color="Color.Error"
|
||||
OnClick="@(() => DeleteFiling(context.Id))" />
|
||||
</MudTd>
|
||||
</RowTemplate>
|
||||
</MudTable>
|
||||
}
|
||||
|
||||
@code {
|
||||
@@ -72,33 +66,44 @@ else
|
||||
|
||||
private async Task MarkFiled(TaxFiling filing)
|
||||
{
|
||||
filing.Status = "filed";
|
||||
var result = await FilingClient.UpdateAsync(filing.Id, filing);
|
||||
if (result != null)
|
||||
try
|
||||
{
|
||||
await JS.InvokeVoidAsync("alert", "신고 완료 처리되었습니다.");
|
||||
await OnStatusChange.InvokeAsync();
|
||||
filing.Status = "filed";
|
||||
var result = await FilingClient.UpdateAsync(filing.Id, filing);
|
||||
if (result != null)
|
||||
{
|
||||
Snackbar.Add("신고 완료 처리되었습니다.", Severity.Success);
|
||||
await OnStatusChange.InvokeAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
Snackbar.Add("처리 실패", Severity.Error);
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
await JS.InvokeVoidAsync("alert", "처리 실패");
|
||||
Snackbar.Add($"오류: {ex.Message}", Severity.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task DeleteFiling(int id)
|
||||
{
|
||||
var confirmed = await JS.InvokeAsync<bool>("confirm", "이 항목을 삭제하시겠습니까?");
|
||||
if (!confirmed) return;
|
||||
|
||||
var success = await FilingClient.DeleteAsync(id);
|
||||
if (success)
|
||||
try
|
||||
{
|
||||
await JS.InvokeVoidAsync("alert", "삭제되었습니다.");
|
||||
await OnStatusChange.InvokeAsync();
|
||||
var success = await FilingClient.DeleteAsync(id);
|
||||
if (success)
|
||||
{
|
||||
Snackbar.Add("삭제되었습니다.", Severity.Info);
|
||||
await OnStatusChange.InvokeAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
Snackbar.Add("삭제 실패", Severity.Error);
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
await JS.InvokeVoidAsync("alert", "삭제 실패");
|
||||
Snackbar.Add($"오류: {ex.Message}", Severity.Error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user