From 76281d909e76379c640c068b04119a4d227c1242 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 16 一月 2025 16:37:07 +0800
Subject: [PATCH] 细节
---
DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs | 216 ++++++++++++++++++++++++++++++-----------------------
1 files changed, 122 insertions(+), 94 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs b/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs
index 2dff202..0589453 100644
--- a/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Sys/DocNoRule.cs
@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Data;
using System.Windows.Forms;
-using DevExpress.RichEdit.Export;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using Gs.DevApp.Entity;
@@ -24,43 +23,28 @@
toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
- gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
- gridView1.FocusedRowChanged += (s, e) =>
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "checkStatus", "", (value) =>
{
- UtilityHelper.SetCheckIco(s, picCheckBox, this, "checkStatus", "");
- };
- getPageList(1, UtilityHelper.GetPageSize());
+ 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;
getTree();
- txt_docCode.EditValueChanged += Txt_docCode_EditValueChanged;
- txxtItem1.EditValueChanged += TxxtItem1_EditValueChanged;
- txxtItem2.EditValueChanged += TxxtItem1_EditValueChanged;
- txxtItem3.EditValueChanged += TxxtItem1_EditValueChanged;
- txxtItem4.EditValueChanged += TxxtItem1_EditValueChanged;
- txt_noLength.ValueChanged += Txt_noLength_ValueChanged;
- txt_isIncludeDoc.CheckedChanged +=
- Txt_flagIncludeDocCode_CheckedChanged;
- txt_isSpilit.CheckedChanged +=
- Txt_flagIncludeDocCode_CheckedChanged;
-
-
- }
-
- /// <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);
- txxtItem1.Enabled = txxtItem2.Enabled =
- txxtItem3.Enabled = txxtItem4.Enabled = false;
- }
+ txt_docCode.EditValueChanged += (s, e) => { DoPreviewCode(); };
+ txxtItem1.EditValueChanged += (s, e) => { DoPreviewCode(); };
+ txxtItem2.EditValueChanged += (s, e) => { DoPreviewCode(); };
+ txxtItem3.EditValueChanged += (s, e) => { DoPreviewCode(); };
+ txxtItem4.EditValueChanged += (s, e) => { DoPreviewCode(); };
+ txt_noLength.ValueChanged += (s, e) => { DoPreviewCode(); };
+ txt_isIncludeDoc.CheckedChanged += (s, e) => { DoPreviewCode(); };
+ txt_isSpilit.CheckedChanged += (s, e) => { DoPreviewCode(); };
}
/// <summary>
@@ -70,7 +54,7 @@
/// <param name="pageSize"></param>
private void PageBar1_PagerEvent(int curPage, int pageSize)
{
- getPageList(curPage, pageSize);
+ getPageList(1);
}
/// <summary>
@@ -81,11 +65,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_docCode, gridView1);
- toolBarMenu1.guidKey = rowGuid;
+ _toolCk(0);
}
/// <summary>
@@ -95,11 +75,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_docCode, gridView1);
- toolBarMenu1.guidKey = rowGuid;
+ _toolCk(1);
}
/// <summary>
@@ -109,7 +85,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>
@@ -121,7 +97,7 @@
{
string rowGuid, rowName;
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_docCode, gridView1);
+ lbGuid, txt_docCode, gridView1, "docCode");
if (string.IsNullOrEmpty(rowGuid))
{
MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -141,10 +117,12 @@
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1, UtilityHelper.GetPageSize());
+ if (xtraTabControl1.SelectedTabPageIndex == 0)
+ { }
+ else
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
+ getPageList(this.pageBar1.CurrentPage);
}
-
MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
catch (Exception ex)
@@ -160,8 +138,20 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1, UtilityHelper.GetPageSize());
+ if (xtraTabControl1.SelectedTabPageIndex == 1)
+ 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);
+ getPageList(this.pageBar1.CurrentPage);
+ }
}
/// <summary>
@@ -179,10 +169,9 @@
MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
-
- getModel(rowGuid, true, 1);
- txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled =
- txxtItem4.Enabled = panelControl1.Enabled = true;
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
+ UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
+ txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled = txxtItem4.Enabled = panelControl1.Enabled = true;
}
/// <summary>
@@ -192,8 +181,8 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 1);
lbGuid.Text = "";
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
UtilityHelper.CleanValueByControl(panel1.Controls, true);
txxtItem1.SelectedIndex = txxtItem2.SelectedIndex =
txxtItem3.SelectedIndex = txxtItem4.SelectedIndex = 0;
@@ -234,7 +223,7 @@
var _obj = new
{
- guid =UtilityHelper.ToGuid( lbGuid.Text.Trim()), //涓诲缓
+ guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
docCode = txt_docCode.EditValue.ToString(),
docFormat = txt_docFormat.Text,
noLength = txt_noLength.Value.ToString(),
@@ -265,9 +254,9 @@
/// </summary>
/// <param name="curPage">绗嚑椤�</param>
/// <param name="pageSize">姣忛〉鍑犳潯</param>
- private void getPageList(int curPage, int pageSize)
+ private void getPageList(int curPage)
{
- var pgq = new PageQueryModel(curPage, pageSize, "doc_Code");
+ var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "doc_Code");
var json = JsonConvert.SerializeObject(pgq);
try
{
@@ -280,12 +269,10 @@
gcMain.BindingContext = new BindingContext();
gcMain.DataSource = dt;
gcMain.ForceInitialize();
- int dddd = dd.rtnData.pages;//鎬婚〉
- pageBar1.TotalPages = dddd;
- pageBar1.RecordCount = dd.rtnData.total;//璁板綍鎬绘暟
+ pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
pageBar1.CurrentPage = curPage;//褰撳墠椤�
- pageBar1.RowsCount = pageSize;//姣忛〉鏄剧ず
- pageBar1.setTxt();
+ pageBar1.RecordCount = dd.rtnData.total;//鎬昏褰曟暟
+ gridView1.BestFitColumns();
}
else
{
@@ -298,15 +285,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 //涓诲缓
@@ -333,6 +321,7 @@
txxtItem3.Text = "<" + _ary[2];
if (_ary.Length > 3)
txxtItem4.Text = "<" + _ary[3];
+ txxtItem1.Enabled = txxtItem2.Enabled = txxtItem3.Enabled = txxtItem4.Enabled = panelControl1.Enabled = false;
}
else
{
@@ -349,11 +338,15 @@
{
var dataTable = new DataTable();
dataTable.Columns.Add("docCode", typeof(string));
- dataTable.Rows.Add("DH(鍒拌揣鍗�)");
- dataTable.Rows.Add("JY(妫�楠屽崟)");
+ dataTable.Rows.Add("CGDH(鍒拌揣鍗�)");//V
+ dataTable.Rows.Add("CGJY(妫�楠屽崟)");//V
+ dataTable.Rows.Add("DBSQ(璋冩嫧鐢宠鍗�)");//V
+ dataTable.Rows.Add("GDPC(宸ュ崟鎺掍骇)");//V
+ dataTable.Rows.Add("WWPC(濮斿鎺掍骇)");//V
+ dataTable.Rows.Add("CKSQ(鍑哄簱鐢宠)");//V
+ dataTable.Rows.Add("RKSQ(鍏ュ簱鐢宠)");//V
dataTable.Rows.Add("TL(閫�鏂欏崟)");
dataTable.Rows.Add("IN(鍏ュ簱鍗�)");
- dataTable.Rows.Add("PB(鎵归噺鎺掍骇)");
dataTable.Rows.Add("SC(鐢熶骇宸ュ崟)");
dataTable.Rows.Add("OUT(鍑哄簱鍗�)");
dataTable.Rows.Add("HB(鐗╂枡鍚堝苟)");
@@ -361,25 +354,9 @@
txt_docCode.Properties.DataSource = dataTable;
txt_docCode.Properties.DisplayMember = "docCode"; // 鏄剧ず鐨勫垪
txt_docCode.Properties.ValueMember = "docCode"; // 瀹為檯鍊肩殑鍒�
- txt_docCode.Properties.TextEditStyle =TextEditStyles.DisableTextEditor;
+ txt_docCode.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
}
-
- private void Txt_flagIncludeDocCode_CheckedChanged(object sender,
- EventArgs e)
- {
- DoPreviewCode();
- }
-
- private void Txt_noLength_ValueChanged(object sender, EventArgs e)
- {
- DoPreviewCode();
- }
-
- private void TxxtItem1_EditValueChanged(object sender, EventArgs e)
- {
- DoPreviewCode();
- }
-
+
private void DoPreviewCode()
{
if (txt_docCode.Enabled == false
@@ -397,7 +374,6 @@
}
else
{
- // txtRuleFormat="<骞村勾>", "<骞村勾骞村勾>", "<鏈堟湀>", "<鏃ユ棩>" });
var preview = txt_docFormat.Text;
var length = int.Parse(txt_noLength.Value.ToString());
var docCode = "";
@@ -411,13 +387,65 @@
preview = preview.Replace("<鏃ユ棩>", "18");
preview = preview + (txt_isSpilit.Checked ? "-" : "") +
"8".PadLeft(length, '0');
- lblPreview.Text = "鐢熸垚缂栧彿锛�" + preview;
+ lblPreview.Text = "鏍蜂緥锛�" + preview;
}
}
- private void Txt_docCode_EditValueChanged(object sender, EventArgs e)
+ /// <summary>
+ /// 宸ュ叿鏉′簨浠�
+ /// </summary>
+ /// <param name="inFieldValue"></param>
+ private void _toolCk(int _inFieldValue)
{
- DoPreviewCode();
+ string strMsg = "";
+ switch (_inFieldValue)
+ {
+ case 1:
+ strMsg = "瀹℃牳";
+ break;
+ case 0:
+ strMsg = "鍙嶅鏍�";
+ break;
+ };
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_docCode, gridView1, "docCode");
+ if (string.IsNullOrEmpty(rowGuid))
+ {
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ return;
+ }
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
+ return;
+
+ var _obj = new
+ {
+ guid = rowGuid,
+ ckValue = _inFieldValue,
+ parameter = "SYS_DOC_RULE,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());
+ }
+ int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+ gridView1.FocusedRowHandle = rowHandle;
+ UtilityHelper.SetCheckIco(gridView1, "checkStatus", "", "", picCheckBox, this, _inFieldValue.ToString());
+ }
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+
}
}
}
\ No newline at end of file
--
Gitblit v1.9.3