123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348 |
- using AntDesign;
- using AntDesign.ProLayout;
- using AntDesign.TableModels;
- using Microsoft.AspNetCore.Authorization;
- 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.AppCase
- {
- [Authorize]
- public partial class MyCaselist
- {
- const string strAgentFeedbackMemo = "AgentFeedbackMemo";
- const string strDoItemCoefficient = "DoItemCoefficient";
- const string strReturnCasseNo = "ReturnCasseNo";
- const string strCaseCoefficient = "CaseCoefficient";
- const string strWordCount = "WordCount";
- class Reason
- {
- public string Value { get; set; }
- public string Name { get; set; }
- }
- List<Reason> _Reasons = new List<Reason>()
- {
- new Reason(){Name="PCT首次英文案",Value="PCT首次英文案"},
- new Reason(){Name="我方转格式、复核",Value="我方转格式、复核"},
- new Reason(){Name="台湾案转大陆案",Value="台湾案转大陆案"},
- new Reason(){Name="大陆案转台湾案",Value="大陆案转台湾案"},
- new Reason(){Name="同套大陆+台湾",Value="同套大陆+台湾"},
- new Reason(){Name="不请款",Value="不请款"},
- new Reason(){Name="撤回后重新递交",Value="撤回后重新递交"},
- new Reason(){Name="发文后客户取消申请",Value="发文后客户取消申请"},
- new Reason(){Name="发文后客户原因取消申请,系统结案",Value="发文后客户原因取消申请,系统结案"},
- new Reason(){Name="改权",Value="改权"},
- new Reason(){Name="改权+改说明书",Value="改权+改说明书"},
- new Reason(){Name="客户不进行答辩",Value="客户不进行答辩"},
- new Reason(){Name="客户提供答辩点,撰写英文报导函",Value="客户提供答辩点,撰写英文报导函"},
- new Reason(){Name="客户未提供答辩点,撰写英文报导函",Value="客户未提供答辩点,撰写英文报导函辩"},
- new Reason(){Name="内-外",Value="内-外"},
- new Reason(){Name="外-内",Value="外-内"},
- new Reason(){Name="外-内首次申请",Value="外-内首次申请"},
- new Reason(){Name="请款",Value="请款"},
- new Reason(){Name="涉外OA不答辩,发报导函结案",Value="涉外OA不答辩,发报导函结案"},
- new Reason(){Name="涉外实质改权",Value="涉外实质改权"},
- new Reason(){Name="首次中文案",Value="首次中文案"},
- new Reason(){Name="我方转格式、复核",Value="我方转格式、复核"},
- new Reason(){Name="外所/他人首次转入OA",Value="外所/他人首次转入OA"},
- new Reason(){Name="我方代交",Value="我方代交"},
- new Reason(){Name="转格式",Value="转格式"},
- new Reason(){Name="撰写中客户取消申请",Value="撰写中客户取消申请"},
- new Reason(){Name="中-英",Value="中-英"},
- new Reason(){Name="英-中",Value="英-中"},
- new Reason(){Name="英-德",Value="英-德"}
- };
- private List<PerformanceItem> _Datas;
- private List<StaffStatistics> MyStatistics;
- IEnumerable<PerformanceItem> selectedItems= new List<PerformanceItem>();
- private CalMonth HandlingCalMonth;
- int _pageIndex = 1;
- int _pageSize = 10;
- int _total;
- bool _loading = false;
- PerformanceItem EditingItem = null;
- bool _visible = false;
- bool _isAdd = false;
- [Inject] public PerformanceItemServices _ItemService { get; set; }
- [Inject] public MessageService _message { get; set; }
- [Inject] protected NavigationManager NavigationManager { get; set; }
- [Inject] protected IUserService _userService { get; set; }
- [Inject] protected CalMonthServices _CalMonthService { get; set; }
- private bool isFirstInit = true;
- protected async override Task OnInitializedAsync()
- {
- if (isFirstInit)
- {
- _loading = true;
- var HandlingCalMonth =await _CalMonthService.GetHandlingMonth();
- MyStatistics = await _ItemService.CalMyStatistics(HandlingCalMonth.Year,HandlingCalMonth.Month, _userService.CurrentUser.Userid.Value);
- var data = await _ItemService.GetMyList(_userService.CurrentUser.Userid.Value, jxType.doing,_pageIndex,_pageSize);
- _Datas = data.Results;
- _total = data.TotalCount;
- _loading = false;
- }
- isFirstInit = false;
- StateHasChanged();
- Console.WriteLine($"OnInitializedAsync:[tota:{_total}\tPageIndex:{_pageIndex}\tPageSize:{_pageSize}]");
- }
- private string GetStatistics(string strType)
- {
- if (strType != "ALL")
- {
- var tem= MyStatistics.Where<StaffStatistics>(s => s.jxType == strType).FirstOrDefault();
- if(tem != null)
- {
- return (tem.totalBasePoint.HasValue?tem.totalBasePoint.Value.ToString("0.00"):"");
- }
- else
- {
- return "";
- }
- }
- else
- {
- return MyStatistics.Select(s => s.totalBasePoint.Value).Sum().ToString("0.00");
- }
- }
- private int serialNumber(int pageIndex, int pageSize, int id)
- {
- int iIndex = 0;
- foreach (PerformanceItem sf in _Datas)
- {
- iIndex++;
- if (sf.Id == id)
- {
- break;
- }
- }
- return (pageIndex - 1) * pageSize + iIndex;
- }
- private async Task HandleTableChange(QueryModel<PerformanceItem> queryModel)
- {
- _loading = true;
- var data = await _ItemService.GetMyList(_userService.CurrentUser.Userid.Value, jxType.doing, _pageIndex, _pageSize);
- _Datas = data.Results;
- _total = data.TotalCount;
- _loading = false;
- StateHasChanged();
-
- }
- private void OnsubShensu(PerformanceItem Item)
- {
- EditingItem = Item;
- _visible = true;
- //return new EventCallback();
- }
- bool _ShowJXModal = false;
- private void OnJXCal(PerformanceItem Item)
- {
- EditingItem = Item;
- _ShowJXModal = true;
- }
- #region 申诉窗口事件
- private void HandleOk(MouseEventArgs e)
- {
- Console.WriteLine(e);
- _visible = false;
- }
- private void HandleCancel(MouseEventArgs e)
- {
- Console.WriteLine(e);
- _visible = false;
- }
- #endregion
- #region 绩效计算窗口事件
- private async Task HandleOk1(MouseEventArgs e)
- {
-
- _ShowJXModal = false;
-
- var respone = await _ItemService.SaveFieldChange(EditingItem.Id, $"{strAgentFeedbackMemo}|{strWordCount}", $"{_calType.AgentMemo}|{_calType.wordCount}");
- var HandlingCalMonth = await _CalMonthService.GetHandlingMonth();
- MyStatistics = await _ItemService.CalMyStatistics(HandlingCalMonth.Year, HandlingCalMonth.Month, _userService.CurrentUser.Userid.Value);
- EditingItem.AgentFeedbackMemo = _calType.AgentMemo;
- StateHasChanged();
- }
- private void HandleCancel1(MouseEventArgs e)
- {
- Console.WriteLine(e);
- _ShowJXModal = false;
- }
- #endregion
-
- public shensuType[] AvatarMenuItems { get; set; } = new shensuType[]
- {
- new() { ChangeField = "核稿人", Name = "核稿人申诉"},
- new() { ChangeField = "处理人", Name = "处理人申诉"},
- new() { ChangeField = "案件系数", Name = "案件系数申诉"},
- new() { ChangeField = "处理事项系数", Name = "处理事项系数申诉"},
- new() { Name = "严重超期说明"}
- };
- private shensuType _SelectedItem;
- private void OnSelectedItemChangedHandler(shensuType value)
- {
- _SelectedItem = value;
- //StaffGradeIdChanged.InvokeAsync(_SelectedItem.Id);
- }
- #region 文件上传控件设定
- List<UploadFileItem> fileList = new List<UploadFileItem>
- {
- new UploadFileItem
- {
- Id = "1",
- FileName = "客户往来邮件1.jpg",
- Url = "#",
- State = UploadState.Success
- },
- new UploadFileItem
- {
- Id = "2",
- FileName = "与客户微信聊天图片.jpg",
- Url = "#",
- State = UploadState.Success
- },
- new UploadFileItem
- {
- Id = "3",
- FileName = "附件.docx",
- Url = "#",
- State = UploadState.Success
- }
- };
- Dictionary<string, object> attrs = new Dictionary<string, object>
- {
- {"Action", "#" },
- {"Name", "files" },
- {"Multiple", true }
- };
- void HandleChange(UploadInfo fileinfo)
- {
- //if (fileList.Count > 5)
- //{
- // fileList.RemoveRange(0, fileList.Count - 2);
- //}
- //fileList.Where(file => file.State == UploadState.Success && !string.IsNullOrWhiteSpace(file.Response)).ForEach(file => {
- // var result = file.GetResponse<ResponseModel>();
- // file.Url = result.url;
- //});
- }
- public class ResponseModel
- {
- public string name { get; set; }
- public string status { get; set; }
- public string url { get; set; }
- public string thumbUrl { get; set; }
- }
- #endregion
-
- CalType _calType = new CalType();
- shenshou _shenshou = new shenshou();
- List<Staff> Reviewers = new List<Staff>()
- {
- new Staff(){Id =1,Name ="钟子敏"},
- new Staff(){Id =2,Name ="邢丽霞"},
- new Staff(){Id =3,Name ="李丽"},
- new Staff(){Id =4,Name ="贾凤涛"},
- };
- private async Task OnChange(PaginationEventArgs args)
- {
- if (_pageIndex != args.Page || _pageSize != args.PageSize)
- {
- _pageIndex = args.Page;
- _pageSize = args.PageSize;
- _loading = true;
- _Datas = null;
- var data = await _ItemService.GetMyList(_userService.CurrentUser.Userid.Value, jxType.doing, _pageIndex, _pageSize);
- _Datas = data.Results;
- _total = data.TotalCount;
- _loading = false;
- }
- }
- void SelectChanged(Reason value)
- {
- if (!_loading && EditingItem != null)
- {
- var respone = _ItemService.SaveFieldChange(EditingItem.Id, strAgentFeedbackMemo, EditingItem.AgentFeedbackMemo);
- EditingItem = null;
- }
- }
- void ClearSelect(int itemId)
- {
- Console.WriteLine($"ClearSelcet:{itemId}");
- var respone = _ItemService.SaveFieldChange(itemId, strAgentFeedbackMemo,"");
- EditingItem = null;
- }
- Dictionary<string, object> OnRow(RowData<PerformanceItem> row)
- {
- Dictionary<string, object> ret = new Dictionary<string, object>();
-
- ret.Add("onclick", ((Action)delegate
- {
- EditingItem = row.Data;
- }));
- return ret;
- }
- void OnFocus(PerformanceItem item)
- {
- EditingItem = item;
- }
- }
- }
|