From b7d9f2e23cbda587d814c7d07c1664c053c83dcb Mon Sep 17 00:00:00 2001
From: cdk <2441919651@qq.com>
Date: 星期二, 12 八月 2025 13:58:07 +0800
Subject: [PATCH] Merge branch 'master' of http://git.gs-mes.com:8080/r/~tjx/GsMesClient

---
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs |  365 +++++++++++++++++++++++++++++++++------------------
 1 files changed, 236 insertions(+), 129 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
index b4aa45c..e5fee83 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
@@ -1,3 +1,6 @@
+using DevExpress.Pdf.Native.BouncyCastle.Utilities.Collections;
+using DevExpress.XtraLayout.Customization;
+using DevExpress.XtraRichEdit.API.Native;
 using Gs.DevApp.DevFrm.QC;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
@@ -10,6 +13,7 @@
 using System.Data;
 using System.Net;
 using System.Threading.Tasks;
+using System.Timers;
 using System.Windows.Forms;
 
 namespace Gs.DevApp.DevFrm
@@ -19,6 +23,10 @@
         string _strTag = "N:涓嶅悎鏍�";
         string _webServiceName = "MesQaItemsDetect01Manager/";
         List<FilterEntity> _filterList = new List<FilterEntity>();
+        /// <summary>
+        /// 瀹氭椂鍒锋柊
+        /// </summary>
+        System.Timers.Timer timer = new System.Timers.Timer(1000);
         public Frm_MesQaItemsDetect01()
         {
             InitializeComponent();
@@ -28,8 +36,8 @@
             this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
-            toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
-            toolBarMenu1.btnFjianYanClick += ToolBarMenu1_btnFjianYanClick;
+            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
+            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
             toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick;
             this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1, tips);
@@ -54,8 +62,157 @@
             gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
             btnIpt.Click += BtnIpt_Click;
             btnYcReport.Click += BtnYcReport_Click;
-        }
+            #region 浜旀閲嶉噺
+            //鍏抽棴鏃堕噴鏀総imer
+            this.Disposed += (s, e) =>
+            {
+                // MessageBox.Show("ddddddd");
+                if (timer != null)
+                {
+                    timer.Stop();
+                    timer.Dispose();
+                }
+            };
+            timer.Elapsed += (s, e) =>
+            {
+                var _obj = new
+                {
 
+                };
+                try
+                {
+                    var strReturn = UtilityHelper.HttpPost("", "WorkWeight/GetIqcWeight", JsonConvert.SerializeObject(_obj), false);
+                    var dd = UtilityHelper.ReturnToDynamic(strReturn);
+                    if (dd.rtnCode > 0)
+                    {
+                        BeginInvoke(new Action(() =>
+                        {
+                            txtWCurrent.Text = dd.rtnData;
+                        }));
+                    }
+                }
+                catch (Exception ex)
+                {
+
+                }
+            };
+            timer.AutoReset = true; // 璁剧疆涓簍rue琛ㄧず閲嶅鎵ц锛宖alse琛ㄧず鎵ц涓�娆″悗鍋滄
+            timer.Enabled = true; // 寮�濮嬭鏃�
+            //璇诲彇閲嶉噺
+            this.btnW.Click += (s, e) =>
+            {
+                string _strCurrent = this.txtWCurrent.Text.Trim();
+                bool _isNumeric = decimal.TryParse(_strCurrent, out _);
+                if (!_isNumeric)
+                {
+                    ToolBox.MsgHelper.ShowError("璇锋鏌ョО閲嶈缃紒");
+                    return;
+                }
+                decimal _decCurrent = decimal.Parse(_strCurrent);
+                if (_decCurrent * 1 <= 0)
+                {
+                    ToolBox.MsgHelper.ShowError("璇锋鏌ョО閲嶈缃紒");
+                    return;
+                }
+                if (txtW1.Text.Trim().Length <= 0)
+                {
+                    _setWeigth(1, _strCurrent);
+                    return;
+                }
+                if (txtW2.Text.Trim().Length <= 0)
+                {
+                    _setWeigth(2, _strCurrent);
+                    return;
+                }
+                if (txtW3.Text.Trim().Length <= 0)
+                {
+                    _setWeigth(3, _strCurrent);
+                    return;
+                }
+                if (txtW4.Text.Trim().Length <= 0)
+                {
+                    _setWeigth(4, _strCurrent);
+                    return;
+                }
+                if (txtW5.Text.Trim().Length <= 0)
+                {
+                    _setWeigth(5, _strCurrent);
+                    return;
+                }
+                ToolBox.MsgHelper.ShowError("閲嶉噺宸茶幏鍙栧畬姣曪紒");
+                return;
+            };
+            //娓呯┖
+            this.btnClean.Click += (s, e) =>
+            {
+                if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + txt_releaseNo.Text.Trim() + "銆戯紝纭畾娓呴櫎鎵�鏈夌О閲嶆暟鎹悧锛�"))
+                    return;
+                _setWeigth(99, "");
+
+            };
+            #endregion
+
+        }
+        /// <summary>
+        /// 鎻愪氦绉伴噸
+        /// </summary>
+        /// <param name="_weightType"></param>
+        /// <param name="_weight"></param>
+        private void _setWeigth(int _weightType, string _weight)
+        {
+            var _obj = new
+            {
+                iqcGuid = this.txt_guid.Text.Trim(),
+                weightType = _weightType,
+                weight = _weight
+            };
+            try
+            {
+                var strReturn = UtilityHelper.HttpPost("", "WorkWeight/EditIqc", JsonConvert.SerializeObject(_obj), false);
+                var dd = UtilityHelper.ReturnToDynamic(strReturn);
+                if (dd.rtnCode <= 0)
+                {
+                    ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + dd.rtnMsg);
+                }
+                else
+                {
+                    if (_weightType == 1)
+                    {
+                        txtW1.Text = _weight;
+                        return;
+                    }
+                    if (_weightType == 2)
+                    {
+                        txtW2.Text = _weight;
+                        return;
+                    }
+                    if (_weightType == 3)
+                    {
+                        txtW3.Text = _weight;
+                        return;
+                    }
+                    if (_weightType == 4)
+                    {
+                        txtW4.Text = _weight;
+                        return;
+                    }
+                    if (_weightType == 5)
+                    {
+                        txtW5.Text = _weight;
+                        return;
+                    }
+                    if (_weightType == 99)
+                    {
+                        this.txtW1.Text = this.txtW2.Text = this.txtW3.Text = this.txtW4.Text = this.txtW5.Text = "";
+                        return;
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
+            }
+        }
 
         /// <summary>
         /// 鎵归噺褰曞叆
@@ -104,7 +261,7 @@
             string strGuid = lbGuid.Text.Trim();
             if (string.IsNullOrEmpty(strGuid))
             {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             var _obj = new
@@ -126,7 +283,7 @@
             }
             catch (Exception ex)
             {
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
         /// <summary>
@@ -139,7 +296,7 @@
             int intHandle = this.gvMx1.FocusedRowHandle;
             if (intHandle < 0)
             {
-                ToolBox.MsgHelper.Warning("鎻愮ず锛氳閫夋嫨妫�楠岄」鐩紒");
+                ToolBox.MsgHelper.ShowError("鎻愮ず锛氳閫夋嫨妫�楠岄」鐩紒");
                 return;
             }
             if (e.KeyCode == Keys.Enter)
@@ -188,7 +345,7 @@
                 }
                 catch (Exception ex)
                 {
-                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                    MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
                 }
             }
         }
@@ -239,119 +396,17 @@
                 lbGuid, txt_releaseNo, gridView1);
             toolBarMenu1.guidKey = rowGuid;
         }
-        /// <summary>
-        ///鎻愪氦妫�楠屼簨浠�
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        /// <exception cref="NotImplementedException"></exception>
-        private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e)
-        {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_releaseNo, gridView1, "releaseNo");
-            toolBarMenu1.guidKey = rowGuid;
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愬鏍稿悧锛�"))
-                return;
-            if (txt_fcheckResu.Text.Trim() == _strTag)
-            {
-                if (string.IsNullOrEmpty(txt_fngDesc.TextTxt.Trim()))
-                {
-                    MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃讹紝璇峰~鍐欏紓甯稿娉ㄨ鏄庯紒");
-                    return;
-                }
-            };
-            var _obj = new
-            {
-                guid = rowGuid,
-            };
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("",
-                    _webServiceName + "EditModelSubmit",
-                    JsonConvert.SerializeObject(_obj));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
-                {
-                    MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnData.outMsg);
-                    if (xtraTabControl1.SelectedTabPageIndex == 1)
-                    {
-                        getModel(lbGuid.Text.Trim(), "0");
-                    }
-                    int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
-                    gridView1.FocusedRowHandle = rowHandle;
-                    int _inFieldValue = 1;
-                    UtilityHelper.SetCheckIco(gridView1, "fsubmitTxt", "", "iqcDate", picCheckBox, this, _inFieldValue.ToString());
-                }
-                else {
-                    MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnData.outMsg);
-                }
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
-            }
 
+
+        private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
+        {
+            _toolCk("EditModelSubmit");
+        }
+        private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
+        {
+            _toolCk("EditModelSubmitZhiLiang");
         }
 
-        /// <summary>
-        /// 鎻愪氦鍙嶆楠�
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        /// <exception cref="NotImplementedException"></exception>
-        private void ToolBarMenu1_btnFjianYanClick(object sender, EventArgs e)
-        {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_releaseNo, gridView1, "releaseNo");
-            toolBarMenu1.guidKey = rowGuid;
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍙嶅鏍稿悧锛�"))
-                return;
-            var _obj = new
-            {
-                guid = rowGuid,
-            };
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("",
-                    _webServiceName + "EditModelSubmitZhiLiang",
-                    JsonConvert.SerializeObject(_obj));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-              
-                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
-                {
-                    MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnData.outMsg);
-                    if (xtraTabControl1.SelectedTabPageIndex == 1)
-                    {
-                        getModel(lbGuid.Text.Trim(), "0");
-                    }
-                    int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
-                    gridView1.FocusedRowHandle = rowHandle;
-                    int _inFieldValue = 1;
-                    UtilityHelper.SetCheckIco(gridView1, "fsubmitTxt", "", "iqcDate", picCheckBox, this, _inFieldValue.ToString());
-                }
-                else {
-                    MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnData.outMsg);
-                }
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
-            }
-        }
         /// <summary>
         /// 鍙栨秷浜嬩欢
         /// </summary>
@@ -374,7 +429,7 @@
                 lbGuid, txt_releaseNo, gridView1, "releaseNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾瀵煎嚭鍚楋紵"))
@@ -403,7 +458,8 @@
                             {
                                 client.DownloadFile(_url, _folderName);
                             }
-                            ToolBox.MsgHelper.ShowInformation("瀵煎嚭鎴愬姛锛�");
+                            var frm = new Gs.DevApp.DevFrm.QC.Xls(_folderName);
+                            frm.ShowDialog();
                         }
                         else
                         {
@@ -452,7 +508,7 @@
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -480,7 +536,7 @@
             toolBarMenu1.isSetBtn = false;
             if (txt_fcheckResu.Text.Trim() == _strTag && string.IsNullOrEmpty(txt_fngDesc.TextTxt.Trim()))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("褰撴楠岀粨鏋滀笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄨ鏄庯紒");
+                Gs.DevApp.ToolBox.MsgHelper.ShowError("褰撴楠岀粨鏋滀笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄨ鏄庯紒");
                 txt_fngDesc.Focus();
                 return;
             }
@@ -493,21 +549,23 @@
             {
                 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)
                 {
+                    ToolBox.MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
                     lbGuid.Text = _rtn.rtnData;
                     toolBarMenu1.isSetBtn = true;
                     UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
                     this.setEable(false);
                     toolBarMenu1.currentAction = "";
                     Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
-
                 }
+                else
+                    ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
             }
             catch (Exception ex)
             {
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
 
@@ -550,7 +608,7 @@
             }
             catch (Exception ex)
             {
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
 
         }
@@ -566,7 +624,7 @@
             if (toolBarMenu1.currentAction == "edit") isEdit = true;
             if (string.IsNullOrEmpty(strGuid))
             {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             var _obj = new
@@ -618,11 +676,11 @@
                     }
                 }
                 else
-                    ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                    ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
             }
             catch (Exception ex)
             {
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
 
         }
@@ -678,7 +736,7 @@
             }
             catch (Exception ex)
             {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
         /// <summary>
@@ -690,6 +748,7 @@
             txtJianYan.ReadOnly = !bl;
             btnLoad.Enabled = bl;
             btnIpt.Text = (bl == true ? "褰曞叆鏍锋湰" : "鏌ョ湅鏍锋湰");
+            btnW.Enabled = btnClean.Enabled = bl;
         }
 
         #region 鎵撳紑鐖朵翰绐楀彛濮旀墭锛屾煡鐪嬪紓甯告姤鍛�
@@ -714,5 +773,53 @@
         }
         #endregion
 
+
+        /// <summary>
+        /// 妫�楠屽拰鍙嶆楠�
+        /// </summary>
+        /// <param name="inFieldValue"></param>
+        private void _toolCk(string _meth)
+        {
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎿嶄綔鍚楋紵"))
+                return;
+            var _obj = new
+            {
+                guid = rowGuid,
+            };
+            try
+            {
+                var strJson = UtilityHelper.HttpPost("",
+                    _webServiceName + _meth,
+                    JsonConvert.SerializeObject(_obj));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+
+                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
+                {
+                    MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnData.outMsg);
+                    if (xtraTabControl1.SelectedTabPageIndex == 1)
+                    {
+                        getModel(lbGuid.Text.Trim(), "0");
+                    }
+                    int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+                    gridView1.FocusedRowHandle = rowHandle;
+                    int _inFieldValue = (_meth == "EditModelSubmit" ? 1 : -1);
+                    UtilityHelper.SetCheckIco(gridView1, "fsubmitTxt", "", "iqcDate", picCheckBox, this, _inFieldValue.ToString());
+                }
+                else
+                    MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnData.outMsg);
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
+            }
+        }
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3