فهرست منبع

添加项目点数分配界面

luocaiyang 3 سال پیش
والد
کامیت
4a823f52bc

+ 68 - 1
wispro.sp.api/Controllers/PerformanceItemController.cs

@@ -659,6 +659,73 @@ namespace wispro.sp.api.Controllers
         }
 
         
-        
+        public ApiSaveResponse AddProjectPerformance(ProjectPointRecord pointRecord)
+        {
+            ApiSaveResponse retResponse = new ApiSaveResponse();
+            retResponse.Success = true;
+
+            if (pointRecord != null && pointRecord.ProjectDoItemPoints != null && pointRecord.ProjectDoItemPoints.Count > 0)
+            {
+                using (var t = Context.Database.BeginTransaction())
+                {
+                    try
+                    {
+                        CalMonth calMonth = Context.CalMonths.FirstOrDefault<CalMonth>(c=>c.Status ==0);
+                        if(calMonth == null)
+                        {
+                            retResponse.Success = false;
+                            retResponse.ErrorMessage = "不存在正在处理的绩效月度!";
+                            return retResponse;
+                        }
+
+                        foreach (var doItem in pointRecord.ProjectDoItemPoints)
+                        {
+                            PerformanceItem item = new PerformanceItem();
+                            item.CaseNo = pointRecord.CaseNo;
+                            item.CaseName = pointRecord.CaseName;
+                            item.CaseMemo = pointRecord.Reason;
+                            item.DoItem = doItem.DoItem;
+                            item.CaseCoefficient = doItem.DoItemCoefficient;
+                            item.CalMonthId = calMonth.Id;
+                            Context.PerformanceItems.Add(item);
+                            Context.SaveChanges();
+
+                            item.ItemStaffs = new List<ItemStaff>();
+
+                            foreach (var p in doItem.PersonPoints)
+                            {
+                                ItemStaff itemStaff = new ItemStaff();
+                                itemStaff.PerformancePoint = p.Point;
+
+                                var staff = Context.Staffs.FirstOrDefault<Staff>(s => s.Name == p.Person);
+                                if (staff != null)
+                                {
+                                    itemStaff.DoPersonId = staff.Id;
+                                    itemStaff.ItemId = item.Id;
+                                    Context.ItemStaffs.Add(itemStaff);
+                                    Context.SaveChanges();
+                                }
+                                else
+                                {
+                                    retResponse.Success = false;
+                                    retResponse.ErrorMessage = $"用户【{p.Person}】不存在!";
+                                    t.Rollback();
+                                    return retResponse;
+                                }
+                            }
+                        }
+                    }
+                    catch(Exception ex)
+                    {
+                        retResponse.Success = false;
+                        retResponse.ErrorMessage = ex.Message;
+                        t.Rollback();
+                        return retResponse;
+                    }
+                }
+            }
+
+            return retResponse;
+        }
     }
 }

+ 13 - 4
wispro.sp.api/Startup.cs

@@ -6,10 +6,12 @@ using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
 using Microsoft.IdentityModel.Tokens;
+using Newtonsoft.Json;
 using Quartz;
 using Quartz.Impl;
 using System;
 using System.Text;
+using System.Text.Json.Serialization;
 using wispro.sp.api.Job;
 
 namespace wispro.sp.api
@@ -52,11 +54,18 @@ namespace wispro.sp.api
                     ClockSkew = TimeSpan.Zero
                 };
             });
-
-            services.AddControllers().AddJsonOptions(options =>
-            {
-                options.JsonSerializerOptions.IgnoreNullValues = true;
+            services.AddControllers().AddNewtonsoftJson(o =>
+            { 
+                o.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
+                o.SerializerSettings.DefaultValueHandling = DefaultValueHandling.Ignore;
+                o.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
+                
             });
+            //services.AddControllers().AddJsonOptions(options =>
+            //{
+            //    options.JsonSerializerOptions.IgnoreNullValues = true;
+            //    options.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.Preserve;
+            //});
 
             services.AddDbContext<spDbContext>(optionsAction =>
                 optionsAction.UseSqlServer(Configuration.GetConnectionString("DefaultConnect"))

+ 35 - 0
wispro.sp.share/ProjectPointRecord.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace wispro.sp.share
+{
+    public class ProjectPointRecord
+    {
+        public string CaseNo { get; set; }
+
+        public string CaseName { get; set; }
+
+        public string Reason { get; set; }
+
+        public List<ProjectDoItemPoint> ProjectDoItemPoints { get; set; }
+    }
+
+    public class ProjectDoItemPoint
+    {
+        public string DoItem { get; set; }
+        public string DoItemCoefficient { get; set; }
+
+        public List<PersonPoint> PersonPoints { get; set; }
+    }
+
+    public class PersonPoint
+    {
+        public string Id { get; set; }
+        public string Person { get; set; }
+
+        public double Point { get; set; }
+    }
+}

+ 0 - 4
wispro.sp.utility/IPEasyUtility.cs

@@ -365,21 +365,17 @@ namespace wispro.sp.utility
                 System.Threading.Thread.Sleep(500);
 
                 driver.SwitchTo().ParentFrame().SwitchTo().Frame(2);
-                //driver.SwitchTo().ParentFrame().SwitchTo().Frame(driver.FindElement(By.XPath("//iframe[contains(@src,'CaseInfo.aspx']")));
                 var DoItemLink = driver.FindElement(By.XPath($"//td[contains(text(),'{doItemName}')]"));
                 retObject.CaseStage = DoItemLink.FindElement(By.XPath("following-sibling::td[1]")).Text; //案件阶段
                 retObject.DoItemState = DoItemLink.FindElement(By.XPath("following-sibling::td[2]")).Text;    //处理事项处理状态
-                //var td4 = DoItemLink.FindElement(By.XPath("following-sibling::td[3]")).Text;   //配案日
                 retObject.InternalDate = DoItemLink.FindElement(By.XPath("following-sibling::td[4]")).Text;   //内部期限
                 retObject.CustomerLimitDate = DoItemLink.FindElement(By.XPath("following-sibling::td[5]")).Text;   //客户期限
-                //var td7 = DoItemLink.FindElement(By.XPath("following-sibling::td[6]")).Text;   //官方期限
                 retObject.FinishedDate = DoItemLink.FindElement(By.XPath("following-sibling::td[7]")).Text;   //处理事项完成日
                 retObject.DoPersons = DoItemLink.FindElement(By.XPath("following-sibling::td[8]")).Text;   //处理人
                 retObject.DoItemMemo = DoItemLink.FindElement(By.XPath("following-sibling::td[9]")).Text;   //处理事项备注
                 DoItemLink.Click();
 
                 retObject.FinalizationDate = driver.FindElement(By.Id("p_proc_info__finish_doc_date")).GetAttribute("value"); //定稿日
-                //retObject.FinalizationDate = driver.FindElement(By.Id("p_proc_info__cus_due_date")).GetAttribute("value"); //客户完成日[定稿日]
                 retObject.ReturnDate = driver.FindElement(By.Id("p_proc_info__back_date")).GetAttribute("value"); //返稿日
                 retObject.Reviewer = driver.FindElement(By.Id("p_proc_info__revise_user")).GetAttribute("value");      //核稿人
                 retObject.DoItemCoefficient = driver.FindElement(By.Id("p_proc_info__proc_coefficient")).GetAttribute("value");     //处理事项系数

+ 1 - 3
wispro.sp.web/Components/CreateAppeal.razor.cs

@@ -44,7 +44,7 @@ namespace wispro.sp.web.Components
                 _Model.FileList.Where(file => file.State == UploadState.Success && !string.IsNullOrWhiteSpace(file.Response)).ForEach(file =>
                 {
                     var result = file.GetResponse<List<AttachFile>>();
-                    file.Url = $"AttachFiles/Download?id={result[0].Id}";
+                    file.Url = $"http://localhost:39476/api/AttachFiles/Download?id={result[0].Id}";
                 });
             }
             catch { }
@@ -77,8 +77,6 @@ namespace wispro.sp.web.Components
         private async void OnFinish()
         {
             await base.OnFeedbackOkAsync(new ModalClosingEventArgs() { Cancel = true });
-            
-            
         }
 
         private void OnCancel()

+ 27 - 19
wispro.sp.web/Pages/AppCase/MyCaselist.razor

@@ -33,11 +33,12 @@
                         <PageHeader>
                             <PageHeaderTitle>基础点数统计</PageHeaderTitle>
                             <PageHeaderExtra>
-                                @foreach(AppealType at in apTypeService.GetItems(1))
+                                <Button Type="@ButtonType.Primary" OnClick="()=>goAssignPoint()">添加项目绩效</Button>
+                                @foreach (AppealType at in apTypeService.GetItems(1))
                                 {
                                     <Button Type="@ButtonType.Primary" OnClick="()=>ShowModel(null,at)">@at.Name</Button>
                                 }
-                            
+
                             </PageHeaderExtra>
                             <PageHeaderContent>
                                 <div style="border:1px solid #000000">
@@ -96,11 +97,12 @@
                                 <AntDesign.Column Title="序号" TData="int" Width="50" Fixed="left">
                                     @serialNumber(_pageIndex, _pageSize, context.Id)
                                 </AntDesign.Column>
-                                <AntDesign.Column Title="基础点数" TData="string" Width="100">@(context.BasePoint == null ? "" : context.BasePoint)</AntDesign.Column>
+                                <AntDesign.Column Title="基础点数" TData="string" Width="120">@(context.BasePoint == null ? "" : context.BasePoint)</AntDesign.Column>
                                 <AntDesign.Column Title="我方文号" @bind-Field="@context.CaseNo" Width="150" Sortable Filterable />
                                 <AntDesign.Column Title="案件类型" @bind-Field="@context.CaseType" Width="120" Sortable Filterable />
+                                <AntDesign.Column Title="申请类型" @bind-Field="@context.ApplicationType" Width="120" Sortable Filterable/>
                                 <AntDesign.Column Title="案件系数"
-                                                  @bind-Field="@context.CaseCoefficient" Width="120"
+                                                  @bind-Field="@context.CaseCoefficient" Width="100"
                                                   Filters="CaseCoeFilters"
                                                   FilterMultiple="false"
                                                   OnFilter="((value,name)=>name.StartsWith(value))"
@@ -108,7 +110,6 @@
                                 <AntDesign.Column Title="处理事项" @bind-Field="@context.DoItem" Width="150" Sortable Filterable />
                                 <AntDesign.Column Title="处理事项系数" @bind-Field="@context.DoItemCoefficient" Width="150" Sortable Filterable />
                                 <AntDesign.Column Title="案件阶段" @bind-Field="@context.CaseStage" Width="100"></AntDesign.Column>
-                                <AntDesign.Column Title="绩效特殊字段" @bind-Field="@context.AgentFeedbackMemo" Width="250" />
                                 <AntDesign.Column Title="处理人" TData="string" DataIndex="@nameof(context.ItemStaffs)" Width="150">
                                     @if (context.ItemStaffs != null)
                                     {
@@ -120,23 +121,30 @@
                                 </AntDesign.Column>
                                 <AntDesign.Column Title="核稿人" TData="string" Width="100">@(context.Reviewer == null ? "" : context.Reviewer.Name)</AntDesign.Column>
 
-                                <ActionColumn Fixed="right" Title="操作" Width="120">
+                                <ActionColumn Fixed="right" Title="操作" Width="50" Style="text-align:right">
                                     <Space>
                                         <SpaceItem>
-                                            <AntDesign.Dropdown>
-                                                <Overlay>
-                                                    <Menu>
-                                                        @foreach (var apType in apTypeService.GetItems(context))
-                                                        {
-                                                            <MenuItem @key="@($"{context.Id}-{apType.Id}")" OnClick="()=>ShowModel(context,apType)">@apType.Name</MenuItem>
-                                                        }
+                                            @{
+                                                var menuItems = apTypeService.GetItems(context);
+                                                if (menuItems.Count > 0)
+                                                {
+                                                    <AntDesign.Dropdown>
+                                                        <Overlay>
+                                                            <Menu>
+                                                                @foreach (var apType in menuItems)
+                                                                {
+                                                                    <MenuItem @key="@($"{context.Id}-{apType.Id}")" OnClick="()=>ShowModel(context,apType)">@apType.Name</MenuItem>
+                                                                }
+
+                                                            </Menu>
+                                                        </Overlay>
+                                                        <ChildContent>
+                                                            <Button Type="Primary" Icon="down" Style="background: #f6ffed;"></Button>
+                                                        </ChildContent>
+                                                    </AntDesign.Dropdown>
+                                                }
+                                            }
 
-                                                    </Menu>
-                                                </Overlay>
-                                                <ChildContent>
-                                                    <Button Type="Primary">...</Button>
-                                                </ChildContent>
-                                            </AntDesign.Dropdown>
                                         </SpaceItem>
                                     </Space>
 

+ 5 - 0
wispro.sp.web/Pages/AppCase/MyCaselist.razor.cs

@@ -315,5 +315,10 @@ namespace wispro.sp.web.Pages.AppCase
             };
             StateHasChanged();
         }
+
+        void goAssignPoint()
+        {
+            NavigationManager.NavigateTo("/Project/AssignPoint");
+        }
     }
 }

+ 82 - 54
wispro.sp.web/Pages/Project/AssignPoint.razor

@@ -1,4 +1,4 @@
-@page "/Project/AssignPoint/{id}"
+@page "/Project/AssignPoint"
 
 <PageContainer>
     <Breadcrumb>
@@ -7,9 +7,6 @@
                 <a href="/Home"><Icon Type="home"></Icon></a>
             </BreadcrumbItem>
             <BreadcrumbItem>
-                <span>项目</span>
-            </BreadcrumbItem>
-            <BreadcrumbItem>
                 <span>分配项目点数</span>
             </BreadcrumbItem>
         </Breadcrumb>
@@ -18,50 +15,62 @@
     <ChildContent>
         <Card>
             <Card>
-                <div>
-                    <Row>
-                        <AntDesign.Col Span="4"><b>我方文号:</b></AntDesign.Col>
-                        <AntDesign.Col Span="8">@task.ProjectInfo.CaseNo</AntDesign.Col>
-                        <AntDesign.Col Span="4"><b>处理事项:</b></AntDesign.Col>
-                        <AntDesign.Col Span="8">@task.ProjectInfo.DoItem</AntDesign.Col>
-                    </Row>
-                    <Row><AntDesign.Col Span="24">&nbsp;</AntDesign.Col></Row>
-                    <Row>
-                        <AntDesign.Col Span="4"><b>案件名称:</b></AntDesign.Col>
-                        <AntDesign.Col Span="16">@task.ProjectInfo.CaseName</AntDesign.Col>
-                        <AntDesign.Col Span="4"><Button Type="primary" Icon="plus" OnClick="AddNew" Style="float:right">添加</Button></AntDesign.Col>
-                    </Row>
-                </div>
+                <Form Model="task">
+                    <FormItem Label="我方文号">
+                        <Input @bind-Value="@context.CaseNo" />
+                    </FormItem>
+                    <FormItem Label="案件名称">
+                        <Input @bind-Value="@context.CaseName" />
+                    </FormItem>
+                    <FormItem Label="分配说明">
+                        <TextArea  @bind-Value="@context.Reason" Rows="4"/>
+                    </FormItem>
+                </Form>
             </Card>
             <Card>
-                <AntDesign.Table TItem="wispro.sp.web.Models.ProjectPoint"
-                                 DataSource="projectPoints"
+                <Button OnClick="AddNew">添加人员绩效</Button>
+                @if (task.ProjectDoItemPoints != null)
+                {
+                <AntDesign.Table TItem="wispro.sp.share.ProjectDoItemPoint"
+                                 DataSource="task.ProjectDoItemPoints"
                                  Bordered=@true
                                  Size=@TableSize.Small>
-                    <ChildContent Context="pp">
-                        <AntDesign.Column Title="处理事项" @bind-Field="@pp.doItem" Sortable Filterable />
-                        <AntDesign.Column Title="难度系数" @bind-Field="@pp.DoItemCoefficient" Sortable Filterable />
-                        <AntDesign.Column Title="处理人" @bind-Field="@pp.person" Sortable Filterable />
-                        <AntDesign.Column Title="分配点数"  @bind-Field="@pp.Point" TData="double">
-                            @if (editId == pp.person)
-                            {
-                                <Input Type="text" @bind-Value="pp.Point" OnBlur="stopEdit" AutoFocus />
-                            }
-                            else
-                            {
-                                <div class="editable-cell-value-wrap" style="padding-right:10px" @onclick="()=>startEdit(pp.person)">
-                                    @pp.Point
-                                </div>
-                            }
-                        </AntDesign.Column>
+                    <RowTemplate Context="pp">
+                        <AntDesign.Column Title="处理事项"  @bind-Field="@pp.DoItem" />
+                        <AntDesign.Column Title="难度系数"  @bind-Field="@pp.DoItemCoefficient"/>
                         <ActionColumn>
                             <Space>
-                                <SpaceItem><Button Danger OnClick="()=>Delete(pp.person)">删除</Button></SpaceItem>
+                                <SpaceItem><Button  OnClick="() => EditDoItem(pp.DoItem)" Type="@ButtonType.Text">修改</Button></SpaceItem>
+                                <SpaceItem><Button Danger OnClick="() => DeleteDoItem(pp.DoItem)" Type="@ButtonType.Text">删除</Button></SpaceItem>
                             </Space>
                         </ActionColumn>
-                    </ChildContent>
+                    </RowTemplate>
+                    <ExpandTemplate Context="rowData">
+                        <Table DataSource="rowData.Data.PersonPoints">
+                            <AntDesign.Column Title="处理人" @bind-Field="@context.Person" Sortable Filterable />
+                            <AntDesign.Column Title="分配点数" @bind-Field="@context.Point" TData="double">
+                                @if (editId == context.Id && _visible== false)
+                                {
+                                    <AntDesign.InputNumber Type="text" @bind-Value="context.Point" OnBlur="stopEdit" AutoFocus />
+                                }
+                                else
+                                {
+                                    <div class="editable-cell-value-wrap" style="padding-right:10px" @onclick="() => startEdit(context.Id)">
+                                        @context.Point
+                                    </div>
+                                }
+                            </AntDesign.Column>
+                            <ActionColumn>
+                                <Space>
+                                    <SpaceItem><Button Danger OnClick="() => Delete(rowData.Data.DoItem, context.Id)" Type="@ButtonType.Text">删除</Button></SpaceItem>
+                                </Space>
+                            </ActionColumn>
+                        </Table>
+                    </ExpandTemplate>
+                    
 
-                </AntDesign.Table>
+            </AntDesign.Table>
+                }
             </Card>
             
             <Card>
@@ -86,37 +95,56 @@
     <Form Model="addDoItem" LabelColSpan="6"
           WrapperColSpan="16">
         <FormItem Label="处理事项">
-            <Input @bind-Value="@context.Name" />
+            <Input @bind-Value="@context.DoItem" />
         </FormItem>
         <FormItem Label="难度系数">
-            <Input @bind-Value="@context.nanduxishu" />
+            <Input @bind-Value="@context.DoItemCoefficient" />
         </FormItem>
-        <AntDesign.Table 
-                         TItem="ProjectPoint"
-                         DataSource="addDoItem.AddprojectPoints"
+        <Button OnClick="addRow" Type="primary" Style="margin-bottom:16px">添加</Button>
+        <AntDesign.Table TItem="wispro.sp.share.PersonPoint"
+                         DataSource="addDoItem.PersonPoints"
                          Bordered=@true
                          Size=@TableSize.Small>
             <ChildContent Context="pp">
-                <AntDesign.Column Title="处理人" @bind-Field="@pp.person" Sortable Filterable />
+                <AntDesign.Column Title="处理人" TData="string" Sortable Filterable>
+                    @if (editId == pp.Id)
+                    {
+                        
+                        <Input Type="text" @bind-Value="pp.Person" />
+                    }
+                    else
+                    {
+                        <div class="editable-cell-value-wrap" style="padding-right:10px">
+                            @pp.Person
+                        </div>
+                    }
+                </AntDesign.Column>
                 <AntDesign.Column Width="30%" Title="分配点数" TData="double">
-                    @if (editId == pp.person)
+                    @if (editId == pp.Id)
                     {
-                        <Input Type="text" @bind-Value="pp.Point" OnBlur="stopEdit" AutoFocus />
+                        <AntDesign.InputNumber Type="text" @bind-Value="pp.Point" />
                     }
                     else
                     {
-                        <div class="editable-cell-value-wrap" style="padding-right:10px" @onclick="()=>startEdit(pp.person)">
-                            @pp.Point  
+                        <div class="editable-cell-value-wrap" style="padding-right:10px">
+                            @pp.Point
                         </div>
                     }
                 </AntDesign.Column>
-                <ActionColumn>
-                    <Space>
-                        <SpaceItem><Button Danger OnClick="()=>Delete(pp.person)">删除</Button></SpaceItem>
-                    </Space>
+                <ActionColumn Title="Action">
+                    @if (editId != pp.Id)
+                    {
+                        <a @onclick="() => startEdit(pp.Id)">修改</a>
+                        <a @onclick="() => deletePersonPoint(pp.Id)">删除</a>
+                    }
+                    else
+                    {
+                        <a @onclick="() => stopEdit()" class="save">保存</a>
+                    }
                 </ActionColumn>
             </ChildContent>
 
         </AntDesign.Table>
     </Form>
-</Modal>
+</Modal>
+

+ 111 - 80
wispro.sp.web/Pages/Project/AssignPoint.razor.cs

@@ -4,7 +4,12 @@ using Microsoft.AspNetCore.Components.Web;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Text.Json;
+using System.Threading.Tasks;
+using wispro.sp.entity;
+using wispro.sp.share;
 using wispro.sp.web.Models;
+using wispro.sp.web.Services;
 
 namespace wispro.sp.web.Pages.Project
 {
@@ -12,96 +17,55 @@ namespace wispro.sp.web.Pages.Project
     {
         [Inject] public MessageService MsgSvr { get; set; }
 
-        [Parameter]
-        public string id { get; set; }
+         [Inject] protected PerformanceItemServices _itemService { get; set; }
+        [Inject] NavigationManager _NavigationManager { get; set; }
+
 
         private AntDesign.Modal model;
 
-        Task task = new()
+        ProjectPointRecord task = new()
         {
-            ProjectInfo = new ProjectInfo()
-            {
-                CaseNo = "S2112394",
-                CaseName = "美的-洗碗机专利调查",
-                DoItem = "提出报告",
-                DoPerson = new List<string>() { "李申", "何倚雯", "王晴", "陆跃" },
-                ResponseMan = "黄瑜"
-            },
-            Id = 1,
-            Name = "2021年9月专案点数分配任务",
-            Type = "专案点数分配任务",
-            ResponseMan = "黄瑜",
-            State = "待处理",
-            LimiteDate = DateTime.Now.AddDays(4),
-            UIUrl = "/Project/AssignPoint"
-        };
-
-        List<ProjectPoint> projectPoints=new List<ProjectPoint>() { 
-            new ProjectPoint(){ doItem="检索条件策略", DoItemCoefficient="B", person="李申", Point=1.0},
-            new ProjectPoint(){ doItem="检索条件策略", DoItemCoefficient="B", person="何倚雯", Point=2.0},
-            new ProjectPoint(){ doItem="检索条件策略", DoItemCoefficient="B", person="王晴", Point=1.5},
-            new ProjectPoint(){ doItem="检索条件策略", DoItemCoefficient="B", person="陆跃", Point=1.0},
-            new ProjectPoint(){ doItem="专利分类", DoItemCoefficient="B", person="李申", Point=2.0},
-            new ProjectPoint(){ doItem="专利分类", DoItemCoefficient="B", person="何倚雯", Point=1.5},
-            new ProjectPoint(){ doItem="专利分类", DoItemCoefficient="B", person="王晴", Point=2.5},
-            new ProjectPoint(){ doItem="专利分类", DoItemCoefficient="B", person="陆跃", Point=3.0},
+            
+            CaseNo = "S2112394",
+            CaseName = "美的-洗碗机专利调查",
+                
+             ProjectDoItemPoints = new List<ProjectDoItemPoint>()
+             {
+                new ProjectDoItemPoint(){ DoItem="检索策略评估",  DoItemCoefficient="B", 
+                    PersonPoints=new List<PersonPoint>{
+                        new PersonPoint(){Id="1", Person ="李申", Point=1.0 },
+                        new PersonPoint(){Id="2", Person ="张三", Point=1.0 },
+                        new PersonPoint(){Id="3", Person ="李四", Point=1.0 },
+                    }},
+                new ProjectDoItemPoint(){ DoItem="专利分类",  DoItemCoefficient="A", 
+                    PersonPoints=new List<PersonPoint>{
+                        new PersonPoint(){Id="1",  Person ="李申", Point=2.0 },
+                        new PersonPoint(){Id="2",  Person ="张三", Point=1.50 },
+                        new PersonPoint(){Id="3",  Person ="李四", Point=2.5 },
+                    }},
+             }
         };
-        
-
-        private class AddDoItem
-        {
-            public string Name { get; set; }
-
-            public string nanduxishu { get; set; }
 
-            public List<ProjectPoint> AddprojectPoints { get; set; }
-        }
-
-        private AddDoItem addDoItem;
+        ProjectDoItemPoint addDoItem;
+        bool isAdd = false;
         private bool _visible = false;
         private void AddNew()
         {
-            addDoItem = new AddDoItem();
-            addDoItem.AddprojectPoints = new List<ProjectPoint>();
-            foreach (string name in task.ProjectInfo.DoPerson)
-            {
-                addDoItem.AddprojectPoints.Add(new ProjectPoint()
-                {
-                    //doItem = addDoItem.nanduxishu,
-                    //DoItemCoefficient = addDoItem.nanduxishu,
-                    person = name,
-                    Point = 0
-                });
-            }
-
-                _visible = true;
+            addDoItem = new ProjectDoItemPoint();
+            isAdd = true;
+            _visible = true;
         }
 
         private void HandleOk(MouseEventArgs e)
         {
-
-            if (!string.IsNullOrEmpty(addDoItem.Name))
+            if (isAdd)
             {
-                List<ProjectPoint> temList = new List<ProjectPoint>();
-
-                if(projectPoints== null)
-                {
-                    projectPoints = new List<ProjectPoint>();
-                }
-
-                if (addDoItem.AddprojectPoints != null)
+                if (!string.IsNullOrEmpty(addDoItem.DoItem))
                 {
-                    foreach(ProjectPoint pp in addDoItem.AddprojectPoints)
-                    {
-                        pp.doItem = addDoItem.Name;
-                        pp.DoItemCoefficient = addDoItem.nanduxishu;
-                    }
-                    
+                    task.ProjectDoItemPoints.Add(addDoItem);
                 }
-
-                projectPoints.AddRange(addDoItem.AddprojectPoints);
             }
-
+            
             _visible = false;
             model.Dispose();
         }
@@ -120,6 +84,12 @@ namespace wispro.sp.web.Pages.Project
             MsgSvr.Info($"开始编辑{editId}");
         }
 
+        void deletePersonPoint(string id)
+        {
+            var delObj = addDoItem.PersonPoints.FirstOrDefault<PersonPoint>(f => f.Id == id);
+            addDoItem.PersonPoints.Remove(delObj);
+        }
+
         void stopEdit()
         {
             //var editedData = addDoItem.AddprojectPoints.FirstOrDefault(x => x.person == editId);
@@ -127,28 +97,89 @@ namespace wispro.sp.web.Pages.Project
             editId = null;
         }
 
-        void Delete(string id)
+        void Delete(string doItem, string person)
         {
+            Console.WriteLine(JsonSerializer.Serialize(task));
             if (_visible)
             {
-                var editedData = addDoItem.AddprojectPoints.FirstOrDefault(x => x.person == id);
-                addDoItem.AddprojectPoints.Remove(editedData);
+                var editedData = addDoItem.PersonPoints.FirstOrDefault(x => x.Person  == person);
+                addDoItem.PersonPoints.Remove(editedData);
             }
             else
             {
-                var editedData = projectPoints.FirstOrDefault(x => x.person == id);
-                projectPoints.Remove(editedData);
+                
+                var editedData = task.ProjectDoItemPoints .FirstOrDefault(x => x.DoItem  == doItem);
+                Console.WriteLine(JsonSerializer.Serialize(editedData));
+                var personPoint = editedData.PersonPoints.FirstOrDefault(x => x.Id  == person);
+                Console.WriteLine(JsonSerializer.Serialize(personPoint));
+                editedData.PersonPoints.Remove(personPoint);
+                
             }
+
+            Console.WriteLine(JsonSerializer.Serialize(task));
+            StateHasChanged();
         }
 
-        void OnSave()
+        void DeleteDoItem(string doItem)
+        {
+            var delData = task.ProjectDoItemPoints.FirstOrDefault(x => x.DoItem == doItem);
+            task.ProjectDoItemPoints.Remove(delData);
+        }
+
+        void EditDoItem(string doItem)
+        {
+            isAdd = false;
+            addDoItem = task.ProjectDoItemPoints.FirstOrDefault(x => x.DoItem == doItem);
+            _visible = true; 
+        }
+
+        private string GetId(List<PersonPoint> personPoints)
+        {
+            int i = personPoints.Count;
+
+            begin:
+            foreach(var pp in personPoints)
+            {
+                if(pp.Id == i.ToString())
+                {
+                    i++;
+                    goto begin;
+                }
+            }
+
+            return i.ToString();
+
+        }
+        void addRow()
+        {
+            if(addDoItem.PersonPoints == null)
+            {
+                addDoItem.PersonPoints = new List<PersonPoint>();
+            }
+
+            string strId = GetId(addDoItem.PersonPoints);
+
+            addDoItem.PersonPoints.Add(
+                new PersonPoint() { Id = strId, Person ="修改处理人姓名", Point = 0}
+                ) ;
+            editId = strId;
+            StateHasChanged();
+        }
+
+        async Task OnSave()
         {
             //添加保存代码
+            await _itemService.AddProjectPerformanctItem(task);
+            await MsgSvr.Info("项目绩效保存成功!");
+            _NavigationManager.NavigateTo("/MyCaseList");
+
         }
 
         void OnCancel()
         {
-
+            _NavigationManager.NavigateTo("/MyCaseList");
         }
     }
+
+    
 }

+ 6 - 0
wispro.sp.web/Services/PerformanceItemServices.cs

@@ -130,5 +130,11 @@ namespace wispro.sp.web.Services
             var data = await _httpClient.Get<List<StaffStatistics>>($"PerformanceItem/CalMyStatistics?userid={userid}&year={year}&month={month}");
             return data;
         }
+
+        public async Task<ApiSaveResponse> AddProjectPerformanctItem(ProjectPointRecord projectPoint)
+        {
+            var data = await _httpClient.Post<ApiSaveResponse>($"PerformanceItem/AddProjectPerformance",projectPoint);
+            return data;
+        }
     }
 }

+ 0 - 6
wispro.sp.web/wispro.sp.web.csproj

@@ -10,7 +10,6 @@
     <Compile Remove="AuthProvider.cs" />
     <Compile Remove="Models\ProjectInfo.cs" />
     <Compile Remove="Pages\AppCase\ShensuReview.razor.cs" />
-    <Compile Remove="Pages\Project\AssignPoint.razor.cs" />
     <Compile Remove="Pages\Project\ConfirmProjectPoint.razor.cs" />
     <Compile Remove="Pages\Project\ProjectList.razor.cs" />
     <Compile Remove="Pages\Project\ReadAssignPointMsg.razor.cs" />
@@ -19,7 +18,6 @@
 
   <ItemGroup>
     <Content Remove="Pages\AppCase\ShensuReview.razor" />
-    <Content Remove="Pages\Project\AssignPoint.razor" />
     <Content Remove="Pages\Project\ConfirmProjectPoint.razor" />
     <Content Remove="Pages\Project\ProjectList.razor" />
     <Content Remove="Pages\Project\ReadAssignPointMsg.razor" />
@@ -83,8 +81,4 @@
     </Content>
   </ItemGroup>
 
-  <ItemGroup>
-    <Folder Include="Pages\Project\" />
-  </ItemGroup>
-
 </Project>