From 93bd757f4801719b769e78f4dee00847c228a55d Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期三, 11 六月 2025 14:06:59 +0800
Subject: [PATCH] iqc单元格
---
DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs | 268 ++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 203 insertions(+), 65 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
index 9ad47bc..abe7cd3 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
@@ -15,6 +15,11 @@
{
string _webServiceName = "MesItemQtrkManager/";
List<FilterEntity> _filterList = new List<FilterEntity>();
+ string _ucGys = "";//渚涘簲鍟�
+ string _ucBm = "";//棰嗘枡閮ㄩ棬
+ string _ucCk = "";//鍙戞枡浠撳簱
+ string _ucHzlx = "";//璐т富绫诲瀷
+ string _ucHz = "";//璐т富
public Frm_MesItemQtrk()
{
InitializeComponent();
@@ -25,55 +30,59 @@
this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
- toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
- toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
+ this.toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick;
+ this.toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
+ this.toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
+ this.toolBarMenu1.btnCaiGouChkClick += ToolBarMenu1_btnCaiGouChkClick;
+ this.toolBarMenu1.btnCaiGouFchkClick += ToolBarMenu1_btnCaiGouFchkClick;
+ this.toolBarMenu1.btnCaiWuChkClick += ToolBarMenu1_btnCaiWuChkClick;
+ this.toolBarMenu1.btnCaiWuFchkClick += ToolBarMenu1_btnCaiWuFchkClick;
+ this.toolBarMenu1.getXmlConfig();
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2);
Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "isSh", "", (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_qt008.getSuppler("");
- txt_qt018.getSuppler("");
- //璁剧疆浠撳簱閫夋嫨
- this.txt_qt008.EditChanged += (s, e) =>
- {
+ //閫夋嫨搴撳瓨缁勭粐锛堝彉鏄庣粏涓殑鐗╂枡鍜屽彉璐т富锛�
+ this.txt_qt022.EditChanged += (s, e) =>
+ {
+ string _orgId = txt_qt022.GetId();
+ if (string.IsNullOrEmpty(_orgId))
+ return;
+ ucLookHuoZhu1.OrgId = _orgId;
+ ucLookHuoZhu1.HzId = _ucHz;
+ ucLookHuoZhu1.SetHzLx(_ucHzlx);
+ txt_qt009.getSuppler(_orgId, _ucBm);
+ txt_qt018.getSuppler(_orgId, _ucGys);
+ txt_qt008.getSuppler(_orgId, _ucCk);
+ System.Text.StringBuilder sbWhere = new System.Text.StringBuilder();
+ sbWhere.Append(" and a.FSubsidiary ='" + _orgId + "'");
+ var _obj = new PageQueryModel(1, 999999, "item_no", "asc", "", sbWhere.ToString(), "");
+ var json = JsonConvert.SerializeObject(_obj);
+ try
+ {
+ var strReturn = UtilityHelper.HttpPost("",
+ "MesItemsManager/GetListSelect", json);
+ var rtn = UtilityHelper.ReturnToTablePage(strReturn);
+ var dt = rtn.rtnData.list;
+ this.repositoryItemSearchLookUpEdit1.DataSource = dt;
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ }
};
- //璁剧疆渚涘簲鍟嗛�夋嫨
- this.txt_qt018.EditChanged += (s, e) =>
- {
-
- };
- var _obj = new
- {
- currentPage = 1,
- everyPageSize = 999999,
- sortName = "",
- keyWhere = "",
- };
- var json = JsonConvert.SerializeObject(_obj);
- try
- {
- var strReturn = UtilityHelper.HttpPost("",
- "MesItemsManager/GetListSelect", json);
- var rtn = UtilityHelper.ReturnToTablePage(strReturn);
- var dt = rtn.rtnData.list;
- this.repositoryItemSearchLookUpEdit1.DataSource = dt;
- }
- catch (Exception ex)
- {
- MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
- }
gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged;
this.ucBtnPrint1.btnDesignClick += (s, e) =>
{
@@ -84,14 +93,14 @@
ucBtnPrint1.guidKey = "";
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(), txt_yuliang_1.Text.Trim()))
{
- Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨鎵撳嵃鏉$爜寮犳暟锛�");
+ 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();
@@ -106,17 +115,42 @@
}
this.ucBtnPrint1.rptParameter = "rpt_Qtrk{" + lbMxGuid.Text.Trim()
+ "," + ""
- + "," + ""
+ + "," + Gs.DevApp.ToolBox.UtilityHelper.ToDecimal(txt_yuliang_1.Text.Trim())
+ "," + txt_iCount_1.Text.Trim()
+ "," + txt_psnQty_1.Text.Trim()
+ "}";
};
+
+ //鑷姩璁$畻鎵撳嵃閲�
+ 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);
+ };
}
+
private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
{
- Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
+ _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns, gridView1);
Task.Delay(100);
getPageList(1);
+ }
+ /// <summary>
+ /// 鏃ュ織
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void ToolBarMenu1_btnLogClick(object sender, EventArgs e)
+ {
+ toolBarMenu1.guidKey = "";
+ string rowGuid, rowName;
+ (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+ lbGuid, txt_qtck, gridView1);
+ toolBarMenu1.guidKey = rowGuid;
}
/// <summary>
@@ -138,7 +172,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();
}
@@ -171,7 +205,7 @@
{
string rowGuid = "", rowName = "";
(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
- lbGuid, txt_qtck, gridView1, "qtck");
+ lbGuid, txt_qtck, gridView1,"qtck");
if (string.IsNullOrEmpty(rowGuid))
{
MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
@@ -253,7 +287,8 @@
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
gvList.Add(gvMx2);
- UtilityHelper.ChangeEnableByControl(panel1.Controls, true, gvList);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList);
+ ucLookHuoZhu1.Enabled = true;
}
}
/// <summary>
@@ -268,9 +303,10 @@
List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gridViews.Add(gvMx1);
gridViews.Add(gvMx2);
- UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
+ UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews);
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
+ ucLookHuoZhu1.Enabled = true;
}
/// <summary>
/// 淇濆瓨浜嬩欢
@@ -283,7 +319,7 @@
string kcZz = txt_qt022.GetId();//搴撳瓨缁勭粐
string kcBm = txt_qt009.GetId();//搴撳瓨閮ㄩ棬
string kcGys = txt_qt018.GetId();//搴撳瓨渚涘簲鍟�
- string djLx = txt_qt003.Text.Trim();//鍗曟嵁绫诲瀷
+ string djLx = txt_qt003.TextTxt.Trim();//鍗曟嵁绫诲瀷
string kcfx = txt_qt019.Text.Trim();//搴撳瓨鏂瑰悜
string inHzlx = ucLookHuoZhu1.GetHzLx();//璐т富绫诲瀷
string inHz = ucLookHuoZhu1.GetHzId();//璐т富
@@ -305,7 +341,7 @@
Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨璐т富锛�");
return;
}
- if (txt_qt003.SelectedIndex < 0)
+ if (txt_qt003.TextTxt.Length < 0)
{
Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍗曟嵁绫诲瀷锛�");
txt_qt003.Focus();
@@ -317,9 +353,15 @@
txt_qt019.Focus();
return;
}
+ if (string.IsNullOrEmpty(kcBm) && string.IsNullOrEmpty(kcGys))
+ {
+ Gs.DevApp.ToolBox.MsgHelper.Warning("閮ㄩ棬鎴栦緵搴斿晢蹇呴』閫変竴涓紒");
+ txt_qt009.Focus();
+ return;
+ }
if (string.IsNullOrEmpty(kcCk))
{
- Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鍙戞枡浠撳簱锛�");
+ Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨鏀舵枡浠撳簱锛�");
txt_qt008.Focus();
return;
}
@@ -378,7 +420,10 @@
List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
gvList.Add(gvMx1);
gvList.Add(gvMx2);
- UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList);
+ UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, false, gvList);
+ ucLookHuoZhu1.Enabled = false;
+ toolBarMenu1.currentAction = "";
+ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6);
}
}
catch (Exception ex)
@@ -394,7 +439,7 @@
/// <param name="pageSize">姣忛〉鍑犳潯</param>
private void getPageList(int curPage)
{
- var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
+ gcMain1.DataSource = null; var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "qt001", "asc", "", _sbSqlWhere.ToString());
string json = JsonConvert.SerializeObject(pgq);
try
@@ -404,16 +449,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();
- gridView1.BestFitColumns();
+ 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;//褰撳墠椤�
@@ -429,8 +474,13 @@
ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
+ /// <summary>
+ /// 璇诲彇瀹炰綋
+ /// </summary>
+ /// <param name="strGuid"></param>
private void getModel(string strGuid)
{
+ gcMx1.DataSource = null;
bool isEdit = false;
if (toolBarMenu1.currentAction == "add") return;
if (toolBarMenu1.currentAction == "edit") isEdit = true;
@@ -450,11 +500,22 @@
if (_rtn.rtnCode > 0)
{
dynamic dy = _rtn.rtnData;
+ _ucGys = dy.qt018;
+ _ucBm = dy.qt009;
+ _ucCk = dy.qt008;
+ _ucHzlx = dy.qt023;
+ _ucHz = dy.qt024;
lbGuid.Text = strGuid;
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);
+ _ucGys = "";
+ _ucBm = "";
+ _ucCk = "";
+ _ucHzlx = "";
+ _ucHz = "";
+ ucLookHuoZhu1.Enabled = isEdit;
JObject _job = JObject.Parse(strJson);
JArray array = new JArray();
foreach (var a in _job["rtnData"]["list"])
@@ -468,12 +529,12 @@
gcMx1.DataSource = dt;
gcMx1.ForceInitialize();
gvMx1.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
}
else
{
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
}
-
JArray array2 = new JArray();
foreach (var a in _job["rtnData"]["list2"])
{
@@ -486,6 +547,7 @@
gcMx2.DataSource = dt2;
gcMx2.ForceInitialize();
gvMx2.BestFitColumns();
+ Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx2);
}
else
{
@@ -508,9 +570,14 @@
gvMx1.SetFocusedRowCellValue("qd002", SelectedDataRow["itemNo"]);
gvMx1.SetFocusedRowCellValue("qd003", SelectedDataRow["itemName"]);
gvMx1.SetFocusedRowCellValue("qd004", SelectedDataRow["itemModel"]);
- gvMx1.SetFocusedRowCellValue("qd009", SelectedDataRow["dwName"]);
+ gvMx1.SetFocusedRowCellValue("kcDw", SelectedDataRow["dwName"]);
+ gvMx1.SetFocusedRowCellValue("itemId", SelectedDataRow["id"]);
}
-
+ /// <summary>
+ /// 绉诲嚭鏄庣粏
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
var rowhandle = gvMx1.FocusedRowHandle;
@@ -571,7 +638,46 @@
{
_toolCk(0);
}
+ /// <summary>
+ /// 璐㈠姟瀹℃牳
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <exception cref="NotImplementedException"></exception>
+ private void ToolBarMenu1_btnCaiWuChkClick(object sender, EventArgs e)
+ {
+ _toolCk(30);
+ }
+ /// <summary>
+ /// 璐㈠姟鍙嶅鏍�
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ /// <exception cref="NotImplementedException"></exception>
+ private void ToolBarMenu1_btnCaiWuFchkClick(object sender, EventArgs e)
+ {
+ _toolCk(31);
+ }
+ /// <summary>
+ /// 閲囪喘瀹℃牳
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void ToolBarMenu1_btnCaiGouChkClick(object sender, EventArgs e)
+ {
+ _toolCk(40);
+ }
+ /// <summary>
+ /// 閲囪喘鍙嶅鏍�
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+
+ private void ToolBarMenu1_btnCaiGouFchkClick(object sender, EventArgs e)
+ {
+ _toolCk(41);
+ }
/// <summary>
/// 宸ュ叿鏉′簨浠�
/// </summary>
@@ -586,6 +692,18 @@
break;
case 0:
strMsg = "鍙嶅鏍�";
+ break;
+ case 30:
+ strMsg = "璐㈠姟瀹℃牳";
+ break;
+ case 31:
+ strMsg = "璐㈠姟鍙嶅鏍�";
+ break;
+ case 40:
+ strMsg = "閲囪喘瀹℃牳";
+ break;
+ case 41:
+ strMsg = "閲囪喘鍙嶅鏍�";
break;
};
toolBarMenu1.guidKey = "";
@@ -617,10 +735,14 @@
{
getModel(lbGuid.Text.Trim());
}
- int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+ //int rowHandle = gridView1.LocateByValue(1, gridView1.Columns["guid"], rowGuid);
+ //gridView1.FocusedRowHandle = rowHandle;
+ //UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, this, _inFieldValue.ToString());
+
+ //娉ㄦ剰锛岃繖閲屽拰鍏跺畠椤甸潰鏈夌偣涓嶄竴鏍�
+ getPageList(this.pageBar1.CurrentPage);
+ int rowHandle = gridView1.LocateByValue("guid", rowGuid);
gridView1.FocusedRowHandle = rowHandle;
- Form parentForm = this.FindForm();
- UtilityHelper.SetCheckIco(gridView1, "isSh", "qt016", "qt002", picCheckBox, parentForm, _inFieldValue.ToString());
}
}
catch (Exception ex)
@@ -630,6 +752,7 @@
}
private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
{
+
if (e.FocusedRowHandle >= 0)
{
DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
@@ -638,18 +761,33 @@
txtWlid.Text = row["qd002"].ToString();
txtWlgg.Text = row["qd004"].ToString();
txtWlmc.Text = row["qd003"].ToString();
- //txtQuantity.Text = row["qd007"].ToString();//鐢宠鎬婚噺
- //txtYdy.Text = row["YDYNUM"].ToString();//宸叉墦鍗版�婚噺
- //kyPrtQty.Text = row["KDYNUM"].ToString();//鍙墦鍗版�婚噺
+ txtQuantity.Text = row["qd007"].ToString();//鐢宠鎬婚噺
+ txt_yQty.Text = row["ydy"].ToString();//宸叉墦鍗版�婚噺
+ txt_kQty.Text = row["kdy"].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>
/// <param name="sender"></param>
/// <param name="e"></param>
private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
+ MsgHelper.ShowInformation("鍔熻兘寮�鍙戜腑锛�");
+ return;
var rowhandle = gvMx2.FocusedRowHandle;
if (rowhandle < 0)
return;
@@ -667,7 +805,7 @@
try
{
var strJson = UtilityHelper.HttpPost("",
- _webServiceName + "DeleteBarcode",
+ "VArrivalBarcodeManager/DeleteBarcode",
JsonConvert.SerializeObject(_obj));
var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
--
Gitblit v1.9.3