From f23d33d0cf77a73d449cd7c38effda9e50c8fda4 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 06 三月 2025 08:13:37 +0800
Subject: [PATCH] 版面

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs |  152 +++++++++++++++++++++-----------------------------
 1 files changed, 63 insertions(+), 89 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
index e406242..edd3337 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
@@ -20,8 +20,9 @@
             InitializeComponent();
             this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
-            //toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick;
-            //toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick;
+            List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+            gvList.Add(gridView1);
+            Gs.DevApp.ToolBox.UtilityHelper.getGridViewConfig(this.GetType().FullName, gvList);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) =>
@@ -37,26 +38,12 @@
             });
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-            txt_depotsId.getSuppler("");
-            txt_suppId.getSuppler("");
-            //璁剧疆浠撳簱閫夋嫨
-            this.txt_depotsId.EditChanged += (s, e) =>
-            {
-                txtDepotsId.Text = this.txt_depotsId.GetId();
-            };
-            //璁剧疆渚涘簲鍟嗛�夋嫨
-            this.txt_suppId.EditChanged += (s, e) =>
-            {
-                txtSupplierId.Text = this.txt_suppId.GetId();
-            };
-            gcMx1.MouseClick += GcMx1_MouseClick;
             this.ucBtnPrint1.btnDesignClick += (s, e) =>
             {
                 ucBtnPrint1.rptParameter = "rpt_Arrival{}";
             };
             this.ucBtnPrint1.btnReportClick += (s, e) =>
             {
-                ucBtnPrint1.guidKey = "";
                 string rowGuid = lbMxGuid.Text.Trim();
                 ucBtnPrint1.guidKey = rowGuid;
                 if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim()))
@@ -85,31 +72,31 @@
                        + "," + txt_iCount_1.Text.Trim()
                        + "," + txt_psnQty_1.Text.Trim()
                        + "}";
+                txt_iCount_1.Text = "";
+                txt_psnQty_1.Text = "";
             };
+            gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
         }
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
-            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
+            Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
             Task.Delay(100);
             getPageList(1);
         }
-        private void GcMx1_MouseClick(object sender, MouseEventArgs e)
+        private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
         {
-            string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "guid");
-            if (string.IsNullOrEmpty(rowGuid))
-                return;
-            lbMxGuid.Text = rowGuid;
-            toolBarMenu1.guidKey = rowGuid;
-            var info = gvMx1.CalcHitInfo(e.Location);
-            var view = info.View;
-            var row = view.GetDataRow(info.RowHandle);
-            txtWlid.Text = row["itemId"].ToString();
-            txtWlgg.Text = row["itemModel"].ToString();
-            txtWlmc.Text = row["itemName"].ToString();
-            txtQuantity.Text = row["Quantity"].ToString();
-            kyPrtQty.Text = row["kyPrtQty"].ToString();
+            if (e.FocusedRowHandle >= 0)
+            {
+                DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
+                lbMxGuid.Text = row["guid"].ToString();
+                txtWlid.Text = row["itemNo"].ToString();
+                txtWlgg.Text = row["itemModel"].ToString();
+                txtWlmc.Text = row["itemName"].ToString();
+                txtQuantity.Text = row["quantity"].ToString();//鏈鏀惰揣鎬婚噺
+                txtYdy.Text = row["yQty"].ToString();//宸叉墦鍗版�婚噺
+                txtKdy.Text = row["kQty"].ToString(); //鍙墦鍗版�婚噺
+            }
         }
-
         /// <summary>
         /// 鍒嗛〉浜嬩欢
         /// </summary>
@@ -143,19 +130,6 @@
             _filterList = e.FilterList;
             getPageList(1);
         }
-        private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e)
-        {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_billNo, gridView1);
-            toolBarMenu1.guidKey = rowGuid;
-            toolBarMenu1.rptParameter = "rpt_Arrival{}";
-        }
-        private void ToolBarMenu1_btnReportClick(object sender, EventArgs e)
-        {
-            _print();
-        }
 
         /// <summary>
         /// 鍒锋柊浜嬩欢
@@ -168,14 +142,15 @@
                 getModel(lbGuid.Text.Trim());
             else
             {
-                _filterList.Clear();
-                if (gridView1.ActiveFilter.Count > 0)
-                {
-                    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
-                    gridView1.ActiveFilter.Clear();
-                    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
-                }
-                getPageList(1);
+                //_filterList.Clear();
+                //if (gridView1.ActiveFilter.Count > 0)
+                //{
+                //    gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+                //    gridView1.ActiveFilter.Clear();
+                //    gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+                //}
+                //getPageList(1);
+                getPageList(this.pageBar1.CurrentPage);
             }
         }
         /// <summary>
@@ -203,6 +178,7 @@
                     {
                         gcMain.DataSource = dt;
                         gcMain.ForceInitialize();
+                        gridView1.BestFitColumns();
                     }
                     else
                         UtilityHelper.SetDefaultTable(gcMain, gridView1);
@@ -223,6 +199,7 @@
         }
         private void getModel(string strGuid)
         {
+            gcMx1.DataSource = null;
             bool isEdit = false;
             if (toolBarMenu1.currentAction == "add") return;
             if (toolBarMenu1.currentAction == "edit") isEdit = true;
@@ -252,12 +229,14 @@
                     {
                         array1.Add(a);
                     }
+
                     DataTable dt1 = JsonConvert.DeserializeObject<DataTable>(array1.ToString());
                     if (dt1.Rows.Count > 0)
                     {
                         gcMx1.BindingContext = new BindingContext();
                         gcMx1.DataSource = dt1;
                         gcMx1.ForceInitialize();
+                        gvMx1.BestFitColumns();
                     }
                     else
                     {
@@ -274,6 +253,7 @@
                         gcMx2.BindingContext = new BindingContext();
                         gcMx2.DataSource = dt2;
                         gcMx2.ForceInitialize();
+                        gvMx2.BestFitColumns();
                     }
                     else
                     {
@@ -288,46 +268,40 @@
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
-        private void _print()
+
+        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
         {
-            toolBarMenu1.guidKey = "";
-            string rowGuid, rowName;
-            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_billNo, gridView1);
-            toolBarMenu1.guidKey = rowGuid;
-            if (xtraTabControl1.SelectedTabPageIndex == 0)
-            {
-                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 5);
-                this.toolBarMenu1.rptParameter = "return false";
+            var rowhandle = gvMx2.FocusedRowHandle;
+            if (rowhandle < 0)
                 return;
-            }
-            if (lbMxGuid.Text.Trim().Length < 36)
+            if (e.Button.Index == 0)
             {
-                Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨浣犺鎵撳嵃鐨勮锛�");
-                this.toolBarMenu1.rptParameter = "return false";
-                return;
+                var dr = gvMx2.GetDataRow(rowhandle);
+                var mxGuid = dr["guid"].ToString();
+                if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
+                    return;
+                var _obj = new
+                {
+                    mxGuid = mxGuid,
+                    inType = "dhtm"
+                };
+                try
+                {
+                    var strJson = UtilityHelper.HttpPost("",
+                        _webServiceName + "DeleteBarcode",
+                        JsonConvert.SerializeObject(_obj));
+                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                    if (_rtn.rtnCode > 0)
+                    {
+                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
+                    }
+                    MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                }
+                catch (Exception ex)
+                {
+                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                }
             }
-            if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim()))
-            {
-                Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�");
-                txt_iCount_1.Focus();
-                this.toolBarMenu1.rptParameter = "return false";
-                return;
-            }
-            if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim()))
-            {
-                Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
-                txt_psnQty_1.Focus();
-                this.toolBarMenu1.rptParameter = "return false";
-                return;
-            }
-            toolBarMenu1.guidKey = lbMxGuid.Text;
-            this.toolBarMenu1.rptParameter = "rpt_Arrival{" + ""
-                   + "," + ""
-                   + "," + ""
-                   + "," + txt_iCount_1.Text.Trim()
-                   + "," + txt_psnQty_1.Text.Trim()
-                   + "}";
         }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3