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/QC/MesQcExceptional.cs |  388 +++++--------------------------------------------------
 1 files changed, 36 insertions(+), 352 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/MesQcExceptional.cs b/DevApp/Gs.DevApp/DevFrm/QC/MesQcExceptional.cs
index 89ec0b2..b5da7cf 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/MesQcExceptional.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/MesQcExceptional.cs
@@ -1,6 +1,4 @@
-锘縰sing DevExpress.XtraEditors;
-using DevExpress.XtraGrid.Views.Grid;
-using Gs.DevApp.Entity;
+锘縰sing Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
 using Newtonsoft.Json;
@@ -15,24 +13,19 @@
 {
     public partial class MesQcExceptional : DevExpress.XtraEditors.XtraForm
     {
-        string _webServiceName = "WompbaManager/";
+        string _webServiceName = "MesQcExceptionalManager/";
         List<FilterEntity> _filterList = new List<FilterEntity>();
-        string _cjBm = "";//杞﹂棿
         public MesQcExceptional()
         {
             InitializeComponent();
-            this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick;
-            this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
-            this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
             this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
-            this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
-            this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
+            toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
             this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
-            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fstatus", "", (value) =>
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (value) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
             });
@@ -45,63 +38,6 @@
             });
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-            //閫夊瓨缁勭粐锛堝彉鏄庣粏涓殑鐗╂枡鍜岃溅闂达級
-            txt_erpSczz.EditChanged += (s, e) =>
-            {
-                string _orgId = txt_erpSczz.GetId();
-                if (string.IsNullOrEmpty(_orgId))
-                    return;
-                txt_pba013.getSuppler(_orgId, _cjBm);
-            };
-            // 閫夋嫨杞﹂棿锛堝彉鏄庣粏涓骇绾匡級
-            txt_pba013.EditChanged += (s, e) =>
-            {
-                string workGuid = this.txt_pba013.GetId();
-                _getListJybz(workGuid);
-            };
-            //閫夋嫨闇�瑕佺殑鏄庣粏
-            btnSelect.Click += (s, e) =>
-            {
-                if (string.IsNullOrEmpty(this.txt_pba013.GetId()))
-                {
-                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨杞﹂棿锛屾墠鑳介�夋嫨浠诲姟鍗曪紒");
-                    return;
-                }
-                var frm = new SelectWompba(this.txt_pba013.GetId());
-                //璧嬪�肩粰鏄庣粏琛�
-                frm.UpdateParent += (ss, ee) =>
-                {
-                    try
-                    {
-                        var lst = new List<string>();
-                        lst = ee.StringList;
-                        var _obj = lst;
-                        var strReturn = UtilityHelper.HttpPost("",
-                            "WompbaManager/SelectPbaToView",
-                            JsonConvert.SerializeObject(_obj));
-                        var dt = UtilityHelper.ReturnToList(strReturn);
-                        DataTable _newTable = dt.rtnData;
-                        DataTable _oldTable = (DataTable)gcMx1.DataSource;
-                        DataRow[] sourceRows = _newTable.Select();
-                        for (int i = 0; i < sourceRows.Length; i++)
-                        {
-                            _oldTable.ImportRow(sourceRows[i]);
-                        }
-                        gcMx1.BindingContext = new BindingContext();
-                        gcMx1.DataSource = _oldTable;
-                        gvMx1.CloseEditor();
-                        gvMx1.PostEditor();
-                        gvMx1.UpdateCurrentRow();
-                        gcMx1.ForceInitialize();
-                        gvMx1.BestFitColumns();
-                    }
-                    catch (Exception ex)
-                    {
-                        MessageBox.Show(ex.Message);
-                    }
-                };
-                frm.ShowDialog();
-            };
         }
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
@@ -109,7 +45,19 @@
             Task.Delay(100);
             getPageList(1);
         }
-
+        /// <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_fBillNo, gridView1);
+            toolBarMenu1.guidKey = rowGuid;
+        }
         /// <summary>
         /// 鍒嗛〉浜嬩欢
         /// </summary>
@@ -129,7 +77,7 @@
             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, this.GetType().FullName);
             frm.UpdateParent += Frm_UpdateParent;
             frm.ShowDialog();
         }
@@ -144,60 +92,7 @@
             _filterList = e.FilterList;
             getPageList(1);
         }
-
-        /// <summary>
-        /// 鍙栨秷浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
-        {
-            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
-        }
-
-        /// <summary>
-        /// 鍒犻櫎浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
-        {
-            string rowGuid = "", rowName = "";
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_hNo, gridView1, "hNo");
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
-                return;
-            var _obj = new
-            {
-                guid = rowGuid,
-                mxGuid = Guid.Empty.ToString(),
-            };
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("",
-                    _webServiceName + "DeleteModelOrMx",
-                    JsonConvert.SerializeObject(_obj));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                if (_rtn.rtnCode > 0)
-                {
-                    if (xtraTabControl1.SelectedTabPageIndex == 0)
-                    { }
-                    else
-                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
-                    getPageList(this.pageBar1.CurrentPage);
-                }
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
-        }
+         
         /// <summary>
         /// 鍒锋柊浜嬩欢
         /// </summary>
@@ -227,7 +122,7 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
         {
-            _toolCk(1, "EditModelSubmit");
+            _toolCk(1);
         }
 
         /// <summary>
@@ -238,172 +133,11 @@
         /// <exception cref="NotImplementedException"></exception>
         private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
         {
-            _toolCk(0, "EditModelSubmitFSH");
+            _toolCk(0);
         }
 
-
-        /// <summary>
-        /// 淇敼浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
-        {
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_hNo, gridView1);
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
-            if (xtraTabControl1.SelectedTabPageIndex == 1)
-            {
-                getModel(rowGuid);
-            }
-            else
-            {
-                List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
-                gvList.Add(gvMx1);
-                UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
-            }
-        }
-        /// <summary>
-        /// 鏂板浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
-        {
-            lbGuid.Text = "";
-            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.layoutMx1.Controls, true, gridViews);
-            Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
-        }
-        /// <summary>
-        /// 淇濆瓨浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
-        {
-            toolBarMenu1.isSetBtn = false;
-            string workId = txt_pba013.GetId();
-            if (string.IsNullOrEmpty(workId.Trim()))
-            {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨杞﹂棿锛�");
-                txt_pba013.Focus();
-                return;
-            }
-            var _obj = new
-            {
-                guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
-                bz = txt_pba009.Text.Trim(),
-                cjId = workId,
-                list = new List<dynamic>(),
-            };
-            gvMx1.CloseEditor();
-            gvMx1.PostEditor();
-            gvMx1.UpdateCurrentRow();
-            if (gvMx1.DataRowCount <= 0)
-            {
-                MsgHelper.ShowError("鏄庣粏涓嶈兘涓虹┖锛岃閫夋嫨鏄庣粏锛�");
-                return;
-            }
-            for (var i = 0; i < gvMx1.DataRowCount; i++)
-            {
-                var row = gvMx1.GetDataRow(i);
-                if (row != null)
-                {
-                    Guid? _guid = UtilityHelper.ToGuid(row["guid"].ToString());
-                    //string _LineId = row["daa015"].ToString();
-                    //if (string.IsNullOrEmpty(_LineId))
-                    //{
-                    //    MsgHelper.ShowError("浜х嚎缂栫爜涓嶈兘涓虹┖锛�");
-                    //    return;
-                    //}
-                    string _Pcsl = row["daa008"].ToString();
-                    if (string.IsNullOrEmpty(_Pcsl))
-                    {
-                        MsgHelper.ShowError("鎺掍骇鏁伴噺涓嶈兘涓虹┖锛�");
-                        return;
-                    }
-                    string _Yjkgsj = row["mesStartProd"].ToString();
-                    if (string.IsNullOrEmpty(_Yjkgsj))
-                    {
-                        MsgHelper.ShowError("棰勮寮�宸ユ椂闂翠笉鑳戒负绌猴紒");
-                        return;
-                    }
-                    //string _prepareTime = row["prepareTime"].ToString();
-                    //if (string.IsNullOrEmpty(_prepareTime))
-                    //{
-                    //    MsgHelper.ShowError("棰勮澶囨枡鏃堕棿涓嶈兘涓虹┖锛�");
-                    //    return;
-                    //}
-                    //string _planPersonnel = row["planPersonnel"].ToString();
-                    //if (string.IsNullOrEmpty(_planPersonnel))
-                    //{
-                    //    MsgHelper.ShowError("璁″垝浜烘暟锛�");
-                    //    return;
-                    //}
-                    //string _changeLinetime = row["changeLinetime"].ToString();
-                    //if (string.IsNullOrEmpty(_changeLinetime))
-                    //{
-                    //    MsgHelper.ShowError("鎹㈢嚎鏃堕棿涓嶈兘涓虹┖锛�");
-                    //    return;
-                    //}
-                    string _mesEndProd = row["mesEndProd"].ToString();
-                    if (string.IsNullOrEmpty(_mesEndProd))
-                    {
-                        MsgHelper.ShowError("棰勮瀹屽伐鏃堕棿涓嶈兘涓虹┖锛�");
-                        return;
-                    }
-                    //string _restTime = row["restTime"].ToString();
-                    //if (string.IsNullOrEmpty(_prepareTime))
-                    //{
-                    //    MsgHelper.ShowError("浼戞伅鏃堕棿涓嶈兘涓虹┖锛�");
-                    //    return;
-                    //}
-                    _obj.list.Add(new
-                    {
-                        Guid = _guid,
-                        AboutGuid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(row["caaGuid"].ToString()),
-                        LineId = row["daa015"].ToString(),//浜х嚎id
-                        Yjkgsj = (row["mesStartProd"].ToString()),//棰勮寮�宸ユ椂闂�
-                        Jhrs = row["planPersonnel"].ToString(),//璁″垝浜烘暟
-                        Hxsj = row["changeLinetime"].ToString(),//鎹㈢嚎鏃堕棿
-                        Bz = row["daa009"].ToString(),//澶囨敞
-                        Blsj = row["prepareTime"].ToString(),//棰勮澶囨枡鏃堕棿
-                        Pcsl = row["daa008"].ToString(),//鎺掍骇鏁伴噺
-                        Yjwgsj = row["mesEndProd"].ToString()//棰勮瀹屽伐鏃堕棿
-                    });
-                }
-            }
-            try
-            {
-                string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
-                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
-                if (_rtn.rtnCode > 0)
-                {
-                    lbGuid.Text = _rtn.rtnData.outGuid;
-                    txt_hNo.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.layoutMx1.Controls, false, gvList);
-                    toolBarMenu1.currentAction = "";
-                }
-            }
-            catch (Exception ex)
-            {
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
-        }
-
+      
+        
         /// <summary>
         /// 
         /// </summary>
@@ -469,12 +203,10 @@
                 if (_rtn.rtnCode > 0)
                 {
                     dynamic dy = _rtn.rtnData;
-                    _cjBm = dy.pba013;
                     lbGuid.Text = strGuid;
                     List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                     gvList.Add(gvMx1);
                     UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
-                    _cjBm = "";
                     JObject _job = JObject.Parse(strJson);
                     JArray array = new JArray();
                     foreach (var a in _job["rtnData"]["list"])
@@ -543,84 +275,35 @@
         }
 
         /// <summary>
-        /// 鏍规嵁杞﹂棿璇讳骇绾�
-        /// </summary>
-        /// <param name="workGuid"></param>
-        private void _getListJybz(string workGuid)
-        {
-            rptJYBZ.Items.Clear();
-            if (string.IsNullOrEmpty(workGuid))
-                return;
-            var _sbSqlWhere = " and 1=1 and dpt_id=" + workGuid;
-            var pgq = new PageQueryModel(1, 999999, "a.line_no", "asc", "", _sbSqlWhere.ToString());
-            var json = JsonConvert.SerializeObject(pgq);
-            try
-            {
-                var strReturn = UtilityHelper.HttpPost("", "MesWorkshopLineManager/GetListPage", json);
-                var dd = UtilityHelper.ReturnToTablePage(strReturn);
-                DataTable dt = dd.rtnData.list;
-                foreach (DataRow dr in dt.Rows)
-                {
-                    rptJYBZ.Items.Add((new CboItemEntity(dr["id"].ToString(), dr["name"].ToString())));
-                }
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
-        }
-        private void rptJYBZ_SelectedIndexChanged(object sender, EventArgs e)
-        {
-            ComboBoxEdit comboBox = sender as ComboBoxEdit;
-            if (comboBox != null)
-            {
-                GridView myView = (gcMx1.MainView as GridView);
-                int dataIndex = myView.GetDataSourceRowIndex(myView.FocusedRowHandle);
-                CboItemEntity _itm = comboBox.EditValue as CboItemEntity;
-                string _val = _itm.Value.ToString();
-                string _txt = _itm.Text.ToString();
-                gvMx1.CloseEditor();
-                gvMx1.PostEditor();
-                gvMx1.UpdateCurrentRow();
-                gvMx1.SetRowCellValue(dataIndex, "daa015LineName", _txt);
-                gvMx1.SetRowCellValue(dataIndex, "daa015", _val);
-            }
-        }
-
-        /// <summary>
         /// 宸ュ叿鏉′簨浠�
         /// </summary>
         /// <param name="inFieldValue"></param>
-        private void _toolCk(int _inFieldValue, string _mth)
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="inFieldValue"></param>
+        private void _toolCk(int _inFieldValue)
         {
-            string strMsg = "";
-            switch (_inFieldValue)
-            {
-                case 1:
-                    strMsg = "瀹℃牳";
-                    break;
-                case 0:
-                    strMsg = "鍙嶅鏍�";
-                    break;
-            };
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_hNo, gridView1, "hNo");
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_fBillNo, gridView1, "fBillNo");
+            toolBarMenu1.guidKey = rowGuid;
             if (string.IsNullOrEmpty(rowGuid))
             {
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎿嶄綔鍚楋紵"))
                 return;
             var _obj = new
             {
                 guid = rowGuid,
-                inFieldValue = _inFieldValue,
+                inFieldValue = _inFieldValue
             };
             try
             {
-                var strJson = UtilityHelper.HttpPost("", _webServiceName + _mth, JsonConvert.SerializeObject(_obj));
+                var strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModelSubmit", JsonConvert.SerializeObject(_obj));
                 var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                 MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
                 if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
@@ -631,7 +314,7 @@
                     }
                     int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
                     gridView1.FocusedRowHandle = rowHandle;
-                    UtilityHelper.SetCheckIco(gridView1, "fstatus", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
+                    UtilityHelper.SetCheckIco(gridView1, "checkStatus", "checkBy", "checkDate", picCheckBox, this, _inFieldValue.ToString());
                 }
             }
             catch (Exception ex)
@@ -639,5 +322,6 @@
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3