From 64a6c4193199d15d7ac5aa67a9677df01a37a50d Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 12 六月 2025 08:04:31 +0800
Subject: [PATCH] bug

---
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs |  209 +++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 141 insertions(+), 68 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
index 4ba7f62..d7decc4 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
@@ -6,7 +6,9 @@
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
+using System.Configuration;
 using System.Data;
+using System.Net;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
@@ -14,6 +16,7 @@
 {
     public partial class Frm_MesQaItemsDetect01 : DevExpress.XtraEditors.XtraForm
     {
+        string _strTag = "N:涓嶅悎鏍�";
         string _webServiceName = "MesQaItemsDetect01Manager/";
         List<FilterEntity> _filterList = new List<FilterEntity>();
         public Frm_MesQaItemsDetect01()
@@ -25,9 +28,11 @@
             this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
-            toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
+            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
+            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
+            toolBarMenu1.btnOutClick += ToolBarMenu1_btnOutClick;
             this.toolBarMenu1.getXmlConfig();
-            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1, tips);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fsubmitTxt", "", (value) =>
@@ -51,6 +56,7 @@
             btnYcReport.Click += BtnYcReport_Click;
         }
 
+
         /// <summary>
         /// 鎵归噺褰曞叆
         /// </summary>
@@ -70,6 +76,11 @@
             Task.Delay(100);
             getPageList(1);
         }
+        /// <summary>
+        /// 5琛ㄧ劍鐐规椂锛岄噸鏂拌鍙�12琛�
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
         {
             if (e.FocusedRowHandle >= 0)
@@ -88,7 +99,7 @@
         /// <param name="e"></param>
         private void BtnLoad_Click(object sender, EventArgs e)
         {
-            if (!MsgHelper.AskQuestion("纭畾閲嶆柊鍔犺浇妫�楠岄」鐩悧锛岃鎿嶄綔灏嗕細娓呯┖涔嬪墠鐨勬楠岃褰曪紵"))
+            if (!MsgHelper.AskQuestion("璇ユ搷浣滃皢浼氭竻绌烘楠岃褰曪紙鍖呮嫭鏍峰搧妫�楠岃褰曪級锛岀‘瀹氶噸鏂板姞杞芥楠岄」鐩悧锛�"))
                 return;
             string strGuid = lbGuid.Text.Trim();
             if (string.IsNullOrEmpty(strGuid))
@@ -228,62 +239,15 @@
                 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, "lotNo");
-            toolBarMenu1.guidKey = rowGuid;
-            if (string.IsNullOrEmpty(rowGuid))
-            {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
-                return;
-            }
-            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愪氦妫�楠屽悧锛�"))
-                return;
-            if (txt_fcheckResu.Text.Trim() == "涓嶅悎鏍�")
-            {
-                if (string.IsNullOrEmpty(txt_remarks.Text.Trim()))
-                {
-                    MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄨ鏄庯紒");
-                    return;
-                }
-            };
-            var _obj = new
-            {
-                guid = rowGuid,
-            };
-            try
-            {
-                var strJson = UtilityHelper.HttpPost("",
-                    _webServiceName + "EditModelSubmit",
-                    JsonConvert.SerializeObject(_obj));
-                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
-                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
-                {
-                    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());
-                }
-            }
-            catch (Exception ex)
-            {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
+       
 
+        private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
+        {
+            _toolCk("EditModelSubmit");
+        }
+        private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
+        {
+            _toolCk("EditModelSubmitZhiLiang");
         }
 
         /// <summary>
@@ -295,7 +259,62 @@
         {
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
         }
-
+        /// <summary>
+        /// 瀵煎嚭
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        /// <exception cref="NotImplementedException"></exception>
+        private void ToolBarMenu1_btnOutClick(object sender, EventArgs e)
+        {
+            string rowGuid = "", rowName = "";
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_releaseNo, gridView1, "releaseNo");
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾瀵煎嚭鍚楋紵"))
+                return;
+            using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
+            {
+                folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�";
+                DialogResult dialogResult = folderBrowserDialog.ShowDialog();
+                if (dialogResult == DialogResult.OK)
+                {
+                    string _folder = folderBrowserDialog.SelectedPath;
+                    var _obj = new
+                    {
+                        guid = rowGuid,
+                    };
+                    try
+                    {
+                        string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutIqc", JsonConvert.SerializeObject(_obj));
+                        ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
+                        if (_rtn.rtnCode > 0)
+                        {
+                            string _file = _rtn.rtnData.fileUrl.ToString();
+                            string _folderName = _folder + "\\" + _file.Replace("down/", "");
+                            string _url = ConfigurationManager.AppSettings["WebApiUrl"].ToString() + _file;
+                            using (WebClient client = new WebClient())
+                            {
+                                client.DownloadFile(_url, _folderName);
+                            }
+                            ToolBox.MsgHelper.ShowInformation("瀵煎嚭鎴愬姛锛�");
+                        }
+                        else
+                        {
+                            ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
+                    }
+                }
+            }
+        }
 
         /// <summary>
         /// 鍒锋柊浜嬩欢
@@ -357,16 +376,16 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            if (txt_fcheckResu.Text.Trim() == "N:涓嶅悎鏍�" && string.IsNullOrEmpty(txt_remarks.Text.Trim()))
+            if (txt_fcheckResu.Text.Trim() == _strTag && string.IsNullOrEmpty(txt_fngDesc.TextTxt.Trim()))
             {
                 Gs.DevApp.ToolBox.MsgHelper.Warning("褰撴楠岀粨鏋滀笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄨ鏄庯紒");
-                txt_remarks.Focus();
+                txt_fngDesc.Focus();
                 return;
             }
             var _obj = new
             {
                 guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
-                remarks = txt_remarks.Text.Trim(),
+                fngDesc = txt_fngDesc.TextTxt.Trim(),
             };
             try
             {
@@ -381,6 +400,7 @@
                     this.setEable(false);
                     toolBarMenu1.currentAction = "";
                     Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
+
                 }
             }
             catch (Exception ex)
@@ -396,8 +416,7 @@
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
         private void getPageList(int curPage)
         {
-            var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
-            // _sbSqlWhere += " and isnull(fsubmit,0)=0";
+            gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
             PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "release_no", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
             try
@@ -433,6 +452,11 @@
             }
 
         }
+        /// <summary>
+        /// 璇诲彇瀹炰綋
+        /// </summary>
+        /// <param name="strGuid"></param>
+        /// <param name="guid5"></param>
         private void getModel(string strGuid, string guid5)
         {
             bool isEdit = false;
@@ -454,7 +478,7 @@
                 if (_rtn.rtnCode > 0)
                 {
                     dynamic dy = _rtn.rtnData;
-                    btnYcReport.Tag = dy.toGuid.ToString();
+                    btnYcReport.ToolTip = dy.toGuid.ToString();
                     lbGuid.Text = strGuid;
                     List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                     gvList.Add(gvMx1);
@@ -474,6 +498,7 @@
                         gcMx1.DataSource = dt;
                         gcMx1.ForceInitialize();
                         gvMx1.BestFitColumns();
+                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
                         ucUpFileList1.pGuid = lbGuid.Text.Trim();
                         if (guid5.Length > 10)
                         {
@@ -554,7 +579,10 @@
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
-
+        /// <summary>
+        /// 绂佺敤妫�楠屾+閲嶆柊鍔犺浇鎸夐挳
+        /// </summary>
+        /// <param name="bl"></param>
         private void setEable(bool bl)
         {
             txtJianYan.ReadOnly = !bl;
@@ -562,11 +590,11 @@
             btnIpt.Text = (bl == true ? "褰曞叆鏍锋湰" : "鏌ョ湅鏍锋湰");
         }
 
-        #region 鎵撳紑鐖朵翰绐楀彛濮旀墭
+        #region 鎵撳紑鐖朵翰绐楀彛濮旀墭锛屾煡鐪嬪紓甯告姤鍛�
         public event EventHandler<UpdateParentEventArgs> ToUpdateParent;
         private void BtnYcReport_Click(object sender, EventArgs e)
         {
-            string _toGuid = (btnYcReport.Tag == null ? "" : btnYcReport.Tag.ToString());
+            string _toGuid = (btnYcReport.ToolTip == null ? "" : btnYcReport.ToolTip.ToString());
             if (string.IsNullOrEmpty(_toGuid))
             {
                 Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇ュ崟鏃犲紓甯告姤鍛婏紝鏌ョ湅澶辫触锛�");
@@ -584,5 +612,50 @@
         }
         #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.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                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);
+                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
+                if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
+                {
+                    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());
+                }
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+        }
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3