feat(admin): 표준 화면 패턴으로 CRM 화면 정리
This commit is contained in:
@@ -6,34 +6,44 @@
|
||||
@inject IDialogService DialogService
|
||||
@attribute [Authorize]
|
||||
|
||||
<PageTitle>신고 일정 관리</PageTitle>
|
||||
<PageTitle>신고 일정</PageTitle>
|
||||
|
||||
<div class="admin-container">
|
||||
<div class="admin-header">
|
||||
<MudText Typo="Typo.h5" Class="font-weight-bold">신고 일정 관리</MudText>
|
||||
<MudButton Variant="Variant.Filled" Color="Color.Primary" OnClick="OpenCreateDialog" StartIcon="@Icons.Material.Filled.Add">
|
||||
새 일정 추가
|
||||
</MudButton>
|
||||
<section class="admin-page-hero">
|
||||
<div>
|
||||
<MudText Typo="Typo.caption" Class="admin-eyebrow">CRM & 세무관리</MudText>
|
||||
<MudText Typo="Typo.h4" Class="admin-page-title">신고 일정</MudText>
|
||||
<MudText Typo="Typo.body2" Class="admin-page-subtitle">고객별 마감일과 처리 상태를 한 화면에서 관리합니다.</MudText>
|
||||
</div>
|
||||
<MudButton Variant="Variant.Filled"
|
||||
Color="Color.Primary"
|
||||
OnClick="OpenCreateDialog"
|
||||
StartIcon="@Icons.Material.Filled.Add">
|
||||
새 일정 추가
|
||||
</MudButton>
|
||||
</section>
|
||||
|
||||
@if (schedules == null)
|
||||
<MudPaper Class="admin-surface" Elevation="0">
|
||||
@if (schedules is null)
|
||||
{
|
||||
<MudProgressCircular Indeterminate="true" Class="mt-4" />
|
||||
<MudProgressLinear Indeterminate="true" />
|
||||
}
|
||||
else if (schedules.Count == 0)
|
||||
{
|
||||
<MudAlert Severity="Severity.Info" Class="mt-4">신고 일정이 없습니다.</MudAlert>
|
||||
<div class="pa-6 text-center">
|
||||
<MudIcon Icon="@Icons.Material.Filled.EventBusy" Style="font-size:3rem; opacity:.3;" />
|
||||
<MudText Class="mt-2 text-muted">신고 일정이 없습니다.</MudText>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudDataGrid T="TaxFilingSchedule"
|
||||
Items="@schedules"
|
||||
Dense="true"
|
||||
Hover="true"
|
||||
Striped="true"
|
||||
Virtualize="true"
|
||||
RowsPerPage="30"
|
||||
Class="admin-grid mt-4">
|
||||
Items="@schedules"
|
||||
Dense="true"
|
||||
Hover="true"
|
||||
Striped="true"
|
||||
Virtualize="true"
|
||||
RowsPerPage="30"
|
||||
Class="admin-grid">
|
||||
<Columns>
|
||||
<PropertyColumn Property="x => x.Id" Title="ID" Sortable="true" />
|
||||
<TemplateColumn Title="고객">
|
||||
@@ -55,8 +65,14 @@
|
||||
}
|
||||
<MudChip Size="Size.Small" Color="@statusColor" Variant="Variant.Filled">
|
||||
@context.Item.DueDate.ToString("yyyy-MM-dd")
|
||||
@if (daysLeft >= 0) { <span>(D-@daysLeft)</span> }
|
||||
else { <span>(마감@(Math.Abs(daysLeft))일경과)</span> }
|
||||
@if (daysLeft >= 0)
|
||||
{
|
||||
<span class="ms-1">(D-@daysLeft)</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="ms-1">(마감 @Math.Abs(daysLeft)일 경과)</span>
|
||||
}
|
||||
</MudChip>
|
||||
</CellTemplate>
|
||||
</TemplateColumn>
|
||||
@@ -78,27 +94,36 @@
|
||||
<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.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))" />
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete"
|
||||
Color="Color.Error"
|
||||
OnClick="@(async () => await DeleteSchedule(context.Item.Id))"
|
||||
Title="삭제" />
|
||||
</MudButtonGroup>
|
||||
</CellTemplate>
|
||||
</TemplateColumn>
|
||||
</Columns>
|
||||
</MudDataGrid>
|
||||
}
|
||||
</div>
|
||||
</MudPaper>
|
||||
|
||||
<!-- Create/Edit Dialog -->
|
||||
<MudDialog @bind-IsVisible="isDialogOpen" Options="new DialogOptions { MaxWidth = MaxWidth.Small, FullWidth = true }">
|
||||
<TitleContent>
|
||||
<MudText Typo="Typo.h6">@(editingSchedule == null ? "새 신고 일정 추가" : "신고 일정 수정")</MudText>
|
||||
<MudText Typo="Typo.h6">새 신고 일정 추가</MudText>
|
||||
</TitleContent>
|
||||
<DialogContent>
|
||||
<MudForm @ref="form">
|
||||
<MudSelect T="int" @bind-Value="scheduleForm.ClientId" Label="고객" Required="true" Variant="Variant.Outlined" FullWidth="true" Class="mb-4">
|
||||
<MudSelect T="int"
|
||||
@bind-Value="scheduleForm.ClientId"
|
||||
Label="고객"
|
||||
Required="true"
|
||||
Variant="Variant.Outlined"
|
||||
FullWidth="true"
|
||||
Class="mb-4">
|
||||
@foreach (var client in clients)
|
||||
{
|
||||
<MudSelectItem Value="@client.Id">@client.CompanyName</MudSelectItem>
|
||||
@@ -121,13 +146,9 @@
|
||||
private Dictionary<int, string> clientMap = new();
|
||||
private MudForm? form;
|
||||
private bool isDialogOpen;
|
||||
private TaxFilingSchedule? editingSchedule;
|
||||
private TaxFilingScheduleForm scheduleForm = new();
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await LoadData();
|
||||
}
|
||||
protected override async Task OnInitializedAsync() => await LoadData();
|
||||
|
||||
private async Task LoadData()
|
||||
{
|
||||
@@ -146,8 +167,7 @@
|
||||
|
||||
private void OpenCreateDialog()
|
||||
{
|
||||
editingSchedule = null;
|
||||
scheduleForm = new();
|
||||
scheduleForm = new TaxFilingScheduleForm { FilingYear = DateTime.Now.Year };
|
||||
isDialogOpen = true;
|
||||
}
|
||||
|
||||
@@ -155,20 +175,21 @@
|
||||
{
|
||||
try
|
||||
{
|
||||
if (editingSchedule == null)
|
||||
{
|
||||
var newId = await TaxFilingClient.CreateAsync(
|
||||
scheduleForm.ClientId,
|
||||
scheduleForm.FilingType,
|
||||
scheduleForm.DueDate ?? DateTime.Now,
|
||||
scheduleForm.FilingYear);
|
||||
var newId = await TaxFilingClient.CreateAsync(
|
||||
scheduleForm.ClientId,
|
||||
scheduleForm.FilingType,
|
||||
scheduleForm.DueDate ?? DateTime.Today,
|
||||
scheduleForm.FilingYear);
|
||||
|
||||
if (newId > 0)
|
||||
{
|
||||
Snackbar.Add("신고 일정이 추가되었습니다.", Severity.Success);
|
||||
CloseDialog();
|
||||
await LoadData();
|
||||
}
|
||||
if (newId > 0)
|
||||
{
|
||||
Snackbar.Add("신고 일정이 추가되었습니다.", Severity.Success);
|
||||
CloseDialog();
|
||||
await LoadData();
|
||||
}
|
||||
else
|
||||
{
|
||||
Snackbar.Add("등록에 실패했습니다.", Severity.Error);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -193,13 +214,14 @@
|
||||
|
||||
private async Task DeleteSchedule(int id)
|
||||
{
|
||||
var parameters = new DialogParameters();
|
||||
parameters.Add("Title", "삭제 확인");
|
||||
parameters.Add("Message", "이 신고 일정을 삭제하시겠습니까?");
|
||||
var parameters = new DialogParameters
|
||||
{
|
||||
{ "Title", "삭제 확인" },
|
||||
{ "Message", "이 신고 일정을 삭제하시겠습니까?" }
|
||||
};
|
||||
|
||||
var dialog = await DialogService.ShowAsync<ConfirmDialog>("", parameters);
|
||||
var result = await dialog.Result;
|
||||
|
||||
if (result?.Canceled ?? true)
|
||||
return;
|
||||
|
||||
@@ -218,7 +240,6 @@
|
||||
private void CloseDialog()
|
||||
{
|
||||
isDialogOpen = false;
|
||||
editingSchedule = null;
|
||||
scheduleForm = new();
|
||||
}
|
||||
|
||||
@@ -230,20 +251,3 @@
|
||||
public int FilingYear { get; set; } = DateTime.Now.Year;
|
||||
}
|
||||
}
|
||||
|
||||
<style>
|
||||
.admin-container {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.admin-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.admin-grid {
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user