From ccbe3fad6c7ebb9c1e936163c7f04cb469ff32fc Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期四, 19 六月 2025 17:08:59 +0800 Subject: [PATCH] bug --- DevApp/Gs.DevApp/DevFrm/RkQC/Frm_RkDetect01.cs | 131 ++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 120 insertions(+), 11 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/RkQC/Frm_RkDetect01.cs b/DevApp/Gs.DevApp/DevFrm/RkQC/Frm_RkDetect01.cs index ba381bb..b41ec7c 100644 --- a/DevApp/Gs.DevApp/DevFrm/RkQC/Frm_RkDetect01.cs +++ b/DevApp/Gs.DevApp/DevFrm/RkQC/Frm_RkDetect01.cs @@ -1,4 +1,5 @@ 锘縰sing Gs.DevApp.DevFrm.QC; +using Gs.DevApp.DevFrm.Rpt; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Gs.DevApp.UserControl; @@ -6,9 +7,7 @@ using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; -using System.Configuration; using System.Data; -using System.Net; using System.Threading.Tasks; using System.Windows.Forms; @@ -17,7 +16,7 @@ public partial class Frm_RkDetect01 : DevExpress.XtraEditors.XtraForm { string _strTag = "N:涓嶅悎鏍�"; - + List<FilterEntity> _filterList = new List<FilterEntity>(); public Frm_RkDetect01() { @@ -52,6 +51,80 @@ xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged; gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; btnIpt.Click += BtnIpt_Click; + this.ucBtnPrint1.btnPrintClick += (s, e) => + { + ucBtnPrint1.guidKey = ""; + string rowGuid = txt_aboutGuid.Text.Trim(); + ucBtnPrint1.guidKey = rowGuid; + if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_1.Text.Trim(), txt_yuliang_1.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇疯緭鍏ユ纭殑鏉$爜鏁伴噺锛�"); + txt_iCount_1.Focus(); + this.ucBtnPrint1.rptParameter = "return false"; + return; + } + if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_psnQty_1.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�"); + txt_psnQty_1.Focus(); + this.ucBtnPrint1.rptParameter = "return false"; + return; + } + if (rowGuid.Length < 10) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�"); + this.ucBtnPrint1.rptParameter = "return false"; + return; + } + this.ucBtnPrint1.rptParameter = "rpt_SCTL{" + rowGuid.Trim() + + "," + "" + + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim()) + + "," + txt_iCount_1.Text.Trim() + + "," + txt_psnQty_1.Text.Trim() + + "}"; + }; + this.ucBtnPrint1.btnAllClick += (s, e) => + { + string rowGuid = txt_aboutGuid.Text.Trim(); + SelectDeleteBar frm = new SelectDeleteBar(rowGuid, "閲囪喘鍏ュ簱"); + string strCodeList = ""; + frm.UpdateParent += (ss, ee) => + { + strCodeList = ee.StringSingle; + }; + frm.ShowDialog(); + if (string.IsNullOrEmpty(strCodeList)) + return; + try + { + string rptParameter = "rpt_SCTL{" + + "100" + + "," + "" + + "," + "" + + "," + "" + + "," + "" + + "," + strCodeList + + "}"; + using (Form rpt = new RptPreview(rowGuid, rptParameter)) + { + rpt.ShowDialog(); + } + frm.Close(); + } + catch (Exception ex) + { + MsgHelper.ShowError(ex.Message); + } + }; + //鑷姩璁$畻鎵撳嵃閲� + txt_psnQty_1.TextChanged += (s, e) => + { + Gs.DevApp.ToolBox.UtilityHelper.PrintJiSuan(txt_psnQty_1, txt_iCount_1, txt_kQty.Text.Trim(), radOut, txt_yuliang_1); + }; + radOut.SelectedIndexChanged += (s, e) => + { + Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut, txt_yuliang_1); + }; } @@ -257,7 +330,7 @@ { Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1); } - + /// <summary> /// 鍒锋柊浜嬩欢 /// </summary> @@ -318,9 +391,17 @@ private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) { toolBarMenu1.isSetBtn = false; + string rkckid = txt_rkCkId.GetId(); + if (string.IsNullOrEmpty(rkckid)) + { + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨浠撳簱锛�"); + txt_rkCkId.Focus(); + return; + } + if (txt_fcheckResu.Text.Trim() == _strTag && string.IsNullOrEmpty(txt_fngDesc.TextTxt.Trim())) { - Gs.DevApp.ToolBox.MsgHelper.Warning("褰撴楠岀粨鏋滀笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄨ鏄庯紒"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("褰撴楠岀粨鏋滀笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄨ鏄庯紒"); txt_fngDesc.Focus(); return; } @@ -328,26 +409,29 @@ { guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 fngDesc = txt_fngDesc.TextTxt.Trim(), + ckId= rkckid }; try { string strJson = UtilityHelper.HttpPost("", "MesQaItemsDetect01Manager/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; toolBarMenu1.isSetBtn = true; UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false); this.setEable(false); 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); } } @@ -415,7 +499,7 @@ }; try { - string strJson = UtilityHelper.HttpPost("","RkqcManager/GetModel", JsonConvert.SerializeObject(_obj)); + string strJson = UtilityHelper.HttpPost("", "RkqcManager/GetModel", JsonConvert.SerializeObject(_obj)); ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { @@ -424,7 +508,13 @@ 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); + string strCk = dy.rkCkId; + txt_rkCkId.getSuppler(txt_tlOrg.Text.Trim(), strCk); setEable(isEdit); + txtQuantity.Text = dy["fbatchQty"].ToString(); + txt_kQty.Text = dy["kdy"].ToString(); + txtYdy.Text = dy["ydy"].ToString(); + txt_psnQty_1.Text = dy["fbatchQty"].ToString(); JObject _job = JObject.Parse(strJson); JArray array = new JArray(); foreach (var a in _job["rtnData"]["list5"]) @@ -454,6 +544,25 @@ else { Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); + } + JArray array8 = new JArray(); + foreach (var a in _job["rtnData"]["barCodeList"]) + { + array8.Add(a); + } + DataTable dt8 = JsonConvert.DeserializeObject<DataTable>(array8.ToString()); + if (dt8.Rows.Count > 0) + { + gcMx8.DataSource = null; + gcMx8.BindingContext = new BindingContext(); + gcMx8.DataSource = dt8; + gcMx8.ForceInitialize(); + gvMx8.BestFitColumns(); + Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx8); + } + else + { + Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx8, gvMx8); } } else @@ -492,7 +601,7 @@ }; try { - var strJson = UtilityHelper.HttpPost("", "MesQaItemsDetect01Manager/GetModel12", JsonConvert.SerializeObject(_obj)); + var strJson = UtilityHelper.HttpPost("", "MesQaItemsDetect01Manager/GetModel12", JsonConvert.SerializeObject(_obj)); JObject _job = JObject.Parse(strJson); JArray array = new JArray(); foreach (var a in _job["rtnData"]["list"]) @@ -573,6 +682,6 @@ MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } - + } } \ No newline at end of file -- Gitblit v1.9.3