入库单批量新增 主子表
新增物料表
This commit is contained in:
1 parent
f8ee359644
commit
f4505ff18d
31 files changed
+949
-9
No files matched your search
@@ -3,6 +3,8 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web.Models;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@@ -39,6 +41,15 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
[HttpPost]
|
||||
public string Search2(ReceiptDetailListVM2 vm)
|
||||
{
|
||||
vm.Searcher.Page = vm.FC.GetValue<int>("Page");
|
||||
vm.Searcher.Limit = vm.FC.GetValue<int>("Limit");
|
||||
return vm.GetJson(false);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Create
|
||||
@@ -71,6 +82,67 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Create")]
|
||||
public ActionResult Create2(int id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptDetailVM>(passInit: true);
|
||||
vm.Entity.ReceiptHeaderId = id;
|
||||
vm.Entity.ReceiptHeader = new ReceiptHeader();
|
||||
//vm.Entity.ReceiptHeader.Code = vm.DC.Set<ReceiptHeader>().Find(id).Code;
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Create")]
|
||||
public ActionResult Create2(ReceiptDetailVM vm)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
vm.DoAdd();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
vm.DoReInit();
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGrid(index: 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Create")]
|
||||
public ActionResult CreateDetails(int id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptDetailVM>(passInit: true);
|
||||
vm.Entity.ReceiptHeaderId = id;
|
||||
vm.Entity.ReceiptHeader = new ReceiptHeader();
|
||||
//vm.Entity.ReceiptHeader.Code = vm.DC.Set<ReceiptHeader>().Find(id).Code;
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Create")]
|
||||
public ActionResult CreateDetails(ReceiptDetailVM vm)
|
||||
{
|
||||
var materialCodeList = vm.Entity.MaterialCode.Split("\n");
|
||||
var detailList = new List<ReceiptDetail>();
|
||||
foreach(var item in materialCodeList)
|
||||
{
|
||||
detailList.Add(new ReceiptDetail
|
||||
{
|
||||
MaterialCode = item,
|
||||
ReceiptHeaderId = vm.Entity.ReceiptHeaderId
|
||||
});
|
||||
}
|
||||
_unitwork.BatchAdd(detailList.ToArray());
|
||||
return FFResult().CloseDialog().RefreshGrid(index: 1);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Edit
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
@@ -138,6 +138,7 @@ namespace HHWMS.Web.Controllers
|
||||
public ActionResult Details(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptHeaderVM>(id);
|
||||
vm.Details.SearcherMode = ListVMSearchModeEnum.MasterDetail;
|
||||
return PartialView(vm);
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in new issue
Block a user