feat(CLGL): 入库计划编辑页面支持保存计划明细实收数量

This commit is contained in:
2026-02-12 21:44:52 +08:00
parent af5341bb99
commit 3f11ff9548
3 changed files with 34 additions and 5 deletions
@@ -43,8 +43,10 @@ namespace FineUIPro.Web.CLGL
var detailList = TwInOutplandetailService.GetByModle(queryModel).ToList();
foreach (var item in detailList)
{
item.ActNum = item.PlanNum;
if (!item.ActNum.HasValue)
{
item.ActNum = item.PlanNum;
}
}
Grid1.DataSource = detailList;
Grid1.DataBind();
@@ -79,6 +81,26 @@ namespace FineUIPro.Web.CLGL
}
return detailLists;
}
/// <summary>
/// 保存计划明细项的实收数量
/// </summary>
private void SavePlanDetail(string InOutPlanMasterId)
{
JArray teamGroupData = Grid1.GetMergedData();
foreach (JObject teamGroupRow in teamGroupData)
{
JObject values = teamGroupRow.Value<JObject>("values");
string detailId = teamGroupRow.Value<string>("id");
decimal actNum = values.Value<decimal>("ActNum");
var detail = TwInOutplandetailService.GetById(detailId);
if (detail != null)
{
detail.ActNum = actNum;
TwInOutplandetailService.Update(detail);
}
}
}
protected void btnEditProcess_Click(object sender, EventArgs e)
{
throw new NotImplementedException();
@@ -87,7 +109,14 @@ namespace FineUIPro.Web.CLGL
protected void btnSave_Click(object sender, EventArgs e)
{
var model = TwInOutplanmasterService.GetById(Id);
if (model == null) return;
if (model == null) return;
if (model.State == (int)TwConst.State.)
{
SavePlanDetail(Id);
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
return;
}
model.WarehouseMan = this.CurrUser.PersonId;
model.WarehouseDate = DateTime.Now;
TwInOutplanmasterService.Update(model);