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

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs |  203 ++++++++++++++++++++------------------------------
 1 files changed, 81 insertions(+), 122 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs
index e74954e..8d78699 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs
@@ -1,4 +1,6 @@
 using DevExpress.XtraEditors;
+using DevExpress.XtraRichEdit.Model;
+using Gs.DevApp.DevFrm.Rpt;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -31,20 +33,22 @@
             toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
+            toolBarMenu1.btnCaiGouChkClick += ToolBarMenu1_btnCaiGouChkClick;
+            toolBarMenu1.btnCaiGouFchkClick += ToolBarMenu1_btnCaiGouFchkClick;
             this.toolBarMenu1.getXmlConfig();
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
             Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "isCheck", "", (value) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
-            });
+            }, tips);
             Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
             {
                 getModel(value);
             }, (value) =>
             {
                 getPageList(this.pageBar1.CurrentPage);
-            });
+            }, lbGuid);
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
             //閫夋嫨搴撳瓨缁勭粐锛堝彉鏄庣粏涓殑鐗╂枡鍜屽彉璐т富锛�
@@ -54,7 +58,8 @@
                 if (string.IsNullOrEmpty(_orgId))
                     return;
                 txt_fCustId.getSuppler(_orgId, _ucKh);
-                txt_fStockId.getSuppler(_orgId, _ucCk);
+                //2025-08-11鍔犱笂鍙兘鏄唬绠′粨
+                txt_fStockId.getSuppler(_orgId, _ucCk, " and a.depot_id in(select [浠撳簱Id] from [dbo].[浠撳簱灞炴� where [鏄惁浠g鑹搧浠揮=1 )");
                 System.Text.StringBuilder sbWhere = new System.Text.StringBuilder();
                 sbWhere.Append(" and a.FSubsidiary ='" + _orgId + "'");
                 var _obj = new PageQueryModel(1, 999999, "item_no", "asc", "", sbWhere.ToString(), "");
@@ -69,50 +74,13 @@
                 }
                 catch (Exception ex)
                 {
-                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                    MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
                 }
-            };
-            gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
-            this.ucBtnPrint1.btnDesignClick += (s, e) =>
-            {
-                ucBtnPrint1.rptParameter = "rpt_Strk{}";
-            };
-            this.ucBtnPrint1.btnReportClick += (s, e) =>
-            {
-                ucBtnPrint1.guidKey = "";
-                string rowGuid = lbMxGuid.Text.Trim();
-                ucBtnPrint1.guidKey = rowGuid;
-                if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim()))
-                {
-                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�");
-                    txt_iCount_1.Focus();
-                    this.ucBtnPrint1.rptParameter = "return false";
-                    return;
-                }
-                if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim()))
-                {
-                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
-                    txt_psnQty_1.Focus();
-                    this.ucBtnPrint1.rptParameter = "return false";
-                    return;
-                }
-                if (lbMxGuid.Text.Trim().Length < 10)
-                {
-                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�");
-                    this.ucBtnPrint1.rptParameter = "return false";
-                    return;
-                }
-                this.ucBtnPrint1.rptParameter = "rpt_Strk{" + lbMxGuid.Text.Trim()
-                       + "," + ""
-                       + "," + ""
-                       + "," + txt_iCount_1.Text.Trim()
-                       + "," + txt_psnQty_1.Text.Trim()
-                       + "}";
             };
         }
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
-            Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
+            _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
             Task.Delay(100);
             getPageList(1);
         }
@@ -149,7 +117,7 @@
             gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
             gridView1.ActiveFilter.Clear();
             gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
-            var frm = new ShowFilter(gridView1.Columns, _filterList);
+            var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName);
             frm.UpdateParent += Frm_UpdateParent;
             frm.ShowDialog();
         }
@@ -185,7 +153,7 @@
                 lbGuid, txt_billNo, gridView1, "billNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
@@ -203,17 +171,19 @@
                 var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                 if (_rtn.rtnCode > 0)
                 {
+                    MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
                     if (xtraTabControl1.SelectedTabPageIndex == 0)
                     { }
                     else
                         Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                     getPageList(this.pageBar1.CurrentPage);
                 }
-                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                else
+                    MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
             }
             catch (Exception ex)
             {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
 
@@ -251,7 +221,7 @@
                 lbGuid, txt_billNo, gridView1);
             if (string.IsNullOrEmpty(rowGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -266,6 +236,9 @@
                 gvList.Add(gvMx2);
                 UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
             }
+            //2025/07/12鍔犱笂淇敼鐘舵�佷笅涓嶈兘淇敼
+            txt_fStockOrgId.IsReadly = true;
+            txt_fCustId.IsReadly = true;
         }
         /// <summary>
         /// 鏂板浜嬩欢
@@ -282,6 +255,8 @@
             UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
+            //澧炲姞鏃讹紝榛樿缁勭粐
+            string deftOrg = UtilityHelper.GetFirstOrg(txt_fStockOrgId);
         }
         /// <summary>
         /// 淇濆瓨浜嬩欢
@@ -294,22 +269,22 @@
             string kcZz = txt_fStockOrgId.GetId();//搴撳瓨缁勭粐
             string inRkyy = txt_remark.Text.Trim();//鍘熷洜
             string kcCk = txt_fStockId.GetId();//浠撳簱
-            string kh=txt_fCustId.GetId();//瀹㈡埛
+            string kh = txt_fCustId.GetId();//瀹㈡埛
             if (string.IsNullOrEmpty(kcZz))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨搴撳瓨缁勭粐锛�");
+                Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨搴撳瓨缁勭粐锛�");
                 txt_fStockOrgId.Focus();
                 return;
             }
             if (string.IsNullOrEmpty(kcCk))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鏀舵枡浠撳簱锛�");
+                Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鏀舵枡浠撳簱锛�");
                 txt_fStockId.Focus();
                 return;
             }
             if (string.IsNullOrEmpty(kh))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨瀹㈡埛锛�");
+                Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨瀹㈡埛锛�");
                 txt_fCustId.Focus();
                 return;
             }
@@ -319,10 +294,11 @@
                 kcZz = kcZz,//搴撳瓨缁勭粐
                 kcCk = kcCk,//搴撳瓨浠撳簱
                 inRkyy = inRkyy,//鍏ュ簱鍘熷洜
-                kh= kh,
+                kh = kh,
                 list = new List<dynamic>(),
             };
             gvMx1.CloseEditor();
+            gvMx1.PostEditor();
             gvMx1.UpdateCurrentRow();
             if (gvMx1.DataRowCount <= 0)
             {
@@ -354,9 +330,9 @@
             {
                 string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj));
                 ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
                 if (_rtn.rtnCode > 0)
                 {
+                    ToolBox.MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
                     lbGuid.Text = _rtn.rtnData.outGuid;
                     txt_billNo.Text = _rtn.rtnData.outNo;
                     toolBarMenu1.isSetBtn = true;
@@ -365,11 +341,14 @@
                     gvList.Add(gvMx2);
                     UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
                     toolBarMenu1.currentAction = "";
+                    Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
                 }
+                else
+                    ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
             }
             catch (Exception ex)
             {
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
 
@@ -380,7 +359,7 @@
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
         private void getPageList(int curPage)
         {
-            var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+            gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
             PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "billNo", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
             try
@@ -396,7 +375,7 @@
                     {
                         gcMain1.DataSource = dt;
                         gcMain1.ForceInitialize();
-                        gridView1.BestFitColumns();
+                        gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
                     }
                     else
                         UtilityHelper.SetDefaultTable(gcMain1, gridView1);
@@ -417,12 +396,13 @@
         }
         private void getModel(string strGuid)
         {
+            gcMx1.DataSource = null;
             bool isEdit = false;
             if (toolBarMenu1.currentAction == "add") return;
             if (toolBarMenu1.currentAction == "edit") isEdit = true;
             if (string.IsNullOrEmpty(strGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             var _obj = new
@@ -457,6 +437,7 @@
                         gcMx1.DataSource = dt;
                         gcMx1.ForceInitialize();
                         gvMx1.BestFitColumns();
+                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
                     }
                     else
                     {
@@ -474,6 +455,7 @@
                         gcMx2.DataSource = dt2;
                         gcMx2.ForceInitialize();
                         gvMx2.BestFitColumns();
+                        Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx2);
                     }
                     else
                     {
@@ -481,11 +463,11 @@
                     }
                 }
                 else
-                    ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                    ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
             }
             catch (Exception ex)
             {
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
 
@@ -531,13 +513,15 @@
                     var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                     if (_rtn.rtnCode > 0)
                     {
-                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
+                        MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg);
+                        getModel(lbGuid.Text);
                     }
-                    MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+                    else
+                        MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
                 }
                 catch (Exception ex)
                 {
-                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                    MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
                 }
             }
         }
@@ -562,7 +546,25 @@
         {
             _toolCk(0);
         }
+        /// <summary>
+        /// 閲囪喘瀹℃牳
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnCaiGouChkClick(object sender, EventArgs e)
+        {
+            _toolCk(40);
+        }
+        /// <summary>
+        /// 閲囪喘鍙嶅鏍�
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
 
+        private void ToolBarMenu1_btnCaiGouFchkClick(object sender, EventArgs e)
+        {
+            _toolCk(41);
+        }
         /// <summary>
         /// 宸ュ叿鏉′簨浠�
         /// </summary>
@@ -578,14 +580,21 @@
                 case 0:
                     strMsg = "鍙嶅鏍�";
                     break;
-            };
+                case 40:
+                    strMsg = "閲囪喘瀹℃牳";
+                    break;
+                case 41:
+                    strMsg = "閲囪喘鍙嶅鏍�";
+                    break;
+            }
+            ;
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
                lbGuid, txt_billNo, gridView1, "billNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
@@ -601,75 +610,25 @@
                     _webServiceName + "EditModelSubmit",
                     JsonConvert.SerializeObject(_obj));
                 var _rtn = UtilityHelper.ReturnToDynamic(strJson);
-                MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
                 if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
                 {
+                    MsgHelper.ShowInformation(_rtn.rtnData.outMsg.ToString());
                     if (xtraTabControl1.SelectedTabPageIndex == 1)
                     {
                         getModel(lbGuid.Text.Trim());
                     }
-                    int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+                    //娉ㄦ剰锛岃繖閲屽拰鍏跺畠椤甸潰鏈夌偣涓嶄竴鏍�
+                    getPageList(this.pageBar1.CurrentPage);
+                    int rowHandle = gridView1.LocateByValue("guid", rowGuid);
                     gridView1.FocusedRowHandle = rowHandle;
-                    UtilityHelper.SetCheckIco(gridView1, "isCheck", "checkBy", "checkDate", picCheckBox, this, _inFieldValue.ToString());
+                  
                 }
+                else
+                    MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString());
             }
             catch (Exception ex)
             {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-            }
-        }
-        private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
-        {
-            if (e.FocusedRowHandle >= 0)
-            {
-                DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
-                lbMxGuid.Text = row["guid"].ToString();
-                ucBtnPrint1.guidKey = row["guid"].ToString();
-                txtWlid.Text = row["itemNo"].ToString();
-                txtWlgg.Text = row["itemModel"].ToString();
-                txtWlmc.Text = row["itemName"].ToString();
-                txtQuantity.Text = row["sqsl"].ToString();//鐢宠鎬婚噺
-                txtYdy.Text = row["ydy"].ToString();//宸叉墦鍗版�婚噺
-                txtKdy.Text = row["kdy"].ToString();//鍙墦鍗版�婚噺
-            }
-        }
-        /// <summary>
-        /// 绉诲嚭鏉$爜
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
-        {
-            var rowhandle = gvMx2.FocusedRowHandle;
-            if (rowhandle < 0)
-                return;
-            if (e.Button.Index == 0)
-            {
-                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);
-                }
+                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
     }

--
Gitblit v1.9.3