From 31ce91f6ff326063fca78f31ee982001586cc109 Mon Sep 17 00:00:00 2001
From: wbc <2597324127@qq.com>
Date: 星期二, 16 十二月 2025 21:55:34 +0800
Subject: [PATCH] 产能排产功能更新

---
 DevApp/Gs.DevApp/DevFrm/MJGL/Frm_MesMoldArchives.cs |   75 +++++++++++++++++++++++++++++--------
 1 files changed, 59 insertions(+), 16 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/MJGL/Frm_MesMoldArchives.cs b/DevApp/Gs.DevApp/DevFrm/MJGL/Frm_MesMoldArchives.cs
index 45afdf9..7369322 100644
--- a/DevApp/Gs.DevApp/DevFrm/MJGL/Frm_MesMoldArchives.cs
+++ b/DevApp/Gs.DevApp/DevFrm/MJGL/Frm_MesMoldArchives.cs
@@ -46,7 +46,8 @@
             }, lbGuid);
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-        }
+            _getListDepotSections();
+;        }
 
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
@@ -160,6 +161,7 @@
             UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
             UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
             gvMx1.BestFitColumns();
+            gvMx1.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.True;
             gvMx1.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom;
             gvMx1.OptionsBehavior.Editable = true;
             gvMx1.OptionsBehavior.ReadOnly = false;
@@ -338,25 +340,26 @@
                     var array = new JArray();
                     foreach (var a in _job["rtnData"]["list"]) array.Add(a);
                     var dt = JsonConvert.DeserializeObject<DataTable>(array.ToString());
-                    if (dt.Rows.Count > 0)
-                    {
-                        gcMx1.BindingContext = new BindingContext();
-                        gcMx1.DataSource = dt;
-                        gcMx1.ForceInitialize();
-                        gvMx1.BestFitColumns();
-                    }
-                    else
-                    {
-                        UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
-                    }
-                    gvMx1.OptionsBehavior.Editable = isEdit;
-                    gvMx1.OptionsBehavior.ReadOnly = !isEdit;
-                    gvMx1.OptionsView.NewItemRowPosition = isEdit ? NewItemRowPosition.Bottom : NewItemRowPosition.None;
+                if (dt.Rows.Count > 0)
+                {
+                    gcMx1.BindingContext = new BindingContext();
+                    gcMx1.DataSource = dt;
+                    gcMx1.ForceInitialize();
+                    gvMx1.BestFitColumns();
                 }
                 else
                 {
-                    MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                    UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
                 }
+                    gvMx1.OptionsBehavior.Editable = isEdit;
+                    gvMx1.OptionsBehavior.ReadOnly = !isEdit;
+                    gvMx1.OptionsBehavior.AllowAddRows = isEdit ? DevExpress.Utils.DefaultBoolean.True : DevExpress.Utils.DefaultBoolean.False;
+                    gvMx1.OptionsView.NewItemRowPosition = isEdit ? NewItemRowPosition.Bottom : NewItemRowPosition.None;
+            }
+            else
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+            }
             }
             catch (Exception ex)
             {
@@ -448,5 +451,45 @@
             }
         }
 
+
+        private void rptDepotSections_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            ComboBoxEdit comboBox = sender as ComboBoxEdit;
+            if (comboBox != null)
+            {
+                CboItemEntity _itm = comboBox.EditValue as CboItemEntity;
+                if (_itm == null) return;
+                string sectionCode = _itm.Text.ToString();
+                gvMx1.CloseEditor();
+                gvMx1.PostEditor();
+                gvMx1.SetRowCellValue(gvMx1.FocusedRowHandle, "location", sectionCode);
+            }
+        }
+
+        /// <summary>
+        /// 璇诲彇搴撲綅
+        /// </summary>
+        private void _getListDepotSections()
+        {
+            try
+            {
+               
+                var pgq = new PageQueryModel(1, 999999, "b.xh", "asc", "", " and is_ng='A'");
+                var json = JsonConvert.SerializeObject(pgq);
+                var strReturn = UtilityHelper.HttpPost("", "MesDepotSectionsManager/GetListPage", json);
+                var rtn = UtilityHelper.ReturnToTablePage(strReturn);
+                var dt = rtn.rtnData.list;
+                this.rptDepotSections.Items.Clear();
+                foreach (System.Data.DataRow dr in dt.Rows)
+                {
+                    this.rptDepotSections.Items.Add(new CboItemEntity(dr["depotSectionCode"].ToString(), dr["depotSectionCode"].ToString()));
+                }
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+        }
+
     }
 }

--
Gitblit v1.9.3