From fa113f04a917e85af84813487f033fb6bc43a5d7 Mon Sep 17 00:00:00 2001 From: lu <123456> Date: 星期六, 20 九月 2025 15:04:35 +0800 Subject: [PATCH] bug --- DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs | 66 ++++++++++++++++++++++----------- 1 files changed, 44 insertions(+), 22 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs index 9b74e45..70b698e 100644 --- a/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs +++ b/DevApp/Gs.DevApp/DevFrm/Work/Frm_Work01.cs @@ -26,7 +26,7 @@ string isWater = "0"; string hostName = "192.168.60.51"; int hostNamePoint = 502; - string strConn = "Data Source=192.168.1.146;Initial Catalog=GS_MES;User ID=mesUser;Password =qixi1qaz@WSXmes"; + string strConn = "Data Source=192.168.1.146,12468;Initial Catalog=GS_MES;User ID=mesUser;Password =qixi1qaz@WSXmes"; bool isCleanDianJian = true; string _webServiceName = "WorkCollect/"; string dianJianPath = "";//鐢垫鍙栧�艰矾寰� @@ -43,12 +43,13 @@ /// <param name="_fGx">宸ュ簭</param> /// <param name="_fBc">鐝</param> /// <param name="_strinOther">鐩墠涓虹數妫�璺緞</param> - public Frm_Work01(string _fGx, string _fBc, string _strinOther) + /// <param name="chkWater">鏄惁姘存</param> + public Frm_Work01(string _fGx, string _fBc, string _strinOther, int chkWater = 0) { InitializeComponent(); try { - string _vanishingSeconds = ConfigurationManager.AppSettings["IsWater"]; + string _vanishingSeconds = chkWater.ToString(); if (!string.IsNullOrEmpty(_vanishingSeconds)) isWater = _vanishingSeconds; } @@ -107,15 +108,43 @@ }; btnBad.Click += (s, e) => { - string _collectGuid = lbCollectGuid.Text.Trim(); + int idx = tabMx.SelectedTabPageIndex; + if (idx > 0) + { + Toast vm = new Toast(-1, "~宸插府浣犲垏鎹㈠埌銆愯壇鍝佹槑缁嗐��,璇烽噸鏂版搷浣渵"); + vm.Show(); + tabMx.SelectedTabPageIndex = 0; + return; + } + string _collectGuid = ""; + string _collCode = ""; + var dr = gvMx1.GetFocusedDataRow(); + if (dr == null || string.IsNullOrEmpty(dr["guid"].ToString())) + { + + } + else + { + _collectGuid = dr["guid"].ToString(); + _collCode = dr["barCode"].ToString(); + } if (_collectGuid.Length < 30) { Toast vm = new Toast(-1, "~璇峰厛閫夋嫨杩芥函鐮亊"); vm.Show(); return; } - string _msg = "浣犲噯澶囧皢銆�" + txt_gdbh.Text + "銆戙��" + txt_currentBarCode.Text.Trim() + "銆戝彉鏇翠负涓嶈壇"; - UcDictionarySelect frm = new UcDictionarySelect("宸ュ簭涓嶈壇鎻忚堪", " a.s_type='宸ュ簭涓嶈壇鎻忚堪' and pid<>'00000000-0000-0000-0000-000000000000'", _msg); + string _msg = "浣犲噯澶囧皢銆�" + _collCode + "銆戝彉鏇翠负涓嶈壇"; + string _type = ""; + if (txt_gx.Text.Trim() == fGxTouRu) + _type = "宸ュ簭G001:鎶曞叆涓嶈壇鎻忚堪"; + if (txt_gx.Text.Trim() == fGxDianJian) + _type = "宸ュ簭G002:鐢垫涓嶈壇鎻忚堪"; + if (txt_gx.Text.Trim() == fGxShouJian) + _type = "宸ュ簭G003:姘存涓嶈壇鎻忚堪"; + if (txt_gx.Text.Trim() == fGxZhongJian) + _type = "宸ュ簭G004:缁堟涓嶈壇鎻忚堪"; + UcDictionarySelect frm = new UcDictionarySelect(_type, " a.s_type='" + _type + "' and pid<>'00000000-0000-0000-0000-000000000000'", _msg); frm.UpdateParent += (ss, ee) => { System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); @@ -133,22 +162,14 @@ vm.Show(); } else - addModel(badTag, _txt, lbCollectGuid.Text.Trim()); + addModel(badTag, _txt, _collectGuid); }; frm.ShowDialog(); + this.ActiveControl = this.txt_barCode; + txt_barCode.Focus(); }; this.ActiveControl = this.txt_barCode; txt_barCode.Focus(); - gvMx1.FocusedRowChanged += (s, e) => - { - if (e.FocusedRowHandle >= 0) - { - DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle); - txt_gdbh.Text = row["gdbh"].ToString(); - txt_currentBarCode.Text = row["barCode"].ToString(); - lbCollectGuid.Text = row["guid"].ToString(); - } - }; } /// <summary> @@ -347,7 +368,8 @@ string _msg = _rtn.rtnMsg; if (!string.IsNullOrEmpty(_msg)) { - Toast vm = new Toast((goodTag == "鈭�" ? 1 : -1), _msg); + // Toast vm = new Toast((goodTag == "鈭�" ? 1 : -1), _msg); 2025-08-20 淇敼鎻愮ず澶栬 + Toast vm = new Toast(1, _rtn.rtnMsg); vm.Show(); } } @@ -418,25 +440,25 @@ { ziduan = "t007", wenben = "鎺ュ湴缁撴灉", - visibleIndex = -1, + visibleIndex = 1, }); _lst.Add(new { ziduan = "t009", wenben = "浜よ�愮粨鏋�", - visibleIndex = -1, + visibleIndex = 1, }); _lst.Add(new { ziduan = "t010", wenben = "娉勬紡缁撴灉", - visibleIndex = -1, + visibleIndex = 1, }); _lst.Add(new { ziduan = "t011", wenben = "鍔熺巼缁撴灉", - visibleIndex = -1, + visibleIndex = 1, }); } if (txt_gx.Text.Trim() == fGxShouJian) -- Gitblit v1.9.3