From 2f7e917dc9032961335d506a689bfd30c709ba9e Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 03 四月 2025 11:01:52 +0800
Subject: [PATCH] 字典
---
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs | 166 +++++++++++++++++++++++++++++++++++++------------------
1 files changed, 111 insertions(+), 55 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs
index 50b1ae8..79bb48b 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs
@@ -1,14 +1,11 @@
using System;
using System.Collections.Generic;
using System.Data;
-using System.Drawing;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
-using DevExpress.RichEdit.Export;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
-using DevExpress.XtraGrid.Views.Base.ViewInfo;
using DevExpress.XtraGrid.Views.Grid;
using Gs.DevApp.DevFrm.QC.Models;
using Gs.DevApp.Entity;
@@ -32,32 +29,23 @@
toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
- gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
- Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1, picCheckBox, this, "checkStatus", "");
+ this.toolBarMenu1.getXmlConfig();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx( gvMx1);
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1,picCheckBox, this, "checkStatus", "", (value) =>
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+ });
+ Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
+ {
+ getModel(value);
+ }, (value) =>
+ {
+ getPageList(this.pageBar1.CurrentPage);
+ });
getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
- Gs.DevApp.ToolBox.UtilityHelper.SetGridSearMx(gvMx1);
}
- private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
- {
- _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
- Task.Delay(100);
- getPageList(1);
- }
- /// <summary>
- /// 鍙屽嚮浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- var rowGuid =
- UtilityHelper.GetCurrentDoubleRow(gridView1,
- e, "guid");
- if (!string.IsNullOrEmpty(rowGuid))
- getModel(rowGuid, false, 999);
- }
-
+
/// <summary>
/// 鍒嗛〉浜嬩欢
/// </summary>
@@ -75,11 +63,7 @@
/// <exception cref="NotImplementedException"></exception>
private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
{
- toolBarMenu1.guidKey = "";
- string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_lookupTypeCode, gridView1);
- toolBarMenu1.guidKey = rowGuid;
+ _toolCk(0);
}
/// <summary>
@@ -89,11 +73,7 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
{
- toolBarMenu1.guidKey = "";
- string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_lookupTypeCode, gridView1);
- toolBarMenu1.guidKey = rowGuid;
+ _toolCk(1);
}
/// <summary>
/// 鍙栨秷浜嬩欢
@@ -102,7 +82,7 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
}
/// <summary>
@@ -113,9 +93,19 @@
private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
{
if (xtraTabControl1.SelectedTabPageIndex == 1)
- getModel(lbGuid.Text.Trim(), false, 999);
+ getModel(lbGuid.Text.Trim());
else
- 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>
@@ -133,7 +123,17 @@
MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
- getModel(rowGuid, true, 1);
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ {
+ getModel(rowGuid);
+ }
+ else
+ {
+ var gvList = new List<GridView>();
+ gvList.Add(gvMx1);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true,gvList);
+ }
}
/// <summary>
@@ -151,6 +151,7 @@
return;
}
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
var lst = new List<MesSysLookups>();
for (var i = 0; i < gvMx1.DataRowCount; i++)
@@ -186,8 +187,9 @@
toolBarMenu1.isSetBtn = true;
var gridViews = new List<GridView>();
gridViews.Add(gvMx1);
- UtilityHelper.ChangeEnableByControl(panel1.Controls, false,
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false,
gridViews);
+ toolBarMenu1.currentAction = "";
}
}
catch (Exception ex)
@@ -214,16 +216,15 @@
if (dd.rtnCode > 0)
{
DataTable dt = dd.rtnData.list;
- gcMain.BindingContext = new BindingContext();
- gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+ gcMain1.BindingContext = new BindingContext();
if (dt.Rows.Count > 0)
{
- gcMain.DataSource = dt;
- gcMain.ForceInitialize();
+ gcMain1.DataSource = dt;
+ gcMain1.ForceInitialize();
+ gridView1.BestFitColumns();
}
else
- UtilityHelper.SetDefaultTable(gcMain, gridView1);
- gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ UtilityHelper.SetDefaultTable(gcMain1, gridView1);
pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
pageBar1.CurrentPage = curPage;//褰撳墠椤�
pageBar1.RecordCount = dd.rtnData.total;//鎬昏褰曟暟
@@ -239,15 +240,16 @@
}
}
- private void getModel(string strGuid, bool isEdit, int tabIdx)
+ private void getModel(string strGuid)
{
+ bool isEdit = false;
+ if (toolBarMenu1.currentAction == "add") return;
+ if (toolBarMenu1.currentAction == "edit") isEdit = true;
if (string.IsNullOrEmpty(strGuid))
{
MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
-
- UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
var _obj = new
{
guid = strGuid //涓诲缓
@@ -263,11 +265,9 @@
{
var dy = _rtn.rtnData;
lbGuid.Text = strGuid;
- var gvList =
- new List<GridView>();
+ var gvList = new List<GridView>();
gvList.Add(gvMx1);
- UtilityHelper.SetValueByObj(panel1.Controls, dy,
- isEdit, gvList);
+ UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
var _job = JObject.Parse(strJson);
var array = new JArray();
foreach (var a in _job["rtnData"]["list"]) array.Add(a);
@@ -302,6 +302,7 @@
ButtonPressedEventArgs e)
{
gvMx1.CloseEditor();
+ gvMx1.PostEditor();
gvMx1.UpdateCurrentRow();
var rowhandle = gvMx1.FocusedRowHandle;
if (rowhandle < 0)
@@ -327,7 +328,7 @@
JsonConvert.SerializeObject(lst));
var _rtn =
UtilityHelper.ReturnToDynamic(strJson);
- if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1);
+ if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
@@ -337,5 +338,60 @@
}
}
}
+ /// <summary>
+ /// 宸ュ叿鏉′簨浠�
+ /// </summary>
+ /// <param name="inFieldValue"></param>
+ private void _toolCk(int _inFieldValue)
+ {
+ string strMsg = "";
+ switch (_inFieldValue)
+ {
+ case 1:
+ strMsg = "瀹℃牳";
+ break;
+ case 0:
+ strMsg = "鍙嶅鏍�";
+ break;
+ };
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_lookupTypeName, gridView1, "lookupTypeName");
+ if (string.IsNullOrEmpty(rowGuid))
+ {
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
+ return;
+
+ var _obj = new
+ {
+ guid = rowGuid,
+ ckValue = _inFieldValue,
+ parameter = "MES_SYS_LOOKUP_TYPES,check_date,check_status,check_by"
+ };
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("", "General/GeneralCheck",
+ JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+ MsgHelper.Warning(_rtn.rtnData.outMsg.ToString());
+ if (_rtn.rtnCode > 0)
+ {
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ getModel(lbGuid.Text.Trim());
+ else
+ getPageList(this.pageBar1.CurrentPage);
+ UtilityHelper.SetCheckIco(gridView1, "checkStatus", "checkBy", "checkDate", picCheckBox, this, _inFieldValue.ToString());
+ }
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+
+ }
+
}
}
\ No newline at end of file
--
Gitblit v1.9.3