From d1104a30df234dc5e28703ea2d9ea57717005442 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期三, 16 七月 2025 09:57:21 +0800
Subject: [PATCH] bug
---
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs | 229 ++++++++++++++++++++++++++++++++------------------------
1 files changed, 131 insertions(+), 98 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
index 699ef10..d4e74a3 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
@@ -1,3 +1,4 @@
+using Gs.DevApp.DevFrm.Rpt;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
@@ -20,60 +21,137 @@
InitializeComponent();
this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
- toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick;
- toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick;
+ this.toolBarMenu1.getXmlConfig();
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) =>
{
Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
- });
+ }, tips);
Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
{
getModel(value);
}, (value) =>
{
getPageList(this.pageBar1.CurrentPage);
- });
+ }, lbGuid);
getPageList(1);
pageBar1.PagerEvent += PageBar1_PagerEvent;
- txt_depotsId.getSuppler("");
- txt_suppId.getSuppler("");
- //璁剧疆浠撳簱閫夋嫨
- this.txt_depotsId.EditChanged += (s, e) =>
+ //鎵撳嵃浜嬩欢
+ this.ucBtnPrint1.btnPrintClick += (s, e) =>
{
- txtDepotsId.Text = this.txt_depotsId.GetId();
+ string rowGuid = lbMxGuid.Text.Trim();
+ ucBtnPrint1.guidKey = rowGuid;
+ if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_1.Text.Trim(), txt_yuliang_1.Text.Trim()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇疯緭鍏ユ纭殑鏉$爜鏁伴噺锛�");
+ txt_iCount_1.Focus();
+ this.ucBtnPrint1.rptParameter = "return false";
+ return;
+ }
+ if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_psnQty_1.Text.Trim()))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
+ txt_psnQty_1.Focus();
+ this.ucBtnPrint1.rptParameter = "return false";
+ return;
+ }
+ if (lbMxGuid.Text.Trim().Length < 10)
+ {
+ Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鐨勮锛�");
+ this.ucBtnPrint1.rptParameter = "return false";
+ return;
+ }
+ this.ucBtnPrint1.rptParameter = "rpt_Arrival{"
+ + lbMxGuid.Text.Trim()//鍏宠仈涓婚敭
+ + "," + ""
+ + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim())//浣欐暟
+ + "," + txt_iCount_1.Text.Trim()//寮犳暟
+ + "," + txt_psnQty_1.Text.Trim()//姣忓紶鏉$爜鏁伴噺
+ + "}";
+ txt_iCount_1.Text = "";
+ txt_psnQty_1.Text = "";
};
- //璁剧疆渚涘簲鍟嗛�夋嫨
- this.txt_suppId.EditChanged += (s, e) =>
+ //鎵撳嵃鎵归噺鎿嶄綔浜嬩欢
+ this.ucBtnPrint1.btnAllClick += (s, e) =>
{
- txtSupplierId.Text = this.txt_suppId.GetId();
+ string rowGuid = lbMxGuid.Text.Trim();
+ SelectDeleteBar frm = new SelectDeleteBar(rowGuid, "閲囪喘鍏ュ簱");
+ string strCodeList = "";
+ frm.UpdateParent += (ss, ee) =>
+ {
+ strCodeList = ee.StringSingle;
+ };
+ frm.ShowDialog();
+ if (string.IsNullOrEmpty(strCodeList))
+ return;
+ try
+ {
+ string rptParameter = "rpt_Arrival{"
+ + "100"//閲嶆墦閮芥槸浼�100锛�
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + strCodeList
+ + "}";
+ using (Form rpt = new RptPreview(rowGuid, rptParameter))
+ {
+ rpt.ShowDialog();
+ }
+ frm.Close();
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.ShowError(ex.Message);
+ }
};
- gcMx1.MouseClick += GcMx1_MouseClick;
+ gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
+ //鎵撳嵃鑷姩璁$畻
+ txt_psnQty_1.TextChanged += (s, e) =>
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.PrintJiSuan(txt_psnQty_1, txt_iCount_1, txt_kQty.Text.Trim(), radOut, txt_yuliang_1);
+ };
+ radOut.SelectedIndexChanged += (s, e) =>
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut, txt_yuliang_1);
+ };
+ this.ucBtnPrint1.SetPrintButton(false);
}
private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
+ _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
Task.Delay(100);
getPageList(1);
}
- private void GcMx1_MouseClick(object sender, MouseEventArgs e)
+ private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
{
- string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "guid");
- if (string.IsNullOrEmpty(rowGuid))
- return;
- lbMxGuid.Text = rowGuid;
- toolBarMenu1.guidKey = rowGuid;
- var info = gvMx1.CalcHitInfo(e.Location);
- var view = info.View;
- var row = view.GetDataRow(info.RowHandle);
- txtWlid.Text = row["itemId"].ToString();
- txtWlgg.Text = row["itemModel"].ToString();
- txtWlmc.Text = row["itemName"].ToString();
- txtQuantity.Text = row["Quantity"].ToString();
- kyPrtQty.Text = row["kyPrtQty"].ToString();
+ if (e.FocusedRowHandle >= 0)
+ {
+ DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
+ lbMxGuid.Text = row["guid"].ToString();
+ txtWlid.Text = row["itemNo"].ToString();
+ txtWlgg.Text = row["itemModel"].ToString();
+ txtWlmc.Text = row["itemName"].ToString();
+ txtQuantity.Text = row["quantity"].ToString();//鏈鏀惰揣鎬婚噺
+ txt_yQty.Text = row["yQty"].ToString();//宸叉墦鍗版�婚噺
+ txt_kQty.Text = row["kQty"].ToString(); //鍙墦鍗版�婚噺
+ txt_psnQty_1.Text = row["mrtmsl"].ToString(); //榛樿姣忓紶鏉$爜鏁伴噺
+ }
+ else
+ {
+ lbMxGuid.Text = "";
+ ucBtnPrint1.guidKey = "";
+ txtWlid.Text = "";
+ txtWlgg.Text = "";
+ txtWlmc.Text = "";
+ txtQuantity.Text = "";
+ txt_yQty.Text = "";
+ txt_kQty.Text = "";
+ txt_psnQty_1.Text = "";
+ txt_iCount_1.Text = "";
+ }
}
-
/// <summary>
/// 鍒嗛〉浜嬩欢
/// </summary>
@@ -93,7 +171,7 @@
gridView1.ColumnFilterChanged -= GridView1_ColumnFilterChanged;
gridView1.ActiveFilter.Clear();
gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
- var frm = new ShowFilter(gridView1.Columns, _filterList);
+ var frm = new ShowFilter(gridView1.Columns, _filterList, this.GetType().FullName);
frm.UpdateParent += Frm_UpdateParent;
frm.ShowDialog();
}
@@ -107,19 +185,6 @@
_filterList = e.FilterList;
getPageList(1);
}
- private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e)
- {
- toolBarMenu1.guidKey = "";
- string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_billNo, gridView1);
- toolBarMenu1.guidKey = rowGuid;
- toolBarMenu1.rptParameter = "rpt_Arrival{}";
- }
- private void ToolBarMenu1_btnReportClick(object sender, EventArgs e)
- {
- _print();
- }
/// <summary>
/// 鍒锋柊浜嬩欢
@@ -132,14 +197,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>
@@ -149,7 +215,7 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
var pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date",
"asc", "", _sbSqlWhere.ToString());
var json = JsonConvert.SerializeObject(pgq);
@@ -161,15 +227,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(); Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gridView1);
}
else
- UtilityHelper.SetDefaultTable(gcMain, gridView1);
+ UtilityHelper.SetDefaultTable(gcMain1, gridView1);
gridView1.ColumnFilterChanged += GridView1_ColumnFilterChanged;
pageBar1.TotalPages = dd.rtnData.pages;//鎬婚〉
pageBar1.CurrentPage = curPage;//褰撳墠椤�
@@ -187,6 +254,7 @@
}
private void getModel(string strGuid)
{
+ gcMx1.DataSource = null;
bool isEdit = false;
if (toolBarMenu1.currentAction == "add") return;
if (toolBarMenu1.currentAction == "edit") isEdit = true;
@@ -210,18 +278,21 @@
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
gvList.Add(gvMx2);
- UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList);
+ UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
JArray array1 = new JArray();
foreach (var a in dy["list1"])
{
array1.Add(a);
}
+
DataTable dt1 = JsonConvert.DeserializeObject<DataTable>(array1.ToString());
if (dt1.Rows.Count > 0)
{
gcMx1.BindingContext = new BindingContext();
gcMx1.DataSource = dt1;
gcMx1.ForceInitialize();
+ gvMx1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
}
else
{
@@ -238,6 +309,8 @@
gcMx2.BindingContext = new BindingContext();
gcMx2.DataSource = dt2;
gcMx2.ForceInitialize();
+ gvMx2.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx2);
}
else
{
@@ -252,46 +325,6 @@
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
- private void _print()
- {
- toolBarMenu1.guidKey = "";
- string rowGuid, rowName;
- (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_billNo, gridView1);
- toolBarMenu1.guidKey = rowGuid;
- if (xtraTabControl1.SelectedTabPageIndex == 0)
- {
- Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 5);
- this.toolBarMenu1.rptParameter = "return false";
- return;
- }
- if (lbMxGuid.Text.Trim().Length < 36)
- {
- Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨浣犺鎵撳嵃鐨勮锛�");
- this.toolBarMenu1.rptParameter = "return false";
- return;
- }
- if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim()))
- {
- Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�");
- txt_iCount_1.Focus();
- this.toolBarMenu1.rptParameter = "return false";
- return;
- }
- if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim()))
- {
- Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
- txt_psnQty_1.Focus();
- this.toolBarMenu1.rptParameter = "return false";
- return;
- }
- toolBarMenu1.guidKey = lbMxGuid.Text;
- this.toolBarMenu1.rptParameter = "rpt_Arrival{" + ""
- + "," + ""
- + "," + ""
- + "," + txt_iCount_1.Text.Trim()
- + "," + txt_psnQty_1.Text.Trim()
- + "}";
- }
+
}
}
\ No newline at end of file
--
Gitblit v1.9.3