123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- using AntDesign;
- using Microsoft.AspNetCore.Components;
- using Microsoft.AspNetCore.Components.Web;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Threading.Tasks;
- using wispro.sp.entity;
- using wispro.sp.share;
- using wispro.sp.web.Services;
- namespace wispro.sp.web.Pages.Project
- {
- public partial class ProjectReviewer
- {
- private List<ProjectContents> projectContents;
- private ProjectInfo projectInfo;
- private List<ProjectInfo> waitingReviewProjects;
- private ViewProjectWorkContent editObj;
- [Parameter]
- public string ProjectNo { get; set; }
-
- [Inject]
- IProjectService projectService { get; set; }
- [Inject]
- CalMonthServices calMonthServices { get; set; }
- [Inject] public MessageService _message { get; set; }
- [Inject] NavigationManager _NavigationManager { get; set; }
- protected async override Task OnInitializedAsync()
- {
- CalMonth cal =await calMonthServices.GetHandlingMonth();
- if (!string.IsNullOrEmpty(ProjectNo))
- {
- projectContents = await projectService.GetProjectCanReviewWorkContent(ProjectNo, cal);
- }
- else
- {
- waitingReviewProjects = await projectService.GetWaitingReviewProjects();
- }
- await base.OnInitializedAsync();
- }
- void startEdit(ViewProjectWorkContent pp)
- {
- editObj = pp;
- }
- void stopEdit()
- {
- editObj = null;
- }
- void ContentChanged(ViewProjectWorkContent pp)
- {
- pp.modifyState = ModifyState.Modified;
- }
- void OnInput(ChangeEventArgs e)
- {
- if (editObj != null)
- {
- editObj.modifyState = ModifyState.Modified;
- }
- }
- async void Save()
- {
- var ret = await projectService.ReviewProjectWorkContent(projectContents);
- if (ret.Success)
- {
- _NavigationManager.NavigateTo("/Home");
- await _message.Success("保存成功!");
-
- }
- else
- {
- await _message.Error("保存出错!");
- }
- }
- }
- }
|