From 6b8f07429a524f4df9887f9364a1b286f198bcb5 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期三, 12 三月 2025 08:45:11 +0800
Subject: [PATCH] 版面
---
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs | 181 ++++++++++++++++++--------------------------
1 files changed, 74 insertions(+), 107 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
index 02d0005..1772159 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
@@ -15,29 +15,27 @@
{
public partial class Frm_MesQaItemsDetect01 : DevExpress.XtraEditors.XtraForm
{
- int _currentHandle5 =0;
+ int _currentHandle5 = 0;
string _webServiceName = "MesQaItemsDetect01Manager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
public Frm_MesQaItemsDetect01()
{
InitializeComponent();
- this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick;
this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
- this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
- Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1);
+ this.toolBarMenu1.getXmlConfig();
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx3);
- Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "modify1FlagTxt", "", (value) =>
- {
- Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
- });
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "fsubmitTxt", "", (value) =>
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+ });
Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
{
getModel(value);
@@ -47,22 +45,15 @@
});
getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
- txt_itemId.EditChanged += (s, e) =>
- {
- txt_itemModel.Text = this.txt_itemId.GetModel();
- txt_itemNo.Text = this.txt_itemId.GetCode();
- };
txtJianYan.KeyDown += TxtJianYan_KeyDown;
this.btnLoad.Click += BtnLoad_Click;
ucUpFile1.UpChanged += UcUpFile1_UpChanged;
xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged;
gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
- //鏈夋�ц兘闂
- this.txt_suppId.getSuppler("");
}
private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
+ Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
Task.Delay(100);
getPageList(1);
}
@@ -103,6 +94,10 @@
if (_rtn.rtnCode > 0)
{
getModel(lbGuid.Text.Trim());
+ }
+ else
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtn.rtnMsg);
}
}
catch (Exception ex)
@@ -183,11 +178,13 @@
_webServiceName + "EdtModel12",
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
- this.alertControl1.Show(this, "鎻愮ず!", _rtn.rtnMsg);
if (_rtn.rtnCode > 0)
{
- txtJianYan.Text = "";
getModel(lbGuid.Text.Trim());
+ }
+ else
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtn.rtnMsg);
}
txtJianYan.Text = "";
}
@@ -250,7 +247,7 @@
/// <param name="sender"></param>
/// <param name="e"></param>
/// <exception cref="NotImplementedException"></exception>
- private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e)
+ private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e)
{
toolBarMenu1.guidKey = "";
string rowGuid, rowName;
@@ -264,7 +261,14 @@
}
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愪氦妫�楠屽悧锛�"))
return;
-
+ if (txt_fcheckResu.Text.Trim() == "涓嶅悎鏍�")
+ {
+ if (string.IsNullOrEmpty(txt_remarks.Text.Trim()) )
+ {
+ MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄨ鏄庯紒");
+ return;
+ }
+ };
var _obj = new
{
guid = rowGuid,
@@ -276,19 +280,23 @@
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 = 1;
+ UtilityHelper.SetCheckIco(gridView1, "fsubmitTxt", "", "iqcDate", picCheckBox, this, _inFieldValue.ToString());
}
}
catch (Exception ex)
{
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
-
+
}
/// <summary>
@@ -301,43 +309,6 @@
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
}
- /// <summary>
- /// 鍒犻櫎浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
- {
- string rowGuid = "", rowName = "";
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
- if (string.IsNullOrEmpty(rowGuid))
- {
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
- return;
- }
- if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵"))
- return;
- List<dynamic> lst = new List<dynamic>();
- lst.Add(rowGuid);
- var _obj = lst;
- try
- {
- string strJson = UtilityHelper.HttpPost("", _webServiceName + "DeleteModel", JsonConvert.SerializeObject(_obj));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
- if (_rtn.rtnCode > 0)
- {
- if (xtraTabControl1.SelectedTabPageIndex == 0)
- getPageList(this.pageBar1.CurrentPage);
- else
- Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
- }
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
- }
- catch (Exception ex)
- {
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- }
- }
/// <summary>
/// 鍒锋柊浜嬩欢
@@ -350,14 +321,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);
}
}
/// <summary>
@@ -367,6 +339,7 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
{
+ toolBarMenu1.currentAction = "edit";
string rowGuid = "", rowName = "";
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
if (string.IsNullOrEmpty(rowGuid))
@@ -375,23 +348,19 @@
return;
}
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
- UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ {
+ getModel(rowGuid);
+ }
+ else
+ {
+ List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+ gvList.Add(gvMx1);
+ gvList.Add(gvMx2);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
+ }
}
- /// <summary>
- /// 鏂板浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
- {
- lbGuid.Text = "";
- Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
- List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
- gridViews.Add(gvMx1);
- gridViews.Add(gvMx2);
- UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
- Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
- }
+
/// <summary>
/// 淇濆瓨浜嬩欢
/// </summary>
@@ -400,23 +369,17 @@
private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e)
{
toolBarMenu1.isSetBtn = false;
- if (string.IsNullOrEmpty(txt_fngDesc.Text.Trim()))
- {
- Gs.DevApp.ToolBox.MsgHelper.Warning("涓嶈壇鎻忚堪涓嶈兘涓虹┖锛�");
- txt_fngDesc.Focus();
- return;
- }
- if (string.IsNullOrEmpty(txt_lotNo1.Text.Trim()))
+ if (string.IsNullOrEmpty(txt_remarks.Text.Trim()))
{
Gs.DevApp.ToolBox.MsgHelper.Warning("澶囨敞鑳戒负绌猴紒");
- txt_fngDesc.Focus();
+ txt_remarks.Focus();
return;
}
var _obj = new
{
guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
- fngDesc = txt_fngDesc.Text.Trim(),
- lotNo1 = txt_lotNo1.Text.Trim(),
+ fngDesc = "",
+ remarks = txt_remarks.Text.Trim(),
};
try
{
@@ -427,7 +390,7 @@
{
lbGuid.Text = _rtn.rtnData;
toolBarMenu1.isSetBtn = true;
- UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false);
}
}
catch (Exception ex)
@@ -441,7 +404,7 @@
/// </summary>
/// <param name="curPage">绗嚑椤�</param>
/// <param name="pageSize">姣忛〉鍑犳潯</param>
- private void getPageList(int curPage)
+ private void getPageList(int curPage)
{
var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
_sbSqlWhere += " and isnull(fsubmit,0)=0";
@@ -454,15 +417,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();
}
else
- UtilityHelper.SetDefaultTable(gcMain, gridView1);
+ UtilityHelper.SetDefaultTable(gcMain1, gridView1);
gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
pageBar1.CurrentPage = curPage;//褰撳墠椤�
@@ -477,9 +441,9 @@
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
-
+
}
- private void getModel(string strGuid)
+ private void getModel(string strGuid)
{
bool isEdit = false;
if (toolBarMenu1.currentAction == "add") return;
@@ -503,7 +467,7 @@
lbGuid.Text = strGuid;
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
- UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
+ UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
JObject _job = JObject.Parse(strJson);
JArray array = new JArray();
foreach (var a in _job["rtnData"]["list5"])
@@ -516,6 +480,7 @@
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = dt;
gcMx1.ForceInitialize();
+ gvMx1.BestFitColumns();
gvMx1.FocusedRowHandle = _currentHandle5;
ucUpFile1.parentGuid = lbGuid.Text.Trim();
var row = gvMx1.GetDataRow(_currentHandle5);
@@ -537,7 +502,7 @@
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
-
+
}
@@ -578,6 +543,7 @@
gcMx3.BindingContext = new BindingContext();
gcMx3.DataSource = dt;
gcMx3.ForceInitialize();
+ gvMx3.BestFitColumns();
}
else
{
@@ -593,7 +559,7 @@
/// 鏍规嵁妫�楠岄」鐩鍙栨娊鏍风粨鏋�
/// </summary>
/// <param name="guid5"></param>
- private void getList12(string guid5)
+ private void getList12(string guid5)
{
var _obj = new
{
@@ -608,12 +574,13 @@
gcMx2.BindingContext = new BindingContext();
gcMx2.DataSource = dt;
gcMx2.ForceInitialize();
+ gvMx2.BestFitColumns();
}
catch (Exception ex)
{
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
-
+
}
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
--
Gitblit v1.9.3