From f13592561fedab01d5d447a3f8db9026ce51b7c8 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期三, 12 二月 2025 11:06:36 +0800 Subject: [PATCH] 其它入库 --- DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs | 165 +++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 113 insertions(+), 52 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs index 8cd1442..9ad47bc 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs @@ -1,5 +1,4 @@ using DevExpress.XtraEditors; -using DevExpress.XtraGrid.Views.Base.ViewInfo; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Gs.DevApp.UserControl; @@ -10,8 +9,6 @@ using System.Data; using System.Threading.Tasks; using System.Windows.Forms; - - namespace Gs.DevApp.DevFrm { public partial class Frm_MesItemQtrk : DevExpress.XtraEditors.XtraForm @@ -31,7 +28,8 @@ toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "qt015", "", (value) => + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "isSh", "", (value) => { Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); }); @@ -44,10 +42,10 @@ }); getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; - txt_qt011.getSuppler(""); + txt_qt008.getSuppler(""); txt_qt018.getSuppler(""); //璁剧疆浠撳簱閫夋嫨 - this.txt_qt011.EditChanged += (s, e) => + this.txt_qt008.EditChanged += (s, e) => { }; @@ -114,10 +112,9 @@ + "}"; }; } - private void GridView1_ColumnFilterChanged(object sender, EventArgs e) { - _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns); + Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1); Task.Delay(100); getPageList(1); } @@ -196,11 +193,11 @@ if (_rtn.rtnCode > 0) { if (xtraTabControl1.SelectedTabPageIndex == 0) - getPageList(this.pageBar1.CurrentPage); + { } else Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); + getPageList(this.pageBar1.CurrentPage); } - MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } catch (Exception ex) @@ -220,14 +217,15 @@ getModel(lbGuid.Text.Trim()); else { - _filterList.Clear(); - if (gridView1.ActiveFilter.Count > 0) - { - gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; - gridView1.ActiveFilter.Clear(); - gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; - } - getPageList(1); + //_filterList.Clear(); + //if (gridView1.ActiveFilter.Count > 0) + //{ + // gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged; + // gridView1.ActiveFilter.Clear(); + // gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged; + //} + //getPageList(1); + getPageList(this.pageBar1.CurrentPage); } } /// <summary> @@ -246,7 +244,17 @@ return; } Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); - UtilityHelper.ChangeEnableByControl(panel1.Controls, true); + if (xtraTabControl1.SelectedTabPageIndex == 1) + { + getModel(rowGuid); + } + else + { + List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); + gvList.Add(gvMx1); + gvList.Add(gvMx2); + UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList); + } } /// <summary> /// 鏂板浜嬩欢 @@ -259,8 +267,10 @@ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4); List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); gridViews.Add(gvMx1); + gridViews.Add(gvMx2); UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews); Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); + Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2); } /// <summary> /// 淇濆瓨浜嬩欢 @@ -270,32 +280,61 @@ private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) { toolBarMenu1.isSetBtn = false; - string inGys = txt_qt018.GetId(); - string inCjId = txt_qt011.GetId(); - if (string.IsNullOrEmpty(inGys)) + string kcZz = txt_qt022.GetId();//搴撳瓨缁勭粐 + string kcBm = txt_qt009.GetId();//搴撳瓨閮ㄩ棬 + string kcGys = txt_qt018.GetId();//搴撳瓨渚涘簲鍟� + string djLx = txt_qt003.Text.Trim();//鍗曟嵁绫诲瀷 + string kcfx = txt_qt019.Text.Trim();//搴撳瓨鏂瑰悜 + string inHzlx = ucLookHuoZhu1.GetHzLx();//璐т富绫诲瀷 + string inHz = ucLookHuoZhu1.GetHzId();//璐т富 + string inRkyy = txt_qt010.Text.Trim();//鍏ュ簱鍘熷洜 + string kcCk = txt_qt008.GetId();//浠撳簱 + if (string.IsNullOrEmpty(kcZz)) { - Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨渚涘簲鍟嗭紒"); - txt_qt018.Focus(); + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨搴撳瓨缁勭粐锛�"); + txt_qt022.Focus(); return; } - if (string.IsNullOrEmpty(inCjId)) + if (string.IsNullOrEmpty(inHzlx)) { - Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�"); - txt_qt011.Focus(); + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璐т富绫诲瀷锛�"); + return; + } + if (string.IsNullOrEmpty(inHz)) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璐т富锛�"); + return; + } + if (txt_qt003.SelectedIndex < 0) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍗曟嵁绫诲瀷锛�"); + txt_qt003.Focus(); + return; + } + if (txt_qt019.SelectedIndex <= 0) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨搴撳瓨鏂瑰悜锛�"); + txt_qt019.Focus(); + return; + } + if (string.IsNullOrEmpty(kcCk)) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍙戞枡浠撳簱锛�"); + txt_qt008.Focus(); return; } var _obj = new { guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 - inRklb = txt_qt003.Text.Trim(),//澶囨敞 - inYwlx = txt_qt004.Text.Trim(),//涓氬姟绫诲瀷 - inRkfs = txt_qt019.Text.Trim(),//鍏ュ簱鏂瑰紡 - inRklx = txt_qt020.Text.Trim(),//鍏ュ簱绫诲瀷 - inGys = inGys,//渚涘簲鍟� - inCjId = inCjId,//鍏ュ簱浠撳簱 - inDepart = txt_qt009.GetId(),//鐢宠閮ㄩ棬 - inXsdh = txt_qt021.Text.Trim(),//閿�鍞崟鍙� - inRkyy = txt_qt010.Text.Trim(),//鍏ュ簱鍘熷洜 + kcZz = kcZz,//搴撳瓨缁勭粐 + kcBm = kcBm,//搴撳瓨閮ㄩ棬 + kcGys = kcGys,//搴撳瓨渚涘簲鍟� + kcCk = kcCk,//搴撳瓨浠撳簱 + inRkyy = inRkyy,//鍏ュ簱鍘熷洜 + djLx = djLx,//鍗曟嵁绫诲瀷 + kcfx = kcfx,//搴撳瓨鏂瑰悜 + hzlx = inHzlx,//璐т富绫诲瀷 + inHz = inHz,//璐т富 list = new List<dynamic>(), }; gvMx1.CloseEditor(); @@ -333,9 +372,13 @@ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); if (_rtn.rtnCode > 0) { - lbGuid.Text = _rtn.rtnData; + lbGuid.Text = _rtn.rtnData.outGuid; + txt_qtck.Text = _rtn.rtnData.outNo; toolBarMenu1.isSetBtn = true; - UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false); + List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); + gvList.Add(gvMx1); + gvList.Add(gvMx2); + UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList); } } catch (Exception ex) @@ -351,7 +394,6 @@ /// <param name="pageSize">姣忛〉鍑犳潯</param> private void getPageList(int curPage) { - var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "qt001", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); @@ -368,6 +410,7 @@ { gcMain.DataSource = dt; gcMain.ForceInitialize(); + gridView1.BestFitColumns(); } else UtilityHelper.SetDefaultTable(gcMain, gridView1); @@ -385,7 +428,6 @@ { ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } - } private void getModel(string strGuid) { @@ -411,6 +453,7 @@ lbGuid.Text = strGuid; List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); gvList.Add(gvMx1); + gvList.Add(gvMx2); UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList); JObject _job = JObject.Parse(strJson); JArray array = new JArray(); @@ -424,10 +467,29 @@ gcMx1.BindingContext = new BindingContext(); gcMx1.DataSource = dt; gcMx1.ForceInitialize(); + gvMx1.BestFitColumns(); } else { Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); + } + + JArray array2 = new JArray(); + foreach (var a in _job["rtnData"]["list2"]) + { + array2.Add(a); + } + DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(array2.ToString()); + if (dt2.Rows.Count > 0) + { + gcMx2.BindingContext = new BindingContext(); + gcMx2.DataSource = dt2; + gcMx2.ForceInitialize(); + gvMx2.BestFitColumns(); + } + else + { + Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2); } } else @@ -537,7 +599,6 @@ } if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵")) return; - var _obj = new { guid = rowGuid, @@ -550,21 +611,23 @@ JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); MsgHelper.Warning(_rtn.rtnData.outMsg.ToString()); - if (_rtn.rtnCode > 0) + if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0) { if (xtraTabControl1.SelectedTabPageIndex == 1) + { getModel(lbGuid.Text.Trim()); - else - getPageList(1); + } + int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); + gridView1.FocusedRowHandle = rowHandle; + Form parentForm = this.FindForm(); + UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, parentForm, _inFieldValue.ToString()); } } catch (Exception ex) { MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } - } - private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { if (e.FocusedRowHandle >= 0) @@ -572,12 +635,12 @@ DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle); lbMxGuid.Text = row["guid"].ToString(); ucBtnPrint1.guidKey = row["guid"].ToString(); - txtWlid.Text = row["itemId"].ToString(); + txtWlid.Text = row["qd002"].ToString(); txtWlgg.Text = row["qd004"].ToString(); txtWlmc.Text = row["qd003"].ToString(); - txtQuantity.Text = row["qd007"].ToString();//鐢宠鎬婚噺 - txtYdy.Text = row["YDYNUM"].ToString();//宸叉墦鍗版�婚噺 - kyPrtQty.Text = row["KDYNUM"].ToString();//鍙墦鍗版�婚噺 + //txtQuantity.Text = row["qd007"].ToString();//鐢宠鎬婚噺 + //txtYdy.Text = row["YDYNUM"].ToString();//宸叉墦鍗版�婚噺 + //kyPrtQty.Text = row["KDYNUM"].ToString();//鍙墦鍗版�婚噺 } } /// <summary> @@ -619,7 +682,5 @@ } } } - - } } \ No newline at end of file -- Gitblit v1.9.3