From e6a7247a28acc148d8f4099ab4b02064e808d11f Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期二, 17 十二月 2024 11:10:20 +0800 Subject: [PATCH] 打印 --- DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 100 insertions(+), 20 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs index 081d82e..96fcd0b 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemTbl.cs @@ -27,8 +27,19 @@ this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; - - Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "tbl013"); + toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick; + toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick; + Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "tbl013", "", (value) => + { + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); + }); + Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) => + { + getModel(value); + }, (value) => + { + getPageList(this.pageBar1.CurrentPage); + }); getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; //閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏 @@ -71,6 +82,8 @@ }; frm.ShowDialog(); }; + + gcMx1.MouseClick += GcMx1_MouseClick; } private async void GridView1_ColumnFilterChanged(object sender, EventArgs e) { @@ -78,17 +91,7 @@ await Task.Delay(100); getPageList(1); } - /// <summary> - /// 鍙屽嚮浜嬩欢 - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e) - { - string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid"); - if (!string.IsNullOrEmpty(rowGuid)) - getModel(rowGuid, false, 999); - } + /// <summary> /// 鍒嗛〉浜嬩欢 /// </summary> @@ -122,6 +125,58 @@ _filterList = e.FilterList; getPageList(1); } + + private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e) + { + toolBarMenu1.guidKey = ""; + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, + lbGuid, txt_billNo, gridView1); + toolBarMenu1.guidKey = rowGuid; + toolBarMenu1.rptParameter = "rpt_SCTL{}"; + } + private void ToolBarMenu1_btnReportClick(object sender, EventArgs e) + { + toolBarMenu1.guidKey = ""; + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, + lbGuid, txt_billNo, gridView1); + toolBarMenu1.guidKey = rowGuid; + if (xtraTabControl1.SelectedTabPageIndex == 0) + { + getModel(rowGuid); + this.toolBarMenu1.rptParameter = "return false"; + return; + } + if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�"); + txt_iCount_1.Focus(); + this.toolBarMenu1.rptParameter = "return false"; + return; + } + if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�"); + txt_psnQty_1.Focus(); + this.toolBarMenu1.rptParameter = "return false"; + return; + } + if (lbMxGuid.Text.Trim().Length < 10) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�"); + this.toolBarMenu1.rptParameter = "return false"; + return; + } + this.toolBarMenu1.rptParameter = "rpt_SCTL{" + lbMxGuid.Text.Trim() + + "," + "" + + "," + "" + + "," + txt_iCount_1.Text.Trim() + + "," + txt_psnQty_1.Text.Trim() + + "}"; + } + + /// <summary> /// 瀹℃牳浜嬩欢 /// </summary> @@ -149,7 +204,7 @@ /// <param name="e"></param> private void ToolBarMenu1_btnEscClick(object sender, EventArgs e) { - UtilityHelper.JumpToTab(xtraTabControl1, 0); + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1); } /// <summary> @@ -202,7 +257,7 @@ private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e) { if (xtraTabControl1.SelectedTabPageIndex == 1) - getModel(lbGuid.Text.Trim(), false, 999); + getModel(lbGuid.Text.Trim()); else { _filterList.Clear(); @@ -229,7 +284,8 @@ ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - getModel(rowGuid, true, 1); + Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); + UtilityHelper.ChangeEnableByControl(panel1.Controls, true); } /// <summary> /// 鏂板浜嬩欢 @@ -361,14 +417,16 @@ } } - private void getModel(string strGuid, bool isEdit, int tabIdx) + private void getModel(string strGuid) { + bool isEdit = false; + if (toolBarMenu1.currentAction == "add") return; + if (toolBarMenu1.currentAction == "edit") isEdit = true; if (string.IsNullOrEmpty(strGuid)) { ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - UtilityHelper.JumpToTab(xtraTabControl1, tabIdx); var _obj = new { guid = strGuid,//涓诲缓 @@ -440,7 +498,7 @@ var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { - if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1); + if (_rtn.rtnCode > 0) getModel(lbGuid.Text); } MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } @@ -494,7 +552,7 @@ if (_rtn.rtnCode > 0) { if (xtraTabControl1.SelectedTabPageIndex == 1) - getModel(lbGuid.Text.Trim(), false, 999); + getModel(lbGuid.Text.Trim()); else getPageList(1); } @@ -505,5 +563,27 @@ } } + + + private void GcMx1_MouseClick(object sender, MouseEventArgs e) + { + string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "tlid"); + if (string.IsNullOrEmpty(rowGuid)) + return; + lbMxGuid.Text = rowGuid; + toolBarMenu1.guidKey = rowGuid; + var info = gvMx1.CalcHitInfo(e.Location); + var view = info.View; + var row = view.GetDataRow(info.RowHandle); + txtWlid.Text = row["tld002"].ToString(); + txtWlgg.Text = row["tld004"].ToString(); + txtWlmc.Text = row["tld003"].ToString(); + txtQuantity.Text = row["tld004"].ToString();//鐢宠鎬婚噺 + //txtYdy.Text = row["YDYNUM"].ToString();//宸叉墦鍗版�婚噺 + //kyPrtQty.Text = row["KDYNUM"].ToString();//鍙墦鍗版�婚噺 + + txtYdy.Text ="";//宸叉墦鍗版�婚噺 + kyPrtQty.Text ="";//鍙墦鍗版�婚噺 + } } } \ No newline at end of file -- Gitblit v1.9.3