feat(hjgl): 完善焊前检查和防腐检查流程
焊前检查需要同时覆盖下料、组对和防腐检查,并支持移动端查询与保存。 扩展焊前检查模型、服务和页面字段,补充检查结果、不合格原因、整改要求、 附件和防腐检查记录,便于按焊口和材料追溯检查过程。
This commit is contained in:
@@ -0,0 +1,119 @@
|
||||
using BLL;
|
||||
using System;
|
||||
|
||||
namespace FineUIPro.Web.CLGL
|
||||
{
|
||||
public partial class AntiCorrosionCheckRecordEdit : PageBase
|
||||
{
|
||||
public string AntiCorrosionCheckId
|
||||
{
|
||||
get { return (string)ViewState["AntiCorrosionCheckId"]; }
|
||||
set { ViewState["AntiCorrosionCheckId"] = value; }
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
AntiCorrosionCheckId = Request.Params["AntiCorrosionCheckId"];
|
||||
BindPaintCode();
|
||||
BindCheckPerson();
|
||||
if (!string.IsNullOrEmpty(AntiCorrosionCheckId))
|
||||
{
|
||||
BindData();
|
||||
}
|
||||
else
|
||||
{
|
||||
drpCheckPerson.SelectedValue = CurrUser.PersonId;
|
||||
dpCheckTime.SelectedDate = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BindPaintCode()
|
||||
{
|
||||
drpPaintId.DataTextField = "PaintCode";
|
||||
drpPaintId.DataValueField = "Id";
|
||||
drpPaintId.DataSource = TwAntiCorrosionTrustService.GetPaintCodeList();
|
||||
drpPaintId.DataBind();
|
||||
Funs.FineUIPleaseSelect(drpPaintId);
|
||||
}
|
||||
|
||||
private void BindCheckPerson()
|
||||
{
|
||||
Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpCheckPerson, CurrUser.LoginProjectId, null, null, true);
|
||||
}
|
||||
|
||||
private void BindData()
|
||||
{
|
||||
var model = PreWeldInspectionService.GetAntiCorrosionCheckById(AntiCorrosionCheckId);
|
||||
if (model == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
txtMaterialCode.Text = model.MaterialCode;
|
||||
txtAnticorrosionLevel.Text = model.AnticorrosionLevel;
|
||||
drpPaintId.SelectedValue = model.PaintId;
|
||||
if (model.FilmThickness.HasValue)
|
||||
{
|
||||
numFilmThickness.Text = model.FilmThickness.Value.ToString();
|
||||
}
|
||||
txtSandBlasting.Text = model.SandBlasting;
|
||||
txtRustSandBlasting.Text = model.RustSandBlasting;
|
||||
ddlCheckResult.SelectedValue = model.CheckResult;
|
||||
drpCheckPerson.SelectedValue = model.CheckPerson;
|
||||
dpCheckTime.SelectedDate = model.CheckTime;
|
||||
txtUnqualifiedReason.Text = model.UnqualifiedReason;
|
||||
txtRectifyRequirement.Text = model.RectifyRequirement;
|
||||
txtRemark.Text = model.Remark;
|
||||
}
|
||||
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.PersonId, Const.Tw_AntiCorrosionCheckRecordMenuId, Const.BtnSave))
|
||||
{
|
||||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
var item = new Model.AntiCorrosionCheckRecordInput
|
||||
{
|
||||
AntiCorrosionCheckId = AntiCorrosionCheckId,
|
||||
ProjectId = CurrUser.LoginProjectId,
|
||||
MaterialCode = txtMaterialCode.Text.Trim(),
|
||||
AnticorrosionLevel = txtAnticorrosionLevel.Text.Trim(),
|
||||
PaintId = drpPaintId.SelectedValue,
|
||||
FilmThickness = string.IsNullOrWhiteSpace(numFilmThickness.Text) ? (decimal?)null : Convert.ToDecimal(numFilmThickness.Text),
|
||||
SandBlasting = txtSandBlasting.Text.Trim(),
|
||||
RustSandBlasting = txtRustSandBlasting.Text.Trim(),
|
||||
CheckResult = ddlCheckResult.SelectedValue,
|
||||
CheckPerson = drpCheckPerson.SelectedValue,
|
||||
CheckTime = dpCheckTime.SelectedDate ?? DateTime.Now,
|
||||
UnqualifiedReason = txtUnqualifiedReason.Text.Trim(),
|
||||
RectifyRequirement = txtRectifyRequirement.Text.Trim(),
|
||||
Remark = txtRemark.Text.Trim(),
|
||||
CreateUser = CurrUser.PersonId
|
||||
};
|
||||
|
||||
AntiCorrosionCheckId = APIPreWeldInspectionService.SaveAntiCorrosionCheck(item);
|
||||
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
}
|
||||
|
||||
protected void btnAttachUrl_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(AntiCorrosionCheckId))
|
||||
{
|
||||
Alert.ShowInTop("请先保存防腐检查记录后再上传附件!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(
|
||||
string.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/CLGL/AntiCorrosionCheckRecord&menuId={1}&edit=1&type=-1",
|
||||
AntiCorrosionCheckId, Const.Tw_AntiCorrosionCheckRecordMenuId)));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user