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

View File

@ -241,7 +241,7 @@ namespace BLL
if (plan == null || plan.State != (int)TwConst.State.)
{
return;
}
}
//判断是否已经生成过入库单
var queryIsExitInMaster = new Tw_InOutMasterOutput();
queryIsExitInMaster.InOutPlanMasterId = planId;

View File

@ -22,7 +22,7 @@
<Toolbars>
<f:Toolbar ID="TbCreate" Position="Top" ToolbarAlign="Right" runat="server" >
<Items>
<f:Button ID="btnSave" ToolTip="入库" Text="入库" Icon="SystemSave" OnClick="btnSave_Click"
<f:Button ID="btnSave" ToolTip="保存" Text="保存" Icon="SystemSave" OnClick="btnSave_Click"
EnablePostBack="true" runat="server">
</f:Button>
<%--<f:Button ID="btnEditProcess" ToolTip="编辑流程" Text="编辑流程" Icon="ApplicationEdit" OnClick="btnEditProcess_Click"

View File

@ -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);