From 4411e9f4d11941ff3869a2a4cfb5093f26a2e07d Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期三, 15 一月 2025 10:26:24 +0800
Subject: [PATCH] 委外
---
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_InitialBarcode.cs | 116 +++++++++++++++++++++++++++++++---------------------------
1 files changed, 62 insertions(+), 54 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_InitialBarcode.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_InitialBarcode.cs
index 07954cb..104c1d8 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_InitialBarcode.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_InitialBarcode.cs
@@ -1,12 +1,12 @@
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
+using Gs.DevApp.UserControl;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
-using System.Drawing;
-using System.Windows.Controls;
+using System.Threading.Tasks;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm
@@ -22,42 +22,33 @@
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick;
toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick;
- gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
- getPageList(1, UtilityHelper.GetPageSize());
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (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();
- }
- };
- 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);
- };
- //璁剧疆渚涘簲鍟嗛�夋嫨
- this.txt_suppNo_1.KeyFile = "id";
+ txt_suppNo_1.getSuppler("");
this.txt_suppNo_1.EditChanged += (s, e) =>
{
- txt_suppId.Text = this.txt_suppNo_1.GetId();
+ txt_suppId.Text = this.txt_suppNo_1.GetCode();
};
}
-
- /// <summary>
- /// 鍙屽嚮浜嬩欢
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
+ private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
- if (!string.IsNullOrEmpty(rowGuid))
- getModel(rowGuid, false, 999);
+ _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
+ Task.Delay(100);
+ getPageList(1);
}
+
/// <summary>
/// 鍒嗛〉浜嬩欢
/// </summary>
@@ -65,7 +56,7 @@
/// <param name="pageSize"></param>
private void PageBar1_PagerEvent(int curPage, int pageSize)
{
- getPageList(curPage, pageSize);
+ getPageList(curPage);
}
/// <summary>
/// 鏌ヨ浜嬩欢
@@ -74,7 +65,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();
}
@@ -86,7 +80,7 @@
private void Frm_UpdateParent(object sender, UpdateParentEventArgs e)
{
_filterList = e.FilterList;
- getPageList(1, pageBar1.RowsCount);
+ getPageList(1);
}
/// <summary>
@@ -97,9 +91,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);
+ }
}
private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e)
{
@@ -108,6 +111,7 @@
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
lbGuid, txt_itemName, gridView1);
toolBarMenu1.guidKey = rowGuid;
+ toolBarMenu1.rptParameter = "rpt_ItemInv{}";
}
private void ToolBarMenu1_btnReportClick(object sender, EventArgs e)
{
@@ -118,7 +122,7 @@
toolBarMenu1.guidKey = rowGuid;
if (xtraTabControl1.SelectedTabPageIndex == 0)
{
- getModel(rowGuid, false, 999);
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 5);
this.toolBarMenu1.rptParameter = "return false";
return;
}
@@ -156,31 +160,32 @@
/// </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);
+ PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
{
- string strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json);
+ var strReturn = UtilityHelper.HttpPost("", _webServiceName + "GetListPage", json);
ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn);
if (dd.rtnCode > 0)
{
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();
+ gridView1.BestFitColumns();
+ }
+ else
+ UtilityHelper.SetDefaultTable(gcMain, gridView1);
+ gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
+ pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
pageBar1.CurrentPage = curPage;//褰撳墠椤�
- pageBar1.RowsCount = pageSize;//姣忛〉鏄剧ず
- pageBar1.setTxt();
+ pageBar1.RecordCount = dd.rtnData.total;//鎬昏褰曟暟
}
else
{
@@ -191,15 +196,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);
txt_iCount_1.Text = "";
txt_psnQty_1.Text = "";
txt_suppNo_1.SetIdOrCode("-1");
--
Gitblit v1.9.3