From a55730702b0b1b541d6ec40cac4469a2418936d5 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 20 十二月 2024 18:50:24 +0800
Subject: [PATCH] 工单打印

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

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemIns.cs
index 0ed0801..e4a9323 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;
@@ -23,7 +22,7 @@
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
-            gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
+            
             getPageList(1, UtilityHelper.GetPageSize());
             pageBar1.PagerEvent += PageBar1_PagerEvent;
             gridView1.CustomDrawRowIndicator += (s, e) =>
@@ -83,33 +82,100 @@
             _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   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;
+            }
+            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);
+            }
+            
+        }
+
+        /// <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>
@@ -129,8 +195,9 @@
         /// </summary>
         /// <param name="curPage">绗嚑椤�</param>
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
-        private void getPageList(int curPage, int pageSize)
+        private   void getPageList(int curPage, int pageSize)
         {
+            
             System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
             foreach (FilterEntity itm in _filterList)
             {
@@ -152,7 +219,6 @@
                     pageBar1.TotalPages = dddd;
                     pageBar1.RecordCount = dd.rtnData.total;//璁板綍鎬绘暟
                     pageBar1.CurrentPage = curPage;//褰撳墠椤�
-                    pageBar1.RowsCount = pageSize;//姣忛〉鏄剧ず
                     pageBar1.setTxt();
                 }
                 else
@@ -164,8 +230,9 @@
             {
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
+            
         }
-        private void getModel(string strGuid, bool isEdit, int tabIdx)
+        private   void getModel(string strGuid, bool isEdit, int tabIdx)
         {
             if (string.IsNullOrEmpty(strGuid))
             {
@@ -173,6 +240,7 @@
                 return;
             }
             UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
+            
             var _obj = new
             {
                 guid = strGuid,//涓诲缓
@@ -187,6 +255,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 +274,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);
@@ -213,6 +299,7 @@
             {
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
+            
         }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3