private async void GoImproveDistributionPage(ImprovementMngDto improvementMng)
 {
     try
     {
         CommonContext.ImpPlanStatus = improvementMng.PlanStatus;
         if (CommonContext.Account.UserType == "S")
         {
             await Navigation.PushAsync <ImproveDistributionViewModel>((vm, v) => vm.Init(improvementMng, paramList), true);
         }
         else
         {
             if (improvementMng.PlanStatus == "A")
             {
                 _commonFun.AlertLongText("未分配,没有分配详细");
             }
             else
             {
                 await Navigation.PushAsync <ImproveDistributionViewModel>((vm, v) => vm.Init(improvementMng, paramList), true);
             }
         }
     }
     catch (Exception)
     {
     }
 }
 private async void GoImpResultCommitPage(ImprovementMngDto improvementMng)
 {
     try
     {
         List <RequestParameter> list = new List <RequestParameter>();
         list.Add(new RequestParameter {
             Name = "improvementId", Value = improvementMng.ImprovementId.ToString()
         });
         list.Add(new RequestParameter {
             Name = "impResultId", Value = improvementMng.ImpResultId.ToString()
         });
         list.Add(new RequestParameter {
             Name = "tPId", Value = improvementMng.TPId.ToString()
         });
         list.Add(new RequestParameter {
             Name = "itemId", Value = improvementMng.ItemId.ToString()
         });
         list.Add(new RequestParameter {
             Name = "ResultApproalYN", Value = improvementMng.ResultApproalYN.ToString()
         });
         list.Add(new RequestParameter {
             Name = "ResultStatus", Value = improvementMng.ResultStatus
         });
         list.Add(new RequestParameter {
             Name = "AllocateYN", Value = improvementMng.AllocateYN.ToString()
         });
         await Navigation.PushAsync <ImpResultCommitViewModel>((vm, v) => vm.Init(improvementMng, list), true);
     }
     catch (Exception)
     {
     }
 }
 public void Init(ImprovementMngDto improvementMng, List <RequestParameter> param)
 {
     try
     {
         IsLoading            = false;
         oldImpPlanAttachList = new List <AttachDto>();
         LstHeight            = 0;
         _improvementMng      = improvementMng;
         GetImpPlanOrResultDetail(param);
     }
     catch (Exception)
     {
         _commonFun.AlertLongText("操作异常,请重试。-->ImpPlanCommitViewModel");
     }
 }
Ejemplo n.º 4
0
 public void Init(ImprovementMngDto m, List <RequestParameter> param = null)
 {
     try
     {
         DepartmentSelect = "选择";
         Department       = null;
         if (m != null)
         {
             improvementMng = m;
             GetImproveDistributionDetail(m);
         }
         if (param != null && param.Count > 0)
         {
             paramList = param;
         }
     }
     catch (Exception)
     {
         _commonFun.AlertLongText("操作异常,请重试。-->ImproveDistributionViewModel");
         return;
     }
 }
Ejemplo n.º 5
0
        //private async void GoMessageItemDetail(object sender, ItemTappedEventArgs args)
        //{
        //    var notice = (args.Item as NoticeListInfoDto);
        //    try
        //    {
        //        await Navigation.PushAsync(ViewFactory.CreatePage<NotifiMngViewModel, NotifiMngPage>((vm, v) =>
        //        vm.Init(notice.NoticeId.ToString(), notice.DisId, notice.DepartId, feedbackYN: notice.FeedbackYN, noticeStatus: notice.Status)) as Page, true);
        //        MessagingCenter.Send<string>(notice.Status, MessageConst.NOTICE_MADE_SETCONTROLROLE);
        //    }
        //    catch (System.Exception)
        //    {
        //    }
        //}

        private async void GoMessageItemDetail(object sender, ItemTappedEventArgs args)
        {
            var notice = (args.Item as MessageDto);

            try
            {
                switch (notice.DataType)
                {
                //通知反馈
                case "ANoticeF":
                    if (notice.Id.Split(',').Length > 4)
                    {
                        string[] ids = notice.Id.Split(',');
                        await Navigation.PushAsync(ViewFactory.CreatePage <NotifiFeedbackViewModel, NotifiFeedbackPage>((vm, v) =>
                                                                                                                        vm.Init(Convert.ToInt32(ids[0]), int.Parse(ids[2]), int.Parse(ids[3]), notice.Status)) as Page, true);
                    }
                    break;

                //通知审核
                case "ANoticeA":
                    await Navigation.PushAsync(ViewFactory.CreatePage <NoticeApproalViewModel, NoticeApproalPage>((vm, v) =>
                                                                                                                  vm.Init(Convert.ToInt32(notice.Id), "W")) as Page, true);

                    break;

                //计划任务审批
                case "Plan":
                    await Navigation.PushAsync(ViewFactory.CreatePage <ReviewPlansViewModel, ReviewPlansDtlPage>((vm, v) =>
                                                                                                                 vm.Init(notice.Id)) as Page, true);

                    break;

                //改善计划审批
                case "BImpA":

                    if (notice.Id.Split(',').Length > 5)
                    {
                        string[] ids = notice.Id.Split(',');
                        List <RequestParameter> list = new List <RequestParameter>();
                        list.Add(new RequestParameter {
                            Name = "improvementId", Value = ids[0]
                        });
                        list.Add(new RequestParameter {
                            Name = "impResultId", Value = "0"
                        });
                        list.Add(new RequestParameter {
                            Name = "tPId", Value = ids[1]
                        });
                        list.Add(new RequestParameter {
                            Name = "itemId", Value = ids[2]
                        });
                        list.Add(new RequestParameter {
                            Name = "planApproalYN", Value = ids[3]
                        });
                        list.Add(new RequestParameter {
                            Name = "PLANSTATUS", Value = notice.Status
                        });
                        list.Add(new RequestParameter {
                            Name = "AllocateYN", Value = ids[5]
                        });
                        ImprovementMngDto paramDto = new ImprovementMngDto();
                        paramDto.ImprovementId = Convert.ToInt32(ids[0]);
                        paramDto.ImpResultId   = 0;
                        paramDto.TPId          = Convert.ToInt32(ids[1]);
                        paramDto.ItemId        = Convert.ToInt32(ids[2]);
                        await Navigation.PushAsync(ViewFactory.CreatePage <ImpPlanCommitViewModel, ImpPlanCommitPage>((vm, v) => vm.Init(paramDto, list)) as Page, true);
                    }
                    break;

                //Push详细
                case "Push":
                    await Navigation.PushAsync(ViewFactory.CreatePage <PushInfoViewModel, PushInfoPage>((vm, v) =>
                                                                                                        vm.Init(notice.Id)) as Page, true);

                    break;

                //改善结果审批
                case "CImpR":
                    if (notice.Id.Split(',').Length == 7)
                    {
                        string[] ids = notice.Id.Split(',');
                        List <RequestParameter> list = new List <RequestParameter>();

                        list.Add(new RequestParameter {
                            Name = "improvementId", Value = ids[1]
                        });
                        list.Add(new RequestParameter {
                            Name = "impResultId", Value = ids[0]
                        });
                        list.Add(new RequestParameter {
                            Name = "tPId", Value = ids[2]
                        });
                        list.Add(new RequestParameter {
                            Name = "itemId", Value = ids[3]
                        });
                        list.Add(new RequestParameter {
                            Name = "ResultApproalYN", Value = ids[5]
                        });
                        list.Add(new RequestParameter {
                            Name = "ResultStatus", Value = notice.Status
                        });
                        list.Add(new RequestParameter {
                            Name = "AllocateYN", Value = ids[6]
                        });
                        ImprovementMngDto paramDto = new ImprovementMngDto();
                        paramDto.ImprovementId = Convert.ToInt32(ids[1]);
                        paramDto.ImpResultId   = Convert.ToInt32(ids[0]);
                        paramDto.TPId          = Convert.ToInt32(ids[2]);
                        paramDto.ItemId        = Convert.ToInt32(ids[3]);
                        paramDto.PlanApproalYN = Convert.ToBoolean(ids[4]);
                        paramDto.PlanStatus    = "G";
                        paramDto.AllocateYN    = Convert.ToBoolean(ids[6]);
                        await Navigation.PushAsync(ViewFactory.CreatePage <ImpResultCommitViewModel, ImpResultCommitPage>((vm, v) => vm.Init(paramDto, list)) as Page, true);
                    }
                    break;

                default:
                    //未读通知
                    if (notice.Id.Split(',').Length == 5)
                    {
                        string[] ids = notice.Id.Split(',');
                        if (ids[4] == "Y")    // 需要反馈的通知,直接跳转到通知反馈页面
                        {
                            await Navigation.PushAsync(ViewFactory.CreatePage <NotifiFeedbackViewModel, NotifiFeedbackPage>((vm, v) =>
                                                                                                                            vm.Init(Convert.ToInt32(ids[0]), int.Parse(ids[1]), int.Parse(ids[2]), notice.Status)) as Page, true);
                        }
                        else
                        {
                            await Navigation.PushAsync(ViewFactory.CreatePage <NotifiMngViewModel, NotifiMngPage>((vm, v) =>
                                                                                                                  vm.Init(ids[0].ToString(), Convert.ToInt32(ids[1]), Convert.ToInt32(ids[2]), noticeStatus: notice.Status)) as Page, true);
                        }
                    }
                    break;
                }
            }
            catch (System.Exception)
            {
            }
        }
Ejemplo n.º 6
0
        private async void GetImproveDistributionDetail(ImprovementMngDto improvementMng)
        {
            try
            {
                string improvementId = improvementMng.ImprovementId.ToString();
                string impResultId   = improvementMng.ImpResultId.ToString();
                string tPId          = improvementMng.TPId.ToString();
                string itemId        = improvementMng.ItemId.ToString();
                if (_commonHelper.IsNetWorkConnected() == true)
                {
                    try
                    {
                        _commonFun.ShowLoading("查询中...");
                        var result = await improveService.GetImpPlanOrResultDetail(improvementId, "0", impResultId, tPId, itemId);

                        if (result.ResultCode == Module.ResultType.Success)
                        {
                            _commonFun.HideLoading();
                            var impAllocateData = CommonHelper.DecodeString <ImpAllocateDto>(result.Body);
                            if (impAllocateData != null)
                            {
                                if (CommonContext.Account.UserType == "S")
                                {
                                    if (impAllocateData.PlanStatus == "A")
                                    {
                                        IsEdit = true;
                                        IsShow = false;
                                    }
                                    else
                                    {
                                        IsEdit = false;
                                        IsShow = true;
                                    }
                                }
                                else
                                {
                                    IsEdit = false;
                                    IsShow = true;
                                }
                                ExecDepartmentName = impAllocateData.ExecDepartmentName;
                                AllocateYN         = impAllocateData.AllocateYN;
                                PlanApproal        = impAllocateData.PlanApproalYN == true ? "评估师" : "总经理";
                                ResultApproal      = impAllocateData.ResultApproalYN == true ? "评估师" : "总经理";
                                StandardList       = impAllocateData.StandardList;
                                PicList            = impAllocateData.PicList;
                                LossImageList      = impAllocateData.PicList.Count * 40;
                                PicDescList        = impAllocateData.PicDescList;
                                if (PicDescList != null)
                                {
                                    foreach (var item in PicDescList)
                                    {
                                        item.IsPreview = string.IsNullOrEmpty(item.Url) ? false : true;
                                    }
                                }
                                ImprovementCaption = impAllocateData.ImprovementCaption;
                                LostDescription    = impAllocateData.LostDescription;
                                Score             = impAllocateData.Score.ToString();
                                PlanFinishDate    = impAllocateData.PlanFinishDate;
                                ResultFinishDate  = impAllocateData.ResultFinishDate;
                                PicDescLstHeight  = 40 * PicDescList.Count + 45;
                                StandardLstHeight = 40 * StandardList.Count + 45;
                            }
                            else
                            {
                                _commonFun.HideLoading();
                                _commonFun.ShowToast("查无数据");
                            }
                        }
                        else
                        {
                            _commonFun.HideLoading();
                            _commonFun.AlertLongText("查询失败,请重试。 " + result.Msg);
                        }
                    }
                    catch (OperationCanceledException)
                    {
                        _commonFun.HideLoading();
                        _commonFun.AlertLongText("请求超时。");
                    }
                    catch (Exception)
                    {
                        _commonFun.HideLoading();
                        _commonFun.AlertLongText("查询异常,请重试。");
                    }
                    finally
                    {
                        _commonFun.HideLoading();
                    }
                }
                else
                {
                    _commonFun.AlertLongText("网络连接异常");
                }
            }
            catch (Exception)
            {
                _commonFun.AlertLongText("操作异常,请重试。-->ImproveDistributionViewModel");
                return;
            }
        }