From 99e172531c9961094e2c05d8722850b455825a20 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 10 三月 2025 15:59:56 +0800
Subject: [PATCH] 版面

---
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs |  115 +++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 95 insertions(+), 20 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs
index 0446616..5abad4e 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs
@@ -31,6 +31,9 @@
             toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnPiZhunClick += ToolBarMenu1_btnPiZhunClick;
+            List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+            gvList.Add(gridView1);
+            Gs.DevApp.ToolBox.UtilityHelper.getGridViewConfig(this.GetType().FullName, gvList);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "foneChecked", "", (value) =>
             {
@@ -67,8 +70,6 @@
                 frm.ShowDialog();
             };
             btnSave.Click += BtnSave_Click;
-
-           
         }
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
@@ -198,7 +199,7 @@
                 List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                 gvList.Add(gvMx1);
                 gvList.Add(gridView2);
-                UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
+                UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
             }
         }
 
@@ -214,7 +215,7 @@
             var gridViews = new List<GridView>();
             gridViews.Add(gvMx1);
             gridViews.Add(gridView2);
-            UtilityHelper.CleanValueByControl(panel1.Controls, true, gridViews);
+            UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
             UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
             xtraTabPageCopy.PageEnabled = false;
         }
@@ -227,15 +228,20 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            string _ItemId = txt_ItemId.GetId();
+            string _ItemId = txt_itemId.GetId();
             if (string.IsNullOrEmpty(_ItemId))
             {
                 MsgHelper.Warning("璇烽�夋嫨鐗╂枡锛�");
-                txt_ItemId.Focus();
+                txt_itemId.Focus();
                 return;
             }
             gvMx1.CloseEditor();
             gvMx1.UpdateCurrentRow();
+            if (gvMx1.DataRowCount <= 0)
+            {
+                MsgHelper.Warning("椤圭洰鏄庣粏涓嶈兘涓虹┖锛�");
+                return;
+            }
             try
             {
                 var lst = new List<MesQmCheckitemDt>();
@@ -243,11 +249,69 @@
                 {
                     var row = gvMx1.GetDataRow(i);
                     if (row != null)
+                    {
+                        if (string.IsNullOrEmpty(row["forder"].ToString()))
+                        {
+                            MsgHelper.ShowError("椤哄簭涓嶈兘涓虹┖锛�");
+                            return;
+                        }
+                        if (string.IsNullOrEmpty(row["FcheckItem"].ToString()))
+                        {
+                            MsgHelper.ShowError("妫�楠岄」鐩笉鑳戒负绌猴紒");
+                            return;
+                        }
+                        if (string.IsNullOrEmpty(row["FcheckTool"].ToString()))
+                        {
+                            MsgHelper.ShowError("妫�楠屽伐鍏蜂笉鑳戒负绌猴紒");
+                            return;
+                        }
+                        if (string.IsNullOrEmpty(row["SampleSizeNo"].ToString()))
+                        {
+                            MsgHelper.ShowError("妫�楠屾爣鍑嗕笉鑳戒负绌猴紒");
+                            return;
+                        }
+                        if (string.IsNullOrEmpty(row["FcheckLevel"].ToString()))
+                        {
+                            MsgHelper.ShowError("妫�楠屾按骞充笉鑳戒负绌猴紒");
+                            return;
+                        }
+                        if (string.IsNullOrEmpty(row["FacLevel"].ToString()))
+                        {
+                            MsgHelper.ShowError("鎺ュ彈姘村钩涓嶈兘涓虹┖锛�");
+                            return;
+                        }
+                        string _Fstand = row["Fstand"].ToString();
+                        string _FupAllow = row["FupAllow"].ToString();
+                        string _FdownAllow = row["FdownAllow"].ToString();
+                        //鍋囧涓変釜閮戒负绌洪�氳繃
+                        if (string.IsNullOrEmpty(_Fstand) && string.IsNullOrEmpty(_FupAllow) && string.IsNullOrEmpty(_FdownAllow))
+                        {
+
+                        }
+                        else
+                        {
+                            if (!string.IsNullOrEmpty(_Fstand) && !string.IsNullOrEmpty(_FupAllow) && !string.IsNullOrEmpty(_FdownAllow))
+                            {
+                                decimal _Fstand_f = Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(_Fstand);
+                                decimal _FupAllow_f = Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(_FupAllow);
+                                decimal _FdownAllow_f = Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(_FdownAllow);
+                                if (_Fstand_f >= _FdownAllow_f && _Fstand_f <= _FupAllow_f) { }
+                                else
+                                {
+                                    MsgHelper.ShowError("鏍囧噯鍊煎繀椤诲湪涓婇檺鍜屼笅闄愪箣闂达紒");
+                                    return;
+                                }
+                            }
+                            else
+                            {
+                                MsgHelper.ShowError("璇峰~鍐欐纭殑涓婇檺锛屾爣鍑嗗�硷紝涓嬮檺锛�");
+                                return;
+                            }
+                        }
                         lst.Add(new MesQmCheckitemDt
                         {
                             Guid = UtilityHelper.ToGuid(row["guid"].ToString()),
-                           // Forder = int.Parse(row["forder"].ToString()),
-                            Forder = 0,
+                            Forder = int.Parse(row["forder"].ToString()),
                             FcheckItem = row["FcheckItem"].ToString(),
                             SampleSizeNo = row["SampleSizeNo"].ToString(),
                             FcheckTool = row["FcheckTool"].ToString(),
@@ -259,6 +323,7 @@
                             FupAllow = row["FupAllow"].ToString(),
                             FdownAllow = row["FdownAllow"].ToString(),
                         });
+                    }
                 }
                 var _obj = new MesQmCheckitem
                 {
@@ -285,7 +350,7 @@
                         var gridViews = new List<GridView>();
                         gridViews.Add(gvMx1);
                         gridViews.Add(gridView2);
-                        UtilityHelper.ChangeEnableByControl(panel1.Controls, false, gridViews);
+                        UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gridViews);
                     }
                 }
                 catch (Exception ex)
@@ -375,7 +440,7 @@
                     var gvList =
                         new List<GridView>();
                     gvList.Add(gvMx1);
-                    UtilityHelper.SetValueByObj(panel1.Controls, dy,
+                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy,
                         isEdit, gvList);
                     var _job = JObject.Parse(strJson);
                     var array = new JArray();
@@ -451,9 +516,11 @@
                 if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                 {
                     if (xtraTabControl1.SelectedTabPageIndex == 1)
+                    {
                         getModel(lbGuid.Text.Trim());
-                    else
-                        getPageList(this.pageBar1.CurrentPage);
+                    }
+                    int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+                    gridView1.FocusedRowHandle = rowHandle;
                     UtilityHelper.SetCheckIco(gridView1, "foneChecked", "foneCheckor", "foneCheckdate", picCheckBox, this, _inFieldValue.ToString());
                 }
             }
@@ -466,18 +533,21 @@
         #region 浠ヤ笅涓虹绉嶄笅鎷�
         private void _setIno()
         {
-            this.txt_OrgName.EditChanged += (s, e) => {
-                string _orgId = txt_OrgName.GetId();
+            this.txt_fSubsidiary.EditChanged += (s, e) =>
+            {
+                string _orgId = txt_fSubsidiary.GetId();
                 if (string.IsNullOrEmpty(_orgId))
                     return;
-                txt_ItemId.getSuppler(_orgId);
-                txt_itemModel.Text ="";
-                txt_itemNo.Text = "";
+                txt_itemId.getSuppler(_orgId);
+                //txt_gg.Text ="";
+                //txt_itemNo.Text = "";
             };
-            txt_ItemId.EditChanged += (s, e) =>
+            txt_itemId.EditChanged += (s, e) =>
             {
-                txt_itemModel.Text = this.txt_ItemId.GetModel();
-                txt_itemNo.Text = this.txt_ItemId.GetCode();
+                if (!string.IsNullOrEmpty(this.txt_itemId.GetModel()))
+                    txt_gg.Text = this.txt_itemId.GetModel();
+                if (!string.IsNullOrEmpty(this.txt_itemId.GetCode()))
+                    txt_itemNo.Text = this.txt_itemId.GetCode();
             };
             _getListJyxm();
             _getListJygj();
@@ -719,5 +789,10 @@
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
+
+        private void lb_ftwoCheckdate_Click(object sender, EventArgs e)
+        {
+
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3