feat: 完善焊接质量检查和材料管理

补齐焊前专项审核和焊缝外观检测流程,统一质检查询、附件处理与材料明细导出,提升业务数据追溯和组件匹配使用效率。
This commit is contained in:
2026-08-10 17:58:55 +08:00
parent bd73295ff8
commit 2de696fad2
48 changed files with 2252 additions and 131 deletions
@@ -90,6 +90,9 @@
<f:RenderField Width="90px" ColumnID="RealNum" DataField="RealNum" SortField="RealNum"
FieldType="String" HeaderText="到货量" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="OutputNum" DataField="OutputNum" SortField="OutputNum"
FieldType="String" HeaderText="出库量" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="StockNum" DataField="StockNum" SortField="StockNum"
FieldType="String" HeaderText="库存量" TextAlign="Left" HeaderTextAlign="Center">
</f:RenderField>
+1 -1
View File
@@ -57,7 +57,7 @@
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSearch" ToolTip="查询" Icon="SystemSearch" runat="server" Text="查询" OnClick="btnSearch_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出" Icon="FolderUp"
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="入库明细导出" ToolTip="导出选中入库单的全部明细" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
+21 -18
View File
@@ -266,26 +266,29 @@ namespace FineUIPro.Web.CLGL
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIDArray.Length > 0)
if (Grid1.SelectedRowIDArray.Length == 0)
{
var printModel = TwInputdetailService.GePrintListByInputMasterIds(Grid1.SelectedRowIDArray.ToList());
string path = Funs.RootPath + @"File\Excel\Temp\InputDetail.xlsx";
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
MiniExcel.SaveAs(path, printModel);
string fileName = "入库明细表.xlsx";
FileInfo info = new FileInfo(path);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
File.Delete(path);
Alert.ShowInTop("请至少选择一张入库单", MessageBoxIcon.Warning);
return;
}
var printModel = TwInputdetailService.GePrintListByInputMasterIds(Grid1.SelectedRowIDArray.ToList());
string path = Funs.RootPath + @"File\Excel\Temp\InputDetail.xlsx";
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
MiniExcel.SaveAs(path, printModel);
string fileName = "入库明细表.xlsx";
FileInfo info = new FileInfo(path);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
File.Delete(path);
}
/// <summary>
@@ -225,8 +225,7 @@ namespace FineUIPro.Web.CLGL
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("材料库存表" + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = 500;
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.BindGrid();
Response.Write(GetGridTableHtml(Grid1));
Response.End();
+2 -1
View File
@@ -87,7 +87,7 @@
</f:Button>
<f:Button ID="btnGenOutPlanMaster" Text="生成补料申请单" Icon="ArrowRefresh" runat="server" OnClick="btnGenOutPlanMaster_Click" Hidden="true">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" ToolTip="导出" Icon="FolderUp"
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="出库明细导出" ToolTip="导出选中出库单的全部明细" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
@@ -97,6 +97,7 @@
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="申请单"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="Id" PageSize="1000"
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="Id"
EnableCheckBoxSelect="true"
AllowSorting="true" SortField="CusBillCode" SortDirection="ASC" OnSort="Grid1_Sort" OnRowCommand="Grid1_RowCommand"
EnableTextSelection="True" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableRowClickEvent="true" OnRowClick="Grid1_RowClick">
<Columns>
+21 -22
View File
@@ -672,30 +672,29 @@ namespace FineUIPro.Web.CLGL
protected void btnOut_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIDArray.Length > 0)
if (Grid1.SelectedRowIDArray.Length == 0)
{
var sheets = new Dictionary<string, object>
{
["出库明细"] = TwOutputdetailService.GetPrintListByOutputMasterIds(Grid1.SelectedRowIDArray.ToList()),
["管线材料明细"] = TwInoutplandetailRelationService.GetPrintListByOutputMasterIds(Grid1.SelectedRowIDArray.ToList())
};
string path = Funs.RootPath + @"File\Excel\Temp\OutputDetail.xlsx";
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
MiniExcel.SaveAs(path, sheets);
string fileName = "出库明细表.xlsx";
FileInfo info = new FileInfo(path);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
File.Delete(path);
Alert.ShowInTop("请至少选择一张出库单", MessageBoxIcon.Warning);
return;
}
var printModel = TwOutputdetailService.GetPrintListByOutputMasterIds(Grid1.SelectedRowIDArray.ToList());
string path = Funs.RootPath + @"File\Excel\Temp\OutputDetail.xlsx";
path = path.Replace(".xlsx", string.Format("{0:yyyy-MM-dd-HH-mm}", DateTime.Now) + ".xlsx");
MiniExcel.SaveAs(path, printModel);
string fileName = "出库明细表.xlsx";
FileInfo info = new FileInfo(path);
long fileSize = info.Length;
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType = "application/x-zip-compressed";
System.Web.HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
System.Web.HttpContext.Current.Response.AddHeader("Content-Length", fileSize.ToString());
System.Web.HttpContext.Current.Response.TransmitFile(path, 0, fileSize);
System.Web.HttpContext.Current.Response.Flush();
System.Web.HttpContext.Current.Response.Close();
File.Delete(path);
}
}
}
+16
View File
@@ -1727,6 +1727,8 @@
<Content Include="HJGL\WeldingManage\WeldMatMatch.aspx" />
<Content Include="HJGL\WeldingManage\WeldMatMatchGet.aspx" />
<Content Include="HJGL\WeldingManage\WeldReport.aspx" />
<Content Include="HJGL\WeldingManage\WeldAppearanceCheck.aspx" />
<Content Include="HJGL\WeldingManage\WeldAppearanceCheckEdit.aspx" />
<Content Include="HJGL\WeldingManage\WeldReportEdit.aspx" />
<Content Include="HJGL\WeldingManage\WeldTask.aspx" />
<Content Include="HJGL\WeldingReport\CheckResult.aspx" />
@@ -11726,6 +11728,20 @@
<DependentUpon>WeldReport.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HJGL\WeldingManage\WeldAppearanceCheck.aspx.cs">
<DependentUpon>WeldAppearanceCheck.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HJGL\WeldingManage\WeldAppearanceCheck.aspx.designer.cs">
<DependentUpon>WeldAppearanceCheck.aspx</DependentUpon>
</Compile>
<Compile Include="HJGL\WeldingManage\WeldAppearanceCheckEdit.aspx.cs">
<DependentUpon>WeldAppearanceCheckEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HJGL\WeldingManage\WeldAppearanceCheckEdit.aspx.designer.cs">
<DependentUpon>WeldAppearanceCheckEdit.aspx</DependentUpon>
</Compile>
<Compile Include="HJGL\WeldingManage\WeldReport.aspx.designer.cs">
<DependentUpon>WeldReport.aspx</DependentUpon>
</Compile>
@@ -7,6 +7,9 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>材料信息</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.f-grid-row.batch-changed-review, .f-grid-row.batch-changed-review a { background-color: #ffe0e0 !important; color: #c00000 !important; }
</style>
</head>
<body>
<form id="form1" runat="server">
@@ -105,7 +108,7 @@
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipeLineMatId"
EnableColumnLines="true" DataIDField="PipeLineMatId" AllowSorting="true" EnableCheckBoxSelect="true"
SortField="PrefabricatedComponents" SortDirection="ASC" OnSort="Grid1_Sort"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" OnRowDataBound="MaterialGrid_RowDataBound">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
@@ -175,7 +178,7 @@
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipeLineMatId"
EnableColumnLines="true" DataIDField="PipeLineMatId" AllowSorting="true"
SortField="PipeLineMatId" SortDirection="ASC" OnSort="Grid2_Sort" EnableCheckBoxSelect="true"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid2_RowDoubleClick">
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid2_RowDoubleClick" OnRowDataBound="MaterialGrid_RowDataBound">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
Width="60px" HeaderTextAlign="Center" TextAlign="Center" />
@@ -238,7 +241,7 @@
<f:Grid ID="Grid3" ShowBorder="true" ShowHeader="false" Title="散件管理"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PipeLineMatId"
EnableColumnLines="true" DataIDField="PipeLineMatId" AllowSorting="true"
SortField="PipeLineMatId" SortDirection="ASC" OnSort="Grid3_Sort" EnableCheckBoxSelect="true"
SortField="PipeLineMatId" SortDirection="ASC" OnSort="Grid3_Sort" EnableCheckBoxSelect="true" OnRowDataBound="MaterialGrid_RowDataBound"
EnableRowDoubleClickEvent="true" >
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号"
@@ -329,12 +329,19 @@ namespace FineUIPro.Web.HJGL.DataImport
ISNULL(lib.MaterialDef, libCode.MaterialDef) AS MaterialDef,
pipe.Number,pipe.PrefabricatedComponents,
CASE pipe.PipeArea WHEN '1' THEN N'工厂预制' WHEN '2' THEN N'现场安装' END AS PipeAreaText,
weld.WeldJointCode
weld.WeldJointCode, ISNULL(reviewChange.HasChange, 0) AS HasReviewedBatchChange
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.PipelineId
OUTER APPLY (SELECT TOP 1 * FROM dbo.HJGL_MaterialCodeLib codeLib WHERE codeLib.ProjectId=line.ProjectId AND codeLib.Code=pipe.MaterialCode2 ORDER BY codeLib.MaterialCode) libCode
LEFT JOIN dbo.HJGL_WeldJoint weld ON weld.WeldJointId = pipe.WeldJointId
OUTER APPLY (
SELECT TOP 1 CAST(CASE WHEN ISNULL(s.ReportedMainCode,'') <> ISNULL(pipe.MaterialCode,'') THEN 1 ELSE 0 END AS BIT) HasChange
FROM dbo.HJGL_PreWeldCuttingCheckMaterial s
INNER JOIN dbo.HJGL_PreWeldCuttingCheck c ON c.CuttingCheckId=s.CuttingCheckId
WHERE s.PipeLineMatId=pipe.PipeLineMatId AND c.ReviewState=2
ORDER BY c.ReviewTime DESC, c.CheckTime DESC, c.CuttingCheckId DESC
) reviewChange
WHERE line.UnitWorkId=@UnitWorkId and pipe.PipeArea='1' and pipe.PrefabricatedComponents !='' ";
List<SqlParameter> listStr = new List<SqlParameter>();
//if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
@@ -373,12 +380,19 @@ namespace FineUIPro.Web.HJGL.DataImport
ISNULL(lib.MaterialDef, libCode.MaterialDef) AS MaterialDef,
pipe.Number,
CASE pipe.PipeArea WHEN '1' THEN N'工厂预制' WHEN '2' THEN N'现场安装' END AS PipeAreaText,
weld.WeldJointCode
weld.WeldJointCode, ISNULL(reviewChange.HasChange, 0) AS HasReviewedBatchChange
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.PipelineId
OUTER APPLY (SELECT TOP 1 * FROM dbo.HJGL_MaterialCodeLib codeLib WHERE codeLib.ProjectId=line.ProjectId AND codeLib.Code=pipe.MaterialCode2 ORDER BY codeLib.MaterialCode) libCode
LEFT JOIN dbo.HJGL_WeldJoint weld ON weld.WeldJointId = pipe.WeldJointId
OUTER APPLY (
SELECT TOP 1 CAST(CASE WHEN ISNULL(s.ReportedMainCode,'') <> ISNULL(pipe.MaterialCode,'') THEN 1 ELSE 0 END AS BIT) HasChange
FROM dbo.HJGL_PreWeldCuttingCheckMaterial s
INNER JOIN dbo.HJGL_PreWeldCuttingCheck c ON c.CuttingCheckId=s.CuttingCheckId
WHERE s.PipeLineMatId=pipe.PipeLineMatId AND c.ReviewState=2
ORDER BY c.ReviewTime DESC, c.CheckTime DESC, c.CuttingCheckId DESC
) reviewChange
WHERE line.UnitWorkId=@UnitWorkId and pipe.PipeArea='2' ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(pipelineId))
@@ -413,12 +427,19 @@ namespace FineUIPro.Web.HJGL.DataImport
ISNULL(lib.MaterialDef, libCode.MaterialDef) AS MaterialDef,
pipe.Number,pipe.PrefabricatedComponents,
CASE pipe.PipeArea WHEN '1' THEN N'工厂预制' WHEN '2' THEN N'现场安装' END AS PipeAreaText,
weld.WeldJointCode
weld.WeldJointCode, ISNULL(reviewChange.HasChange, 0) AS HasReviewedBatchChange
FROM dbo.HJGL_PipeLineMat pipe
LEFT JOIN dbo.HJGL_MaterialCodeLib lib ON lib.MaterialCode = pipe.MaterialCode
LEFT JOIN HJGL_Pipeline line ON pipe.PipelineId=line.PipelineId
OUTER APPLY (SELECT TOP 1 * FROM dbo.HJGL_MaterialCodeLib codeLib WHERE codeLib.ProjectId=line.ProjectId AND codeLib.Code=pipe.MaterialCode2 ORDER BY codeLib.MaterialCode) libCode
LEFT JOIN dbo.HJGL_WeldJoint weld ON weld.WeldJointId = pipe.WeldJointId
OUTER APPLY (
SELECT TOP 1 CAST(CASE WHEN ISNULL(s.ReportedMainCode,'') <> ISNULL(pipe.MaterialCode,'') THEN 1 ELSE 0 END AS BIT) HasChange
FROM dbo.HJGL_PreWeldCuttingCheckMaterial s
INNER JOIN dbo.HJGL_PreWeldCuttingCheck c ON c.CuttingCheckId=s.CuttingCheckId
WHERE s.PipeLineMatId=pipe.PipeLineMatId AND c.ReviewState=2
ORDER BY c.ReviewTime DESC, c.CheckTime DESC, c.CuttingCheckId DESC
) reviewChange
WHERE line.UnitWorkId=@UnitWorkId and pipe.PipeArea='1' and (pipe.PrefabricatedComponents is null or pipe.PrefabricatedComponents='') ";
List<SqlParameter> listStr = new List<SqlParameter>();
//if (!string.IsNullOrEmpty(txtMaterialCode.Text.Trim()))
@@ -450,6 +471,19 @@ namespace FineUIPro.Web.HJGL.DataImport
#endregion
/// <summary>
/// 最新专项审核反馈主编码与当前材料主编码不一致时整行标红。
/// </summary>
protected void MaterialGrid_RowDataBound(object sender, GridRowEventArgs e)
{
var row = e.DataItem as DataRowView;
if (row != null && row.Row.Table.Columns.Contains("HasReviewedBatchChange")
&& Convert.ToBoolean(row["HasReviewedBatchChange"]))
{
e.RowCssClass = "batch-changed-review";
}
}
#region
#region
@@ -112,6 +112,9 @@
<f:RenderField HeaderText="完成状态" ColumnID="IsWeldOK" DataField="IsWeldOK"
SortField="IsWeldOK" FieldType="String" HeaderTextAlign="Center" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="焊缝是否合格" ColumnID="WeldAppearanceResult" DataField="WeldAppearanceResult"
SortField="WeldAppearanceResult" FieldType="String" HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="单位名称" ColumnID="UnitName" DataField="UnitName"
SortField="UnitName" FieldType="String" HeaderTextAlign="Center" Width="180px">
</f:RenderField>
@@ -626,6 +626,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
线 = x.PipelineCode,
= x.WeldJointCode,
= x.IsWeldOK,
= x.WeldAppearanceResult,
= x.UnitName,
= x.FlowingSection,
= x.TaskCode,
@@ -709,6 +710,7 @@ namespace FineUIPro.Web.HJGL.InfoQuery
{
= x.WeldJointCode,
= x.IsWeldOK,
= x.WeldAppearanceResult,
= x.UnitName,
= x.FlowingSection,
= x.TaskCode,
@@ -43,7 +43,7 @@
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtPipelineComponentCode" Label="组件编号" ShowRedStar="true" Readonly="true"
<f:TextBox ID="txtPipelineComponentCode" Label="组件编号" ShowRedStar="true"
Required="true" runat="server" FocusOnPageLoad="true" LabelWidth="120px">
</f:TextBox>
</Items>
@@ -68,6 +68,12 @@
<f:RenderField Width="120px" ColumnID="CheckResult" DataField="CheckResult" FieldType="String"
HeaderText="检查结果" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="140px" ColumnID="ReviewStateText" DataField="ReviewStateText" FieldType="String"
HeaderText="专项审核状态" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="SpecialReviewerName" DataField="SpecialReviewerName" FieldType="String"
HeaderText="专项审核办理人" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="180px" ColumnID="CreateTime" DataField="CreateTime" FieldType="Date"
RendererArgument="yyyy-MM-dd HH:mm" HeaderText="创建时间" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
@@ -52,6 +52,18 @@
</f:CheckBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="ddlSpecialReviewer" runat="server" Label="专项审核办理人" LabelWidth="170px" EnableEdit="true">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtMaterialFeedback" runat="server" Label="两侧主编码反馈" LabelWidth="170px" Enabled="false">
</f:TextArea>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="ddlCheckResult" runat="server" Label="检查结果" LabelWidth="170px" Required="true"
@@ -107,6 +119,8 @@
<f:Button ID="btnSave" Text="保存" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnReview" Text="审核" Icon="SystemSave" runat="server" Hidden="true" OnClick="btnReview_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" Text="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
@@ -20,10 +20,12 @@ namespace FineUIPro.Web.HJGL.PreWeld
CuttingCheckId = Request.Params["CuttingCheckId"];
BindWeldJoint();
BindCheckPerson();
BindSpecialReviewer();
ddlCheckResult.SelectedValue = "合格";
if (!string.IsNullOrEmpty(CuttingCheckId))
{
BindData();
btnReview.Hidden = Request.Params["review"] != "1";
}
else
{
@@ -57,6 +59,14 @@ namespace FineUIPro.Web.HJGL.PreWeld
Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpCheckPerson, CurrUser.LoginProjectId, null, null, true);
}
private void BindSpecialReviewer()
{
ddlSpecialReviewer.DataTextField = "BaseInfoName";
ddlSpecialReviewer.DataValueField = "BaseInfoId";
ddlSpecialReviewer.DataSource = APIPreWeldInspectionService.GetSpecialReviewers(CurrUser.LoginProjectId);
ddlSpecialReviewer.DataBind();
}
private void BindData()
{
var model = PreWeldInspectionService.GetCuttingCheckById(CuttingCheckId);
@@ -83,6 +93,17 @@ namespace FineUIPro.Web.HJGL.PreWeld
txtUnqualifiedReason.Text = model.UnqualifiedReason;
txtRectifyRequirement.Text = model.RectifyRequirement;
txtRemark.Text = model.Remark;
if (!string.IsNullOrEmpty(model.SpecialReviewerId))
{
ddlSpecialReviewer.SelectedValue = model.SpecialReviewerId;
}
var detail = PreWeldInspectionService.GetCuttingCheckItemsByWeldJointId(model.WeldJointId)
.FirstOrDefault(x => x.CuttingCheckId == CuttingCheckId);
if (detail != null && detail.Materials != null)
{
txtMaterialFeedback.Text = string.Join("\r\n", detail.Materials.Select(x => string.Format(
"第{0}侧:{1} → {2}", x.MaterialSide, x.OriginalMainCode, x.ReportedMainCode)));
}
}
protected void btnSave_Click(object sender, EventArgs e)
@@ -109,7 +130,8 @@ namespace FineUIPro.Web.HJGL.PreWeld
CreateUser = CurrUser.PersonId,
UnqualifiedReason = txtUnqualifiedReason.Text.Trim(),
RectifyRequirement = txtRectifyRequirement.Text.Trim(),
Remark = txtRemark.Text.Trim()
Remark = txtRemark.Text.Trim(),
SpecialReviewerId = ddlSpecialReviewer.SelectedValue
};
CuttingCheckId = APIPreWeldInspectionService.SaveCuttingCheck(item);
@@ -117,6 +139,19 @@ namespace FineUIPro.Web.HJGL.PreWeld
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
protected void btnReview_Click(object sender, EventArgs e)
{
APIPreWeldInspectionService.ReviewCuttingCheck(new Model.PreWeldCuttingCheckReviewInput
{
CuttingCheckId = CuttingCheckId,
ReviewerId = CurrUser.PersonId,
ReviewTime = DateTime.Now,
Remark = txtRemark.Text.Trim()
});
ShowNotify("专项审核已完成!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
protected void btnAttachUrl_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(CuttingCheckId))
@@ -95,6 +95,10 @@ namespace FineUIPro.Web.HJGL.PreWeld
/// </remarks>
protected global::FineUIPro.CheckBox chkMaterialQuantity;
protected global::FineUIPro.DropDownList ddlSpecialReviewer;
protected global::FineUIPro.TextArea txtMaterialFeedback;
/// <summary>
/// ddlCheckResult 控件。
/// </summary>
@@ -176,6 +180,8 @@ namespace FineUIPro.Web.HJGL.PreWeld
/// </remarks>
protected global::FineUIPro.Button btnSave;
protected global::FineUIPro.Button btnReview;
/// <summary>
/// btnClose 控件。
/// </summary>
@@ -523,7 +523,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
&& x.PipelineId == item.PipelineId
&& x.PrefabricatedComponents == item.PrefabricatedComponents
&& x.PipeArea == item.PipeArea
&& (string.IsNullOrEmpty(item.MaterialCode) || x.MaterialCode == item.MaterialCode)
// && (string.IsNullOrEmpty(item.MaterialCode) || x.MaterialCode == item.MaterialCode)
select x;
if (pipeLineMat.Count() == 0 || pipeLineMat == null)
{
@@ -533,12 +533,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage
else
{
var oldPipeLineMat = pipeLineMat.First();
item.PipeLineMatId = oldPipeLineMat.PipeLineMatId;
if (string.IsNullOrEmpty(item.MaterialCode))
oldPipeLineMat.Number=item.Number;
oldPipeLineMat.MaterialCode2 = item.MaterialCode2;
if (!string.IsNullOrEmpty(item.MaterialCode))
{
item.MaterialCode = oldPipeLineMat.MaterialCode;
oldPipeLineMat.MaterialCode = item.MaterialCode;
}
BLL.PipelineMatService.UpdatePipeLineMat(item);
BLL.PipelineMatService.UpdatePipeLineMat(oldPipeLineMat);
}
BLL.HJGL_PipelineComponentService.SyncPipelineComponentByMatId(item.PipeLineMatId);
}
@@ -0,0 +1,106 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WeldAppearanceCheck.aspx.cs" Inherits="FineUIPro.Web.HJGL.WeldingManage.WeldAppearanceCheck" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>焊缝外观检测记录</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<link href="../../res/css/viewer.min.css" rel="stylesheet" />
<script src="../../res/js/viewer.min.js" type="text/javascript"></script>
<style type="text/css">
.img {
cursor: zoom-in;
object-fit: cover;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox">
<Items>
<f:Grid ID="Grid1" runat="server" BoxFlex="1" ShowBorder="true" ShowHeader="false"
EnableColumnLines="true" DataKeyNames="AppearanceCheckId" DataIDField="AppearanceCheckId"
AllowPaging="true" IsDatabasePaging="true" PageSize="15"
OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
OnRowDoubleClick="Grid1_RowDoubleClick">
<Toolbars>
<f:Toolbar runat="server">
<Items>
<f:TextBox ID="txtPipelineCode" runat="server" Label="管线号" Width="250px"
LabelWidth="70px" />
<f:TextBox ID="txtWeldJointCode" runat="server" Label="焊口号" Width="220px"
LabelWidth="70px" />
<f:DropDownList ID="ddlQualified" runat="server" Label="是否合格" Width="190px"
LabelWidth="80px">
<f:ListItem Text="全部" Value="" />
<f:ListItem Text="合格" Value="1" />
<f:ListItem Text="不合格" Value="0" />
</f:DropDownList>
<f:Button ID="btnQuery" runat="server" Text="查询" Icon="SystemSearch"
OnClick="btnQuery_Click" />
<f:ToolbarFill runat="server" />
<f:Button ID="btnNew" runat="server" Text="新增" Icon="Add"
OnClick="btnNew_Click" />
<f:Button ID="btnEdit" runat="server" Text="修改" Icon="Pencil"
OnClick="btnEdit_Click" />
<f:Button ID="btnDelete" runat="server" Text="删除" Icon="Delete"
ConfirmText="确认删除选中的外观检测记录?" OnClick="btnDelete_Click" />
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RowNumberField Width="60px" HeaderText="序号" TextAlign="Center" />
<f:RenderField Width="220px" DataField="PipelineCode" HeaderText="管线号" />
<f:RenderField Width="130px" DataField="WeldJointCode" HeaderText="焊口号" />
<f:RenderField Width="100px" DataField="QualifiedText" HeaderText="外观是否合格"
TextAlign="Center" />
<f:RenderField Width="120px" DataField="CheckPersonName" HeaderText="检测人"
TextAlign="Center" />
<f:RenderField Width="170px" DataField="CheckTime" FieldType="Date"
RendererArgument="yyyy-MM-dd HH:mm" HeaderText="检测时间" TextAlign="Center" />
<f:TemplateField ColumnID="AttachUrl" MinWidth="120px" HeaderText="照片"
HeaderTextAlign="Center" TextAlign="Center">
<ItemTemplate>
<asp:Label ID="lbAttachUrl" runat="server"
Text='<%# ConvertImageUrlByImage(Eval("AttachUrl")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="300px" DataField="Remark" HeaderText="备注" />
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="焊缝外观检测" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Top" runat="server" OnClose="Window1_Close" IsModal="true"
Width="760px" Height="560px" />
</form>
<script type="text/javascript">
var gridImageSelector = '#<%= Grid1.ClientID %> img.img';
F.ready(function () {
$(document).off('click.weldappearance', gridImageSelector)
.on('click.weldappearance', gridImageSelector, function () {
var imageUrl = $(this).attr('src');
if (!imageUrl) {
return;
}
var container = document.createElement('div');
var image = document.createElement('img');
container.style.display = 'none';
image.src = imageUrl;
container.appendChild(image);
document.body.appendChild(container);
var viewer = new Viewer(image);
viewer.show();
viewer.on('hidden', function () {
document.body.removeChild(container);
});
});
});
</script>
</body>
</html>
@@ -0,0 +1,85 @@
using BLL;
using System;
using System.Web;
namespace FineUIPro.Web.HJGL.WeldingManage
{
public partial class WeldAppearanceCheck : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack) BindGrid();
}
private void BindGrid()
{
var result = WeldAppearanceCheckService.GetList(CurrUser.LoginProjectId, txtPipelineCode.Text.Trim(),
txtWeldJointCode.Text.Trim(), ddlQualified.SelectedValue, Grid1.PageIndex, Grid1.PageSize);
Grid1.RecordCount = result.Item2;
Grid1.DataSource = result.Item1;
Grid1.DataBind();
}
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) { Grid1.PageIndex = e.NewPageIndex; BindGrid(); }
protected void btnQuery_Click(object sender, EventArgs e) { Grid1.PageIndex = 0; BindGrid(); }
protected void Window1_Close(object sender, WindowCloseEventArgs e) { BindGrid(); }
/// <summary>
/// 将附件地址转换为列表缩略图。
/// </summary>
/// <param name="photoUrl">以逗号分隔的照片地址。</param>
/// <returns>照片缩略图HTML。</returns>
protected string ConvertImageUrlByImage(object photoUrl)
{
if (photoUrl == null || string.IsNullOrWhiteSpace(photoUrl.ToString()))
{
return string.Empty;
}
string html = "<table cellpadding='5' cellspacing='5' style=\"width: 100%\">";
foreach (string item in photoUrl.ToString().Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries))
{
string imageUrl = "../../" + item.Trim().Replace('\\', '/');
html += "<tr><td align='center'><img class='img' width='100' height='100' src='"
+ HttpUtility.HtmlAttributeEncode(imageUrl) + "' alt='外观检测照片' /></td></tr>";
}
return html + "</table>";
}
protected void btnNew_Click(object sender, EventArgs e)
{
if (HasPower(Const.BtnAdd)) PageContext.RegisterStartupScript(Window1.GetShowReference("WeldAppearanceCheckEdit.aspx"));
}
protected void btnEdit_Click(object sender, EventArgs e) { OpenSelectedRecord(); }
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) { OpenSelectedRecord(); }
protected void btnDelete_Click(object sender, EventArgs e)
{
if (!EnsureSelected() || !HasPower(Const.BtnDelete)) return;
WeldAppearanceCheckService.Delete(Grid1.SelectedRowID);
BindGrid();
}
private void OpenSelectedRecord()
{
if (!EnsureSelected() || !HasPower(Const.BtnModify)) return;
PageContext.RegisterStartupScript(Window1.GetShowReference("WeldAppearanceCheckEdit.aspx?AppearanceCheckId=" + Grid1.SelectedRowID));
}
private bool EnsureSelected()
{
if (Grid1.SelectedRowIndexArray.Length > 0) return true;
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return false;
}
private bool HasPower(string button)
{
bool hasPower = CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.PersonId,
Const.HJGL_WeldAppearanceCheckMenuId, button);
if (!hasPower) Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return hasPower;
}
}
}
@@ -0,0 +1,134 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HJGL.WeldingManage
{
public partial class WeldAppearanceCheck
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// txtPipelineCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipelineCode;
/// <summary>
/// txtWeldJointCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtWeldJointCode;
/// <summary>
/// ddlQualified 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlQualified;
/// <summary>
/// btnQuery 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnQuery;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnEdit;
/// <summary>
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDelete;
/// <summary>
/// lbAttachUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbAttachUrl;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
}
}
@@ -0,0 +1,72 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WeldAppearanceCheckEdit.aspx.cs" Inherits="FineUIPro.Web.HJGL.WeldingManage.WeldAppearanceCheckEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>编辑焊缝外观检测</title>
<base target="_self" />
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText">
<Rows>
<f:FormRow>
<Items>
<f:DropDownList ID="ddlWeldJoint" runat="server" Label="已焊接焊口" Required="true"
ShowRedStar="true" EnableEdit="true" LabelWidth="130px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="ddlQualified" runat="server" Label="外观是否合格" Required="true"
ShowRedStar="true" LabelWidth="130px">
<f:ListItem Text="合格" Value="1" />
<f:ListItem Text="不合格" Value="0" />
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="ddlCheckPerson" runat="server" Label="检测人" Required="true"
ShowRedStar="true" EnableEdit="true" LabelWidth="130px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker ID="dpCheckTime" runat="server" Label="检测时间" Required="true"
ShowRedStar="true" LabelWidth="130px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextArea ID="txtRemark" runat="server" Label="备注" MaxLength="500"
LabelWidth="130px" />
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Button ID="btnAttach" runat="server" Text="上传/查看照片(必填)" Icon="TableCell"
OnClick="btnAttach_Click" />
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar runat="server" Position="Bottom" ToolbarAlign="Right">
<Items>
<f:Button ID="btnSave" runat="server" Text="保存" Icon="SystemSave"
ValidateForms="SimpleForm1" OnClick="btnSave_Click" />
<f:Button ID="btnClose" runat="server" Text="关闭" Icon="SystemClose"
EnablePostBack="false" />
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="WindowAtt" Title="外观检测照片" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Parent" runat="server" IsModal="true" Width="720px"
Height="440px" />
</form>
</body>
</html>
@@ -0,0 +1,85 @@
using BLL;
using System;
using System.Linq;
namespace FineUIPro.Web.HJGL.WeldingManage
{
public partial class WeldAppearanceCheckEdit : PageBase
{
private string AppearanceCheckId
{
get { return (string)ViewState["AppearanceCheckId"]; }
set { ViewState["AppearanceCheckId"] = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack) return;
btnClose.OnClientClick = ActiveWindow.GetHideReference();
AppearanceCheckId = Request.Params["AppearanceCheckId"] ?? Guid.NewGuid().ToString();
BindWeldJoints();
Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(ddlCheckPerson, CurrUser.LoginProjectId, null, null, true);
var model = WeldAppearanceCheckService.GetById(AppearanceCheckId);
if (model == null)
{
ddlQualified.SelectedValue = "1";
ddlCheckPerson.SelectedValue = CurrUser.PersonId;
dpCheckTime.SelectedDate = DateTime.Now;
return;
}
ddlWeldJoint.SelectedValue = model.WeldJointId;
ddlQualified.SelectedValue = model.IsQualified ? "1" : "0";
ddlCheckPerson.SelectedValue = model.CheckPerson;
dpCheckTime.SelectedDate = model.CheckTime;
txtRemark.Text = model.Remark;
}
private void BindWeldJoints()
{
var data = WeldAppearanceCheckService.GetWeldedJoints(CurrUser.LoginProjectId, null, null, 0, 10000)
.Select(x => new { x.WeldJointId, Name = x.PipelineCode + " / " + x.WeldJointCode }).ToList();
ddlWeldJoint.DataTextField = "Name";
ddlWeldJoint.DataValueField = "WeldJointId";
ddlWeldJoint.DataSource = data;
ddlWeldJoint.DataBind();
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (!CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.PersonId,
Const.HJGL_WeldAppearanceCheckMenuId, Const.BtnSave))
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
try
{
WeldAppearanceCheckService.Save(new Model.WeldAppearanceCheckInput
{
AppearanceCheckId = AppearanceCheckId,
ProjectId = CurrUser.LoginProjectId,
WeldJointId = ddlWeldJoint.SelectedValue,
IsQualified = ddlQualified.SelectedValue == "1",
CheckPerson = ddlCheckPerson.SelectedValue,
CheckTime = dpCheckTime.SelectedDate,
Remark = txtRemark.Text.Trim(),
CreateUser = CurrUser.PersonId
});
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
catch (Exception ex)
{
Alert.ShowInTop(ex.Message, MessageBoxIcon.Warning);
}
}
protected void btnAttach_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(string.Format(
"../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/HJGL/WeldingManage/WeldAppearanceCheck&menuId={1}&edit=1",
AppearanceCheckId, Const.HJGL_WeldAppearanceCheckMenuId)));
}
}
}
@@ -0,0 +1,125 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.HJGL.WeldingManage
{
public partial class WeldAppearanceCheckEdit
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// ddlWeldJoint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlWeldJoint;
/// <summary>
/// ddlQualified 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlQualified;
/// <summary>
/// ddlCheckPerson 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlCheckPerson;
/// <summary>
/// dpCheckTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker dpCheckTime;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtRemark;
/// <summary>
/// btnAttach 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttach;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}
@@ -91,7 +91,7 @@
</f:Button>
<f:Button ID="btnStatisticsMat" ToolTip="匹配材料" Icon="TabGo" runat="server" OnClick="btnStatisticsMat_Click" Hidden="true">
</f:Button>
<f:Button ID="btnExportPartialComponents" Text="导出部分已焊组件" ToolTip="按当前区域导出所选单位工程的部分已焊组件"
<f:Button ID="btnExportPartialComponents" Text="导出部组件" ToolTip="按当前区域导出所选单位工程的部组件"
Icon="TableGo" runat="server" OnClick="btnExportPartialComponents_Click" EnableAjax="false"
DisableControlBeforePostBack="true" EnablePostBack="true">
</f:Button>
@@ -728,7 +728,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage
}
/// <summary>
/// 按当前材料区域导出所选单位工程下全部部分已焊接组件。
/// 按当前材料区域导出所选单位工程下全部组件。
/// </summary>
protected void btnExportPartialComponents_Click(object sender, EventArgs e)
{
@@ -748,24 +748,40 @@ namespace FineUIPro.Web.HJGL.WeldingManage
drpWarehouse.SelectedValue);
if (!components.Any())
{
ShowNotify("当前单位工程和区域下没有部分已焊接组件!", MessageBoxIcon.Warning);
ShowNotify("当前单位工程和区域下没有可导出的组件!", MessageBoxIcon.Warning);
return;
}
var exportData = components.Select(x => new
// 列顺序保持未焊口数后追加未焊达因量、材料编码、数量,便于后续导入使用;每个材料编码单独导出一行。
var exportData = components.SelectMany(x =>
{
= x.UnitWorkName,
= x.PipeAreaText,
线 = x.PipelineCode,
= x.PrefabricatedComponents,
= x.TotalWeldJointCount,
= x.WeldedWeldJointCount,
= x.UnweldedWeldJointCount,
= x.ComponentMatchRateString
List<string> materialCodes = SplitExportValues(x.MaterialCode);
List<string> materialQuantities = SplitExportValues(x.MaterialQuantity);
int materialRowCount = Math.Max(materialCodes.Count, materialQuantities.Count);
if (materialRowCount == 0)
{
materialRowCount = 1;
}
return Enumerable.Range(0, materialRowCount).Select(index => new
{
= x.UnitWorkName,
= x.PipeAreaText,
线 = x.PipelineCode,
= x.PrefabricatedComponents,
= x.TotalWeldJointCount,
= x.WeldedWeldJointCount,
= x.UnweldedWeldJointCount,
= x.UnweldedDin ?? 0,
= index < materialCodes.Count ? materialCodes[index] : string.Empty,
= index < materialQuantities.Count ? materialQuantities[index] : string.Empty,
= x.ComponentMatchRateString,
= GetComponentStatus(x.TotalWeldJointCount, x.UnweldedWeldJointCount)
});
}).ToList();
string areaText = PipeArea == PipelineService.PipeArea_SHOP ? "工厂预制" : "现场安装";
string fileName = GetSafeFileName(unitWork.UnitWorkName) + "_" + areaText + "_部分已焊组件_" + DateTime.Now.ToString("yyyyMMdd") + ".xlsx";
string fileName = GetSafeFileName(unitWork.UnitWorkName) + "_" + areaText + "_部组件_" + DateTime.Now.ToString("yyyyMMdd") + ".xlsx";
string tempDirectory = Path.Combine(Funs.RootPath, @"File\Excel\Temp");
Directory.CreateDirectory(tempDirectory);
string filePath = Path.Combine(tempDirectory, Guid.NewGuid().ToString("N") + ".xlsx");
@@ -794,6 +810,29 @@ namespace FineUIPro.Web.HJGL.WeldingManage
return safeFileName;
}
private static List<string> SplitExportValues(string values)
{
return string.IsNullOrEmpty(values)
? new List<string>()
: values.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => x.Trim())
.ToList();
}
private static string GetComponentStatus(int totalWeldJointCount, int unweldedWeldJointCount)
{
// 以总焊口数和未焊口数判断组件进度:全部未焊为未开始、无未焊口为已完成,其余为进行中。
if (unweldedWeldJointCount == totalWeldJointCount)
{
return "未开始";
}
if (unweldedWeldJointCount == 0)
{
return "已完成";
}
return "进行中";
}
/// <summary>
/// 按树节点获取可加入本次匹配的管线。单位工程节点会展开到其下所有试压包,再套用当前仓库和页面筛选条件。
/// </summary>
+1
View File
@@ -64,6 +64,7 @@
<TreeNode id="D1B5A8B7-5D2A-4C51-9B7E-6A2F15B7F002" Text="管道下料检查记录" NavigateUrl="HJGL/PreWeld/CuttingCheck.aspx"></TreeNode>
<TreeNode id="D1B5A8B7-5D2A-4C51-9B7E-6A2F15B7F003" Text="组对检查记录" NavigateUrl="HJGL/PreWeld/FitupCheck.aspx"></TreeNode>
<TreeNode id="5TYHMD2F-2582-4DEB-905E-6E9DCFEFBGHO" Text="焊接日报" NavigateUrl="HJGL/WeldingManage/WeldReport.aspx"></TreeNode>
<TreeNode id="A4C8F8A1-1A27-4B63-A6DF-3F8AAE67C901" Text="焊缝外观检测记录" NavigateUrl="HJGL/WeldingManage/WeldAppearanceCheck.aspx"></TreeNode>
</TreeNode>
<TreeNode id="3363C60A-E1ED-445B-BC93-DF2BE04D9759" Text="无损检测管理" NavigateUrl=""><TreeNode id="3ACE25CE-C5CE-4CEC-AD27-0D5CF1DF2F01" Text="点口管理" NavigateUrl="HJGL/PointTrust/PointBatch.aspx"></TreeNode>
<TreeNode id="0CA58EC2-7934-49B3-A2C3-327FAD27C541" Text="无损检测委托单" NavigateUrl="HJGL/PointTrust/TrustBatch.aspx"></TreeNode>