From 13096114a7457a3b1b519c88b9409697b697eb21 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期五, 25 四月 2025 12:00:08 +0800
Subject: [PATCH] 工位和fqc绑定
---
DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs | 129 ++++++++++++++++++++++++++++++-------------
1 files changed, 90 insertions(+), 39 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
index 7a1a7a1..097574c 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_ArrivalBarcode.cs
@@ -1,4 +1,3 @@
-using DevExpress.Utils.MVVM.Services;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
@@ -8,7 +7,6 @@
using System.Collections.Generic;
using System.Data;
using System.Threading.Tasks;
-using System.Windows.Controls;
using System.Windows.Forms;
namespace Gs.DevApp.DevFrm
@@ -22,34 +20,22 @@
InitializeComponent();
this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
+ 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) =>
- {
- txtDepotsId.Text = this.txt_depotsId.GetCode();
- };
- //璁剧疆渚涘簲鍟嗛�夋嫨
- this.txt_suppId.EditChanged += (s, e) =>
- {
- txtSupplierId.Text = this.txt_suppId.GetCode();
- };
-
this.ucBtnPrint1.btnDesignClick += (s, e) =>
{
ucBtnPrint1.rptParameter = "rpt_Arrival{}";
@@ -58,14 +44,14 @@
{
string rowGuid = lbMxGuid.Text.Trim();
ucBtnPrint1.guidKey = rowGuid;
- if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim()))
+ if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_iCount_1.Text.Trim()))
{
Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�");
txt_iCount_1.Focus();
this.ucBtnPrint1.rptParameter = "return false";
return;
}
- if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim()))
+ if (!Gs.DevApp.ToolBox.UtilityHelper.IsNumeric3(txt_psnQty_1.Text.Trim()))
{
Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜鏁伴噺锛�");
txt_psnQty_1.Focus();
@@ -80,16 +66,27 @@
}
this.ucBtnPrint1.rptParameter = "rpt_Arrival{" + lbMxGuid.Text.Trim()
+ "," + ""
- + "," + ""
+ + "," + Gs.DevApp.ToolBox.UtilityHelper.PrintYuLiang(radOut).ToString()
+ "," + txt_iCount_1.Text.Trim()
+ "," + txt_psnQty_1.Text.Trim()
+ "}";
+ txt_iCount_1.Text = "";
+ txt_psnQty_1.Text = "";
};
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);
+ };
+ radOut.SelectedIndexChanged += (s, e) =>
+ {
+ Gs.DevApp.ToolBox.UtilityHelper.PrintAuto(txt_psnQty_1, txt_iCount_1, radOut);
+ };
}
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);
}
@@ -103,8 +100,21 @@
txtWlgg.Text = row["itemModel"].ToString();
txtWlmc.Text = row["itemName"].ToString();
txtQuantity.Text = row["quantity"].ToString();//鏈鏀惰揣鎬婚噺
- txtYdy.Text = row["yQty"].ToString();//宸叉墦鍗版�婚噺
- txtKdy.Text = row["kQty"].ToString(); //鍙墦鍗版�婚噺
+ txt_yQty.Text = row["yQty"].ToString();//宸叉墦鍗版�婚噺
+ txt_kQty.Text = row["kQty"].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>
@@ -126,7 +136,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();
}
@@ -152,14 +162,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>
@@ -169,7 +180,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);
@@ -181,15 +192,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;//褰撳墠椤�
@@ -231,19 +243,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
{
@@ -260,6 +274,8 @@
gcMx2.BindingContext = new BindingContext();
gcMx2.DataSource = dt2;
gcMx2.ForceInitialize();
+ gvMx2.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx2);
}
else
{
@@ -274,5 +290,40 @@
ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
+
+ private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
+ {
+ var rowhandle = gvMx2.FocusedRowHandle;
+ if (rowhandle < 0)
+ return;
+ if (e.Button.Index == 0)
+ {
+ var dr = gvMx2.GetDataRow(rowhandle);
+ var mxGuid = dr["guid"].ToString();
+ if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
+ return;
+ var _obj = new
+ {
+ mxGuid = mxGuid,
+ inType = "dhtm"
+ };
+ try
+ {
+ var strJson = UtilityHelper.HttpPost("",
+ _webServiceName + "DeleteBarcode",
+ JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+ if (_rtn.rtnCode > 0)
+ {
+ if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
+ }
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
+ }
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3