From b5dcb53aa7b452d44b4fc19a0c830f86ab9cb5aa Mon Sep 17 00:00:00 2001
From: cdk <2441919651@qq.com>
Date: 星期五, 25 七月 2025 15:19:50 +0800
Subject: [PATCH] Merge branch 'master' of http://git.gs-mes.com:8080/r/~tjx/GsMesClient

---
 DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs |   74 ++++++++++++++++++++++++++++---------
 1 files changed, 56 insertions(+), 18 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
index 53b7e42..8ee8dbf 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
@@ -86,6 +86,7 @@
                         lst = ee.StringList;
                         string strReturn = "";
                         ReturnModel<DataTable> dt;
+                        DataTable _oldTable = (DataTable)gcMx1.DataSource;
                         #region 杩欐槸Srm鏉ョ殑鍗曞瓙
                         if (lst == null)
                         {
@@ -102,12 +103,12 @@
                             };
                             strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectSrmTo", JsonConvert.SerializeObject(_obj));
                             dt = UtilityHelper.ReturnToList(strReturn);
+                            //绂佹淇敼鏁伴噺
+                            gvMx1quantity.OptionsColumn.ReadOnly = true;
+                            txt_paperBillNo.ReadOnly = true;
+                            txt_isSrm.Checked = true;
                             DataTable _newTable = dt.rtnData;
-                            gcMx1.BindingContext = new BindingContext();
-                            gcMx1.DataSource = _newTable;
-                            gcMx1.ForceInitialize();
-                            gvMx1.PostEditor();
-                            gvMx1.UpdateCurrentRow();
+                            _oldTable = _newTable;
                         }
                         #endregion
                         #region 杩欐槸鏅�氱殑鍗�
@@ -117,20 +118,25 @@
                             var _obj = lst;
                             strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectFormTo", JsonConvert.SerializeObject(_obj));
                             dt = UtilityHelper.ReturnToList(strReturn);
+                            //淇敼鏁伴噺
+                            gvMx1quantity.OptionsColumn.ReadOnly = false;
+                            txt_paperBillNo.ReadOnly = false;
+                            txt_isSrm.Checked = false;
                             DataTable _newTable = dt.rtnData;
-                            DataTable _oldTable = (DataTable)gcMx1.DataSource;
                             DataRow[] sourceRows = _newTable.Select();
                             for (int i = 0; i < sourceRows.Length; i++)
                             {
                                 _oldTable.ImportRow(sourceRows[i]);
                             }
-                            gcMx1.BindingContext = new BindingContext();
-                            gcMx1.DataSource = _oldTable;
-                            gcMx1.ForceInitialize();
-                            gvMx1.PostEditor();
-                            gvMx1.UpdateCurrentRow();
                         }
                         #endregion
+                        gcMx1.BindingContext = new BindingContext();
+                        gcMx1.DataSource = _oldTable;
+                        gcMx1.ForceInitialize();
+                        gvMx1.PostEditor();
+                        gvMx1.UpdateCurrentRow();
+                        gvMx1.BestFitColumns();
+                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
                     }
                     catch (Exception ex)
                     {
@@ -139,7 +145,6 @@
                 };
                 frm.ShowDialog();
             };
-
         }
 
 
@@ -251,12 +256,14 @@
                     else
                         Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                     getPageList(this.pageBar1.CurrentPage);
+                    MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
                 }
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                else
+                MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
             }
             catch (Exception ex)
             {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
 
@@ -295,7 +302,7 @@
                 lbGuid, txt_billNo, gridView1);
             if (string.IsNullOrEmpty(rowGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -309,6 +316,10 @@
                 gvList.Add(gvMx1);
                 UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
             }
+            //2025/07/12鍔犱笂淇敼鐘舵�佷笅涓嶈兘淇敼渚涘簲鍟嗗拰缁勭粐srm,绂佺敤
+            setSrm();
+            txt_receiveOrgId.IsReadly = true;
+            txt_suppId.IsReadly = true;
         }
 
         /// <summary>
@@ -326,6 +337,8 @@
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
             //澧炲姞鏃讹紝榛樿缁勭粐
             string deftOrg = UtilityHelper.GetFirstOrg(txt_receiveOrgId);
+            txt_isSrm.Checked = false;
+            setSrm();
         }
 
         /// <summary>
@@ -357,6 +370,7 @@
                 Remark = txt_remark.Text.Trim(), //澶囨敞
                 SuppId = _gysId, //渚涘簲鍟�
                 OrgId = _orgId,
+                IsSrm = (txt_isSrm.Checked ? 1 : 0),
                 list = new List<dynamic>(),
             };
             gvMx1.CloseEditor();
@@ -385,7 +399,7 @@
                         AboutGuid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(row["aboutGuid"].ToString()),
                         ItemId = int.Parse(row["itemId"].ToString()),
                         Quantity = decimal.Parse(row["quantity"].ToString()),
-                        UrgentFlag = Gs.DevApp.ToolBox.UtilityHelper.ToBit(row["urgentFlag"].ToString()),
+                        UrgentFlag = (row["urgentFlagTxt"].ToString().Replace(":","").Replace("鏅��", "").Replace("鎬ユ枡", "").Replace("涓�鑸�", "")),
                         Remark = row["memo"].ToString(),
                     });
                 }
@@ -636,9 +650,9 @@
                     _webServiceName + _meth,
                     JsonConvert.SerializeObject(_obj));
                 var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
                 if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                 {
+                    MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnData.outMsg);
                     if (xtraTabControl1.SelectedTabPageIndex == 1)
                     {
                         getModel(lbGuid.Text.Trim());
@@ -648,10 +662,12 @@
                     int _inFieldValue = (_meth == "EditModelSubmit" ? 1 : -1);
                     UtilityHelper.SetCheckIco(gridView1, "fstatus", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
                 }
+                else
+                    MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnData.outMsg);
             }
             catch (Exception ex)
             {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
 
@@ -671,5 +687,27 @@
             frm.ShowDialog();
         }
 
+        private void setSrm()
+        {
+            bool isSrm = (txt_isSrm.Checked);
+            if (isSrm == true)
+            {
+                gvMx1quantity.OptionsColumn.ReadOnly = true;
+                txt_paperBillNo.ReadOnly = true;
+                txt_isSrm.Checked = true;
+                txt_receiveOrgId.IsReadly = true;
+                txt_suppId.IsReadly = true;
+                btnSelect.Enabled = false;
+            }
+            else
+            {
+                gvMx1quantity.OptionsColumn.ReadOnly = false;
+                txt_paperBillNo.ReadOnly = false;
+                txt_isSrm.Checked = false;
+                txt_receiveOrgId.IsReadly = false;
+                txt_suppId.IsReadly = false;
+                btnSelect.Enabled = true;
+            }
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3