From 48e061f462dba5b11a0426206075908aef4aa6f4 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期五, 22 十一月 2024 15:04:08 +0800
Subject: [PATCH] 11

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs |  121 ++++++++++++++++++++++++++++++++++-----
 1 files changed, 104 insertions(+), 17 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs
index 0ed0801..4622518 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs
@@ -1,7 +1,6 @@
-using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraGrid.Views.Grid.ViewInfo;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
+using Gs.DevApp.UserControl;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
@@ -40,6 +39,9 @@
                 Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
                 e.Graphics.DrawString(str, f, Brushes.Gray, r);
             };
+            //璁剧疆渚涘簲鍟嗛�夋嫨
+            this.txt_suppId.KeyFile = "id";
+            this.txt_depotsId.KeyFile = "depotId";
         }
 
         /// <summary>
@@ -83,20 +85,6 @@
             _filterList = e.FilterList;
             getPageList(1, pageBar1.RowsCount);
         }
-        /// <summary>
-        ///     鍙嶅鏍�
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        /// <exception cref="NotImplementedException"></exception>
-        private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
-        {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_billNo, gridView1);
-            toolBarMenu1.guidKey = rowGuid;
-        }
 
         /// <summary>
         ///     瀹℃牳浜嬩欢
@@ -109,7 +97,88 @@
             string rowGuid, rowName;
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                 lbGuid, txt_billNo, gridView1);
-            toolBarMenu1.guidKey = rowGuid;
+            //toolBarMenu1.guidKey = rowGuid;
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            //MsgHelper.Warning(rowGuid);
+            UcLoading _loading = new UcLoading();
+            var _obj = new
+            {
+                guid = rowGuid,
+            };
+            try
+            {
+                var strJson =  UtilityHelper.HttpPost("",
+                    _webServiceName + "EditModelSubmit",
+                    JsonConvert.SerializeObject(_obj));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                if (_rtn.rtnCode > 0)
+                {
+                    if (xtraTabControl1.SelectedTabPageIndex == 1)
+                        getModel(lbGuid.Text.Trim(), false, 999);
+                    else
+                        getPageList(1, UtilityHelper.GetPageSize());
+                }
+                else
+                {
+                    MsgHelper.Warning(_rtn.rtnMsg);
+                }
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+            _loading.Stop();
+        }
+
+        /// <summary>
+        ///     鍙嶅鏍�
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        /// <exception cref="NotImplementedException"></exception>
+        private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
+        {
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_billNo, gridView1);
+            // toolBarMenu1.guidKey = rowGuid;
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            //MsgHelper.Warning(rowGuid);
+            var _obj = new
+            {
+                guid = rowGuid,
+            };
+            try
+            {
+                var strJson = UtilityHelper.HttpPost("",
+                    _webServiceName + "DeApprove",
+                    JsonConvert.SerializeObject(_obj));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                if (_rtn.rtnCode > 0)
+                {
+                    if (xtraTabControl1.SelectedTabPageIndex == 1)
+                        getModel(lbGuid.Text.Trim(), false, 999);
+                    else
+                        getPageList(1, UtilityHelper.GetPageSize());
+                }
+                else
+                {
+                    MsgHelper.Warning(_rtn.rtnMsg);
+                }
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
         }
 
         /// <summary>
@@ -187,6 +256,7 @@
                     lbGuid.Text = strGuid;
                     List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                     gvList.Add(gvMx1);
+                    gvList.Add(gvMx2);
                     UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
                     JObject _job = JObject.Parse(strJson);
                     JArray array = new JArray();
@@ -205,6 +275,23 @@
                     {
                         Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
                     }
+
+                    JArray array2 = new JArray();
+                    foreach (var a in _job["rtnData"]["list2"])
+                    {
+                        array2.Add(a);
+                    }
+                    DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(array2.ToString());
+                    if (dt.Rows.Count > 0)
+                    {
+                        gcMx2.BindingContext = new BindingContext();
+                        gcMx2.DataSource = dt2;
+                        gcMx2.ForceInitialize();
+                    }
+                    else
+                    {
+                        Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
+                    }
                 }
                 else
                     ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);

--
Gitblit v1.9.3