From 5bf6668fc8a570f64498888b8d923911485180b3 Mon Sep 17 00:00:00 2001 From: lu <123456> Date: 星期一, 11 八月 2025 17:43:56 +0800 Subject: [PATCH] bug --- DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs | 237 +++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 150 insertions(+), 87 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs index d8e2793..f07b552 100644 --- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs +++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs @@ -1,4 +1,6 @@ using DevExpress.XtraEditors; +using Gs.DevApp.DevFrm.Rpt; +using Gs.DevApp.DevFrm.Work; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Gs.DevApp.UserControl; @@ -23,6 +25,7 @@ public Frm_MesItemQtrk() { InitializeComponent(); + split99.PanelVisibility = SplitPanelVisibility.Panel2; this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick; @@ -53,7 +56,6 @@ }, lbGuid); getPageList(1); pageBar1.PagerEvent += PageBar1_PagerEvent; - //閫夋嫨搴撳瓨缁勭粐锛堝彉鏄庣粏涓殑鐗╂枡鍜屽彉璐т富锛� this.txt_qt022.EditChanged += (s, e) => { @@ -80,17 +82,26 @@ } catch (Exception ex) { - MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } }; - gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; - this.ucBtnPrint1.btnDesignClick += (s, e) => + //閫夋嫨婧愬崟鏄庣粏 + txt_qt035.ButtonClick += (s, e) => { - ucBtnPrint1.rptParameter = "rpt_Qtrk{}"; + string strSrmNo = ""; + SelectDaa frm = new SelectDaa(); + frm.UpdateParent += (ss, ee) => + { + var lst = new List<dynamic>(); + lst = ee.DynamicList; + strSrmNo = lst[0].guid; + txt_qt035.Text = strSrmNo; + }; + frm.ShowDialog(); }; - this.ucBtnPrint1.btnReportClick += (s, e) => + //鎵撳嵃浜嬩欢 + this.ucBtnPrint1.btnPrintClick += (s, e) => { - ucBtnPrint1.guidKey = ""; string rowGuid = lbMxGuid.Text.Trim(); ucBtnPrint1.guidKey = rowGuid; if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_1.Text.Trim(), txt_yuliang_1.Text.Trim())) @@ -113,24 +124,66 @@ this.ucBtnPrint1.rptParameter = "return false"; return; } - this.ucBtnPrint1.rptParameter = "rpt_Qtrk{" + lbMxGuid.Text.Trim() + this.ucBtnPrint1.rptParameter = "rpt_Qtrk{" + + lbMxGuid.Text.Trim()//鍏宠仈涓婚敭 + "," + "" - + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim()) - + "," + txt_iCount_1.Text.Trim() - + "," + txt_psnQty_1.Text.Trim() + + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim())//浣欐暟 + + "," + txt_iCount_1.Text.Trim()//寮犳暟 + + "," + txt_psnQty_1.Text.Trim()//姣忓紶鏉$爜鏁伴噺 + "}"; + txt_iCount_1.Text = ""; + txt_psnQty_1.Text = ""; }; - - //鑷姩璁$畻鎵撳嵃閲� + //鎵撳嵃鎵归噺鎿嶄綔浜嬩欢 + this.ucBtnPrint1.btnAllClick += (s, e) => + { + string rowGuid = lbMxGuid.Text.Trim(); + SelectDeleteBar frm = new SelectDeleteBar(rowGuid, QcSeason.鍏跺畠鍏ュ簱妫�.ToString()); + string strCodeList = ""; + string strAction = ""; + frm.UpdateParent += (ss, ee) => + { + strCodeList = ee.StringSingle; + strAction = ee.Data; + }; + frm.ShowDialog(); + if (string.IsNullOrEmpty(strCodeList)) + return; + if (strAction == "print") + { + try + { + string rptParameter = "rpt_Qtrk{" + + "100"//閲嶆墦閮芥槸浼�100锛� + + "," + "" + + "," + "" + + "," + "" + + "," + "" + + "," + strCodeList + + "}"; + using (Form rpt = new RptPreview(rowGuid, rptParameter)) + { + rpt.ShowDialog(); + } + frm.Close(); + } + catch (Exception ex) + { + MsgHelper.ShowError(ex.Message); + } + } + }; + gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; + //鎵撳嵃鑷姩璁$畻 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); }; + } private void GridView1_ColumnFilterChanged(object sender, EventArgs e) @@ -205,10 +258,10 @@ { string rowGuid = "", rowName = ""; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_qtck, gridView1, "isSh"); + lbGuid, txt_qtck, gridView1, "qtck"); if (string.IsNullOrEmpty(rowGuid)) { - MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵")) @@ -226,17 +279,19 @@ var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) { + MsgHelper.ShowInformation("鎻愮ず锛�" + _rtn.rtnMsg); if (xtraTabControl1.SelectedTabPageIndex == 0) { } else Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); getPageList(this.pageBar1.CurrentPage); } - MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + else + MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg); } catch (Exception ex) { - MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } } @@ -274,7 +329,7 @@ lbGuid, txt_qtck, gridView1); if (string.IsNullOrEmpty(rowGuid)) { - MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3); @@ -290,6 +345,9 @@ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList); ucLookHuoZhu1.Enabled = true; } + //2025/07/12鍔犱笂淇敼鐘舵�佷笅涓嶈兘淇敼 + txt_qt022.IsReadly = true; + ucLookHuoZhu1.Enabled = false; } /// <summary> /// 鏂板浜嬩欢 @@ -307,6 +365,8 @@ Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2); ucLookHuoZhu1.Enabled = true; + //澧炲姞鏃讹紝榛樿缁勭粐 + string deftOrg = UtilityHelper.GetFirstOrg(txt_qt022); } /// <summary> /// 淇濆瓨浜嬩欢 @@ -327,44 +387,44 @@ string kcCk = txt_qt008.GetId();//浠撳簱 if (string.IsNullOrEmpty(kcZz)) { - Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨搴撳瓨缁勭粐锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨搴撳瓨缁勭粐锛�"); txt_qt022.Focus(); return; } if (string.IsNullOrEmpty(inHzlx)) { - Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璐т富绫诲瀷锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨璐т富绫诲瀷锛�"); return; } if (string.IsNullOrEmpty(inHz)) { - Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璐т富锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨璐т富锛�"); return; } if (txt_qt003.TextTxt.Length < 0) { - Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍗曟嵁绫诲瀷锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鍗曟嵁绫诲瀷锛�"); txt_qt003.Focus(); return; } if (txt_qt019.SelectedIndex <= 0) { - Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨搴撳瓨鏂瑰悜锛�"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨搴撳瓨鏂瑰悜锛�"); txt_qt019.Focus(); return; } if (string.IsNullOrEmpty(kcBm) && string.IsNullOrEmpty(kcGys)) { - Gs.DevApp.ToolBox.MsgHelper.Warning("閮ㄩ棬鎴栦緵搴斿晢蹇呴』閫変竴涓紒"); + Gs.DevApp.ToolBox.MsgHelper.ShowError("閮ㄩ棬鎴栦緵搴斿晢蹇呴』閫変竴涓紒"); txt_qt009.Focus(); return; } - if (string.IsNullOrEmpty(kcCk)) - { - Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鏀舵枡浠撳簱锛�"); - txt_qt008.Focus(); - return; - } + //if (string.IsNullOrEmpty(kcCk)) + //{ + // Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鏀舵枡浠撳簱锛�"); + // txt_qt008.Focus(); + // return; + //} var _obj = new { guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 @@ -377,6 +437,7 @@ kcfx = kcfx,//搴撳瓨鏂瑰悜 hzlx = inHzlx,//璐т富绫诲瀷 inHz = inHz,//璐т富 + inSource = txt_qt035.EditValue,//宸ュ崟鍙� list = new List<dynamic>(), }; gvMx1.CloseEditor(); @@ -404,6 +465,7 @@ ItemId = (row["itemId"].ToString()), Sqsl = (row["qd007"].ToString()), Bz = (row["qd010"].ToString()), + Bllb = (row["qd012"].ToString()), }); } } @@ -411,9 +473,9 @@ { 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); lbGuid.Text = _rtn.rtnData.outGuid; txt_qtck.Text = _rtn.rtnData.outNo; toolBarMenu1.isSetBtn = true; @@ -425,10 +487,12 @@ 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); } } @@ -480,13 +544,14 @@ /// <param name="strGuid"></param> private void getModel(string strGuid) { + gcMx1.DataSource = null; bool isEdit = false; if (toolBarMenu1.currentAction == "add") return; if (toolBarMenu1.currentAction == "edit") isEdit = true; if (string.IsNullOrEmpty(strGuid)) { - MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } var _obj = new @@ -553,13 +618,18 @@ { Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2); } + + if (txt_isIqc.Checked) + split99.PanelVisibility = SplitPanelVisibility.Panel2; + else + split99.PanelVisibility = SplitPanelVisibility.Both; } else - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg); } catch (Exception ex) { - ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } } @@ -572,6 +642,9 @@ gvMx1.SetFocusedRowCellValue("qd004", SelectedDataRow["itemModel"]); gvMx1.SetFocusedRowCellValue("kcDw", SelectedDataRow["dwName"]); gvMx1.SetFocusedRowCellValue("itemId", SelectedDataRow["id"]); + gvMx1.CloseEditor(); + gvMx1.PostEditor(); + gvMx1.UpdateCurrentRow(); } /// <summary> /// 绉诲嚭鏄庣粏 @@ -607,13 +680,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); } } } @@ -693,7 +768,7 @@ case 0: strMsg = "鍙嶅鏍�"; break; - case 30: + case 30: strMsg = "璐㈠姟瀹℃牳"; break; case 31: @@ -705,14 +780,15 @@ case 41: strMsg = "閲囪喘鍙嶅鏍�"; break; - }; + } + ; toolBarMenu1.guidKey = ""; string rowGuid, rowName; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_qtck, gridView1, "qtck"); if (string.IsNullOrEmpty(rowGuid)) { - MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); + MsgHelper.ShowError("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵")) @@ -728,9 +804,10 @@ _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()); if (xtraTabControl1.SelectedTabPageIndex == 1) { getModel(lbGuid.Text.Trim()); @@ -738,21 +815,48 @@ //int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); //gridView1.FocusedRowHandle = rowHandle; //UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, this, _inFieldValue.ToString()); - //娉ㄦ剰锛岃繖閲屽拰鍏跺畠椤甸潰鏈夌偣涓嶄竴鏍� getPageList(this.pageBar1.CurrentPage); int rowHandle = gridView1.LocateByValue("guid", rowGuid); gridView1.FocusedRowHandle = rowHandle; } + else + MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString()); } catch (Exception ex) { - MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + MsgHelper.ShowError("鎻愮ず锛�" + ex.Message); } } + /// <summary> + /// 閫夋嫨涓嶈壇 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void rptBl_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) + { + var rowhandle = gvMx1.FocusedRowHandle; + if (rowhandle < 0) + return; + UcDictionarySelect frm = new UcDictionarySelect("寮傚父鎻忚堪", " a.s_type='QC寮傚父鎻忚堪' and a.pid<>'00000000-0000-0000-0000-000000000000'"); + frm.UpdateParent += (ss, ee) => + { + System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); + var lst = ee.DynamicList; + foreach (dynamic dym in lst) + { + if (stringBuilder.Length > 0) + stringBuilder.Append("|"); + stringBuilder.Append(dym.dicTxt); + } + gvMx1.SetFocusedRowCellValue("qd012", stringBuilder.ToString()); + // this.TextTxt = ; + }; + frm.ShowDialog(); + } + private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { - if (e.FocusedRowHandle >= 0) { DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle); @@ -777,47 +881,6 @@ txt_kQty.Text = ""; txt_psnQty_1.Text = ""; txt_iCount_1.Text = ""; - } - } - /// <summary> - /// 閲嶆墦鏉$爜 - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) - { - MsgHelper.ShowInformation("鍔熻兘寮�鍙戜腑锛�"); - return; - var rowhandle = gvMx2.FocusedRowHandle; - if (rowhandle < 0) - return; - if (e.Button.Index == 0) - { - var dr = gvMx2.GetDataRow(rowhandle); - var mxGuid = dr["guid"].ToString(); - if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵")) - return; - var _obj = new - { - mxGuid = mxGuid, - inType = "dhtm" - }; - try - { - var strJson = UtilityHelper.HttpPost("", - "VArrivalBarcodeManager/DeleteBarcode", - JsonConvert.SerializeObject(_obj)); - var _rtn = UtilityHelper.ReturnToDynamic(strJson); - if (_rtn.rtnCode > 0) - { - if (_rtn.rtnCode > 0) getModel(lbGuid.Text); - } - MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); - } - catch (Exception ex) - { - MsgHelper.Warning("鎻愮ず锛�" + ex.Message); - } } } } -- Gitblit v1.9.3