From 39e49e75c30f0aeacf6a37a3f2ea1e43ee147e6e Mon Sep 17 00:00:00 2001
From: cdk <2441919651@qq.com>
Date: 星期六, 15 十一月 2025 17:18:31 +0800
Subject: [PATCH] iqc,fqc,查询工单追溯码增加导出功能

---
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs |  118 +++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 102 insertions(+), 16 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
index 90482ae..ea2c3d2 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
@@ -1,7 +1,5 @@
-using DevExpress.Pdf.Native.BouncyCastle.Utilities.Collections;
-using DevExpress.XtraLayout.Customization;
-using DevExpress.XtraRichEdit.API.Native;
 using Gs.DevApp.DevFrm.QC;
+using Gs.DevApp.DevFrm.Rpt;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -124,27 +122,27 @@
                     ToolBox.MsgHelper.ShowError("璇锋鏌ョО閲嶈缃紒");
                     return;
                 }
-                if (txtW1.Text.Trim().Length <= 0)
+                if (txt_weight1.Text.Trim().Length <= 0)
                 {
                     _setWeigth(1, _strCurrent);
                     return;
                 }
-                if (txtW2.Text.Trim().Length <= 0)
+                if (txt_weight2.Text.Trim().Length <= 0)
                 {
                     _setWeigth(2, _strCurrent);
                     return;
                 }
-                if (txtW3.Text.Trim().Length <= 0)
+                if (txt_weight3.Text.Trim().Length <= 0)
                 {
                     _setWeigth(3, _strCurrent);
                     return;
                 }
-                if (txtW4.Text.Trim().Length <= 0)
+                if (txt_weight4.Text.Trim().Length <= 0)
                 {
                     _setWeigth(4, _strCurrent);
                     return;
                 }
-                if (txtW5.Text.Trim().Length <= 0)
+                if (txt_weight5.Text.Trim().Length <= 0)
                 {
                     _setWeigth(5, _strCurrent);
                     return;
@@ -188,32 +186,32 @@
                 {
                     if (_weightType == 1)
                     {
-                        txtW1.Text = _weight;
+                        txt_weight1.Text = _weight;
                         return;
                     }
                     if (_weightType == 2)
                     {
-                        txtW2.Text = _weight;
+                        txt_weight2.Text = _weight;
                         return;
                     }
                     if (_weightType == 3)
                     {
-                        txtW3.Text = _weight;
+                        txt_weight3.Text = _weight;
                         return;
                     }
                     if (_weightType == 4)
                     {
-                        txtW4.Text = _weight;
+                        txt_weight4.Text = _weight;
                         return;
                     }
                     if (_weightType == 5)
                     {
-                        txtW5.Text = _weight;
+                        txt_weight5.Text = _weight;
                         return;
                     }
                     if (_weightType == 99)
                     {
-                        this.txtW1.Text = this.txtW2.Text = this.txtW3.Text = this.txtW4.Text = this.txtW5.Text = "";
+                        this.txt_weight1.Text = this.txt_weight2.Text = this.txt_weight3.Text = this.txt_weight4.Text = this.txt_weight5.Text = "";
                         return;
                     }
                 }
@@ -434,6 +432,39 @@
         /// <exception cref="NotImplementedException"></exception>
         private void ToolBarMenu1_btnOutClick(object sender, EventArgs e)
         {
+
+            var frm = new SelOutType();
+            var type = 0;
+            //璧嬪�肩粰鏄庣粏琛�
+            frm.UpdateParent += (ss, ee) =>
+            {
+                var lst = new List<string>();
+                lst = ee.StringList;
+                if (!string.IsNullOrEmpty(lst[0]))
+                {
+                    if(lst[0] == "鍒楄〃瀵煎嚭")
+                    {
+                        type = 1;
+                    }
+                    else if (lst[0] == "鏄庣粏瀵煎嚭")
+                    {
+                        type = 2;
+                    }
+                }
+            };
+            frm.ShowDialog();
+            if(type == 1)
+            {
+                LstOutput();
+            }
+            if(type == 2)
+            {
+                MxOutput();
+            }
+        }
+
+        private void MxOutput()
+        {
             string rowGuid = "", rowName = "";
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                 lbGuid, txt_releaseNo, gridView1, "releaseNo");
@@ -479,6 +510,54 @@
                     catch (Exception ex)
                     {
                         ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
+                    }
+                }
+            }
+        }
+
+        private void LstOutput()
+        {
+            using (FolderBrowserDialog folderBrowserDialog = new FolderBrowserDialog())
+            {
+                folderBrowserDialog.Description = "閫夋嫨瀵煎嚭鏂囦欢鐨勪繚瀛樿矾寰�";
+                DialogResult dialogResult = folderBrowserDialog.ShowDialog();
+                System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
+                _sbSqlWhere.Append(" and a.ReceiveOrgId in");
+                _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
+                _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
+                if (dialogResult == DialogResult.OK)
+                {
+                    string _folder = folderBrowserDialog.SelectedPath;
+                    var _params = new
+                    {
+                        inSortName = "",
+                        inSortOrder = "",
+                        inQueryWhere = _sbSqlWhere.ToString()
+                    };
+                    var _obj = new Gs.DevApp.Entity.XlsOutModel("xlsOut_iqcdetect01lst", "", "", "", _params);
+                    try
+                    {
+                        string strJson = UtilityHelper.HttpPost("", "XlsInOut/XlsOutView_NEW", 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.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
                     }
                 }
             }
@@ -546,20 +625,27 @@
             toolBarMenu1.isSetBtn = false;
             if (txt_fcheckResu.Text.Trim() == _strTag && string.IsNullOrEmpty(txt_fngDesc.TextTxt.Trim()))
             {
-                Gs.DevApp.ToolBox.MsgHelper.ShowError("褰撴楠岀粨鏋滀笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄨ鏄庯紒");
+                Gs.DevApp.ToolBox.MsgHelper.ShowError("褰撴楠岀粨鏋滀笉鍚堟牸鏃讹紝璇峰~鍐欏紓甯告弿杩帮紒");
                 txt_fngDesc.Focus();
+                return;
+            }
+            if (txt_fcheckResu.Text.Trim() == _strTag && string.IsNullOrEmpty(txt_xblb.TextTxt.Trim()))
+            {
+                Gs.DevApp.ToolBox.MsgHelper.ShowError("褰撴楠岀粨鏋滀笉鍚堟牸鏃讹紝璇峰~鍐欓�夊埆绫诲埆锛�");
+                txt_xblb.Focus();
                 return;
             }
             var _obj = new
             {
                 guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
                 fngDesc = txt_fngDesc.TextTxt.Trim(),
+                iqcRemark= txt_iqcRemark.Text.Trim(),
+                iqcXblb = txt_xblb.TextTxt.Trim(),
             };
             try
             {
                 string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
                 ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
-
                 if (_rtn.rtnCode > 0)
                 {
                     ToolBox.MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);

--
Gitblit v1.9.3