Add supply contracts page

This commit is contained in:
2025-11-23 18:08:51 +09:00
parent 5ec3776f6f
commit 1ba1576943
8 changed files with 122 additions and 4 deletions

View File

@ -1,6 +1,5 @@
@page "/objects/houses"
@using Hcs.WebApp.Components.Dialogs
@using Hcs.WebApp.Services
@using Microsoft.AspNetCore.Authorization
@using System.Security.Claims
@ -10,7 +9,6 @@
@attribute [Authorize]
@inject HouseService HouseService
@inject DialogService DialogService
<PageTitle>Жилищный фонд</PageTitle>

View File

@ -0,0 +1,56 @@
@page "/objects/supply-contracts"
@using Hcs.WebApp.Services
@using Microsoft.AspNetCore.Authorization
@using System.Security.Claims
@inherits SyncedPageBase<SupplyContract>
@attribute [Authorize]
@inject SupplyContractService SupplyContractService
<PageTitle>Договора ресурсоснабжения</PageTitle>
<AuthorizedContent Roles="@($"{AppRole.ADMINISTRATOR_TYPE},{AppRole.OPERATOR_TYPE}")">
<Content>
<RadzenStack>
<RadzenRow AlignItems="AlignItems.Center">
<RadzenColumn Size="12" SizeMD="6">
<RadzenText Text="Договора ресурсоснабжения" TextStyle="TextStyle.H5" class="rz-m-0" />
</RadzenColumn>
<RadzenColumn Size="12" SizeMD="6">
<RadzenStack Orientation="Orientation.Horizontal" AlignItems="AlignItems.Center" JustifyContent="JustifyContent.End" Gap="0.5rem">
<RadzenButton Icon="sync" Text="@syncButtonText" Disabled="@(state != SyncedPageState.Idle)" Click="@SyncDataAsync" ButtonStyle="ButtonStyle.Primary" />
</RadzenStack>
</RadzenColumn>
</RadzenRow>
<RadzenRow>
<RadzenColumn SizeMD="12">
<RadzenDataGrid TItem="SupplyContract" Data="@data" IsLoading="@(state != SyncedPageState.Idle)" AllowFiltering="true" AllowPaging="true" ShowPagingSummary="true" PageSizeOptions=@(new int[] { 5, 10, 20, 30 }) AllowSorting="true">
<Columns>
<RadzenDataGridColumn TItem="SupplyContract" Property="@nameof(SupplyContract.Id)" Title="ID" SortOrder="SortOrder.Descending" Resizable="false" Width="100px" MaxWidth="100px" />
<RadzenDataGridColumn TItem="SupplyContract" Property="@nameof(SupplyContract.HcsId)" Title="ID ГИС ЖКХ" />
<RadzenDataGridColumn TItem="SupplyContract" Property="@nameof(SupplyContract.ThirdPartyId)" Title="ID интеграции" />
<RadzenDataGridColumn TItem="SupplyContract" Property="@nameof(SupplyContract.SyncedAt)" Title="Дата синхронизации" />
</Columns>
</RadzenDataGrid>
</RadzenColumn>
</RadzenRow>
</RadzenStack>
</Content>
</AuthorizedContent>
@code {
protected override Campaign.CampaignType CampaignType => Campaign.CampaignType.ExportSupplyContracts_15_7_0_1;
protected override bool HasPermission(ClaimsPrincipal user)
{
return user.IsOperatorOrHigher();
}
protected override Task<IEnumerable<SupplyContract>> GetDataAsync()
{
return SupplyContractService.GetAllSupplyContractsAsync();
}
}