1
lu
2024-11-09 6ab82e2c95d6ad274983c985bde0175bb436719f
DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
@@ -43,6 +43,8 @@
            btnZhiLiangFchk.ItemClick += BtnZhiLiangFchk_ItemClick;
            btnCaiGouChk.ItemClick += BtnCaiGouChk_ItemClick;
            btnCaiGouFchk.ItemClick += BtnCaiGouFchk_ItemClick;
            btnBoHui.ItemClick += BtnBoHui_ItemClick;
            btnPrint.ItemClick += BtnPrint_ItemClick;
            var lst = new List<string>();
            foreach (BarItem item in barManager1.Items)
                if (item is BarLargeButtonItem largeButtonItem)
@@ -50,6 +52,9 @@
                        lst.Add(item.Caption);
            actions = lst;
        }
        /// <summary>
        ///     初始化按钮状态
@@ -60,88 +65,115 @@
            if (Parent != null) getNamespace();
        }
        private void BtnPrint_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (btnPrintClick != null)
                btnPrintClick(this, e);
        }
        private void BtnBoHui_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (btnBoHuiClick != null)
                btnBoHuiClick(this, e);
            //if (string.IsNullOrEmpty(guidKey))
            //{
            //    MsgHelper.Warning("请先选择你要操作的行!");
            //    return;
            //}
            //if (string.IsNullOrEmpty(chkParameter))
            //{
            //    MsgHelper.ShowError("没有指定驳回参数,请联系开发人员获取支持!");
            //    return;
            //}
            //if (!MsgHelper.AskQuestion("你选择了1条数据,确定驳回重检吗?"))
            //    return;
            //_ckService("5");
        }
        private void BtnCaiGouFchk_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (btnCaiGouFchkClick != null)
                btnCaiGouFchkClick(this, e);
            if (string.IsNullOrEmpty(guidKey))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            //if (string.IsNullOrEmpty(guidKey))
            //{
            //    MsgHelper.Warning("请先选择你要操作的行!");
            //    return;
            //}
            if (string.IsNullOrEmpty(chkParameter))
            {
                MsgHelper.ShowError("没有指定审核参数,请联系开发人员获取支持!");
                return;
            }
            //if (string.IsNullOrEmpty(chkParameter))
            //{
            //    MsgHelper.ShowError("没有指定审核参数,请联系开发人员获取支持!");
            //    return;
            //}
            if (!MsgHelper.AskQuestion("你选择了1条数据,确定采购反审核吗?"))
                return;
            _ckService("-2");
            //if (!MsgHelper.AskQuestion("你选择了1条数据,确定采购反审核吗?"))
            //    return;
            //_ckService("-2");
        }
        private void BtnCaiGouChk_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (btnCaiGouChkClick != null)
                btnCaiGouChkClick(this, e);
            if (string.IsNullOrEmpty(guidKey))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            //if (string.IsNullOrEmpty(guidKey))
            //{
            //    MsgHelper.Warning("请先选择你要操作的行!");
            //    return;
            //}
            if (string.IsNullOrEmpty(chkParameter))
            {
                MsgHelper.ShowError("没有指定审核参数,请联系开发人员获取支持!");
                return;
            }
            //if (string.IsNullOrEmpty(chkParameter))
            //{
            //    MsgHelper.ShowError("没有指定审核参数,请联系开发人员获取支持!");
            //    return;
            //}
            if (!MsgHelper.AskQuestion("你选择了1条数据,确定采购审核吗?"))
                return;
            _ckService("2");
            //if (!MsgHelper.AskQuestion("你选择了1条数据,确定采购审核吗?"))
            //    return;
            //_ckService("2");
        }
        private void BtnZhiLiangFchk_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (btnZhiLiangFchkClick != null)
                btnZhiLiangFchkClick(this, e);
            if (string.IsNullOrEmpty(guidKey))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            //if (string.IsNullOrEmpty(guidKey))
            //{
            //    MsgHelper.Warning("请先选择你要操作的行!");
            //    return;
            //}
            if (string.IsNullOrEmpty(chkParameter))
            {
                MsgHelper.ShowError("没有指定审核参数,请联系开发人员获取支持!");
                return;
            }
            //if (string.IsNullOrEmpty(chkParameter))
            //{
            //    MsgHelper.ShowError("没有指定审核参数,请联系开发人员获取支持!");
            //    return;
            //}
            if (!MsgHelper.AskQuestion("你选择了1条数据,确定质量反审核吗?"))
                return;
            _ckService("-3");
            //if (!MsgHelper.AskQuestion("你选择了1条数据,确定质量反审核吗?"))
            //    return;
            //_ckService("-3");
        }
        private void BtnZhiLiangChk_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (btnZhiLiangChkClick != null)
                btnZhiLiangChkClick(this, e);
            if (string.IsNullOrEmpty(guidKey))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            //if (string.IsNullOrEmpty(guidKey))
            //{
            //    MsgHelper.Warning("请先选择你要操作的行!");
            //    return;
            //}
            if (string.IsNullOrEmpty(chkParameter))
            {
                MsgHelper.ShowError("没有指定审核参数,请联系开发人员获取支持!");
                return;
            }
            //if (string.IsNullOrEmpty(chkParameter))
            //{
            //    MsgHelper.ShowError("没有指定审核参数,请联系开发人员获取支持!");
            //    return;
            //}
            if (!MsgHelper.AskQuestion("你选择了1条数据,确定质量审核吗?"))
                return;
            _ckService("3");
            //if (!MsgHelper.AskQuestion("你选择了1条数据,确定质量审核吗?"))
            //    return;
            //_ckService("3");
        }
        private void BtnFchk_ItemClick(object sender, ItemClickEventArgs e)
@@ -218,21 +250,21 @@
                btnFjianYanClick(this, e);
            else
                return;
            if (string.IsNullOrEmpty(guidKey))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            //if (string.IsNullOrEmpty(guidKey))
            //{
            //    MsgHelper.Warning("请先选择你要操作的行!");
            //    return;
            //}
            if (string.IsNullOrEmpty(chkParameter))
            {
                MsgHelper.ShowError("没有指定检验参数,请联系开发人员获取支持!");
                return;
            }
            //if (string.IsNullOrEmpty(chkParameter))
            //{
            //    MsgHelper.ShowError("没有指定检验参数,请联系开发人员获取支持!");
            //    return;
            //}
            if (!MsgHelper.AskQuestion("你选择了1条数据,确定反检验吗?"))
                return;
            _ckService(0.ToString());
            //if (!MsgHelper.AskQuestion("你选择了1条数据,确定撤回检验吗?"))
            //    return;
            //_ckService(0.ToString());
        }
        private void BtnJianYan_ItemClick(object sender, ItemClickEventArgs e)
@@ -242,26 +274,26 @@
            else
                return;
            if (string.IsNullOrEmpty(guidKey))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            //if (string.IsNullOrEmpty(guidKey))
            //{
            //    MsgHelper.Warning("请先选择你要操作的行!");
            //    return;
            //}
            if (string.IsNullOrEmpty(chkParameter))
            {
                MsgHelper.ShowError("没有指定检验参数,请联系开发人员获取支持!");
                return;
            }
            //if (string.IsNullOrEmpty(chkParameter))
            //{
            //    MsgHelper.ShowError("没有指定检验参数,请联系开发人员获取支持!");
            //    return;
            //}
            if (!MsgHelper.AskQuestion("你选择了1条数据,确定提交检验吗?"))
                return;
            var _obj = new
            {
                guid = guidKey,
                parameter = chkParameter
            };
            _ckService(1.ToString());
            //if (!MsgHelper.AskQuestion("你选择了1条数据,确定提交检验吗?"))
            //    return;
            //var _obj = new
            //{
            //    guid = guidKey,
            //    parameter = chkParameter
            //};
            //_ckService(1.ToString());
        }
        private async void BtnIn_ItemClick(object sender, ItemClickEventArgs e)
@@ -583,20 +615,20 @@
                        }
                    ///具有联动关系的按钮(提交检验),
                    if (item.Caption == "提交检验")
                    {
                        var ld1 = dt.AsEnumerable().Any(
                            row => row.Field<string>("name") == "提交检验"
                        );
                        if (ld1)
                        {
                            btnJianYan.Visibility = btnFjianYan.Visibility =
                                btnLoad.Visibility = BarItemVisibility.Always;
                            btnJianYan.Visibility = BarItemVisibility.Always;
                            _enabledList.Add(item.Name);
                            continue;
                        }
                    }
                    //if (item.Caption == "提交检验")
                    //{
                    //    var ld1 = dt.AsEnumerable().Any(
                    //        row => row.Field<string>("name") == "提交检验"
                    //    );
                    //    if (ld1)
                    //    {
                    //        btnJianYan.Visibility = btnFjianYan.Visibility =
                    //            btnLoad.Visibility = BarItemVisibility.Always;
                    //        btnJianYan.Visibility = BarItemVisibility.Always;
                    //        _enabledList.Add(item.Name);
                    //        continue;
                    //    }
                    //}
                    //按钮是否在权限表中
                    var exists = dt.AsEnumerable().Any(row =>
@@ -779,7 +811,13 @@
        /// </summary>
        public event EventHandler btnZhiLiangFchkClick;
        /// <summary>
        ///   驳回
        /// </summary>
        public event EventHandler btnBoHuiClick;
        public event EventHandler btnPrintClick;
        #endregion
        #region 公共属性
@@ -812,7 +850,7 @@
        public string xlsInService { get; set; }
        /// <summary>
        ///     审核参数,表名,字段名,如:MES_HOLIDAY,check_date,check_status,check_by,存储过程名
        ///     审核参数,表名,字段名,如:MES_HOLIDAY(表名),check_date(时间),check_status(状态),check_by(审核人),存储过程名
        /// </summary>
        public string chkParameter { get; set; }