From 7113711bc89507350e328357808ae6d7cef1c461 Mon Sep 17 00:00:00 2001
From: lu <123456>
Date: 星期五, 22 八月 2025 10:17:00 +0800
Subject: [PATCH] 称重
---
DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs | 130 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 129 insertions(+), 1 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
index 8ff0765..a472296 100644
--- a/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Rk/Frm_MesItemQtrk.cs
@@ -1,4 +1,5 @@
using DevExpress.XtraEditors;
+using Gs.DevApp.DevFrm.Rpt;
using Gs.DevApp.DevFrm.Work;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
@@ -24,6 +25,7 @@
public Frm_MesItemQtrk()
{
InitializeComponent();
+ split99.PanelVisibility = SplitPanelVisibility.Panel2;
this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick;
this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick;
this.toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
@@ -97,6 +99,91 @@
};
frm.ShowDialog();
};
+ //鎵撳嵃浜嬩欢
+ this.ucBtnPrint1.btnPrintClick += (s, e) =>
+ {
+ 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_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_iCount_1.Text = "";
+ txt_psnQty_1.Text = "";
+ };
+ //鎵撳嵃鎵归噺鎿嶄綔浜嬩欢
+ this.ucBtnPrint1.btnAllClick += (s, e) =>
+ {
+ string rowGuid = lbMxGuid.Text.Trim();
+ SelectDeleteBar frm = new SelectDeleteBar(rowGuid, QcSeason.鍏跺畠鍏ュ簱妫�.ToString());
+ string strCodeList = "";
+ string strAction = "";
+ frm.UpdateParent += (ss, ee) =>
+ {
+ strCodeList = ee.StringSingle;
+ strAction = ee.Data;
+ };
+ frm.ShowDialog();
+ if (string.IsNullOrEmpty(strCodeList))
+ return;
+ if (strAction == "print")
+ {
+ try
+ {
+ string rptParameter = "rpt_Qtrk{"
+ + "100"//閲嶆墦閮芥槸浼�100锛�
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + ""
+ + "," + strCodeList
+ + "}";
+ using (Form rpt = new RptPreview(rowGuid, rptParameter))
+ {
+ rpt.ShowDialog();
+ }
+ frm.Close();
+ }
+ catch (Exception ex)
+ {
+ MsgHelper.ShowError(ex.Message);
+ }
+ }
+ };
+ 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);
+ };
+
}
private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
@@ -457,6 +544,7 @@
/// <param name="strGuid"></param>
private void getModel(string strGuid)
{
+
gcMx1.DataSource = null;
bool isEdit = false;
if (toolBarMenu1.currentAction == "add") return;
@@ -530,6 +618,11 @@
{
Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2);
}
+
+ if (txt_isIqc.Checked)
+ split99.PanelVisibility = SplitPanelVisibility.Panel2;
+ else
+ split99.PanelVisibility = SplitPanelVisibility.Both;
}
else
ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
@@ -735,6 +828,11 @@
MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
}
}
+ /// <summary>
+ /// 閫夋嫨涓嶈壇
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
private void rptBl_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
{
var rowhandle = gvMx1.FocusedRowHandle;
@@ -748,7 +846,8 @@
foreach (dynamic dym in lst)
{
if (stringBuilder.Length > 0)
- stringBuilder.Append("|");
+ // stringBuilder.Append("|");//|鍜寏宸茶鍗犵敤
+ stringBuilder.Append("&");
stringBuilder.Append(dym.dicTxt);
}
gvMx1.SetFocusedRowCellValue("qd012", stringBuilder.ToString());
@@ -756,5 +855,34 @@
};
frm.ShowDialog();
}
+
+ private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
+ {
+ if (e.FocusedRowHandle >= 0)
+ {
+ DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle);
+ lbMxGuid.Text = row["guid"].ToString();
+ ucBtnPrint1.guidKey = row["guid"].ToString();
+ txtWlid.Text = row["qd002"].ToString();
+ txtWlgg.Text = row["qd004"].ToString();
+ txtWlmc.Text = row["qd003"].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 = "";
+ }
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.3