From 1544b9ba3902d93a3d701db3656227cc3b46dce8 Mon Sep 17 00:00:00 2001 From: lu <123456> Date: 星期五, 01 八月 2025 14:45:09 +0800 Subject: [PATCH] 过站bug --- DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkTechnique.cs | 114 +++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 75 insertions(+), 39 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkTechnique.cs b/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkTechnique.cs index dfac085..7a2d27c 100644 --- a/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkTechnique.cs +++ b/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkTechnique.cs @@ -1,4 +1,4 @@ -锘� +锘縰sing Gs.DevApp.DevFrm.QC; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Gs.DevApp.UserControl; @@ -9,7 +9,6 @@ using System.Data; using System.Threading.Tasks; using System.Windows.Forms; - namespace Gs.DevApp.DevFrm.Work { @@ -42,7 +41,6 @@ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) => { - }); getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; @@ -62,8 +60,8 @@ _row["fSeq"] = dym.fSeq; _row["statStatus"] = "Y-鏄�"; _row["collectionName"] = "绌�"; - _row["processNo"] = dym.processNo+":"+ dym.processName; - //_row["processName"] = dym.processName; + _row["processNo"] = dym.processNo; + _row["processName"] = dym.processName; _Table.Rows.Add(_row); } gcMx1.BindingContext = new BindingContext(); @@ -76,12 +74,28 @@ } catch (Exception ex) { - MessageBox.Show(ex.Message); + Gs.DevApp.ToolBox.MsgHelper.ShowError(ex.Message); } }; frm.ShowDialog(); }; _getListJyxm(); + //澶嶅埗 + btnCopy.Click += (s, e) => + { + if ((lbGuid.Text.Trim().Length < 10)) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛淇濆瓨褰撳墠淇℃伅锛�"); + return; + } + if ((txt_isCheck.Checked == false)) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇ラ」鐩湭瀹℃牳锛屾殏涓嶈兘澶嶅埗鍒板叾瀹冪墿鏂欙紒"); + return; + } + Frm_WorkTechniqueShow frm = new Frm_WorkTechniqueShow(lbGuid.Text.Trim()); + frm.ShowDialog(); + }; } private void GridView1_ColumnFilterChanged(object sender, EventArgs e) @@ -156,7 +170,7 @@ private void getPageList(int curPage) { gcMain1.DataSource = null; - gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); + gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "org.FNumber asc ,a.item_no asc", "", "", _sbSqlWhere.ToString()); var json = JsonConvert.SerializeObject(pgq); @@ -190,7 +204,7 @@ } catch (Exception ex) { - MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } } @@ -224,6 +238,7 @@ List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); gvList.Add(gvMx1); UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList); + this.btnCopy.Enabled = true; } /// <summary> /// 淇濆瓨浜嬩欢 @@ -233,53 +248,63 @@ private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) { toolBarMenu1.isSetBtn = false; - if (txt_fType.SelectedIndex <= 0) - { - Gs.DevApp.ToolBox.MsgHelper.ShowInformation("鐢熶骇绫诲瀷涓嶈兘涓虹┖锛�"); - txt_fType.Focus(); - return; - } + //if (txt_fType.SelectedIndex <0) + //{ + // Gs.DevApp.ToolBox.MsgHelper.ShowError("鐢熶骇绫诲瀷涓嶈兘涓虹┖锛�"); + // txt_fType.Focus(); + // return; + //} if (txt_fJingDu.SelectedIndex < 0) { - Gs.DevApp.ToolBox.MsgHelper.ShowInformation("绠$悊绮惧害涓嶈兘涓虹┖锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("绠$悊绮惧害涓嶈兘涓虹┖锛�"); txt_fJingDu.Focus(); return; } + txt_fBegDate.DateTime = new DateTime(2025, 1, 1); + txt_fEndDate.DateTime = new DateTime(2099, 1, 1); + txt_fSumPeople.Text = "0"; if (txt_fBegDate.Text.Length <= 0) { - Gs.DevApp.ToolBox.MsgHelper.ShowInformation("鐢熸晥鏃ユ湡涓嶈兘涓虹┖锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("鐢熸晥鏃ユ湡涓嶈兘涓虹┖锛�"); txt_fBegDate.Focus(); return; } if (txt_fEndDate.Text.Length > 0 && txt_fBegDate.DateTime > txt_fEndDate.DateTime) { - Gs.DevApp.ToolBox.MsgHelper.ShowInformation("鐢熸晥鏃ユ湡涓嶈兘澶т簬澶辨晥鏃ユ湡锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("鐢熸晥鏃ユ湡涓嶈兘澶т簬澶辨晥鏃ユ湡锛�"); txt_fEndDate.Focus(); return; } decimal num = 0; int num2 = 0; if (!int.TryParse(txt_fSumPeople.Text.Trim(), out num2)) { - Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇疯緭鍏ユ纭殑瀹氬憳锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇疯緭鍏ユ纭殑瀹氬憳锛�"); txt_fSumPeople.Focus(); return; } if (!decimal.TryParse(txt_fCapacity.Text.Trim(), out num)) { - Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇疯緭鍏ユ纭殑浜ц兘锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇疯緭鍏ユ纭殑浜ц兘锛�"); txt_fCapacity.Focus(); return; } if (!decimal.TryParse(txt_fMaxWeight.Text.Trim(), out num)) { - Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇疯緭鍏ユ纭殑閲嶉噺涓婇檺锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇疯緭鍏ユ纭殑閲嶉噺涓婇檺锛�"); txt_fMaxWeight.Focus(); return; } if (!decimal.TryParse(txt_fMinWeight.Text.Trim(), out num)) { - Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇疯緭鍏ユ纭殑閲嶉噺涓嬮檺锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇疯緭鍏ユ纭殑閲嶉噺涓嬮檺锛�"); txt_fMinWeight.Focus(); return; + } + //涓婇檺涓嶈兘浣庝簬涓嬮檺 + if (decimal.Parse(txt_fMaxWeight.Text.Trim()) < decimal.Parse(txt_fMinWeight.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("涓婇檺涓嶈兘浣庝簬涓嬮檺锛�"); + txt_fMaxWeight.Focus(); return; } var _obj = new { guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 - fType = txt_fType.Text.Trim(), + // fType = txt_fType.Text.Trim(), + fType = "F-閲忎骇", fBegDate = txt_fBegDate.Text.Trim(), fEndDate = txt_fEndDate.Text.Trim(), fJingDu = txt_fJingDu.Text.Trim(), @@ -313,20 +338,22 @@ { 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); toolBarMenu1.isSetBtn = true; List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); gvList.Add(gvMx1); UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList); toolBarMenu1.currentAction = ""; - //Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); + //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); } } @@ -341,12 +368,16 @@ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_itemNo, gridView1); if (string.IsNullOrEmpty(rowGuid)) { - ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } getModel(rowGuid); - } + + /// <summary> + /// 璇诲彇瀹炰綋 + /// </summary> + /// <param name="strGuid"></param> private void getModel(string strGuid) { bool isEdit = false; @@ -354,7 +385,7 @@ if (toolBarMenu1.currentAction == "edit") isEdit = true; if (string.IsNullOrEmpty(strGuid)) { - MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } var _obj = new @@ -374,6 +405,7 @@ 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); + this.btnCopy.Enabled = true; JObject _job = JObject.Parse(strJson); JArray array = new JArray(); foreach (var a in _job["rtnData"]["list"]) @@ -396,12 +428,12 @@ } else { - MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg); } } catch (Exception ex) { - MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } } @@ -427,10 +459,10 @@ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_itemNo, gridView1, "itemNo"); if (string.IsNullOrEmpty(rowGuid)) { - MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵")) + if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝璇ユ搷浣滃皢浼氬奖鍝嶅埌銆怐:寰呭紑宸ャ�戜笖銆愭湭閫氱煡澶囨枡銆戠殑宸ュ崟锛岀‘瀹�" + strMsg + "鍚楋紵")) return; var _obj = new { @@ -443,15 +475,17 @@ _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()); getModel(lbGuid.Text.Trim()); } + else + MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString()); } catch (Exception ex) { - MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } } @@ -489,13 +523,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); } } } @@ -515,12 +551,12 @@ rptGx.Items.Add("绌�"); foreach (DataRow dr in dt.Rows) { - rptGx.Items.Add(dr["processNo"].ToString()+":"+ dr["processName"].ToString()); + rptGx.Items.Add(dr["processNo"].ToString()); } } catch (Exception ex) { - MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } } } -- Gitblit v1.9.3