mh_custom/wtmProject.Shared/Pages/CustomReport.razor

166 lines
9.2 KiB
Plaintext
Raw Permalink Normal View History

2026-01-06 10:55:05 +08:00
@page "/CustomReport/Report/{id}"
@using wtmProject.Model
@using wtmProject.Shared.Pages._Admin.WTM_CUSTOM
@using wtmProject.ViewModel._Admin.WTM_BUSINESSVMs
@using wtmProject.ViewModel._Admin.WTM_CUSTOMVMs;
@using wtmProject.ViewModel._Admin.WTM_VISIT_PLANVMs
@using wtmProject.ViewModel._Admin.WTM_CONTRACTVMs;
@inherits BasePage
@*<WTSearchPanel OnSearch="@DoSearch">*@
<ValidateForm Model="@SearchModel">
<Row ItemsPerRow="ItemsPerRow.Three" RowType="RowType.Inline">
<Select @bind-Value="@SearchModel.CustomAllName" Items="@AllWTM_CUSTOMs" ShowSearch="true" PlaceHolder="@WtmBlazor.Localizer["Sys.All"]" />
<Button Color="Color.Primary" Icon="fa fa-search" Text="@WtmBlazor.Localizer["Sys.Search"]" OnClick="@DoSearch" />
</Row>
</ValidateForm>
@*</WTSearchPanel>*@
<br />
<ValidateForm @ref="vform" Model="@Model">
<Tab IsBorderCard="true">
<TabItem Text="@WtmBlazor.Localizer["_Admin.BasicInfo"]">
<Row ItemsPerRow="ItemsPerRow.Three" RowType="RowType.Normal">
<Display @bind-Value="@Model.CustomInfo.CustomAllName" ShowLabel="true" />
<Display @bind-Value="@Model.CustomInfo.CustomShortName" ShowLabel="true" />
<Display @bind-Value="@Model.CustomInfo.CustomClass" ShowLabel="true" />
@* <Display @bind-Value="@Model.CustomInfo.IndustryType" ShowLabel="true" />*@
<Display @bind-Value="@Model.CustomInfo.ParentUnit" ShowLabel="true" />
<Display @bind-Value="@Model.CustomInfo.EnterprisesType" ShowLabel="true" />
<Display @bind-Value="@Model.CustomInfo.AreaId" ShowLabel="true" Lookup="AllWTM_AREAs" />
<Display @bind-Value="@Model.CustomInfo.CreateBy" ShowLabel="true" />
<Display @bind-Value="@Model.CustomInfo.CreateTime" ShowLabel="true" FormatString="yyyy-MM-dd" />
</Row>
<br />
<Table TItem="WTM_CUSTOM_PERSON"
IsPagination="false"
IsStriped="false" IsBordered="true" IsMultipleSelect="false" @bind-Items="@CustomPersons"
ShowToolbar="false" ShowExtendButtons="false" ShowSkeleton="true">
<TableColumns>
<TableColumn @bind-Field="@context.PersonName" />
<TableColumn @bind-Field="@context.PersonPhone" />
<TableColumn @bind-Field="@context.PersonPost" />
</TableColumns>
</Table>
</TabItem>
<TabItem Text="@WtmBlazor.Localizer["_Admin.VisitRecord"]">
<Table TItem="WTM_VISIT_PLAN_View"
IsPagination="false"
IsStriped="false" IsBordered="true" IsMultipleSelect="false" @bind-Items="@VisitRecords"
ShowToolbar="false" ShowExtendButtons="false" ShowSkeleton="true">
<TableColumns>
<TableColumn @bind-Field="@context.Name_view" />
<TableColumn @bind-Field="@context.CustomAllName_view" />
<TableColumn @bind-Field="@context.PersonName_view" />
<TableColumn @bind-Field="@context.VisitStartTime" FormatString="yyyy-MM-dd" />
<TableColumn @bind-Field="@context.VisitEndTime" FormatString="yyyy-MM-dd" />
<TableColumn @bind-Field="@context.VisitTarget" TextWrap=true />
<TableColumn @bind-Field="@context.VisitPersons" />
</TableColumns>
</Table>
</TabItem>
<TabItem Text="@WtmBlazor.Localizer["_Admin.BusinessInfo"]">
<Table TItem="WTM_BUSINESS_View"
IsPagination="false"
IsStriped="false" IsBordered="true" IsMultipleSelect="false" @bind-Items="@BusinessInfos"
ShowToolbar="false" ShowExtendButtons="true" ShowSkeleton="true" ShowDefaultButtons="false" ShowExtendEditButton="false" ShowExtendDeleteButton="false">
<TableColumns>
<TableColumn @bind-Field="@context.ID" Visible="false" />
<TableColumn @bind-Field="@context.CustomAllName_view" />
<TableColumn @bind-Field="@context.BusinessName" />
<TableColumn @bind-Field="@context.PersonName_view" />
<TableColumn @bind-Field="@context.ProjectName_view" />
<TableColumn @bind-Field="@context.BusinessStatus" />
<TableColumn @bind-Field="@context.UpdateTime" FormatString="yyyy-MM-dd"/>
<TableColumn @bind-Field="@context.UpdateBy" />
</TableColumns>
<RowButtonTemplate>
<div style="padding-right:10px;">
<TableCellButton Size="Size.ExtraSmall" Color="Color.Info" Icon="fa fa-info" Text="@WtmBlazor.Localizer["Sys.Details"]" OnClick="()=>OnDetailsClick(context)" />
</div>
</RowButtonTemplate>
</Table>
</TabItem>
<TabItem Text="@WtmBlazor.Localizer["_Admin.ContractInfo"]">
<Table TItem="WTM_CONTRACT_View"
IsPagination="false"
IsStriped="false" IsBordered="true" IsMultipleSelect="false" @bind-Items="@ContractInfos"
ShowToolbar="false" ShowExtendButtons="true" ShowSkeleton="true" ShowExtendEditButton="false" ShowExtendDeleteButton="false">
<TableColumns>
<TableColumn @bind-Field="@context.ID" Visible="false" />
<TableColumn @bind-Field="@context.ContractCode" />
<TableColumn @bind-Field="@context.ContractName" />
<TableColumn @bind-Field="@context.ProjectName_view" />
<TableColumn @bind-Field="@context.ContractAmount" />
<TableColumn @bind-Field="@context.RefundAmount" />
<TableColumn @bind-Field="@context.RefundCount" />
<TableColumn @bind-Field="@context.Name_view2" />
<TableColumn @bind-Field="@context.Name_view" />
@*<TableColumn Text="开票查看" @bind-Field="@context.ProjectName_view">
<Button OnClick="() => ShowDetails(context)">查看详情</Button>
</TableColumn>*@
</TableColumns>
<RowButtonTemplate>
<TableCellButton Size="Size.ExtraSmall" Color="Color.Success" Icon="fa fa-eye" Text="查看" OnClick="() => OnDetailsClick(context)" />
</RowButtonTemplate>
</Table>
</TabItem>
</Tab>
</ValidateForm>
@code {
private ValidateForm vform { get; set; }
private WTM_CUSTOM_Temp Model = null;
private WTM_CUSTOMSearcher SearchModel = new WTM_CUSTOMSearcher();
private List<SelectedItem> AllWTM_CUSTOMs = new List<SelectedItem>();
private List<SelectedItem> AllWTM_AREAs = new List<SelectedItem>();
private IEnumerable<WTM_CUSTOM_PERSON> CustomPersons { get; set; }
private IEnumerable<WTM_VISIT_PLAN_View> VisitRecords { get; set; }
private IEnumerable<WTM_BUSINESS_View> BusinessInfos { get; set; }
private IEnumerable<WTM_CONTRACT_View> ContractInfos { get; set; }
[Parameter]
public string id { get; set; }
[Inject]
private NavigationManager NavigationManager { get; set; }
[Inject]
private IJSRuntime jsRuntime { get; set; }
protected override async Task OnInitializedAsync()
{
if (!string.IsNullOrEmpty(id))
{
SearchModel.CustomAllName = id;
}
AllWTM_AREAs = await WtmBlazor.Api.CallItemsApi("/api/WTM_CUSTOM/GetWTM_AREAs", placeholder: WtmBlazor.Localizer["Sys.All"]);
AllWTM_CUSTOMs = await WtmBlazor.Api.CallItemsApi("/api/WTM_VISIT_PLAN/GetWTM_CUSTOMs", placeholder: WtmBlazor.Localizer["Sys.All"]);
var rv = await WtmBlazor.Api.CallAPI<WTM_CUSTOM_Temp>($"/api/WTM_CUSTOM/GetCustomInfo?name={SearchModel.CustomAllName}");
Model = rv.Data;
CustomPersons = Model.CustomInfo.CustomPerson;
VisitRecords = Model.VisitRecord;
BusinessInfos = Model.BusinessInfo;
ContractInfos = Model.ContractInfo;
_ = jsRuntime.InvokeVoidAsync("setTabTitle", "客户综合信息展示");
await base.OnInitializedAsync();
}
private async Task OnDetailsClick(WTM_CONTRACT_View item)
{
await OpenDialog<BilingList>(WtmBlazor.Localizer["Sys.Details"], x => x.id == item.ID.ToString());
}
private async Task DoSearch()
{
var url = $"/api/WTM_CUSTOM/GetCustomInfo?name={SearchModel.CustomAllName}";
var rv = await WtmBlazor.Api.CallAPI<WTM_CUSTOM_Temp>(url);
Model = rv.Data;
CustomPersons = Model.CustomInfo.CustomPerson;
VisitRecords = Model.VisitRecord;
BusinessInfos = Model.BusinessInfo;
ContractInfos = Model.ContractInfo;
}
public void OnClose()
{
CloseDialog();
}
private async Task OnDetailsClick(WTM_BUSINESS_View item)
{
await OpenDialog<BusinessDetails>(WtmBlazor.Localizer["Sys.Details"], x => x.id == item.ID.ToString());
}
}