From c2480b417edd62db2e587afb7d0252d3cdcafa72 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 06 一月 2025 16:28:55 +0800
Subject: [PATCH] 退货申请
---
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs | 226 ++++++++++++++++++++++++++++----------------------------
1 files changed, 112 insertions(+), 114 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
index 1311a03..dd68677 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01.cs
@@ -1,25 +1,21 @@
-using DevExpress.Utils.About;
-using DevExpress.XtraGrid.Views.Grid.ViewInfo;
-using DevExpress.XtraRichEdit.Model;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
-using MES.Service.Modes;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
-using System.Drawing;
using System.Net;
+using System.Threading.Tasks;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm
{
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()
@@ -29,71 +25,51 @@
this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
- this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
+ // this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick;
- gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
- gcMx1.MouseClick += GcMx1_MouseClick;
- getPageList(1, UtilityHelper.GetPageSize());
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1);
+ 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, "fsubmitTxt", "", (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;
- gridView1.CustomDrawRowIndicator += (s, e) =>
- {
- if (e.Info.IsRowIndicator && e.RowHandle >= 0)
- {
- e.Info.DisplayText = (e.RowHandle + 1).ToString();
- }
- };
- this.gvMx1.IndicatorWidth = 50;
- gvMx1.CustomDrawRowIndicator += (s, e) =>
- {
- if (e.Info.IsRowIndicator && e.RowHandle >= 0)
- {
- e.Info.DisplayText = (e.RowHandle + 1).ToString();
- }
- };
- this.gvMx2.IndicatorWidth = 50;
- gvMx2.CustomDrawRowIndicator += (s, e) =>
- {
- if (e.Info.IsRowIndicator && e.RowHandle >= 0)
- {
- e.Info.DisplayText = (e.RowHandle + 1).ToString();
- }
- };
- gridView1.CustomDrawEmptyForeground += (s, e) =>
- {
- string str = "鏆傛湭鏌ユ壘鍒板尮閰嶇殑鏁版嵁!";
- Font f = new Font("寰蒋闆呴粦", 16);
- Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
- e.Graphics.DrawString(str, f, Brushes.Gray, r);
- };
- gvMx2.OptionsFind.ShowSearchNavButtons = false;
- gvMx2.OptionsView.ShowGroupPanel = false;
- gvMx3.OptionsFind.ShowSearchNavButtons = false;
- gvMx3.OptionsView.ShowGroupPanel = false;
- 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;
}
-
- private void GcMx1_MouseClick(object sender, MouseEventArgs e)
+ private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "guid");
- if (string.IsNullOrEmpty(rowGuid))
- return;
- var info = gvMx1.CalcHitInfo(e.Location);
- this._currentHandle5 = info.RowHandle;
- getList12(rowGuid);
+ _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
+ Task.Delay(100);
+ getPageList(1);
}
-
+ private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
+ {
+ if (e.FocusedRowHandle >= 0)
+ {
+ DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
+ string rowGuid = row["guid"].ToString();
+ if (string.IsNullOrEmpty(rowGuid))
+ return;
+ getList12(rowGuid);
+ }
+ }
/// <summary>
/// 閲嶆柊鍔犺浇妫�楠�
/// </summary>
@@ -119,7 +95,11 @@
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- getModel(lbGuid.Text.Trim(), false, 999);
+ getModel(lbGuid.Text.Trim());
+ }
+ else
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtn.rtnMsg);
}
}
catch (Exception ex)
@@ -135,6 +115,7 @@
private void TxtJianYan_KeyDown(object sender, KeyEventArgs e)
{
int intHandle = this.gvMx1.FocusedRowHandle;
+ this._currentHandle5 = intHandle;
if (intHandle < 0)
{
ToolBox.MsgHelper.Warning("鎻愮ず锛氳閫夋嫨妫�楠岄」鐩紒");
@@ -199,12 +180,15 @@
_webServiceName + "EdtModel12",
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
- MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
if (_rtn.rtnCode > 0)
{
- txtJianYan.Text = "";
- getModel(lbGuid.Text.Trim(), false, 999);
+ getModel(lbGuid.Text.Trim());
}
+ else
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtn.rtnMsg);
+ }
+ txtJianYan.Text = "";
}
catch (Exception ex)
{
@@ -214,24 +198,13 @@
}
/// <summary>
- /// 鍙屽嚮浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
- if (!string.IsNullOrEmpty(rowGuid))
- getModel(rowGuid, false, 999);
- }
- /// <summary>
/// 鍒嗛〉浜嬩欢
/// </summary>
/// <param name="curPage"></param>
/// <param name="pageSize"></param>
private void PageBar1_PagerEvent(int curPage, int pageSize)
{
- getPageList(curPage, pageSize);
+ getPageList(curPage);
}
/// <summary>
/// 鏌ヨ浜嬩欢
@@ -240,7 +213,10 @@
/// <param name="e"></param>
private void ToolBarMenu1_btnQueryClick(object sender, EventArgs e)
{
- Gs.DevApp.UserControl.ShowFilter frm = new Gs.DevApp.UserControl.ShowFilter(gridView1.Columns, _filterList);
+ gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+ gridView1.ActiveFilter.Clear();
+ gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ var frm = new ShowFilter(gridView1.Columns, _filterList);
frm.UpdateParent += Frm_UpdateParent;
frm.ShowDialog();
}
@@ -252,7 +228,7 @@
private void Frm_UpdateParent(object sender, UpdateParentEventArgs e)
{
_filterList = e.FilterList;
- getPageList(1, pageBar1.RowsCount);
+ getPageList(1);
}
/// <summary>
/// 鏃ュ織浜嬩欢
@@ -273,12 +249,12 @@
/// <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;
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_releaseNo, gridView1);
+ lbGuid, txt_releaseNo, gridView1, "lotNo");
toolBarMenu1.guidKey = rowGuid;
if (string.IsNullOrEmpty(rowGuid))
{
@@ -287,7 +263,14 @@
}
if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愪氦妫�楠屽悧锛�"))
return;
-
+ if (txt_fcheckResu.Text.Trim() == "涓嶅悎鏍�")
+ {
+ if (string.IsNullOrEmpty(txt_lotNo1.Text.Trim())|| string.IsNullOrEmpty(txt_fngDesc.Text.Trim()))
+ {
+ MsgHelper.Warning("鍗曟嵁涓轰笉鍚堟牸鏃讹紝璇峰~鍐欏娉ㄤ俊鎭拰涓嶈壇鎻忚堪锛�");
+ return;
+ }
+ };
var _obj = new
{
guid = rowGuid,
@@ -302,16 +285,18 @@
if (_rtn.rtnCode > 0)
{
if (xtraTabControl1.SelectedTabPageIndex == 1)
- getModel(lbGuid.Text.Trim(), false, 999);
+ {
+ // getModel(lbGuid.Text.Trim());
+ }
else
- getPageList(1, UtilityHelper.GetPageSize());
+ getPageList(this.pageBar1.CurrentPage);
}
}
catch (Exception ex)
{
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
-
+
}
/// <summary>
@@ -321,7 +306,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>
@@ -332,7 +317,7 @@
private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e)
{
string rowGuid = "", rowName = "";
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1);
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
if (string.IsNullOrEmpty(rowGuid))
{
ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -349,8 +334,10 @@
ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- UtilityHelper.JumpToTab(xtraTabControl1, 0);
- getPageList(1, UtilityHelper.GetPageSize());
+ if (xtraTabControl1.SelectedTabPageIndex == 0)
+ getPageList(this.pageBar1.CurrentPage);
+ else
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
}
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
@@ -368,9 +355,18 @@
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, UtilityHelper.GetPageSize());
+ {
+ _filterList.Clear();
+ if (gridView1.ActiveFilter.Count > 0)
+ {
+ gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+ gridView1.ActiveFilter.Clear();
+ gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ }
+ getPageList(1);
+ }
}
/// <summary>
/// 淇敼浜嬩欢
@@ -380,13 +376,14 @@
private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e)
{
string rowGuid = "", rowName = "";
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1);
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1, "releaseNo");
if (string.IsNullOrEmpty(rowGuid))
{
ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
- getModel(rowGuid, true, 1);
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
+ UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
}
/// <summary>
/// 鏂板浜嬩欢
@@ -395,8 +392,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);
List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gridViews.Add(gvMx1);
gridViews.Add(gvMx2);
@@ -452,15 +449,11 @@
/// </summary>
/// <param name="curPage">绗嚑椤�</param>
/// <param name="pageSize">姣忛〉鍑犳潯</param>
- private void getPageList(int curPage, int pageSize)
+ private void getPageList(int curPage)
{
-
- System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder();
- foreach (FilterEntity itm in _filterList)
- {
- _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" + itm.fileValue + "'");
- }
- PageQueryModel pgq = new PageQueryModel(curPage, pageSize, "create_date", "asc", "", _sbSqlWhere.ToString());
+ var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ // _sbSqlWhere += " and isnull(fsubmit,0)=0";
+ PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "release_no", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
{
@@ -470,13 +463,18 @@
{
DataTable dt = dd.rtnData.list;
gcMain.BindingContext = new BindingContext();
- gcMain.DataSource = dt;
- gcMain.ForceInitialize();
- int dddd = dd.rtnData.pages;//鎬婚〉
- pageBar1.TotalPages = dddd;
- pageBar1.RecordCount = dd.rtnData.total;//璁板綍鎬绘暟
+ gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
+ if (dt.Rows.Count > 0)
+ {
+ gcMain.DataSource = dt;
+ gcMain.ForceInitialize();
+ }
+ else
+ UtilityHelper.SetDefaultTable(gcMain, gridView1);
+ gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
pageBar1.CurrentPage = curPage;//褰撳墠椤�
- pageBar1.setTxt();
+ pageBar1.RecordCount = dd.rtnData.total;//鎬昏褰曟暟
}
else
{
@@ -487,17 +485,18 @@
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
-
+
}
- 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))
{
ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
- UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
-
var _obj = new
{
guid = strGuid,//涓诲缓
@@ -546,7 +545,7 @@
{
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
-
+
}
@@ -602,9 +601,8 @@
/// 鏍规嵁妫�楠岄」鐩鍙栨娊鏍风粨鏋�
/// </summary>
/// <param name="guid5"></param>
- private void getList12(string guid5)
+ private void getList12(string guid5)
{
-
var _obj = new
{
parentGuid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //涓诲缓
@@ -623,7 +621,7 @@
{
MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
-
+
}
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
--
Gitblit v1.9.3