feat(hjgl): 完善焊接任务与质量管理流程
This commit is contained in:
@@ -22,6 +22,12 @@ namespace FineUIPro.Web.CLGL
|
||||
set { ViewState["UnitWorkId"] = value; }
|
||||
}
|
||||
|
||||
public string HotProessTrustId
|
||||
{
|
||||
get { return (string)ViewState["HotProessTrustId"]; }
|
||||
set { ViewState["HotProessTrustId"] = value; }
|
||||
}
|
||||
|
||||
public string PaintCodeJson
|
||||
{
|
||||
get
|
||||
@@ -54,7 +60,8 @@ namespace FineUIPro.Web.CLGL
|
||||
txtDemandDate.Text = string.Format("{0:yyyy-MM-dd}", trust.DemandDate);
|
||||
txtCompleteDate.Text = string.Format("{0:yyyy-MM-dd}", trust.CompleteDate);
|
||||
txtRemark.Text = trust.Remark;
|
||||
InitOutputMasterDropDown(trust.OutputMasterId);
|
||||
HotProessTrustId = trust.HotProessTrustId;
|
||||
InitWeldTaskDropDown(trust.WeldTaskCode);
|
||||
BindGrid(TwAntiCorrosionTrustService.GetDetailList(TrustId));
|
||||
}
|
||||
else
|
||||
@@ -66,30 +73,28 @@ namespace FineUIPro.Web.CLGL
|
||||
txtUnitWorkName.Text = unitWork.UnitWorkName;
|
||||
}
|
||||
txtTrustCode.Text = TwAntiCorrosionTrustService.GenerateTrustCode(UnitWorkId);
|
||||
InitOutputMasterDropDown(null);
|
||||
InitWeldTaskDropDown(Request.Params["TaskCode"]);
|
||||
BindGrid(new List<AntiCorrosionTrustDetailOutput>());
|
||||
if (!string.IsNullOrEmpty(Request.Params["TaskCode"]))
|
||||
{
|
||||
drpWeldTask.SelectedValue = Request.Params["TaskCode"];
|
||||
BindGrid(TwAntiCorrosionTrustService.GetDetailsByTaskCode(this.CurrUser.LoginProjectId, Request.Params["TaskCode"]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InitOutputMasterDropDown(string selectedOutputMasterId)
|
||||
private void InitWeldTaskDropDown(string selectedTaskCode)
|
||||
{
|
||||
drpOutputMaster.DataTextField = "CusBillCode";
|
||||
drpOutputMaster.DataValueField = "Id";
|
||||
var list = TwAntiCorrosionTrustService.GetAvailableOutputMasters(this.CurrUser.LoginProjectId, UnitWorkId, TrustId);
|
||||
if (!string.IsNullOrEmpty(selectedOutputMasterId) && list.All(x => x.Id != selectedOutputMasterId))
|
||||
drpWeldTask.DataTextField = "Text";
|
||||
drpWeldTask.DataValueField = "TaskCode";
|
||||
var list = TwAntiCorrosionTrustService.GetAvailableWeldTasks(this.CurrUser.LoginProjectId, UnitWorkId, TrustId)
|
||||
.Select(x => new { x.TaskCode, Text = x.TaskCode + "(" + x.TeamGroupName + ")" }).ToList();
|
||||
drpWeldTask.DataSource = list;
|
||||
drpWeldTask.DataBind();
|
||||
Funs.FineUIPleaseSelect(drpWeldTask);
|
||||
if (!string.IsNullOrEmpty(selectedTaskCode))
|
||||
{
|
||||
var current = TwAntiCorrosionTrustService.GetOutputMasterById(selectedOutputMasterId);
|
||||
if (current != null)
|
||||
{
|
||||
list.Insert(0, current);
|
||||
}
|
||||
}
|
||||
drpOutputMaster.DataSource = list;
|
||||
drpOutputMaster.DataBind();
|
||||
Funs.FineUIPleaseSelect(drpOutputMaster);
|
||||
if (!string.IsNullOrEmpty(selectedOutputMasterId))
|
||||
{
|
||||
drpOutputMaster.SelectedValue = selectedOutputMasterId;
|
||||
drpWeldTask.SelectedValue = selectedTaskCode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,11 +113,11 @@ namespace FineUIPro.Web.CLGL
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
protected void drpOutputMaster_SelectedIndexChanged(object sender, EventArgs e)
|
||||
protected void drpWeldTask_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (drpOutputMaster.SelectedValue != Const._Null)
|
||||
if (drpWeldTask.SelectedValue != Const._Null)
|
||||
{
|
||||
BindGrid(TwAntiCorrosionTrustService.GetDetailsByOutputMasterId(drpOutputMaster.SelectedValue));
|
||||
BindGrid(TwAntiCorrosionTrustService.GetDetailsByTaskCode(this.CurrUser.LoginProjectId, drpWeldTask.SelectedValue));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -122,7 +127,7 @@ namespace FineUIPro.Web.CLGL
|
||||
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
var trust = SaveTrust();
|
||||
var trust = SaveTrust(false);
|
||||
if (trust == null)
|
||||
{
|
||||
return;
|
||||
@@ -134,7 +139,7 @@ namespace FineUIPro.Web.CLGL
|
||||
|
||||
protected void btnSubmit_Click(object sender, EventArgs e)
|
||||
{
|
||||
var trust = SaveTrust();
|
||||
var trust = SaveTrust(true);
|
||||
if (trust == null)
|
||||
{
|
||||
return;
|
||||
@@ -144,16 +149,17 @@ namespace FineUIPro.Web.CLGL
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
}
|
||||
|
||||
private AntiCorrosionTrustOutput SaveTrust()
|
||||
private AntiCorrosionTrustOutput SaveTrust(bool splitOnSubmit)
|
||||
{
|
||||
if (!CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, Const.Tw_AntiCorrosionTrustMenuId, Const.BtnSave))
|
||||
{
|
||||
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
return null;
|
||||
}
|
||||
if (drpOutputMaster.SelectedValue == Const._Null)
|
||||
if (string.IsNullOrEmpty(TrustId) && string.IsNullOrEmpty(HotProessTrustId)
|
||||
&& drpWeldTask.SelectedValue == Const._Null)
|
||||
{
|
||||
ShowNotify("请选择出库单编号!", MessageBoxIcon.Warning);
|
||||
ShowNotify("请选择焊接任务单!", MessageBoxIcon.Warning);
|
||||
return null;
|
||||
}
|
||||
if (TwAntiCorrosionTrustService.IsExistTrustCode(txtTrustCode.Text.Trim(), TrustId, this.CurrUser.LoginProjectId))
|
||||
@@ -170,7 +176,8 @@ namespace FineUIPro.Web.CLGL
|
||||
ConstructionPart = txtConstructionPart.Text.Trim(),
|
||||
ConstructionProfessional = txtConstructionProfessional.Text.Trim(),
|
||||
TrustCode = txtTrustCode.Text.Trim(),
|
||||
OutputMasterId = drpOutputMaster.SelectedValue,
|
||||
WeldTaskCode = drpWeldTask.SelectedValue == Const._Null ? null : drpWeldTask.SelectedValue,
|
||||
HotProessTrustId = HotProessTrustId,
|
||||
DemandDate = Funs.GetNewDateTime(txtDemandDate.Text.Trim()),
|
||||
CompleteDate = Funs.GetNewDateTime(txtCompleteDate.Text.Trim()),
|
||||
CreateMan = this.CurrUser.PersonId,
|
||||
@@ -184,8 +191,16 @@ namespace FineUIPro.Web.CLGL
|
||||
return null;
|
||||
}
|
||||
|
||||
TwAntiCorrosionTrustService.Save(trust, details);
|
||||
return trust;
|
||||
try
|
||||
{
|
||||
TwAntiCorrosionTrustService.Save(trust, details, splitOnSubmit);
|
||||
return trust;
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
ShowNotify(ex.Message, MessageBoxIcon.Warning);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private List<AntiCorrosionTrustDetailOutput> CollectGridDetailInfo()
|
||||
@@ -200,10 +215,11 @@ namespace FineUIPro.Web.CLGL
|
||||
result.Add(new AntiCorrosionTrustDetailOutput
|
||||
{
|
||||
Id = values.Value<string>("Id"),
|
||||
SortIndex = sortIndex,
|
||||
SortIndex = values.Value<int?>("SortIndex") ?? sortIndex,
|
||||
MaterialCode = values.Value<string>("MaterialCode"),
|
||||
Quantity = GetDecimal(values.Value<string>("Quantity")),
|
||||
PaintCode = values.Value<string>("PaintCode"),
|
||||
IsPostWeld = values.Value<bool?>("IsPostWeld") ?? false,
|
||||
Remark = values.Value<string>("Remark")
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user