From 9778339d53c6abbed56e27d1f49c06fa8f569cf2 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 27 五月 2025 08:40:22 +0800
Subject: [PATCH] 工单打印
---
DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs | 114 +++++++++++++++++++++++++++++++++-----------------------
1 files changed, 67 insertions(+), 47 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
index 994ed2b..d4ae8aa 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesInvItemArn.cs
@@ -1,9 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.Threading.Tasks;
-using System.Windows.Forms;
-using DevExpress.RichEdit.Export;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid.Views.Grid;
@@ -12,6 +6,11 @@
using Gs.DevApp.UserControl;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Threading.Tasks;
+using System.Windows.Forms;
namespace Gs.DevApp.DevFrm
{
@@ -19,10 +18,11 @@
{
private List<FilterEntity> _filterList = new List<FilterEntity>();
private readonly string _webServiceName = "MesInvItemArnManager/";
+ string _ucCk = "";//浠撳簱
+ string _ucGys = "";//渚涘簲鍟�
public Frm_MesInvItemArn()
{
InitializeComponent();
- pageBar1.PagerEvent += PageBar1_PagerEvent;
toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick;
toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
@@ -33,22 +33,20 @@
toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
toolBarMenu1.btnFjianYanClick += ToolBarMenu1_btnFjianYanClick;
toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
+ this.toolBarMenu1.getXmlConfig();
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fstatus", "", (value) =>
- {
- Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
- });
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+ }, tips);
Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
{
getModel(value);
}, (value) =>
{
getPageList(this.pageBar1.CurrentPage);
- });
+ }, lbGuid);
getPageList(1);
- //浠ヤ笅涓よ鏈夊奖鍝嶆�ц兘锛屼絾鐩墠娌″ソ鏂规
- txt_suppId.getSuppler("");
- txt_depotsId.getSuppler("");
pageBar1.PagerEvent += PageBar1_PagerEvent;
//璁剧疆缁勭粐
this.txt_receiveOrgId.EditChanged += (s, e) =>
@@ -56,8 +54,8 @@
string _orgId = txt_receiveOrgId.GetId();
if (string.IsNullOrEmpty(_orgId))
return;
- txt_suppId.getSuppler(_orgId);
- txt_depotsId.getSuppler(_orgId);
+ txt_suppId.getSuppler(_orgId, _ucGys);
+ txt_depotsId.getSuppler(_orgId, _ucCk);
};
//璁剧疆浠撳簱閫夋嫨
this.txt_depotsId.EditChanged += (s, e) =>
@@ -72,6 +70,12 @@
//閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏
btnSelect.Click += (s, e) =>
{
+ if (string.IsNullOrEmpty(this.txt_receiveOrgId.GetId()))
+ {
+ MsgHelper.Warning("璇烽�夋嫨鏀舵枡缁勭粐锛�");
+ txt_receiveOrgId.Focus();
+ return;
+ }
if (string.IsNullOrEmpty(this.txt_suppId.GetId()))
{
Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨渚涘簲鍟嗭紝鎵嶈兘閫夋嫨鏉ユ枡鏄庣粏锛�");
@@ -98,13 +102,13 @@
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = _oldTable;
gcMx1.ForceInitialize();
+ gvMx1.PostEditor();
+ gvMx1.UpdateCurrentRow();
}
catch (Exception ex)
{
-
MessageBox.Show(ex.Message);
}
-
};
frm.ShowDialog();
};
@@ -112,7 +116,7 @@
private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
+ _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
Task.Delay(100);
getPageList(1);
}
@@ -137,7 +141,7 @@
gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
gridView1.ActiveFilter.Clear();
gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
- var frm = new ShowFilter(gridView1.Columns, _filterList);
+ var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName);
frm.UpdateParent += Frm_UpdateParent;
frm.ShowDialog();
}
@@ -224,8 +228,11 @@
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1);
+ if (xtraTabControl1.SelectedTabPageIndex == 0)
+ { }
+ else
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
+ getPageList(this.pageBar1.CurrentPage);
}
MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
@@ -246,14 +253,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);
}
}
@@ -281,7 +289,7 @@
{
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
- UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
}
}
@@ -296,7 +304,7 @@
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gridViews.Add(gvMx1);
- UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
+ UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
}
@@ -336,11 +344,11 @@
Remark = txt_remark.Text.Trim(), //澶囨敞
SuppId = _gysId, //渚涘簲鍟�
DepotsId = _ckId,//浠撳簱
- FType = txt_fType.Checked ? 1 : 0,//0=閲囪喘锛�1=濮斿
OrgId = _orgId,
list = new List<dynamic>(),
};
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
if (gvMx1.DataRowCount <= 0)
{
@@ -366,6 +374,7 @@
ItemId = int.Parse(row["itemId"].ToString()),
Quantity = decimal.Parse(row["quantity"].ToString()),
UrgentFlag = Gs.DevApp.ToolBox.UtilityHelper.ToBit(row["urgentFlag"].ToString()),
+ Remark = row["memo"].ToString(),
});
}
}
@@ -378,11 +387,14 @@
MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
if (_rtn.rtnCode > 0)
{
- lbGuid.Text = _rtn.rtnData;
+ lbGuid.Text = _rtn.rtnData.outGuid;
+ txt_billNo.Text = _rtn.rtnData.outNo;
toolBarMenu1.isSetBtn = true;
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
- UtilityHelper.ChangeEnableByControl(panel1.Controls, false);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
+ toolBarMenu1.currentAction = "";
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
}
}
catch (Exception ex)
@@ -397,7 +409,7 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date",
"asc", "", _sbSqlWhere.ToString());
var json = JsonConvert.SerializeObject(pgq);
@@ -409,15 +421,16 @@
if (dd.rtnCode > 0)
{
DataTable dt = dd.rtnData.list;
- gcMain.BindingContext = new BindingContext();
+ gcMain1.BindingContext = new BindingContext();
gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
if (dt.Rows.Count > 0)
{
- gcMain.DataSource = dt;
- gcMain.ForceInitialize();
+ gcMain1.DataSource = dt;
+ gcMain1.ForceInitialize();
+ gridView1.BestFitColumns(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
}
else
- UtilityHelper.SetDefaultTable(gcMain, gridView1);
+ UtilityHelper.SetDefaultTable(gcMain1, gridView1);
gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
pageBar1.CurrentPage = curPage;//褰撳墠椤�
@@ -457,10 +470,14 @@
if (_rtn.rtnCode > 0)
{
var dy = _rtn.rtnData;
+ _ucGys = dy.suppId;
+ _ucCk = dy.depotsId;
lbGuid.Text = strGuid;
var gvList = new List<GridView>();
gvList.Add(gvMx1);
- UtilityHelper.SetValueByObj(panel1.Controls, dy, isEdit, gvList);
+ UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
+ _ucGys = "";
+ _ucCk = "";
var _job = JObject.Parse(strJson);
var array = new JArray();
foreach (var a in _job["rtnData"]["list"]) array.Add(a);
@@ -472,6 +489,8 @@
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = dt;
gcMx1.ForceInitialize();
+ gvMx1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
}
else
{
@@ -575,10 +594,8 @@
{
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
-
}
}
-
/// <summary>
/// 妫�楠屽拰鍙嶆楠�
@@ -606,12 +623,16 @@
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
- if (_rtn.rtnCode > 0)
+ if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0)
{
if (xtraTabControl1.SelectedTabPageIndex == 1)
+ {
getModel(lbGuid.Text.Trim());
- else
- getPageList(this.pageBar1.CurrentPage);
+ }
+ int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+ gridView1.FocusedRowHandle = rowHandle;
+ int _inFieldValue = (_meth == "EditModelSubmit" ? 1 : -1);
+ UtilityHelper.SetCheckIco(gridView1, "fstatus", "checkUser", "checkDate", picCheckBox, this, _inFieldValue.ToString());
}
}
catch (Exception ex)
@@ -619,6 +640,5 @@
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
-
}
}
\ No newline at end of file
--
Gitblit v1.9.3