lu
2025-04-21 b8b5785627c262546c296b8586998a5f5447e6a9
DevApp/Gs.DevApp/DevFrm/Ck/UcBlcl.cs
@@ -26,7 +26,6 @@
            txt_bl017.Text = _strType;
            txt_bl017.Tag = "moren." + _strType;
        }
        protected override void OnCreateControl()
        {
            base.OnCreateControl();
@@ -41,23 +40,20 @@
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
            toolBarMenu1.btnLayoutClick += ToolBarMenu1_btnLayoutClick;
            this.toolBarMenu1.getXmlConfig();
            Form parentForm = this.FindForm();
            List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
            gvList.Add(gridView1);
            Gs.DevApp.ToolBox.UtilityHelper.getGridViewConfig(parentForm.GetType().FullName, gvList);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, parentForm, "bl018", "", (value) =>
           {
               Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
           });
           }, tips);
            Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
            {
                getModel(value);
            }, (value) =>
            {
                getPageList(this.pageBar1.CurrentPage);
            });
            }, lbGuid);
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            //设置组织
@@ -81,9 +77,10 @@
                txt_bl002.Text = txt_aboutGuid.GetPrdNo();
                txt_bl014.Text = txt_aboutGuid.GetPrdName();
                txt_bl015.Text = txt_aboutGuid.GetPrdModel();
                txt_bl011.Text = txt_aboutGuid.GetWorkName();
                txt_dptName.Text = txt_aboutGuid.GetWorkName();
                txt_bl012.Text = txt_aboutGuid.GetWorkXb();
                txt_bl013.Text = txt_aboutGuid.GetRwd();
                txt_tldh.Text = txt_aboutGuid.GetTldh();
                var _obj = new
                {
                    currentPage = 1,
@@ -100,6 +97,7 @@
                    var rtn = UtilityHelper.ReturnToTablePage(strReturn);
                    var dt = rtn.rtnData.list;
                    this.repositoryItemSearchLookUpEdit1.DataSource = dt;
                    this.repositoryItemSearchLookUpEdit1.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
                }
                catch (Exception ex)
                {
@@ -109,7 +107,7 @@
        }
        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
        {
            Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
            Task.Delay(100);
            getPageList(1);
        }
@@ -119,15 +117,6 @@
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ToolBarMenu1_btnLayoutClick(object sender, EventArgs e)
        {
            Form parentForm = this.FindForm();
            string _formNamespace = parentForm.GetType().FullName;
            List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
            gvList.Add(gridView1);
            Gs.DevApp.UserControl.showLayOut DevFrm = new showLayOut(_formNamespace, gvList);
            DevFrm.ShowDialog();
        }
        /// <summary>
        /// 日志
        /// </summary>
@@ -157,10 +146,16 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
        {
            Form parentForm;
            if (this.Parent is Form)
                parentForm = this.Parent as Form;
            else
                parentForm = this.Parent.Parent as Form;
            gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
            gridView1.ActiveFilter.Clear();
            gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
            var frm = new ShowFilter(gridView1.Columns, _filterList);
            var frm = new ShowFilter(gridView1.Columns, _filterList, parentForm.GetType().FullName);
            frm.UpdateParent += Frm_UpdateParent;
            frm.ShowDialog();
        }
@@ -269,13 +264,13 @@
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
            if (xtraTabControl1.SelectedTabPageIndex == 1)
            {
                getModel(lbGuid.Text.Trim());
                getModel(rowGuid);
            }
            else
            {
                List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                gvList.Add(gvMx1);
                UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
                UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
            }
        }
        /// <summary>
@@ -289,7 +284,7 @@
            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
            List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
            gridViews.Add(gvMx1);
            UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
        }
@@ -339,6 +334,7 @@
                list = new List<dynamic>(),
            };
            gvMx1.CloseEditor();
            gvMx1.PostEditor();
            gvMx1.UpdateCurrentRow();
            if (gvMx1.DataRowCount <= 0)
            {
@@ -379,8 +375,9 @@
                    toolBarMenu1.isSetBtn = true;
                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                    gvList.Add(gvMx1);
                    UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList);
                    UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
                    toolBarMenu1.currentAction = "";
                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                }
            }
            catch (Exception ex)
@@ -396,7 +393,7 @@
        /// <param name="pageSize">每页几条</param>
        private void getPageList(int curPage)
        {
            var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
            _sbSqlWhere += " and a.bl008='" + strType + "'";
            PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
            string json = JsonConvert.SerializeObject(pgq);
@@ -407,16 +404,16 @@
                if (dd.rtnCode > 0)
                {
                    DataTable dt = dd.rtnData.list;
                    gcMain.BindingContext = new BindingContext();
                    gcMain1.BindingContext = new BindingContext();
                    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
                    if (dt.Rows.Count > 0)
                    {
                        gcMain.DataSource = dt;
                        gcMain.ForceInitialize();
                        gridView1.BestFitColumns();
                        gcMain1.DataSource = dt;
                        gcMain1.ForceInitialize();
                        gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
                    }
                    else
                        UtilityHelper.SetDefaultTable(gcMain, gridView1);
                        UtilityHelper.SetDefaultTable(gcMain1, gridView1);
                    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
                    pageBar1.TotalPages = dd.rtnData.pages;//总页
                    pageBar1.CurrentPage = curPage;//当前页
@@ -459,7 +456,7 @@
                    lbGuid.Text = strGuid;
                    List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                    gvList.Add(gvMx1);
                    UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
                    _ucCk = "";
                    _ucGd = "";
                    JObject _job = JObject.Parse(strJson);
@@ -475,6 +472,7 @@
                        gcMx1.DataSource = dt;
                        gcMx1.ForceInitialize();
                        gvMx1.BestFitColumns();
                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
                    }
                    else
                    {