From 5e376d06404a16cb3c82a93cff351c5315bbcfe3 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期六, 28 六月 2025 16:10:22 +0800 Subject: [PATCH] 客户多打印 --- DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkTechnique.cs | 163 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 149 insertions(+), 14 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkTechnique.cs b/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkTechnique.cs index 15d7045..98e34cf 100644 --- a/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkTechnique.cs +++ b/DevApp/Gs.DevApp/DevFrm/Work/Frm_WorkTechnique.cs @@ -1,6 +1,5 @@ -锘縰sing DevExpress.Utils.MVVM.Services; -using DevExpress.XtraPivotGrid.Data; -using DevExpress.XtraPrinting.Native; +锘� +using Gs.DevApp.DevFrm.QC; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Gs.DevApp.UserControl; @@ -11,6 +10,7 @@ using System.Data; using System.Threading.Tasks; using System.Windows.Forms; + namespace Gs.DevApp.DevFrm.Work { @@ -60,7 +60,7 @@ foreach (dynamic dym in lst) { DataRow _row = _Table.NewRow(); - _row["fSeq"] = "001"; + _row["fSeq"] = dym.fSeq; _row["statStatus"] = "Y-鏄�"; _row["collectionName"] = "绌�"; _row["processNo"] = dym.processNo; @@ -80,6 +80,23 @@ MessageBox.Show(ex.Message); } }; + frm.ShowDialog(); + }; + _getListJyxm(); + //澶嶅埗 + btnCopy.Click += (s, e) => + { + if ((lbGuid.Text.Trim().Length < 10)) + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇峰厛淇濆瓨褰撳墠淇℃伅锛�"); + return; + } + if ((txt_isCheck.Checked == false)) + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇ラ」鐩湭瀹℃牳锛屾殏涓嶈兘澶嶅埗鍒板叾瀹冪墿鏂欙紒"); + return; + } + Frm_WorkTechniqueShow frm = new Frm_WorkTechniqueShow(lbGuid.Text.Trim()); frm.ShowDialog(); }; } @@ -156,7 +173,7 @@ private void getPageList(int curPage) { 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); @@ -224,6 +241,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,6 +251,56 @@ 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_fJingDu.SelectedIndex < 0) + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation("绠$悊绮惧害涓嶈兘涓虹┖锛�"); + txt_fJingDu.Focus(); return; + } + if (txt_fBegDate.Text.Length <= 0) + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation("鐢熸晥鏃ユ湡涓嶈兘涓虹┖锛�"); + txt_fBegDate.Focus(); return; + } + txt_fEndDate.DateTime= new DateTime(2099, 1, 1); + if (txt_fEndDate.Text.Length > 0 && txt_fBegDate.DateTime > txt_fEndDate.DateTime) + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation("鐢熸晥鏃ユ湡涓嶈兘澶т簬澶辨晥鏃ユ湡锛�"); + txt_fEndDate.Focus(); return; + } + decimal num = 0; + int num2 = 0; + if (!int.TryParse(txt_fSumPeople.Text.Trim(), out num2)) + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇疯緭鍏ユ纭殑瀹氬憳锛�"); + txt_fSumPeople.Focus(); return; + } + if (!decimal.TryParse(txt_fCapacity.Text.Trim(), out num)) + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇疯緭鍏ユ纭殑浜ц兘锛�"); + txt_fCapacity.Focus(); return; + } + if (!decimal.TryParse(txt_fMaxWeight.Text.Trim(), out num)) + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇疯緭鍏ユ纭殑閲嶉噺涓婇檺锛�"); + txt_fMaxWeight.Focus(); return; + } + if (!decimal.TryParse(txt_fMinWeight.Text.Trim(), out num)) + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation("璇疯緭鍏ユ纭殑閲嶉噺涓嬮檺锛�"); + txt_fMinWeight.Focus(); return; + } + //涓婇檺涓嶈兘浣庝簬涓嬮檺 + if (decimal.Parse(txt_fMaxWeight.Text.Trim()) < decimal.Parse(txt_fMinWeight.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.ShowInformation("涓婇檺涓嶈兘浣庝簬涓嬮檺锛�"); + txt_fMaxWeight.Focus(); return; + } var _obj = new { guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓 @@ -278,6 +346,7 @@ gvList.Add(gvMx1); UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList); toolBarMenu1.currentAction = ""; + //Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); } } catch (Exception ex) @@ -301,10 +370,13 @@ return; } getModel(rowGuid); - List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); - gvList.Add(gvMx1); - UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList); + } + + /// <summary> + /// 璇诲彇瀹炰綋 + /// </summary> + /// <param name="strGuid"></param> private void getModel(string strGuid) { bool isEdit = false; @@ -332,6 +404,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"]) @@ -350,7 +423,6 @@ { Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); } - UtilityHelper.SetCheckIco(null, "", "", "", picCheckBox, this, (txt_isCheck.Checked == true ? 1 : 0).ToString()); } else @@ -405,13 +477,76 @@ MsgHelper.Warning(_rtn.rtnData.outMsg.ToString()); if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0) { - if (xtraTabControl1.SelectedTabPageIndex == 1) + getModel(lbGuid.Text.Trim()); + } + } + catch (Exception ex) + { + MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + } + + /// <summary> + /// 绉诲嚭宸ュ簭 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) + { + var rowhandle = gvMx1.FocusedRowHandle; + if (rowhandle < 0) + return; + if (e.Button.Index == 0) + { + var dr = gvMx1.GetDataRow(rowhandle); + var mxGuid = dr["guid"].ToString(); + if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵")) + return; + if (string.IsNullOrEmpty(mxGuid)) + { + gvMx1.DeleteRow(rowhandle); + return; + } + var _obj = new + { + guid = lbGuid.Text.Trim(),//杩欐槸浜у搧鐨刧uid + mxGuid = mxGuid, + }; + try + { + var strJson = UtilityHelper.HttpPost("", + _webServiceName + "DeleteModelOrMx", + JsonConvert.SerializeObject(_obj)); + var _rtn = UtilityHelper.ReturnToDynamic(strJson); + if (_rtn.rtnCode > 0) { - getModel(lbGuid.Text.Trim()); + if (_rtn.rtnCode > 0) getModel(lbGuid.Text); } - int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid); - gridView1.FocusedRowHandle = rowHandle; - // UtilityHelper.SetCheckIco(gridView1, "status", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString()); + MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); + } + catch (Exception ex) + { + MsgHelper.Warning("鎻愮ず锛�" + ex.Message); + } + } + } + + /// <summary> + /// 璇诲彇宸ュ簭涓嬫媺 + /// </summary> + private void _getListJyxm() + { + var pgq = new PageQueryModel(1, 999999, "a.processNo", "asc", "", ""); + var json = JsonConvert.SerializeObject(pgq); + try + { + var strReturn = UtilityHelper.HttpPost("", "WorkPro/GetListPage", json); + var dd = UtilityHelper.ReturnToTablePage(strReturn); + DataTable dt = dd.rtnData.list; + rptGx.Items.Add("绌�"); + foreach (DataRow dr in dt.Rows) + { + rptGx.Items.Add(dr["processNo"].ToString()); } } catch (Exception ex) -- Gitblit v1.9.3