From 236874a930147c27e46c673d8c1a607f1260e8aa Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 31 三月 2025 12:43:43 +0800
Subject: [PATCH] 追溯码

---
 DevApp/Gs.DevApp/DevFrm/Ck/UcBlcl.cs |  120 ++++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 80 insertions(+), 40 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Ck/UcBlcl.cs b/DevApp/Gs.DevApp/DevFrm/Ck/UcBlcl.cs
index c08c85a..635e23a 100644
--- a/DevApp/Gs.DevApp/DevFrm/Ck/UcBlcl.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Ck/UcBlcl.cs
@@ -14,10 +14,10 @@
 {
     public partial class UcBlcl : DevExpress.XtraEditors.XtraUserControl
     {
-
+        string _ucCk = "";//浠撳簱
+        string _ucGd = "";//宸ュ崟
         string _webServiceName = "MesItemBlManager/";
         List<FilterEntity> _filterList = new List<FilterEntity>();
-
         public string strType = "";
         public UcBlcl(string _strType)
         {
@@ -26,7 +26,6 @@
             txt_bl017.Text = _strType;
             txt_bl017.Tag = "moren." + _strType;
         }
-
         protected override void OnCreateControl()
         {
             base.OnCreateControl();
@@ -40,12 +39,14 @@
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
-            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
+            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
+            this.toolBarMenu1.getXmlConfig();
             Form parentForm = this.FindForm();
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, parentForm, "bl018", "", (value) =>
-            {
-                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
-            });
+           {
+               Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+           });
             Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
             {
                 getModel(value);
@@ -60,11 +61,10 @@
             {
                 string orgdId = txt_orgId.GetId();
                 if (string.IsNullOrEmpty(orgdId)) return;
-                txt_bl010.getSuppler(orgdId);
-                txt_aboutGuid.getSuppler(orgdId);
+                txt_bl010.getSuppler(orgdId, _ucCk);
+                txt_aboutGuid.getSuppler(orgdId, _ucGd);
             };
             //璁剧疆浠撳簱閫夋嫨
-           // txt_bl010.getSuppler("");
             this.txt_bl010.EditChanged += (s, e) =>
             {
 
@@ -77,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,
@@ -96,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)
                 {
@@ -105,9 +107,28 @@
         }
         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);
+        }
+        /// <summary>
+        /// 甯冨眬浜嬩欢
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+ 
+        /// <summary>
+        /// 鏃ュ織
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnLogClick(object sender, EventArgs e)
+        {
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_blNo, gridView1);
+            toolBarMenu1.guidKey = rowGuid;
         }
         /// <summary>
         /// 鍒嗛〉浜嬩欢
@@ -125,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();
         }
@@ -183,10 +210,12 @@
                 var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                 if (_rtn.rtnCode > 0)
                 {
-                    UtilityHelper.JumpToTab(xtraTabControl1, 0);
-                    getPageList(1);
+                    if (xtraTabControl1.SelectedTabPageIndex == 0)
+                    { }
+                    else
+                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
+                    getPageList(this.pageBar1.CurrentPage);
                 }
-
                 MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
             }
             catch (Exception ex)
@@ -207,14 +236,15 @@
                 getModel(lbGuid.Text.Trim());
             else
             {
-                _filterList.Clear();
-                if (gridView1.ActiveFilter.Count > 0)
-                {
-                    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
-                    gridView1.ActiveFilter.Clear();
-                    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
-                }
-                getPageList(1);
+                //_filterList.Clear();
+                //if (gridView1.ActiveFilter.Count > 0)
+                //{
+                //    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+                //    gridView1.ActiveFilter.Clear();
+                //    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+                //}
+                //getPageList(1);
+                getPageList(this.pageBar1.CurrentPage);
             }
         }
         /// <summary>
@@ -240,7 +270,7 @@
             {
                 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>
@@ -254,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);
 
         }
@@ -304,6 +334,7 @@
                 list = new List<dynamic>(),
             };
             gvMx1.CloseEditor();
+            gvMx1.PostEditor();
             gvMx1.UpdateCurrentRow();
             if (gvMx1.DataRowCount <= 0)
             {
@@ -339,11 +370,13 @@
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
                 if (_rtn.rtnCode > 0)
                 {
-                    lbGuid.Text = _rtn.rtnData;
+                    lbGuid.Text = _rtn.rtnData.outGuid;
+                    txt_blNo.Text = _rtn.rtnData.outNo;
                     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 = "";
                 }
             }
             catch (Exception ex)
@@ -360,6 +393,7 @@
         private void getPageList(int curPage)
         {
             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);
             try
@@ -369,16 +403,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;//褰撳墠椤�
@@ -416,10 +450,14 @@
                 if (_rtn.rtnCode > 0)
                 {
                     dynamic dy = _rtn.rtnData;
+                    _ucCk = dy.bl010;
+                    _ucGd = dy.aboutGuid;
                     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);
                     JArray array = new JArray();
                     foreach (var a in _job["rtnData"]["list"])
@@ -433,6 +471,7 @@
                         gcMx1.DataSource = dt;
                         gcMx1.ForceInitialize();
                         gvMx1.BestFitColumns();
+                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
                     }
                     else
                     {
@@ -508,21 +547,23 @@
                     JsonConvert.SerializeObject(_obj));
                 var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                 MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
-                if (_rtn.rtnCode > 0)
+                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                 {
                     if (xtraTabControl1.SelectedTabPageIndex == 1)
+                    {
                         getModel(lbGuid.Text.Trim());
-                    else
-                        getPageList(this.pageBar1.CurrentPage);
+                    }
+                    int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+                    gridView1.FocusedRowHandle = rowHandle;
+                    Form parentForm = this.FindForm();
+                    UtilityHelper.SetCheckIco(gridView1, "bl018", "bl016", "bl006", picCheckBox, parentForm, _inFieldValue.ToString());
                 }
             }
             catch (Exception ex)
             {
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
-
         }
-
         private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e)
         {
             SearchLookUpEdit LookupEdit = sender as SearchLookUpEdit;
@@ -534,7 +575,6 @@
             gvMx1.SetFocusedRowCellValue("dwName", SelectedDataRow["dwName"]);
             gvMx1.SetFocusedRowCellValue("dabGuid", SelectedDataRow["dabGuid"]);
         }
-
         private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
         {
             var rowhandle = gvMx1.FocusedRowHandle;

--
Gitblit v1.9.3