From b7d9f2e23cbda587d814c7d07c1664c053c83dcb Mon Sep 17 00:00:00 2001
From: cdk <2441919651@qq.com>
Date: 星期二, 12 八月 2025 13:58:07 +0800
Subject: [PATCH] Merge branch 'master' of http://git.gs-mes.com:8080/r/~tjx/GsMesClient

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs |  171 +++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 107 insertions(+), 64 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesShouTuo.cs
index aa000fa..8ffc01c 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,6 +33,8 @@
             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);
@@ -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 [鏄惁Dgc]=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,7 +74,7 @@
                 }
                 catch (Exception ex)
                 {
-                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                    MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
                 }
             };
             gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
@@ -105,12 +110,55 @@
                        + "," + txt_psnQty_1.Text.Trim()
                        + "}";
             };
+            this.ucBtnPrint1.btnAllClick += (s, e) =>
+            {
+                string rowGuid = lbMxGuid.Text.Trim();
+                if (rowGuid.Length < 10)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�");
+                    this.ucBtnPrint1.rptParameter = "return false";
+                    return;
+                }
+                SelectDeleteBar frm = new SelectDeleteBar(rowGuid, QcSeason.鍙楁墭鍏ュ簱.ToString());
+                string strCodeList = "";
+                string strAction = "";
+                frm.UpdateParent += (ss, ee) =>
+                {
+                    strCodeList = ee.StringSingle;
+                    strAction = ee.Data;
+                };
+                frm.ShowDialog();
+                if (string.IsNullOrEmpty(strCodeList))
+                    return;
+                if (strAction == "print")
+                {
+                    try
+                    {
+                        string rptParameter = "rpt_Strk{"
+                        + "100"
+                        + "," + ""
+                        + "," + ""
+                        + "," + ""
+                        + "," + ""
+                        + "," + strCodeList
+                        + "}";
+                        using (Form rpt = new RptPreview(rowGuid, rptParameter))
+                        {
+                            rpt.ShowDialog();
+                        }
+                        frm.Close();
+                    }
+                    catch (Exception ex)
+                    {
+                        MsgHelper.ShowError(ex.Message);
+                    }
+                }
+            };
             //鑷姩璁$畻鎵撳嵃閲�
             txt_psnQty_1.TextChanged += (s, e) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.PrintJiSuan(txt_psnQty_1, txt_iCount_1, txt_kQty.Text.Trim(), radOut, txt_yuliang_1);
             };
-
             radOut.SelectedIndexChanged += (s, e) =>
             {
                 Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut, txt_yuliang_1);
@@ -191,7 +239,7 @@
                 lbGuid, txt_billNo, gridView1, "billNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
@@ -209,17 +257,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);
             }
         }
 
@@ -257,7 +307,7 @@
                 lbGuid, txt_billNo, gridView1);
             if (string.IsNullOrEmpty(rowGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -272,6 +322,9 @@
                 gvList.Add(gvMx2);
                 UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
             }
+            //2025/07/12鍔犱笂淇敼鐘舵�佷笅涓嶈兘淇敼
+            txt_fStockOrgId.IsReadly = true;
+            txt_fCustId.IsReadly = true;
         }
         /// <summary>
         /// 鏂板浜嬩欢
@@ -305,19 +358,19 @@
             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;
             }
@@ -363,9 +416,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;
@@ -376,10 +429,12 @@
                     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);
             }
         }
 
@@ -390,7 +445,7 @@
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
         private void getPageList(int curPage)
         {
-            gcMain1.DataSource = null;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
@@ -433,7 +488,7 @@
             if (toolBarMenu1.currentAction == "edit") isEdit = true;
             if (string.IsNullOrEmpty(strGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             var _obj = new
@@ -494,11 +549,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);
             }
         }
 
@@ -544,13 +599,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);
                 }
             }
         }
@@ -575,7 +632,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>
@@ -591,14 +666,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 + "鍚楋紵"))
@@ -614,9 +696,9 @@
                     _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());
@@ -625,10 +707,12 @@
                     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);
+                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
         }
         private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
@@ -657,47 +741,6 @@
                 txt_kQty.Text = "";
                 txt_psnQty_1.Text = "";
                 txt_iCount_1.Text = "";
-            }
-        }
-        /// <summary>
-        /// 閲嶆墦鏉$爜
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
-        {
-            MsgHelper.ShowInformation("鍔熻兘寮�鍙戜腑锛�");
-            return;
-            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("",
-                           "VArrivalBarcodeManager/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);
-                }
             }
         }
     }

--
Gitblit v1.9.3