2025-04-18 11:01:56 +08:00
|
|
|
|
@page "/stock/list"
|
2025-07-05 10:07:33 +08:00
|
|
|
|
@using MasaBlazorApp3.Report
|
2025-04-18 11:01:56 +08:00
|
|
|
|
<style>
|
2025-06-24 08:55:34 +08:00
|
|
|
|
@@keyframes shake {
|
2025-07-05 10:07:33 +08:00
|
|
|
|
0% {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
color: red;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
25% {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
color: orange;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
50% {
|
|
|
|
|
opacity: 0;
|
|
|
|
|
color: yellow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
75% {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
color: crimson;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
100% {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
color: red;
|
|
|
|
|
}
|
2025-06-24 08:55:34 +08:00
|
|
|
|
}
|
2025-07-05 10:07:33 +08:00
|
|
|
|
|
2025-04-18 11:01:56 +08:00
|
|
|
|
.rz-custom-header {
|
2025-07-05 10:07:33 +08:00
|
|
|
|
width: 100%;
|
2025-06-24 08:55:34 +08:00
|
|
|
|
}
|
2025-07-05 10:07:33 +08:00
|
|
|
|
|
2025-06-24 08:55:34 +08:00
|
|
|
|
.shaky-text {
|
2025-07-05 10:07:33 +08:00
|
|
|
|
animation: shake 2s infinite ease-in-out;
|
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>Ը<EFBFBD><D4B8><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD><C4B3><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>͵<EFBFBD><CDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
|
|
|
transition: color 0.5s linear,opacity 0.5s linear;
|
2025-04-18 11:01:56 +08:00
|
|
|
|
}
|
2025-06-24 08:55:34 +08:00
|
|
|
|
|
2025-04-18 11:01:56 +08:00
|
|
|
|
</style>
|
2025-07-05 10:07:33 +08:00
|
|
|
|
<div class="col-12 mb-4">
|
|
|
|
|
|
|
|
|
|
<form onsubmit="@(() => grid.Reload())">
|
|
|
|
|
<RadzenFieldset Text="<22><>ѯ">
|
|
|
|
|
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem">
|
|
|
|
|
<RadzenRow AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenColumn Size="4">
|
|
|
|
|
<RadzenLabel Text="<22><>ʼʱ<CABC><CAB1>" Component="Start" />
|
|
|
|
|
</RadzenColumn>
|
|
|
|
|
<RadzenColumn Size="8">
|
|
|
|
|
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="start" Style="width: 100%;" Name="Start" />
|
|
|
|
|
</RadzenColumn>
|
|
|
|
|
</RadzenRow>
|
|
|
|
|
<RadzenRow AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenColumn Size="4">
|
|
|
|
|
<RadzenLabel Text="<22><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>" Component="End" />
|
|
|
|
|
</RadzenColumn>
|
|
|
|
|
<RadzenColumn Size="8">
|
|
|
|
|
<RadzenDatePicker DateFormat="yyyy-MM-dd HH:mm:ss" ShowTime="true" @bind-Value="end" Style="width: 100%;" Name="End" />
|
|
|
|
|
</RadzenColumn>
|
|
|
|
|
</RadzenRow>
|
|
|
|
|
<RadzenRow AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenColumn Size="6">
|
|
|
|
|
<RadzenLabel Text="ҩƷ<D2A9><C6B7><EFBFBD><EFBFBD>/ƴ<><C6B4><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD>" Component="drug" />
|
|
|
|
|
</RadzenColumn>
|
|
|
|
|
<RadzenColumn Size="6">
|
|
|
|
|
<RadzenAutoComplete Name="drug" Multiline="true" @bind-Value=@drugName Data=@drugInfo TextProperty="@nameof(DrugInfo.DrugNameSpecManufactory)"
|
|
|
|
|
Style="width: 100%;" InputAttributes="@(new Dictionary<string, object>() { { "aria-label", "drugInfo" } })" />
|
|
|
|
|
</RadzenColumn>
|
|
|
|
|
</RadzenRow>
|
|
|
|
|
|
|
|
|
|
<RadzenRow AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenColumn Size="12">
|
|
|
|
|
@* <RadzenButton Size="ButtonSize.Large" ButtonType="ButtonType.Submit" IsBusy="isLoading" Icon="search" Text="<22><>ѯ" /> *@
|
|
|
|
|
<RadzenButton Size="ButtonSize.Large" Click="reloadGrid" IsBusy="isLoading" Icon="refresh" Text="<22><><EFBFBD><EFBFBD>" ButtonStyle="ButtonStyle.Warning" />
|
|
|
|
|
</RadzenColumn>
|
|
|
|
|
</RadzenRow>
|
|
|
|
|
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
|
|
|
|
<RadzenButton Icon="download" Text="<22><><EFBFBD>浼<EFBFBD><E6B5BC>" Variant="Variant.Outlined" Click="StockExport" />
|
|
|
|
|
<RadzenButton Icon="download" Text="ר<><D7A8><EFBFBD>˲ᵼ<CBB2><E1B5BC>" Variant="Variant.Outlined" Click="AccountBookExport" />
|
|
|
|
|
</RadzenRow>
|
|
|
|
|
</RadzenStack>
|
|
|
|
|
</RadzenFieldset>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-12 mb-4">
|
2025-04-18 11:01:56 +08:00
|
|
|
|
|
|
|
|
|
<RadzenDataGrid @ref="grid"
|
2025-07-05 10:07:33 +08:00
|
|
|
|
IsLoading="@isLoading"
|
|
|
|
|
RowRender="@RowRender"
|
|
|
|
|
EmptyText="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
|
|
|
|
Data="@_forecasts"
|
|
|
|
|
AllowColumnResize="true" AllowAlternatingRows="false"
|
|
|
|
|
SelectionMode="DataGridSelectionMode.Single"
|
|
|
|
|
ExpandMode="DataGridExpandMode.Multiple">
|
|
|
|
|
@* <HeaderTemplate>
|
2025-04-18 11:01:56 +08:00
|
|
|
|
<RadzenRow JustifyContent="JustifyContent.End" AlignItems="AlignItems.Center">
|
2025-06-24 08:55:34 +08:00
|
|
|
|
<RadzenButton Icon="download" Text="<22><><EFBFBD>浼<EFBFBD><E6B5BC>" Variant="Variant.Outlined" Click="StockExport" />
|
|
|
|
|
<RadzenButton Icon="download" Text="ר<><D7A8><EFBFBD>˲ᵼ<CBB2><E1B5BC>" Variant="Variant.Outlined" Click="AccountBookExport" />
|
2025-04-18 11:01:56 +08:00
|
|
|
|
</RadzenRow>
|
2025-07-05 10:07:33 +08:00
|
|
|
|
</HeaderTemplate> *@
|
2025-04-18 11:01:56 +08:00
|
|
|
|
<Template Context="di">
|
|
|
|
|
<RadzenDataGrid Data="@di.Stocks" EmptyText="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>">
|
|
|
|
|
<Columns>
|
|
|
|
|
<RadzenDataGridColumn Title="<22><>λ" Property="DrawerNo">
|
|
|
|
|
<Template Context="s">
|
|
|
|
|
@s.DrawerNo - @s.ColNo
|
|
|
|
|
</Template>
|
|
|
|
|
</RadzenDataGridColumn>
|
2025-06-24 08:55:34 +08:00
|
|
|
|
<RadzenDataGridColumn Title="<22><><EFBFBD><EFBFBD>" Property="Quantity">
|
|
|
|
|
</RadzenDataGridColumn>
|
2025-04-18 11:01:56 +08:00
|
|
|
|
<RadzenDataGridColumn Title="<22><><EFBFBD><EFBFBD>" Property="ManuNo"></RadzenDataGridColumn>
|
2025-06-24 08:55:34 +08:00
|
|
|
|
<RadzenDataGridColumn Title="Ч<><D0A7>" Property="EffDate">
|
|
|
|
|
<Template Context="s">
|
|
|
|
|
@{
|
|
|
|
|
DateTime dateTime;
|
|
|
|
|
bool success = DateTime.TryParse(s.EffDate, out dateTime);
|
2025-07-05 10:07:33 +08:00
|
|
|
|
if (success && dateTime <= DateTime.Now.AddMonths(3))
|
2025-06-24 08:55:34 +08:00
|
|
|
|
{
|
2025-07-05 10:07:33 +08:00
|
|
|
|
@s.EffDate
|
|
|
|
|
|
|
|
|
|
<p class="shaky-text"><3E><>Ч<EFBFBD><D0A7>ҩƷ<D2A9><C6B7></p>
|
2025-06-24 08:55:34 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@s.EffDate
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</Template>
|
|
|
|
|
</RadzenDataGridColumn>
|
2025-04-18 11:01:56 +08:00
|
|
|
|
</Columns>
|
|
|
|
|
</RadzenDataGrid>
|
|
|
|
|
</Template>
|
|
|
|
|
<Columns>
|
|
|
|
|
<RadzenDataGridColumn Frozen="true" Width="200px" Title="ҩƷ<D2A9><C6B7><EFBFBD><EFBFBD>" Property="DrugName"></RadzenDataGridColumn>
|
|
|
|
|
<RadzenDataGridColumn Title="<22><><EFBFBD><EFBFBD>" Property="DrugSpec"></RadzenDataGridColumn>
|
2025-07-05 10:07:33 +08:00
|
|
|
|
<RadzenDataGridColumn Title="<22>ܿ<EFBFBD><DCBF><EFBFBD>" Property="StockQuantity">
|
2025-06-24 08:55:34 +08:00
|
|
|
|
<Template Context="s">
|
2025-07-05 10:07:33 +08:00
|
|
|
|
@if (s.StockQuantity < 10)
|
2025-06-24 08:55:34 +08:00
|
|
|
|
{
|
2025-07-05 10:07:33 +08:00
|
|
|
|
@s.StockQuantity
|
|
|
|
|
|
|
|
|
|
<p class="shaky-text"><3E><><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD></p>
|
2025-06-24 08:55:34 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@s.StockQuantity
|
|
|
|
|
}
|
|
|
|
|
</Template>
|
|
|
|
|
</RadzenDataGridColumn>
|
|
|
|
|
|
2025-04-18 11:01:56 +08:00
|
|
|
|
</Columns>
|
|
|
|
|
</RadzenDataGrid>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@code {
|
|
|
|
|
@inject IDrugInfoDao drugInfoDao;
|
|
|
|
|
@inject DialogService dialogService;
|
|
|
|
|
RadzenDataGrid<DrugInfo> grid;
|
|
|
|
|
bool isLoading;
|
|
|
|
|
int count;
|
|
|
|
|
private IEnumerable<DrugInfo>? _forecasts;
|
|
|
|
|
DateTime start;
|
|
|
|
|
DateTime end;
|
|
|
|
|
|
2025-07-05 10:07:33 +08:00
|
|
|
|
string drugName;
|
2025-06-24 08:55:34 +08:00
|
|
|
|
|
2025-07-05 10:07:33 +08:00
|
|
|
|
IEnumerable<DrugInfo> drugInfo;
|
2025-04-18 11:01:56 +08:00
|
|
|
|
|
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
|
|
|
{
|
|
|
|
|
await base.OnInitializedAsync();
|
|
|
|
|
isLoading = true;
|
|
|
|
|
|
|
|
|
|
var result = await drugInfoDao.GetAllDrugAndStock();
|
|
|
|
|
// Update the Data property
|
|
|
|
|
_forecasts = result;
|
2025-07-05 10:07:33 +08:00
|
|
|
|
|
|
|
|
|
drugInfo = await drugInfoDao.GetAllDrug();
|
|
|
|
|
|
2025-04-18 11:01:56 +08:00
|
|
|
|
isLoading = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
|
|
|
{
|
|
|
|
|
base.OnAfterRender(firstRender);
|
|
|
|
|
|
|
|
|
|
if (firstRender)
|
|
|
|
|
{
|
|
|
|
|
await grid.ExpandRows(grid.PagedView.Where(di => di.Stocks.Count > 0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RowRender(RowRenderEventArgs<DrugInfo> args)
|
|
|
|
|
{
|
|
|
|
|
args.Expandable = args.Data.Stocks.Count > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 10:07:33 +08:00
|
|
|
|
//<2F><><EFBFBD>浼<EFBFBD><E6B5BC>
|
|
|
|
|
void StockExport()
|
2025-06-24 08:55:34 +08:00
|
|
|
|
{
|
2025-04-18 11:01:56 +08:00
|
|
|
|
|
2025-06-24 08:55:34 +08:00
|
|
|
|
}
|
2025-07-05 10:07:33 +08:00
|
|
|
|
//ר<><D7A8><EFBFBD>˲ᵼ<CBB2><E1B5BC>
|
|
|
|
|
void AccountBookExport()
|
2025-06-24 08:55:34 +08:00
|
|
|
|
{
|
2025-07-05 10:07:33 +08:00
|
|
|
|
// string drugId = drugName != null ? drugName.Split('/').Last().Trim():"";
|
|
|
|
|
// GridReportUtil gridReportUtil = new GridReportUtil();
|
|
|
|
|
GridReportUtil.PrintReport("stock_template.grf", null);
|
2025-06-24 08:55:34 +08:00
|
|
|
|
}
|
2025-04-18 11:01:56 +08:00
|
|
|
|
|
2025-07-05 10:07:33 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
async Task reloadGrid()
|
|
|
|
|
{
|
|
|
|
|
start = DateTime.MinValue;
|
|
|
|
|
end = DateTime.MinValue;
|
|
|
|
|
drugName = string.Empty;
|
|
|
|
|
await grid.Reload();
|
|
|
|
|
}
|
2025-04-18 11:01:56 +08:00
|
|
|
|
|
|
|
|
|
}
|