feat: 完善焊接质量检查和材料管理
补齐焊前专项审核和焊缝外观检测流程,统一质检查询、附件处理与材料明细导出,提升业务数据追溯和组件匹配使用效率。
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user