feat(clgl): 新增入库材料条形码打印

生成入库单时同步生成入库材料条形码明细,并在入库单管理中支持整单和单条条形码打印。
This commit is contained in:
2026-05-18 21:28:56 +08:00
parent 2c25bb3484
commit 44cd0fcf8c
13 changed files with 563 additions and 43 deletions
+77 -1
View File
@@ -64,6 +64,8 @@ namespace FineUIPro.Web.CLGL
Grid2.DataSource = null;
Grid2.DataBind();
Grid3.DataSource = null;
Grid3.DataBind();
}
private void BindDetailGrid(string inputMasterId)
{
@@ -93,6 +95,15 @@ namespace FineUIPro.Web.CLGL
Grid2.SummaryData = summary;
}
private void BindBarCodeGrid(string inputMasterId)
{
Model.Tw_InputDetailBarCodeOutput table = new Model.Tw_InputDetailBarCodeOutput();
table.InputMasterId = inputMasterId;
var tb = BLL.TwInputdetailBarCodeService.GetListData(table, Grid3);
Grid3.DataSource = tb;
Grid3.DataBind();
}
#endregion
#region GV
@@ -134,6 +145,7 @@ namespace FineUIPro.Web.CLGL
{
string ID = Grid1.DataKeys[e.RowIndex][0].ToString();
BindDetailGrid(ID);
BindBarCodeGrid(ID);
}
}
/// <summary>
@@ -321,7 +333,71 @@ namespace FineUIPro.Web.CLGL
{
Print(e.RowID);
}
else if (e.CommandName == "btnInputBarCodePrint")
{
PrintInputBarCode(e.RowID, string.Empty);
}
}
protected void Grid3_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "btnBarCodePrint")
{
PrintInputBarCode(string.Empty, e.RowID);
}
}
protected void TabStrip1_TabIndexChanged(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(Grid1.SelectedRowID))
{
if (TabStrip1.ActiveTabIndex == 0)
{
BindDetailGrid(Grid1.SelectedRowID);
}
else if (TabStrip1.ActiveTabIndex == 1)
{
BindBarCodeGrid(Grid1.SelectedRowID);
}
}
}
private void PrintInputBarCode(string inputMasterId, string barCodeId)
{
if (string.IsNullOrEmpty(inputMasterId) && string.IsNullOrEmpty(barCodeId))
{
ShowNotify("请选择要打印的项", MessageBoxIcon.Warning);
return;
}
BLL.FastReportService.ResetData();
var query = new Tw_InputDetailBarCodeOutput
{
Id = barCodeId,
InputMasterId = inputMasterId
};
var list = TwInputdetailBarCodeService.GetListData(query);
if (list == null || list.Count == 0)
{
ShowNotify("未找到入库条码明细,请确认已生成入库单并已创建条码明细表。", MessageBoxIcon.Warning);
return;
}
DataTable table = LINQToDataTable(list);
if (table != null)
{
table.TableName = "Table1";
}
BLL.FastReportService.AddFastreportTable(table);
string rootPath = Server.MapPath("~/");
string initTemplatePath = "File\\Fastreport\\材料入库条码.frx";
if (File.Exists(rootPath + initTemplatePath))
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("~/Controls/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath)));
}
}
private void Print(string Id)
{
BLL.FastReportService.ResetData();
@@ -432,4 +508,4 @@ namespace FineUIPro.Web.CLGL
}
}
}
}
}