From b2ae2d8e16c6f8daeb5853d3f31d6895f1bf8a3a Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期六, 30 十一月 2024 15:45:28 +0800
Subject: [PATCH] 1

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs |  116 +++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 94 insertions(+), 22 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs
index ad85e36..14efa46 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;
@@ -86,33 +85,102 @@
             _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>
         ///     瀹℃牳浜嬩欢
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
+        private async void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
         {
             toolBarMenu1.guidKey = "";
             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 = await UtilityHelper.HttpPostAsync("",
+                    _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 async 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);
+            UcLoading _loading = new UcLoading();
+            var _obj = new
+            {
+                guid = rowGuid,
+            };
+            try
+            {
+                var strJson = await UtilityHelper.HttpPostAsync("",
+                    _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);
+            }
+            _loading.Stop();
         }
 
         /// <summary>
@@ -132,8 +200,9 @@
         /// </summary>
         /// <param name="curPage">绗嚑椤�</param>
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
-        private void getPageList(int curPage, int pageSize)
+        private async void getPageList(int curPage, int pageSize)
         {
+            UcLoading _loading = new UcLoading();
             System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
             foreach (FilterEntity itm in _filterList)
             {
@@ -143,7 +212,7 @@
             string json = JsonConvert.SerializeObject(pgq);
             try
             {
-                string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json);
+                string strReturn = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetListPage", json);
                 ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
                 if (dd.rtnCode > 0)
                 {
@@ -167,8 +236,9 @@
             {
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
+            _loading.Stop();
         }
-        private void getModel(string strGuid, bool isEdit, int tabIdx)
+        private async void getModel(string strGuid, bool isEdit, int tabIdx)
         {
             if (string.IsNullOrEmpty(strGuid))
             {
@@ -176,13 +246,14 @@
                 return;
             }
             UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
+            UcLoading _loading = new UcLoading();
             var _obj = new
             {
                 guid = strGuid,//涓诲缓
             };
             try
             {
-                string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
+                string strJson = await UtilityHelper.HttpPostAsync("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
                 ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                 if (_rtn.rtnCode > 0)
                 {
@@ -234,6 +305,7 @@
             {
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
+            _loading.Stop();
         }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3