Esempio n. 1
0
        //待审批
        private void WaitApproveList(OfficeListModel vm, IEnumerable <tbWeOAFlowDetail> workflowApproveList)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var waitApproveList = OAWeWorkFlow.GetWaitApproveList(db, flowTypeCode);
                var wait            = (from a in waitApproveList
                                       join b in db.Table <Wechat.Entity.tbWeOAOffice>() on a.ApproveBodyId equals b.Id
                                       select new Dto.Office.OfficeListDto
                {
                    Title = b.Title,
                    LimitDateTo = b.LimitDateTo,
                    OfficeFileFrom = b.OfficeFileFrom,
                    OfficeFileName = b.OfficeFileName,
                    OfficeFileNameSeq = b.OfficeFileNameSeq,
                    ReceiveFileTime = b.ReceiveFileTime,

                    Id = b.Id,
                    ApplyUser = workflowApproveList.Where(m => m.ApproveBodyId == b.Id).FirstOrDefault().tbSysUser.UserName,
                    ApproveDate = a.ApproveDate,
                    ApproveOpinion = a.ApproveOpinion,
                    ApproveUserName = a.tbSysUser.UserName,
                    NodeApproveStatus = a.NodeApproveStatus
                }).Distinct(new Code.EqualComparer <Dto.Office.OfficeListDto>((x, y) => x.Id == y.Id)).OrderByDescending(m => m.ApproveDate);
                //分页
                WaitListPage(vm, wait);
            }
        }
Esempio n. 2
0
        //已审批
        private void ApprovedList(ApplyCarListModel vm, IEnumerable <tbWeOAFlowDetail> workflowApproveList, IEnumerable <tbWeOAFlowDetail> allApproveList)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var approvedList = OAWeWorkFlow.GetApprovedList(db, flowTypeCode);
                var approved     = (from a in approvedList
                                    join b in db.Table <Wechat.Entity.tbWeOAApplyCar>().Include(m => m.tbTeacherDept) on a.ApproveBodyId equals b.Id
                                    select new Dto.ApplyCar.ApplyCarListDto
                {
                    CarTime = b.CarTime,
                    Destination = b.Destination,
                    tbTeacherDeptName = b.tbTeacherDept.TeacherDeptName,
                    Reason = b.Reason,
                    OtherUsers = b.OtherUsers,
                    Remark = b.Remark,

                    Id = b.Id,
                    ApplyUser = workflowApproveList.Where(m => m.ApproveBodyId == b.Id).FirstOrDefault().tbSysUser.UserName,
                    ApproveDate = a.ApproveDate,
                    ApproveOpinion = a.ApproveOpinion,
                    ApproveUserName = a.tbSysUser.UserName,
                    NodeApproveStatus = allApproveList.Where(m => m.ApproveBodyId == a.ApproveBodyId && m.NodeApproveStatus == Code.EnumHelper.OAFlowNodeStatus.WithoutApproval).FirstOrDefault() == null ? Code.EnumHelper.OAFlowNodeStatus.Approved : Code.EnumHelper.OAFlowNodeStatus.WithoutApproval,
                    IsComplete = allApproveList.Where(m => m.ApproveBodyId == a.ApproveBodyId && m.tbWeOAFlowNextNode == null).FirstOrDefault() != null
                }).Distinct(new Code.EqualComparer <Dto.ApplyCar.ApplyCarListDto>((x, y) => x.Id == y.Id)).OrderByDescending(m => m.ApproveDate);
                ApprovedListPage(vm, approved);
            }
        }
Esempio n. 3
0
        public ActionResult AddApplyCar(Models.ApplyCar.ApplyCarEditModel vm)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var error = new List <string>();
                if (error.Count == decimal.Zero)
                {
                    //审批内容表记录
                    var tb = new Wechat.Entity.tbWeOAApplyCar();
                    tb.CarTime       = vm.ApplyCarEditDto.CarTime;
                    tb.Destination   = vm.ApplyCarEditDto.Destination;
                    tb.OtherUsers    = vm.ApplyCarEditDto.OtherUsers;
                    tb.Remark        = vm.ApplyCarEditDto.Remark;
                    tb.tbTeacherDept = db.Set <Teacher.Entity.tbTeacherDept>().Find(vm.ApplyCarEditDto.tbTeacherDeptId);
                    db.Set <Wechat.Entity.tbWeOAApplyCar>().Add(tb);
                    db.SaveChanges();

                    //执行流程引擎
                    OAWeWorkFlow.ExecuteWorkFlowEngine(db, flowTypeCode, tb.Id, "", "发起流程", false, vm.ApplyCarEditDto.NextApproveUserId);
                }
                else
                {
                    return(Content(string.Join("\r\n", error)));//不提交文件表单的方式
                }
                return(Code.MvcHelper.Post(error, Url.Action("ApplyCarIndex")));
            }
        }
Esempio n. 4
0
        //已审批
        private void ApprovedList(OfficeListModel vm, IEnumerable <tbWeOAFlowDetail> workflowApproveList, IEnumerable <tbWeOAFlowDetail> allApproveList)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var approvedList = OAWeWorkFlow.GetApprovedList(db, flowTypeCode);
                var my           = (from a in approvedList
                                    join b in db.Table <Wechat.Entity.tbWeOAOffice>() on a.ApproveBodyId equals b.Id
                                    select new Dto.Office.OfficeListDto
                {
                    Title = b.Title,
                    LimitDateTo = b.LimitDateTo,
                    OfficeFileFrom = b.OfficeFileFrom,
                    OfficeFileName = b.OfficeFileName,
                    OfficeFileNameSeq = b.OfficeFileNameSeq,
                    ReceiveFileTime = b.ReceiveFileTime,

                    Id = b.Id,
                    ApplyUser = workflowApproveList.Where(m => m.ApproveBodyId == b.Id).FirstOrDefault().tbSysUser.UserName,
                    ApproveDate = a.ApproveDate,
                    ApproveOpinion = a.ApproveOpinion,
                    ApproveUserName = a.tbSysUser.UserName,
                    NodeApproveStatus = allApproveList.Where(m => m.ApproveBodyId == a.ApproveBodyId && m.NodeApproveStatus == Code.EnumHelper.OAFlowNodeStatus.WithoutApproval).FirstOrDefault() == null ? Code.EnumHelper.OAFlowNodeStatus.Approved : Code.EnumHelper.OAFlowNodeStatus.WithoutApproval,
                    IsComplete = allApproveList.Where(m => m.ApproveBodyId == a.ApproveBodyId && m.tbWeOAFlowNextNode == null).FirstOrDefault() != null
                }).Distinct(new Code.EqualComparer <Dto.Office.OfficeListDto>((x, y) => x.Id == y.Id)).OrderByDescending(m => m.ApproveDate);
                //分页
                ApprovedListPage(vm, my);
            }
        }
Esempio n. 5
0
        //我的申请
        private static void MyApplyList(ApplyLeaveListModel vm, IEnumerable <tbWeOAFlowDetail> workflowApproveList, IEnumerable <tbWeOAFlowDetail> allApproveList)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var myApplyList = OAWeWorkFlow.GetMyApplyList(db, flowTypeCode).ToList();
                var my          = (from a in myApplyList
                                   join b in db.Table <Wechat.Entity.tbWeOAApplyLeave>().Include(m => m.tbTeacherDept).Include(m => m.tbWeOALeaveType) on a.ApproveBodyId equals b.Id
                                   select new Dto.ApplyLeave.ApplyLeaveListDto
                {
                    CaseFileName = b.CaseFileName,
                    LeaveDayCount = b.LeaveDayCount,
                    LeaveFromTime = b.LeaveFromTime,
                    LeaveToTime = b.LeaveToTime,
                    tbTeacherDeptName = b.tbTeacherDept.TeacherDeptName,
                    tbWeOALeaveTypeName = b.tbWeOALeaveType.LeaveTypeName,
                    Reason = b.Reason,

                    Id = b.Id,
                    ApplyUser = workflowApproveList.Where(m => m.ApproveBodyId == b.Id).FirstOrDefault().tbSysUser.UserName,
                    ApproveDate = a.ApproveDate,
                    ApproveOpinion = a.ApproveOpinion,
                    ApproveUserName = a.tbSysUser.UserName,
                    NodeApproveStatus = allApproveList.Where(m => m.ApproveBodyId == a.ApproveBodyId && m.NodeApproveStatus == Code.EnumHelper.OAFlowNodeStatus.WithoutApproval).FirstOrDefault() == null ? Code.EnumHelper.OAFlowNodeStatus.Approved : Code.EnumHelper.OAFlowNodeStatus.WithoutApproval,
                    IsComplete = allApproveList.Where(m => m.ApproveBodyId == a.ApproveBodyId && m.tbWeOAFlowNextNode == null).FirstOrDefault() != null
                }).Distinct(new Code.EqualComparer <Dto.ApplyLeave.ApplyLeaveListDto>((x, y) => x.Id == y.Id)).OrderByDescending(m => m.ApproveDate);
                MyListPage(vm, my);
            }
        }
Esempio n. 6
0
        //待审批
        private void WaitApproveList(ApplyLeaveListModel vm, IEnumerable <tbWeOAFlowDetail> workflowApproveList)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var waitApproveList = OAWeWorkFlow.GetWaitApproveList(db, flowTypeCode);
                var wait            = (from a in waitApproveList
                                       join b in db.Table <Wechat.Entity.tbWeOAApplyLeave>().Include(m => m.tbTeacherDept).Include(m => m.tbWeOALeaveType) on a.ApproveBodyId equals b.Id
                                       select new Dto.ApplyLeave.ApplyLeaveListDto
                {
                    CaseFileName = b.CaseFileName,
                    LeaveDayCount = b.LeaveDayCount,
                    LeaveFromTime = b.LeaveFromTime,
                    LeaveToTime = b.LeaveToTime,
                    tbTeacherDeptName = b.tbTeacherDept.TeacherDeptName,
                    tbWeOALeaveTypeName = b.tbWeOALeaveType.LeaveTypeName,
                    Reason = b.Reason,

                    Id = b.Id,
                    ApplyUser = workflowApproveList.Where(m => m.ApproveBodyId == b.Id).FirstOrDefault().tbSysUser.UserName,
                    ApproveDate = a.ApproveDate,
                    ApproveOpinion = a.ApproveOpinion,
                    ApproveUserName = a.tbSysUser.UserName,
                    NodeApproveStatus = a.NodeApproveStatus
                }).Distinct(new Code.EqualComparer <Dto.ApplyLeave.ApplyLeaveListDto>((x, y) => x.Id == y.Id)).OrderByDescending(m => m.ApproveDate);
                WaitListPage(vm, wait);
            }
        }
Esempio n. 7
0
 public ActionResult RejectWorkFlow(int approveBodyId = 0, string conditionalFormula = "", string approveOpinion = "")
 {
     using (var db = new XkSystem.Models.DbContext())
     {
         OAWeWorkFlow.ExecuteWorkFlowEngine(db, flowTypeCode, approveBodyId, conditionalFormula, approveOpinion, true);
     }
     return(Content("<script type='text/javascript'> window.parent.location.href = '" + Url.Action("ApplyCarIndex", "ApplyCar", new { area = "wechat" }) + "';</script>"));
 }
Esempio n. 8
0
        public ActionResult AddOffice(Models.Office.OfficeEditModel vm)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                if (string.IsNullOrEmpty(vm.OfficeEditDto.OfficeFileName) && !string.IsNullOrEmpty(vm.OfficeEditDto.FileContent))
                {
                    ModelState.Remove("OfficeEditDto.OfficeFileName");
                }
                else if (!string.IsNullOrEmpty(vm.OfficeEditDto.OfficeFileName) && string.IsNullOrEmpty(vm.OfficeEditDto.FileContent))
                {
                    ModelState.Remove("OfficeEditDto.FileContent");
                }
                else if (string.IsNullOrEmpty(vm.OfficeEditDto.OfficeFileName) && string.IsNullOrEmpty(vm.OfficeEditDto.FileContent))
                {
                    ModelState.Remove("OfficeEditDto.FileContent");
                }
                var error = new List <string>();
                if (error.Count == decimal.Zero)
                {
                    //保存附件,rar,word(doc),pdf
                    string FileName = string.Empty;
                    if (!string.IsNullOrEmpty(vm.OfficeEditDto.OfficeFileName))
                    {
                        var file   = Request.Files[nameof(vm.OfficeEditDto) + "." + nameof(vm.OfficeEditDto.OfficeFileName)];
                        var suffix = file.FileName.Substring(file.FileName.LastIndexOf("."));
                        FileName = System.IO.Path.GetRandomFileName().Replace(".", string.Empty) + suffix;
                        vm.OfficeEditDto.OfficeFileName = file.FileName;
                        file.SaveAs(Server.MapPath("~/Files/OfficeFile/") + FileName);
                    }

                    //审批内容表记录
                    var tb = new Wechat.Entity.tbWeOAOffice();
                    tb.OfficeFileFrom    = vm.OfficeEditDto.OfficeFileFrom;
                    tb.OfficeFileName    = vm.OfficeEditDto.OfficeFileName;
                    tb.OfficeFileNameSeq = FileName;
                    tb.ReceiveFileTime   = vm.OfficeEditDto.ReceiveFileTime;
                    tb.Title             = vm.OfficeEditDto.Title;
                    tb.FileContent       = vm.OfficeEditDto.FileContent;
                    tb.LimitDateTo       = vm.OfficeEditDto.LimitDateTo;
                    db.Set <Wechat.Entity.tbWeOAOffice>().Add(tb);
                    db.SaveChanges();

                    //执行流程引擎
                    OAWeWorkFlow.ExecuteWorkFlowEngine(db, flowTypeCode, tb.Id, "", "发起流程", false, vm.OfficeEditDto.NextApproveUserId);
                }
                else
                {
                    vm.ErrorMsg = string.Join("\r\n", error);
                    return(View(vm));//包含文件表单的方式
                }
                return(Content("<script type='text/javascript'> window.parent.location.href = '" + Url.Action("OfficeIndex", "Office", new { area = "wechat" }) + "';</script>"));
            }
        }
Esempio n. 9
0
        public ActionResult WorkFlowList(int approveBodyId, string segmentedTab)
        {
            Models.ApplyCar.ApplyCarListModel vm = new Models.ApplyCar.ApplyCarListModel();
            vm.SegmentedTab = segmentedTab;
            using (var db = new XkSystem.Models.DbContext())
            {
                var firstNode           = db.Table <Wechat.Entity.tbWeOAFlowNode>().Where(m => m.tbSysOAFlowType.Code == flowTypeCode && m.FlowStep == 1).FirstOrDefault();
                var workFlowList        = OAWeWorkFlow.GetWorkFlowList(db, flowTypeCode, approveBodyId);
                var workflowApproveList = OAWeWorkFlow.GetWorkFlowApproveList(flowTypeCode);
                vm.WorkFlowListDto = (from a in workFlowList
                                      join b in db.Table <Wechat.Entity.tbWeOAApplyCar>().Include(m => m.tbTeacherDept) on a.ApproveBodyId equals b.Id
                                      select new Dto.ApplyCar.ApplyCarListDto
                {
                    CarTime = b.CarTime,
                    Destination = b.Destination,
                    tbTeacherDeptName = b.tbTeacherDept.TeacherDeptName,
                    Reason = b.Reason,
                    OtherUsers = b.OtherUsers,
                    Remark = b.Remark,

                    Id = b.Id,
                    ApplyUser = workflowApproveList.Where(m => m.ApproveBodyId == b.Id).FirstOrDefault().tbSysUser.UserName,
                    ApproveDate = a.ApproveDate,
                    ApproveOpinion = a.ApproveOpinion,
                    ApproveUserName = a.tbSysUser == null ? "" : a.tbSysUser.UserName,
                    NodeApproveStatus = a.NodeApproveStatus,
                    FlowApprovalNode = a.tbWeOAFlowPreviousNode != null ? a.tbWeOAFlowPreviousNode.FlowApprovalNode : firstNode.FlowApprovalNode,
                    FlowStep = a.tbWeOAFlowPreviousNode != null ? a.tbWeOAFlowPreviousNode.FlowStep : firstNode.FlowStep,
                    ConditionalFormula = a.tbWeOAFlowPreviousNode != null ? a.tbWeOAFlowPreviousNode.ConditionalFormula : firstNode.ConditionalFormula,
                }).ToList();

                //下个节点审批人列表
                var currFlow = vm.WorkFlowListDto.Where(m => string.IsNullOrEmpty(m.ApproveUserName)).FirstOrDefault();
                if (currFlow != null)
                {
                    var nextFlow = vm.WorkFlowListDto.Where(m => m.FlowStep == currFlow.FlowStep + 1).FirstOrDefault();
                    if (nextFlow != null)
                    {
                        var nextApproveUsers = db.Table <Wechat.Entity.tbWeOAFlowApprover>().Where(m => m.tbWeOAFlowNode.FlowStep == nextFlow.FlowStep && m.tbWeOAFlowNode.FlowApprovalNode == nextFlow.FlowApprovalNode && m.tbWeOAFlowNode.tbSysOAFlowType.Code == flowTypeCode).Include(m => m.tbSysUser).ToList();
                        var users            = (from p in nextApproveUsers
                                                select new Code.MuiJsonDataBind
                        {
                            text = p.tbSysUser.UserName,
                            value = p.tbSysUser.Id.ToString(),
                        }).ToList();
                        vm.UserListJson = JsonConvert.SerializeObject(users);
                    }
                }

                return(View(vm));
            }
        }
Esempio n. 10
0
        public ActionResult AddApplyLeave(Models.ApplyLeave.ApplyLeaveEditModel vm)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var error = new List <string>();
                if (error.Count == decimal.Zero)
                {
                    //审批内容表记录
                    var tb = new Wechat.Entity.tbWeOAApplyLeave();
                    tb.CaseFileName    = vm.ApplyLeaveEditDto.CaseFileName;
                    tb.LeaveDayCount   = vm.ApplyLeaveEditDto.LeaveDayCount;
                    tb.LeaveFromTime   = vm.ApplyLeaveEditDto.LeaveFromTime;
                    tb.LeaveToTime     = vm.ApplyLeaveEditDto.LeaveToTime;
                    tb.Reason          = vm.ApplyLeaveEditDto.Reason;
                    tb.tbWeOALeaveType = db.Set <Wechat.Entity.tbWeOALeaveType>().Find(vm.ApplyLeaveEditDto.tbWeOALeaveTypeId);
                    tb.tbTeacherDept   = db.Set <Teacher.Entity.tbTeacherDept>().Find(vm.ApplyLeaveEditDto.tbTeacherDeptId);
                    db.Set <Wechat.Entity.tbWeOAApplyLeave>().Add(tb);
                    db.SaveChanges();

                    if (vm.ApplyLeaveEditDto.LeaveDayCount <= 0.5)
                    {
                        vm.ApplyLeaveEditDto.ConditionalFormula = "day=0.5";
                    }
                    else if (vm.ApplyLeaveEditDto.LeaveDayCount <= 2 && vm.ApplyLeaveEditDto.LeaveDayCount > 0.5)
                    {
                        vm.ApplyLeaveEditDto.ConditionalFormula = "day<=2&day>0.5";
                    }
                    else if (vm.ApplyLeaveEditDto.LeaveDayCount >= 3)
                    {
                        vm.ApplyLeaveEditDto.ConditionalFormula = "day>=3";
                    }

                    //执行流程引擎
                    OAWeWorkFlow.ExecuteWorkFlowEngine(db, flowTypeCode, tb.Id, vm.ApplyLeaveEditDto.ConditionalFormula, "发起流程", false, vm.ApplyLeaveEditDto.NextApproveUserId);
                }
                else
                {
                    vm.ErrorMsg = string.Join("\r\n", error);
                    return(View(vm));//包含文件表单的方式
                }
                return(Content("<script type='text/javascript'> window.parent.location.href = '" + Url.Action("ApplyLeaveIndex", "ApplyLeave", new { area = "wechat" }) + "';</script>"));
            }
        }
Esempio n. 11
0
        public ActionResult ApplyCarIndex(Models.ApplyCar.ApplyCarListModel vm)
        {
            using (var db = new XkSystem.Models.DbContext())
            {
                var workflowApproveList = OAWeWorkFlow.GetWorkFlowApproveList(flowTypeCode);
                var allApproveList      = OAWeWorkFlow.GetAllApprovedList(flowTypeCode);

                WaitApproveList(vm, workflowApproveList);
                ApprovedList(vm, workflowApproveList, allApproveList);
                MyApplyList(vm, workflowApproveList, allApproveList);

                if (Request.IsAjaxRequest())
                {
                    return(PartialView("ApplyCarApproveBody", vm));
                }

                //发起流程权限
                var approver = db.Table <Wechat.Entity.tbWeOAFlowApprover>().Where(m => m.tbWeOAFlowNode.tbSysOAFlowType.Code == flowTypeCode && m.tbSysUser.Id == XkSystem.Code.Common.UserId && m.tbWeOAFlowNode.FlowStep == 1).FirstOrDefault();
                vm.StartFlowPermission = approver != null;

                return(View(vm));
            }
        }
Esempio n. 12
0
        //获取审批人列表
        public JsonResult GetNextApproveUsers(string conditionalFormula)
        {
            var approveUsers = OAWeWorkFlow.GetNextApproveUsers(flowTypeCode, conditionalFormula);

            return(Json(approveUsers, JsonRequestBehavior.AllowGet));
        }
Esempio n. 13
0
        public ActionResult WorkFlowList(int approveBodyId, string segmentedTab)
        {
            Models.ApplyLeave.ApplyLeaveListModel vm = new Models.ApplyLeave.ApplyLeaveListModel();
            vm.SegmentedTab = segmentedTab;
            using (var db = new XkSystem.Models.DbContext())
            {
                //查询当前审批角色对应的是哪个节点
                var flowApprovalNodes = db.Table <Wechat.Entity.tbWeOAFlowApprover>().Where(m => m.tbWeOAFlowNode.tbSysOAFlowType.Code == flowTypeCode && m.tbWeOAFlowNode.FlowStep == 2).Include(m => m.tbSysUser).Include(m => m.tbWeOAFlowNode).ToList();

                var firstNode           = db.Table <Wechat.Entity.tbWeOAFlowNode>().Where(m => m.tbSysOAFlowType.Code == flowTypeCode && m.FlowStep == 1).FirstOrDefault();
                var workFlowList        = OAWeWorkFlow.GetWorkFlowList(db, flowTypeCode, approveBodyId);
                var workflowApproveList = OAWeWorkFlow.GetWorkFlowApproveList(flowTypeCode);

                vm.WorkFlowListDto = (from a in workFlowList
                                      join b in db.Table <Wechat.Entity.tbWeOAApplyLeave>().Include(m => m.tbTeacherDept).Include(m => m.tbWeOALeaveType) on a.ApproveBodyId equals b.Id
                                      select new Dto.ApplyLeave.ApplyLeaveListDto
                {
                    CaseFileName = b.CaseFileName,
                    LeaveDayCount = b.LeaveDayCount,
                    LeaveFromTime = b.LeaveFromTime,
                    LeaveToTime = b.LeaveToTime,
                    tbTeacherDeptName = b.tbTeacherDept.TeacherDeptName,
                    tbWeOALeaveTypeName = b.tbWeOALeaveType.LeaveTypeName,
                    Reason = b.Reason,

                    Id = b.Id,
                    ApplyUser = workflowApproveList.Where(m => m.ApproveBodyId == b.Id).FirstOrDefault().tbSysUser.UserName,
                    ApproveDate = a.ApproveDate,
                    ApproveOpinion = a.ApproveOpinion,
                    ApproveUserId = a.tbSysUser == null ? 0 : a.tbSysUser.Id,
                    ApproveUserName = a.tbSysUser == null ? "" : a.tbSysUser.UserName,
                    NodeApproveStatus = a.NodeApproveStatus,
                    FlowComplete = a.tbWeOAFlowPreviousNode != null ? a.tbWeOAFlowPreviousNode.FlowComplete : firstNode.FlowComplete,
                    FlowApprovalNode = a.tbWeOAFlowPreviousNode != null ? a.tbWeOAFlowPreviousNode.FlowApprovalNode : firstNode.FlowApprovalNode,
                    FlowStep = a.tbWeOAFlowPreviousNode != null ? a.tbWeOAFlowPreviousNode.FlowStep : firstNode.FlowStep,
                    ConditionalFormula = a.tbWeOAFlowPreviousNode != null ? a.tbWeOAFlowPreviousNode.ConditionalFormula : firstNode.ConditionalFormula,
                }).ToList();

                //处理流程数据
                if (segmentedTab == "wait")
                {
                    vm.WorkFlowListDto = vm.WorkFlowListDto.FindAll(delegate(Dto.ApplyLeave.ApplyLeaveListDto item)
                    {
                        if (item.ConditionalFormula == "day=0.5" && item.LeaveDayCount <= 0.5)
                        {
                            return(true);
                        }
                        else if (item.ConditionalFormula == "day<=2&day>0.5" && item.LeaveDayCount <= 2 && item.LeaveDayCount > 0.5)
                        {
                            return(true);
                        }
                        else if (item.ConditionalFormula == "day>=3" && item.LeaveDayCount >= 3)
                        {
                            return(true);
                        }
                        else
                        {
                            if (item.ConditionalFormula == "")
                            {
                                return(true);
                            }
                            else
                            {
                                return(false);
                            }
                        }
                    });

                    //过滤分支节点
                    var currApproveUser = db.Table <Entity.tbWeOAFlowApprover>().Where(m => m.tbWeOAFlowNode.tbSysOAFlowType.Code == flowTypeCode && m.tbWeOAFlowNode.FlowStep == 2 && m.tbSysUser.Id == XkSystem.Code.Common.UserId).Include(m => m.tbSysUser).FirstOrDefault();
                    if (currApproveUser != null)
                    {
                        vm.WorkFlowListDto = vm.WorkFlowListDto.Where(m => (m.FlowApprovalNode == currApproveUser.tbWeOAFlowNode.FlowApprovalNode && m.FlowStep == 2) || m.FlowStep != 2).ToList();
                    }

                    //下个节点审批人列表
                    var currFlow = vm.WorkFlowListDto.Where(m => string.IsNullOrEmpty(m.ApproveUserName)).FirstOrDefault();
                    if (currFlow != null)
                    {
                        var nextFlow = vm.WorkFlowListDto.Where(m => m.FlowStep == currFlow.FlowStep + 1).FirstOrDefault();
                        if (nextFlow != null)
                        {
                            var nextApproveUsers = db.Table <Wechat.Entity.tbWeOAFlowApprover>().Where(m => m.tbWeOAFlowNode.FlowStep == nextFlow.FlowStep && m.tbWeOAFlowNode.FlowApprovalNode == nextFlow.FlowApprovalNode && m.tbWeOAFlowNode.tbSysOAFlowType.Code == flowTypeCode).Include(m => m.tbSysUser).ToList();
                            var users            = (from p in nextApproveUsers
                                                    select new Code.MuiJsonDataBind
                            {
                                text = p.tbSysUser.UserName,
                                value = p.tbSysUser.Id.ToString(),
                            }).ToList();
                            vm.UserListJson = JsonConvert.SerializeObject(users);
                        }
                    }
                }
                else
                {
                    //修复分支情况部门负责人和年级负责人名称显示不正确的问题
                    vm.WorkFlowListDto.ForEach(m =>
                    {
                        if (m.FlowStep == 2)
                        {
                            m.FlowApprovalNode = flowApprovalNodes.Where(n => m.ApproveUserId != 0 && n.tbSysUser.Id == m.ApproveUserId).Select(k => k.tbWeOAFlowNode.FlowApprovalNode).FirstOrDefault();
                        }
                    });
                }
                return(View(vm));
            }
        }