From 24d8d7b1bc4e3f878fcc2ad89fa0967a95300ac1 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 10 四月 2025 15:13:41 +0800
Subject: [PATCH] fqc

---
 DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs |  159 ++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 122 insertions(+), 37 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs b/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs
index 0337b88..fc5edf2 100644
--- a/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/FQC/Frm_FqcDetect01.cs
@@ -1,4 +1,4 @@
-锘�
+锘縰sing Gs.DevApp.DevFrm.Work;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -80,8 +80,10 @@
                 };
                 frm.ShowDialog();
             };
+            // 璇诲彇缂洪櫡绛夌骇
+            getRptDefectLevel();
         }
-     
+
         /// <summary>
         /// 鎵归噺褰曞叆
         /// </summary>
@@ -94,7 +96,6 @@
             Gs.DevApp.DevFrm.QC.Frm_MesQaItemsDetect01Input frm = new Gs.DevApp.DevFrm.QC.Frm_MesQaItemsDetect01Input(this.lbGuid.Text.Trim(), bl);
             frm.ShowDialog();
         }
-
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
             _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
@@ -270,7 +271,7 @@
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_releaseNo, gridView1, "lotNo");
+                lbGuid, txt_releaseNo, gridView1, "releaseNo");
             toolBarMenu1.guidKey = rowGuid;
             if (string.IsNullOrEmpty(rowGuid))
             {
@@ -281,9 +282,9 @@
                 return;
             if (txt_fcheckResu.Text.Trim() == "涓嶅悎鏍�")
             {
-                if (string.IsNullOrEmpty(txt_remarks.Text.Trim()))
+                if (string.IsNullOrEmpty(txt_msg.TextTxt.Trim()))
                 {
-                    MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄨ鏄庯紒");
+                    MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃讹紝璇峰~鍐欒繚瑙勪俊鎭紒");
                     return;
                 }
             };
@@ -445,21 +446,18 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            string _txt_djType = txt_djType.Text.Trim();
-            string _txt_fbatchQty = txt_fbatchQty.Text.Trim();
-            string _txt_lifnr = txt_lifnr.Text.Trim();
-            string _txt_suppId = txt_suppId.GetId();
-            string _txt_lineId = txt_lineId.GetId();
-            string _txt_itemId = txt_itemId.Text.Trim();
-            string _txt_remarks = txt_remarks.Text.Trim();
-            string _txt_workNo = "";
-            string _txt_epTag = txt_epTag.Text.Trim();
-            string _txt_fzrId = "";
-            string _txt_msg = txt_msg.TextTxt;
-            string _txt_fmanageNo = txt_fmanageNo.Text.Trim();
-            string _txt_lotNo2 = txt_lotNo2.Text.Trim();
-            string _txt_lotNo1 = txt_lotNo1.Text.Trim();
-            string _txt_lotNo = txt_lotNo.Text.Trim();
+            string _txt_djType = txt_djType.Text.Trim();//鍗曟嵁绫诲瀷
+            string _txt_fbatchQty = txt_fbatchQty.Text.Trim();//鎶芥鏁伴噺
+            string _txt_lifnr = txt_lifnr.Text.Trim();//瀹㈡埛璁㈠崟
+            string _txt_suppId = txt_suppId.GetId();//瀹㈡埛id
+            string _txt_lineId = txt_lineId.GetId();//浜х嚎
+            string _txt_itemId = txt_itemId.Text.Trim();//浜у搧
+            string _txt_remarks = txt_remarks.Text.Trim();//澶囨敞
+            string _txt_epTag = txt_epTag.Text.Trim();//鐜繚
+            string _txt_msg = txt_msg.TextTxt;//寮傚父
+            string _txt_fmanageNo = txt_fmanageNo.Text.Trim();//娴佺▼缂栧彿
+            string _txt_lotNo1 = txt_lotNo1.Text.Trim();//閫佹鎵瑰彿
+            string _txt_lotNo = txt_lotNo.Text.Trim();//鐢熶骇宸ュ崟
             if (txt_djType.SelectedIndex <= 0)
             {
                 Gs.DevApp.ToolBox.MsgHelper.Warning("鍗曟嵁绫诲瀷涓嶈兘涓虹┖锛�");
@@ -493,22 +491,54 @@
             var _obj = new
             {
                 guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
-                djType = _txt_djType,
-                fbatchQty = _txt_fbatchQty,
-                lifnr = _txt_lifnr,
-                suppId = _txt_suppId,
-                lineId = _txt_lineId,
-                itemId = _txt_itemId,
-                remarks = _txt_remarks,
-                workNo = _txt_workNo,
-                epTag = _txt_epTag,
-                fzrId = _txt_fzrId,
-                msg = _txt_msg,
-                fmanageNo = _txt_fmanageNo,
-                lotNo2 = _txt_lotNo2,
-                lotNo1 = _txt_lotNo1,
-                lotNo = _txt_lotNo
+                djType = _txt_djType,//鍗曟嵁绫诲瀷
+                fbatchQty = _txt_fbatchQty,//鎶芥鏁伴噺
+                lifnr = _txt_lifnr,//瀹㈡埛璁㈠崟
+                suppId = _txt_suppId,//瀹㈡埛id
+                lineId = _txt_lineId,//浜х嚎
+                itemId = _txt_itemId,//浜у搧
+                remarks = _txt_remarks,//澶囨敞
+                epTag = _txt_epTag,//鐜繚
+                msg = _txt_msg,//寮傚父
+                fmanageNo = _txt_fmanageNo,//娴佺▼缂栧彿
+                lotNo1 = _txt_lotNo1,//閫佹鎵瑰彿
+                lotNo = _txt_lotNo,//鐢熶骇宸ュ崟
+                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();
+                    string _fcheckResu = row["fcheckResu"].ToString();
+                    if (_fcheckResu == "涓嶅悎鏍�")
+                    {
+                        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));
@@ -523,6 +553,7 @@
                     this.setEable(false);
                     toolBarMenu1.currentAction = "";
                     Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
+                    getModel(lbGuid.Text, "0");
                 }
             }
             catch (Exception ex)
@@ -691,12 +722,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