From 2274820fde74016fca9b11355db8fd862317c8ab Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期五, 10 十月 2025 17:18:15 +0800
Subject: [PATCH] bug

---
 DevApp/Gs.DevApp/DevFrm/WW/WwBlcl.cs |  170 +++++++++++++++++++++++---------------------------------
 1 files changed, 71 insertions(+), 99 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/WW/WwBlcl.cs b/DevApp/Gs.DevApp/DevFrm/WW/WwBlcl.cs
index 81d4769..31b2039 100644
--- a/DevApp/Gs.DevApp/DevFrm/WW/WwBlcl.cs
+++ b/DevApp/Gs.DevApp/DevFrm/WW/WwBlcl.cs
@@ -1,5 +1,4 @@
-锘縰sing DevExpress.XtraEditors;
-using Gs.DevApp.Entity;
+锘縰sing Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
 using Newtonsoft.Json;
@@ -9,12 +8,10 @@
 using System.Data;
 using System.Threading.Tasks;
 using System.Windows.Forms;
-
 namespace Gs.DevApp.DevFrm.WW
 {
     public partial class WwBlcl : DevExpress.XtraEditors.XtraUserControl
     {
-        string _ucCk = "";//浠撳簱
         string _webServiceName = "WWBlManager/";
         List<FilterEntity> _filterList = new List<FilterEntity>();
         public string strType = "";
@@ -55,42 +52,46 @@
             }, lbGuid);
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-            //璁剧疆缁勭粐
-            this.txt_orgId.EditChanged += (s, e) =>
+            //閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏
+            btnSelect.Click += (s, e) =>
             {
-                string orgdId = txt_orgId.GetId();
-                if (string.IsNullOrEmpty(orgdId)) return;
-                txt_bl010.getSuppler(orgdId, _ucCk);
-            };
-            //閫夋嫨濮斿宸ュ崟
-            this.txt_aboutGuid.EditChanged += (s, e) =>
-            {
-                string strGdId = txt_aboutGuid.GetId();
-                if (string.IsNullOrEmpty(strGdId)) return;
-                txt_bl002.Text = txt_aboutGuid.GetPrdNo();
-                txt_bl014.Text = txt_aboutGuid.GetPrdName();
-                txt_bl015.Text = txt_aboutGuid.GetPrdModel();
-                txt_bl013.Text = txt_aboutGuid.GetRwd();
-                var _obj = new
+                var frm = new UcWwBlclSelectAll();
+                //璧嬪�肩粰鏄庣粏琛�
+                frm.UpdateParent += (ss, ee) =>
                 {
-                    currentPage = 1,
-                    everyPageSize = 999999,
-                    sortName = "",
-                    keyWhere = "",
-                    inP1 = strGdId
+                    try
+                    {
+                        var lst = ee.DynamicList;
+                        DataTable _Table = (DataTable)gcMx1.DataSource;
+                        int idx = 1;
+                        foreach (dynamic dym in lst)
+                        {
+                            DataRow _row = _Table.NewRow();
+                            _row["bld002"] = dym.itemNo;//鐗╂枡缂栧彿 
+                            _row["bld003"] = dym.itemName;//鐗╂枡鍚嶇О
+                            _row["bld004"] = dym.itemModel;//瑙勬牸鍨嬪彿
+                            _row["dabGuid"] = dym.dabGuid;
+                            _row["xlsl"] = dym.dab006;
+                            _row["bld008"] = dym.dab007;//宸查鐢ㄩ噺
+                            _row["bld009"] = dym.dwName;//鍗曚綅
+                            _row["bld001"] = dym.bld001;//宸ュ崟鍙�
+                            _Table.Rows.Add(_row);
+                            idx++;
+                        }
+                        gcMx1.BindingContext = new BindingContext();
+                        gcMx1.DataSource = _Table;
+                        gcMx1.ForceInitialize();
+                        gvMx1.CloseEditor();
+                        gvMx1.PostEditor();
+                        gvMx1.UpdateCurrentRow();
+                        gvMx1.BestFitColumns();
+                    }
+                    catch (Exception ex)
+                    {
+                        MessageBox.Show(ex.Message);
+                    }
                 };
-                var json = JsonConvert.SerializeObject(_obj);
-                try
-                {
-                    var strReturn = UtilityHelper.HttpPost("", "WWBlManager/SelectFormMx", json);
-                    var rtn = UtilityHelper.ReturnToTablePage(strReturn);
-                    var dt = rtn.rtnData.list;
-                    this.repositoryItemSearchLookUpEdit1.DataSource = dt;
-                }
-                catch (Exception ex)
-                {
-                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
-                }
+                frm.ShowDialog();
             };
         }
         private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
@@ -134,7 +135,6 @@
                 parentForm = this.Parent as Form;
             else
                 parentForm = this.Parent.Parent as Form;
-
             gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
             gridView1.ActiveFilter.Clear();
             gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
@@ -175,7 +175,7 @@
                 lbGuid, txt_blNo, gridView1, "blNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
@@ -193,20 +193,20 @@
                 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);
             }
-
         }
 
         /// <summary>
@@ -242,7 +242,7 @@
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_blNo, gridView1, "blNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
@@ -270,7 +270,6 @@
             gridViews.Add(gvMx1);
             UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
-
         }
         /// <summary>
         /// 淇濆瓨浜嬩欢
@@ -280,39 +279,15 @@
         private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
         {
             toolBarMenu1.isSetBtn = false;
-            string inGdId = txt_aboutGuid.GetId();//宸ュ崟鍙�
-            string inCkId = txt_bl010.GetId();//鍙戞枡浠�
-            string inFlOrg = txt_orgId.GetId();//鍙戞枡缁勭粐
-            if (string.IsNullOrEmpty(inFlOrg))
-            {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍙戞枡缁勭粐锛�");
-                txt_orgId.Focus();
-                return;
-            }
-            if (string.IsNullOrEmpty(inGdId))
-            {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨宸ュ崟锛�");
-                txt_aboutGuid.Focus();
-                return;
-            }
-            if (string.IsNullOrEmpty(inCkId))
-            {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�");
-                txt_bl010.Focus();
-                return;
-            }
             if (string.IsNullOrEmpty(txt_bl017.Text.Trim()))
             {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍗曟嵁绫诲瀷锛�");
+                Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鍗曟嵁绫诲瀷锛�");
                 txt_bl017.Focus();
                 return;
             }
             var _obj = new
             {
                 guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
-                inOrgId = inFlOrg,//鍙戞枡缁勭粐
-                inGdId = inGdId,//宸ュ崟鍙�
-                inCkId = inCkId,//浠撳簱
                 inYy = txt_bl007.Text.Trim(),//鍘熷洜
                 inType = txt_bl017.Text.Trim(),//鍑哄簱绫诲埆
                 list = new List<dynamic>(),
@@ -351,9 +326,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_blNo.Text = _rtn.rtnData.outNo;
                     toolBarMenu1.isSetBtn = true;
@@ -363,10 +338,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);
             }
         }
 
@@ -377,8 +354,12 @@
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
         private void getPageList(int curPage)
         {
-            gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
-            _sbSqlWhere += " and a.bl008='" + strType + "'";
+            gcMain1.DataSource = null;
+            System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
+            _sbSqlWhere.Append("  and a.bl008='" + strType + "'");
+            _sbSqlWhere.Append(" and a.org_id in");
+            _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere());
+            _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList));
             PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
             try
@@ -421,7 +402,7 @@
             if (toolBarMenu1.currentAction == "edit") isEdit = true;
             if (string.IsNullOrEmpty(strGuid))
             {
-                ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             var _obj = new
@@ -435,12 +416,10 @@
                 if (_rtn.rtnCode > 0)
                 {
                     dynamic dy = _rtn.rtnData;
-                    _ucCk = dy.bl010;
                     lbGuid.Text = strGuid;
                     List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
                     gvList.Add(gvMx1);
                     UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
-                    _ucCk = "";
                     JObject _job = JObject.Parse(strJson);
                     JArray array = new JArray();
                     foreach (var a in _job["rtnData"]["list"])
@@ -461,11 +440,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);
             }
         }
 
@@ -506,13 +485,14 @@
                 case 0:
                     strMsg = "鍙嶅鏍�";
                     break;
-            };
+            }
+            ;
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_blNo, gridView1, "blNo");
             if (string.IsNullOrEmpty(rowGuid))
             {
-                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
             if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
@@ -528,9 +508,10 @@
                     _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());
@@ -540,23 +521,13 @@
                     Form parentForm = this.FindForm();
                     UtilityHelper.SetCheckIco(gridView1, "bl018", "bl016", "bl006", picCheckBox, parentForm, _inFieldValue.ToString());
                 }
+                else
+                    MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString());
             }
             catch (Exception ex)
             {
-                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
-        }
-
-        private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e)
-        {
-            SearchLookUpEdit LookupEdit = sender as SearchLookUpEdit;
-            DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow();
-            gvMx1.SetFocusedRowCellValue("bld002", SelectedDataRow["itemNo"]);
-            gvMx1.SetFocusedRowCellValue("bld003", SelectedDataRow["itemName"]);
-            gvMx1.SetFocusedRowCellValue("bld004", SelectedDataRow["itemModel"]);
-            gvMx1.SetFocusedRowCellValue("dabGuid", SelectedDataRow["dabGuid"]);
-            gvMx1.SetFocusedRowCellValue("bld008", SelectedDataRow["dab007"]);//宸查鐢ㄩ噺
-            gvMx1.SetFocusedRowCellValue("bld009", SelectedDataRow["dwName"]);//鍗曚綅
         }
 
         private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
@@ -588,16 +559,17 @@
                     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);
                 }
             }
         }
-
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3