IndividualCoefficients.razor 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. @page "/individualcoefficients"
  2. @using AIPlatform.Protocol.Entities
  3. @using AIPlatform.Protocol.Model
  4. @using aipmgr.Models
  5. <Table TItem="IndividualCoefficientModel" IsBordered="true" @ref="IndividualCoefficientTable"
  6. IsPagination="true" PageItemsSource="@PageItemsSource" ShowLoading="true" ShowEmpty="true" EditDialogSize="Size.Large"
  7. ShowToolbar="true" ShowDefaultButtons="false" ShowSearch="false" ShowExtendButtons="true" ExtendButtonColumnWidth="200"
  8. IsFixedHeader="true" OnQueryAsync="@OnQueryAsync" OnEditAsync="OnEditAsync" OnSaveAsync="@OnSaveAsync" OnDeleteAsync="OnDeleteAsync">
  9. <TableToolbarTemplate>
  10. <TableToolbarButton TItem="IndividualCoefficientModel" Color="BootstrapBlazor.Components.Color.Success" Icon="fa fa-plus" Text="新建" TooltipText="新建个体系数" OnClick="@OnAddAsync" />
  11. </TableToolbarTemplate>
  12. <TableColumns>
  13. <TableColumn @bind-Field="@context.Account.Name" Text="人员" IsReadonlyWhenEdit="true" />
  14. <TableColumn @bind-Field="@context.CategoryName" Text="大类" IsReadonlyWhenEdit="true" />
  15. <TableColumn @bind-Field="@context.LabelPriceCoefficient" />
  16. <TableColumn @bind-Field="@context.LabelQuantityCoefficient" />
  17. <TableColumn @bind-Field="@context.StartEffectiveTime" FormatString="yyyy-MM-dd" />
  18. <TableColumn @bind-Field="@context.EndEffectiveTime" FormatString="yyyy-MM-dd" />
  19. </TableColumns>
  20. <RowButtonTemplate Context="value">
  21. <Button Size="Size.ExtraSmall" Color="BootstrapBlazor.Components.Color.Info" style="color:#ffffff" Text="操作记录" OnClickWithoutRender="@(()=>OpenOperateLogAsync(value))" />
  22. </RowButtonTemplate>
  23. </Table>
  24. <Modal @ref="Modal" OnCloseAsync="@OnCloseAsync">
  25. <ModalDialog Size="Size.Medium" Title="新建个体系数" IsCentered="true" ShowFooter="false">
  26. <BodyTemplate>
  27. <ValidateForm Model="@ValidateModel" OnValidSubmit="@OnSubmitAsync">
  28. <EditorForm TModel="IndividualCoefficientModel" AutoGenerateAllItem="false" RowType="RowType.Inline">
  29. <FieldItems>
  30. <EditorItem @bind-Field="@context.CategoryName">
  31. <EditTemplate Context="value">
  32. <div class="col-12 col-sm-12">
  33. <Select @bind-Value="@value.CategoryId" DisplayText="大类" ShowSearch="true" Items="@CategoryItems" OnSelectedItemChanged="@OnCategoryItemChanged" />
  34. </div>
  35. </EditTemplate>
  36. </EditorItem>
  37. <EditorItem @bind-Field="@context.AccountValues">
  38. <EditTemplate Context="value">
  39. <div class="col-12 col-sm-12">
  40. <MultiSelect @bind-Value="@value.AccountValues" Items="@AccountItems" />
  41. </div>
  42. </EditTemplate>
  43. </EditorItem>
  44. <EditorItem @bind-Field="@context.LabelPriceCoefficient">
  45. <EditTemplate Context="value">
  46. <div class="col-12 col-sm-12">
  47. <BootstrapInput @bind-Value="@value.LabelPriceCoefficient" />
  48. </div>
  49. </EditTemplate>
  50. </EditorItem>
  51. <EditorItem @bind-Field="@context.LabelQuantityCoefficient">
  52. <EditTemplate Context="value">
  53. <div class="col-12 col-sm-12">
  54. <BootstrapInput @bind-Value="@value.LabelQuantityCoefficient" />
  55. </div>
  56. </EditTemplate>
  57. </EditorItem>
  58. <EditorItem @bind-Field="@context.StartEffectiveTime">
  59. <EditTemplate Context="value">
  60. <div class="col-12 col-sm-12">
  61. <DateTimePicker @bind-Value="@value.StartEffectiveTime" />
  62. </div>
  63. </EditTemplate>
  64. </EditorItem>
  65. <EditorItem @bind-Field="@context.EndEffectiveTime">
  66. <EditTemplate Context="value">
  67. <div class="col-12 col-sm-12">
  68. <DateTimePicker @bind-Value="@value.EndEffectiveTime" />
  69. </div>
  70. </EditTemplate>
  71. </EditorItem>
  72. </FieldItems>
  73. <Buttons>
  74. <div class="text-end">
  75. <Button ButtonType="ButtonType.Submit" Icon="fa fa-save" Text="提交" />
  76. </div>
  77. </Buttons>
  78. </EditorForm>
  79. </ValidateForm>
  80. </BodyTemplate>
  81. </ModalDialog>
  82. </Modal>
  83. <Modal @ref="OperateLogModal" OnCloseAsync="@OnCloseOperateLogAsync">
  84. <ModalDialog ShowCloseButton="true" IsCentered="true" Size="Size.Large" Title="操作记录" ShowFooter="false">
  85. <BodyTemplate>
  86. <Table @ref="PricingOperateLogTable" TItem="PricingOperateLogModel" IsPagination="true" PageItemsSource="@PageItemsSource"
  87. IsStriped="true" IsBordered="true" IsFixedHeader="true" OnQueryAsync="@OnOperateLogQueryAsync" ShowDefaultButtons="false" IsAutoQueryFirstRender="false">
  88. <TableColumns>
  89. <TableColumn @bind-Field="@context.Operation" TextWrap="true" />
  90. <TableColumn @bind-Field="@context.Message" TextWrap="true" TextEllipsis="true" ShowTips="true" />
  91. <TableColumn @bind-Field="@context.UpdateTime" TextWrap="true" FormatString="yyyy-MM-dd HH:mm:ss" />
  92. </TableColumns>
  93. </Table>
  94. </BodyTemplate>
  95. </ModalDialog>
  96. </Modal>
  97. <MessageBase @ref="_messageBaseRef"></MessageBase>