From e06c6fad5e892a4ea2a15d1181c5705c6dc560f7 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期三, 09 四月 2025 10:51:03 +0800
Subject: [PATCH] fqc

---
 DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs |   97 ++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 92 insertions(+), 5 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs b/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs
index 012eac3..8c1224e 100644
--- a/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs
@@ -1,4 +1,5 @@
-锘縰sing Gs.DevApp.Entity;
+锘縰sing Gs.DevApp.DevFrm.Work;
+using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
 using Newtonsoft.Json;
@@ -79,8 +80,10 @@
                 };
                 frm.ShowDialog();
             };
+            // 璇诲彇缂洪櫡绛夌骇
+            getRptDefectLevel();
         }
-     
+
         /// <summary>
         /// 鎵归噺褰曞叆
         /// </summary>
@@ -500,8 +503,38 @@
                 fmanageNo = _txt_fmanageNo,//娴佺▼缂栧彿
                 lotNo1 = _txt_lotNo1,//閫佹鎵瑰彿
                 lotNo = _txt_lotNo,//鐢熶骇宸ュ崟
-                edtType = 0
+                edtType = 0,
+                list = new List<dynamic>(),
             };
+            gvMx1.CloseEditor();
+            gvMx1.PostEditor();
+            gvMx1.UpdateCurrentRow();
+            for (var i = 0; i < gvMx1.DataRowCount; i++)
+            {
+                var row = gvMx1.GetDataRow(i);
+                if (row != null)
+                {
+                    Guid _guid = UtilityHelper.ToGuid(row["guid"].ToString());
+                    string defectLevel = row["defectLevel"].ToString();
+                    string defectDetails = row["defectDetails"].ToString();
+                    if (string.IsNullOrEmpty(defectLevel))
+                    {
+                        MsgHelper.ShowError("璇烽�夋嫨缂洪櫡绛夌骇锛�");
+                        return;
+                    }
+                    if (string.IsNullOrEmpty(defectDetails))
+                    {
+                        MsgHelper.ShowError("璇峰~鍐欑己闄锋弿杩帮紒");
+                        return;
+                    }
+                    _obj.list.Add(new
+                    {
+                        guid5 = _guid,
+                        defectLevel = defectLevel,
+                        defectDetails = defectDetails,
+                    });
+                }
+            }
             try
             {
                 string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
@@ -516,7 +549,7 @@
                     this.setEable(false);
                     toolBarMenu1.currentAction = "";
                     Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
-                    getModel(lbGuid.Text,"0");
+                    getModel(lbGuid.Text, "0");
                 }
             }
             catch (Exception ex)
@@ -685,12 +718,66 @@
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
-        
+
         private void setEable(bool bl)
         {
             txtJianYan.ReadOnly = !bl;
             btnLoad.Enabled = bl;
             btnIpt.Text = (bl == true ? "褰曞叆鏍锋湰" : "鏌ョ湅鏍锋湰");
         }
+
+
+        /// <summary>
+        /// 璇诲彇缂洪櫡绛夌骇
+        /// </summary>
+        /// <param name="curPage"></param>
+        private void getRptDefectLevel()
+        {
+            string _where = " and 1=1 and  s_type='缂洪櫡绛夌骇'";
+            var pgq = new PageQueryModel(1, 999999, "a.defect_code", "asc", "", _where);
+            var json = JsonConvert.SerializeObject(pgq);
+            try
+            {
+                var strReturn = UtilityHelper.HttpPost("", "MesDefectCodeManager/GetListPage", json);
+                var dd = UtilityHelper.ReturnToTablePage(strReturn);
+                var dt = dd.rtnData.list;
+                foreach (DataRow dr in dt.Rows)
+                {
+                    rptDefectLevel.Items.Add(dr["defectName"].ToString());
+                }
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+        }
+        /// <summary>
+        /// 閫夋嫨缂洪櫡鎻忚堪
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void rptDefectDetails_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+        {
+            var rowhandle = gvMx1.FocusedRowHandle;
+            if (rowhandle < 0)
+                return;
+            UcDictionarySelect frm = new UcDictionarySelect("缂洪櫡鎻忚堪", " s_type='FQC缂洪櫡鎻忚堪'");
+            frm.UpdateParent += (ss, ee) =>
+            {
+                System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
+                var lst = ee.DynamicList;
+                foreach (dynamic dym in lst)
+                {
+                    if (stringBuilder.Length > 0)
+                        stringBuilder.Append("|");
+                    stringBuilder.Append(dym.dicTxt);
+                }
+                gvMx1.SetFocusedRowCellValue("defectDetails", stringBuilder.ToString());
+                // this.TextTxt = ;
+            };
+            frm.ShowDialog();
+        }
+ 
+       
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3