1
This commit is contained in:
@@ -573,7 +573,7 @@ namespace FineUIPro.Web.HJGL.DataImport
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开材料编码维护窗口,按管线材料ID只维护 HJGL_PipeLineMat.MaterialCode2。
|
||||
/// 打开材料信息维护窗口,按管线材料ID维护材料主编码和材料编码。
|
||||
/// </summary>
|
||||
private void OpenMaterialCodeEdit(Grid grid)
|
||||
{
|
||||
@@ -595,7 +595,7 @@ namespace FineUIPro.Web.HJGL.DataImport
|
||||
return;
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(Window5.GetShowReference(String.Format("MaterialInformationEdit.aspx?PipeLineMatId={0}", grid.SelectedRowID), "维护材料编码", 500, 180));
|
||||
PageContext.RegisterStartupScript(Window5.GetShowReference(String.Format("MaterialInformationEdit.aspx?PipeLineMatId={0}", grid.SelectedRowID), "维护材料信息", 500, 300));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,14 @@
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpMainMaterialCode" runat="server" Label="材料主编码" EnableEdit="true"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="drpMainMaterialCode_SelectedIndexChanged"
|
||||
LabelWidth="100px">
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtMaterialCode" runat="server" Label="材料编码"
|
||||
@@ -22,6 +30,20 @@
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtHeatNo" runat="server" Label="炉号"
|
||||
MaxLength="50" LabelWidth="100px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtBatchNo" runat="server" Label="批号"
|
||||
MaxLength="50" LabelWidth="100px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.HJGL.DataImport
|
||||
{
|
||||
@@ -22,11 +23,16 @@ namespace FineUIPro.Web.HJGL.DataImport
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.txtHeatNo.Readonly = true;
|
||||
this.txtBatchNo.Readonly = true;
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
this.PipeLineMatId = Request.Params["PipeLineMatId"];
|
||||
|
||||
BindMainMaterialCodes();
|
||||
|
||||
Model.HJGL_PipeLineMat pipeLineMat = PipelineMatService.GetPipeLineMat(this.PipeLineMatId);
|
||||
if (pipeLineMat == null)
|
||||
{
|
||||
@@ -34,12 +40,64 @@ namespace FineUIPro.Web.HJGL.DataImport
|
||||
return;
|
||||
}
|
||||
|
||||
this.drpMainMaterialCode.SelectedValue = string.IsNullOrEmpty(pipeLineMat.MaterialCode)
|
||||
? Const._Null
|
||||
: pipeLineMat.MaterialCode;
|
||||
this.txtMaterialCode.Text = pipeLineMat.MaterialCode2;
|
||||
BindMaterialDetails(pipeLineMat.MaterialCode, false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存材料编码。
|
||||
/// 绑定材料主编码,下拉框保留空选项以支持解除材料主数据关联。
|
||||
/// </summary>
|
||||
private void BindMainMaterialCodes()
|
||||
{
|
||||
this.drpMainMaterialCode.DataTextField = "MaterialCode";
|
||||
this.drpMainMaterialCode.DataValueField = "MaterialCode";
|
||||
this.drpMainMaterialCode.DataSource = MaterialCodeLibService.GetMaterialCodeLibList()
|
||||
.OrderBy(x => x.MaterialCode)
|
||||
.ToList();
|
||||
this.drpMainMaterialCode.DataBind();
|
||||
Funs.FineUIPleaseSelect(this.drpMainMaterialCode, "-请选择-");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 材料主编码变化后同步其材料编码、炉号和批号。
|
||||
/// </summary>
|
||||
protected void drpMainMaterialCode_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
BindMaterialDetails(GetMainMaterialCode(), true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 按材料主编码填充关联信息;清空选择时同步清空联动字段。
|
||||
/// </summary>
|
||||
private void BindMaterialDetails(string mainMaterialCode, bool updateMaterialCode)
|
||||
{
|
||||
Model.HJGL_MaterialCodeLib material = string.IsNullOrEmpty(mainMaterialCode)
|
||||
? null
|
||||
: MaterialCodeLibService.GetMaterialCodeLib(mainMaterialCode);
|
||||
|
||||
if (updateMaterialCode)
|
||||
{
|
||||
this.txtMaterialCode.Text = material == null ? string.Empty : material.Code;
|
||||
}
|
||||
this.txtHeatNo.Text = material == null ? string.Empty : material.HeatNo;
|
||||
this.txtBatchNo.Text = material == null ? string.Empty : material.BatchNo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将下拉框的“请选择”值转换为数据库可保存的空值。
|
||||
/// </summary>
|
||||
private string GetMainMaterialCode()
|
||||
{
|
||||
string value = this.drpMainMaterialCode.SelectedValue;
|
||||
return string.IsNullOrEmpty(value) || value == Const._Null ? null : value.Trim();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存材料主编码和材料编码。
|
||||
/// </summary>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -49,7 +107,17 @@ namespace FineUIPro.Web.HJGL.DataImport
|
||||
return;
|
||||
}
|
||||
|
||||
PipelineMatService.UpdateMaterialCode2(this.PipeLineMatId, this.txtMaterialCode.Text.Trim());
|
||||
string mainMaterialCode = GetMainMaterialCode();
|
||||
if (!string.IsNullOrEmpty(mainMaterialCode) && MaterialCodeLibService.GetMaterialCodeLib(mainMaterialCode) == null)
|
||||
{
|
||||
Alert.ShowInTop("所选材料主编码不存在,请重新选择!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
PipelineMatService.UpdateMaterialCodes(
|
||||
this.PipeLineMatId,
|
||||
mainMaterialCode,
|
||||
this.txtMaterialCode.Text.Trim());
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
|
||||
@@ -41,6 +41,15 @@ namespace FineUIPro.Web.HJGL.DataImport
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// drpMainMaterialCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpMainMaterialCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtMaterialCode 控件。
|
||||
/// </summary>
|
||||
@@ -50,6 +59,24 @@ namespace FineUIPro.Web.HJGL.DataImport
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtMaterialCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtHeatNo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtHeatNo;
|
||||
|
||||
/// <summary>
|
||||
/// txtBatchNo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtBatchNo;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Ai辅助单线图自动提取材料表</title>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<script type="module" crossorigin src="./ocrz-app.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./ocrz-app.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
<!-- <input id="hdpdfurl2" value="https://equipmentcheck.oss-cn-beijing.aliyuncs.com/03DR-003A-12-C1R_Sht_1.PDF">
|
||||
<input id="resultdata" value=""> -->
|
||||
|
||||
|
||||
</body>
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user