From f14d1fc28a8012035ee251fba71a0d048e9efd0d Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 16 一月 2025 09:10:48 +0800
Subject: [PATCH] 工具条切换状态

---
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs |  309 ++++++++++++++++++++------------------------------
 1 files changed, 125 insertions(+), 184 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
index fa6f27f..4a0369e 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
@@ -7,7 +7,6 @@
 using System.Collections.Generic;
 using System.Configuration;
 using System.Data;
-using System.Drawing;
 using System.Net;
 using System.Threading.Tasks;
 using System.Windows.Forms;
@@ -26,18 +25,17 @@
             this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
             this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
-            this.toolBarMenu1.btnZhiLiangChkClick += ToolBarMenu1_btnZhiLiangChkClick;
-            this.toolBarMenu1.btnZhiLiangFchkClick += ToolBarMenu1_btnZhiLiangFchkClick;
-            this.toolBarMenu1.btnCaiGouChkClick += ToolBarMenu1_btnCaiGouChkClick;
-            this.toolBarMenu1.btnCaiGouFchkClick += ToolBarMenu1_btnCaiGouFchkClick;
+            this.toolBarMenu1.btnChkClick += ToolBarMenu1_btnZhiLiangChkClick;
+            this.toolBarMenu1.btnFChkClick += ToolBarMenu1_btnZhiLiangFchkClick;
             this.toolBarMenu1.btnBoHuiClick += ToolBarMenu1_btnBoHuiClick;
+            toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick;
+            toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick;
             toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
-            gcMx1.MouseClick += GcMx1_MouseClick;
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3);
-            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) =>
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "modifyFlagTxt", "", (value) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
             });
@@ -50,18 +48,13 @@
             });
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-            //鍒濆鍖栫墿鏂欓�夋嫨鍜屽悇绉嶄笅鎷�
-            txt_itemId.EditChanged += (s, e) =>
-            {
-                txt_itemModel.Text = this.txt_itemId.GetModel();
-                txt_itemNo.Text = this.txt_itemId.GetCode();
-            };
             ucUpFile1.UpChanged += UcUpFile1_UpChanged;
             xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged;
+            gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
         }
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
-            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
+            Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
             Task.Delay(100);
             getPageList(1);
         }
@@ -72,7 +65,17 @@
                 return;
             getList12(rowGuid);
         }
-       
+        private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
+        {
+            if (e.FocusedRowHandle >= 0)
+            {
+                DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
+                string rowGuid = row["guid"].ToString();
+                if (string.IsNullOrEmpty(rowGuid))
+                    return;
+                getList12(rowGuid);
+            }
+        }
         /// <summary>
         /// 鍒嗛〉浜嬩欢
         /// </summary>
@@ -184,6 +187,28 @@
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
             UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
         }
+        private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e)
+        {
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_itemName, gridView1);
+            toolBarMenu1.guidKey = rowGuid;
+            toolBarMenu1.rptParameter = "rpt_Detect01{}";
+        }
+        private void ToolBarMenu1_btnReportClick(object sender, EventArgs e)
+        {
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_itemName, gridView1);
+            toolBarMenu1.guidKey = rowGuid;
+            this.toolBarMenu1.rptParameter = "rpt_Detect01{" + "1"
+                   + "," + "1"
+                   + "," + "1"
+                   + "," + "1"
+                   + "," + "1"
+                   + "}";
+        }
+
         /// <summary>
         /// 椹冲洖
         /// </summary>
@@ -192,102 +217,7 @@
         private void ToolBarMenu1_btnBoHuiClick(object sender, EventArgs e)
         {
             toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_releaseNo, gridView1);
-            toolBarMenu1.guidKey = rowGuid;
-
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾瑕侀┏鍥炲悧锛�"))
-                return;
-
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit13",
-                    JsonConvert.SerializeObject(rowGuid));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
-        }
-        /// <summary>
-        /// 閲囪喘鍙嶅鏍�
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ToolBarMenu1_btnCaiGouFchkClick(object sender, EventArgs e)
-        {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_releaseNo, gridView1);
-            toolBarMenu1.guidKey = rowGuid;
-
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾瑕侀噰璐弽瀹℃牳鍚楋紵"))
-                return;
-
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit12",
-                    JsonConvert.SerializeObject(rowGuid));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
-        }
-        /// <summary>
-        /// 閲囪喘瀹℃牳
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void ToolBarMenu1_btnCaiGouChkClick(object sender, EventArgs e)
-        {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_releaseNo, gridView1);
-            toolBarMenu1.guidKey = rowGuid;
-
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾瑕侀噰璐鏍稿悧锛�"))
-                return;
-
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcCGAudit",
-                    JsonConvert.SerializeObject(rowGuid));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
+            _toolCk(-1);
         }
         /// <summary>
         /// 璐ㄩ噺鍙嶅鏍�
@@ -296,33 +226,7 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnZhiLiangFchkClick(object sender, EventArgs e)
         {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_releaseNo, gridView1);
-            toolBarMenu1.guidKey = rowGuid;
-
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾璐ㄩ噺瀹℃牳鍚楋紵"))
-                return;
-
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit11",
-                    JsonConvert.SerializeObject(rowGuid));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
+            _toolCk(0);
         }
         /// <summary>
         /// 璐ㄩ噺瀹℃牳
@@ -331,33 +235,7 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnZhiLiangChkClick(object sender, EventArgs e)
         {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_releaseNo, gridView1);
-            toolBarMenu1.guidKey = rowGuid;
-
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾璐ㄩ噺瀹℃牳鍚楋紵"))
-                return;
-
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("", _webServiceName + "IqcQcSubmit",
-                    JsonConvert.SerializeObject(rowGuid));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
+            _toolCk(1);
         }
 
         /// <summary>
@@ -368,17 +246,18 @@
         private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
         {
             if (xtraTabControl1.SelectedTabPageIndex == 1)
-                getModel(lbGuid.Text.Trim(), false, 999);
+                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);
             }
         }
 
@@ -387,9 +266,10 @@
         /// </summary>
         /// <param name="curPage">绗嚑椤�</param>
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
-        private   void getPageList(int curPage)
+        private void getPageList(int curPage)
         {
             var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+            _sbSqlWhere += " and isnull(fsubmit,0)=1";
             PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
             try
@@ -422,9 +302,9 @@
             {
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
-            
+
         }
-        private   void getModel(string strGuid)
+        private void getModel(string strGuid)
         {
             bool isEdit = false;
             if (toolBarMenu1.currentAction == "add") return;
@@ -476,7 +356,7 @@
             {
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
-            
+
         }
         /// <summary>
         /// 閫夐」鍗″垏鎹�
@@ -530,9 +410,8 @@
         /// 鏍规嵁妫�楠岄」鐩鍙栨娊鏍风粨鏋� 
         /// </summary>
         /// <param name="guid5"></param>
-        private   void getList12(string guid5)
+        private void getList12(string guid5)
         {
-            
             var _obj = new
             {
                 parentGuid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
@@ -551,7 +430,6 @@
             {
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
-            
         }
         private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
         {
@@ -599,7 +477,6 @@
                 {
                     Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message);
                 }
-
             }
         }
 
@@ -635,9 +512,73 @@
                 {
                     Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message);
                 }
-
             }
-
         }
+
+        /// <summary>
+        /// 宸ュ叿鏉′簨浠�
+        /// </summary>
+        /// <param name="inFieldValue"></param>
+        private void _toolCk(int _inFieldValue)
+        {
+            string strMsg = "";
+            switch (_inFieldValue)
+            {
+                case 1:
+                    strMsg = "瀹℃牳";
+                    break;
+                case 0:
+                    strMsg = "鍙嶅鏍�";
+                    break;
+                case -1:
+                    strMsg = "椹冲洖";
+                    break;
+            };
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
+                return;
+            if (_inFieldValue == 1)
+            {
+                if (txt_fcheckResu.Text == "涓嶅悎鏍�")
+                {
+                    if (txt_fngHandle.Text.Trim().Length == 0) {
+                        MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃惰閫夋嫨澶勭悊鏂瑰紡锛�");
+                        return;
+                    }
+                }
+            }
+            var _obj = new
+            {
+                guid = rowGuid,
+                inFieldValue = _inFieldValue,
+            };
+            try
+            {
+                var strJson = UtilityHelper.HttpPost("",
+                    _webServiceName + "EditModelSubmitZhiLiang",
+                    JsonConvert.SerializeObject(_obj));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
+                if (_rtn.rtnCode > 0)
+                {
+                    if (xtraTabControl1.SelectedTabPageIndex == 1)
+                        getModel(lbGuid.Text.Trim());
+                    else
+                        getPageList(this.pageBar1.CurrentPage);
+                }
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+        }
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3