单据明细点数
This commit is contained in:
1 parent
2459d4664a
commit
bdaaa0d5d9
7 files changed
+838
-73
No files matched your search
@@ -6,6 +6,8 @@ using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Linq;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@@ -161,7 +163,7 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchEdit())
|
||||
{
|
||||
return PartialView("BatchEdit",vm);
|
||||
return PartialView("BatchEdit", vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -185,7 +187,7 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
if (!ModelState.IsValid || !vm.DoBatchDelete())
|
||||
{
|
||||
return PartialView("BatchDelete",vm);
|
||||
return PartialView("BatchDelete", vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -195,7 +197,7 @@ namespace HHWMS.Web.Controllers
|
||||
#endregion
|
||||
|
||||
#region Import
|
||||
[ActionDescription("Sys.Import")]
|
||||
[ActionDescription("Sys.Import")]
|
||||
public ActionResult Import()
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptHeaderImportVM>();
|
||||
@@ -226,5 +228,47 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 点数
|
||||
[ActionDescription("ReceiptHeader.Count")]
|
||||
public ActionResult Count(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptHeaderVM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查所有新建的明细,已开始收货明细不允许点数
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult SelectReceiptDetailsByCode(string code)
|
||||
{
|
||||
var data = _unitwork.Find<ReceiptHeader>(x => x.Code == code)
|
||||
.Include(x => x.ReceiptDetails).ToList();
|
||||
return JsonMore(data.FirstOrDefault().ReceiptDetails.Where(x => x.Status == ReceiptStatusEnum.新建));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改明细的数量
|
||||
/// </summary>
|
||||
/// <param name="code"></param>
|
||||
/// <param name="uniqueCode"></param>
|
||||
/// <param name="qty"></param>
|
||||
/// <returns></returns>
|
||||
public ActionResult CountCommit(string code, string uniqueCode, int qty)
|
||||
{
|
||||
var receiptDetail = _unitwork.FindSingle<ReceiptDetail>(x => x.UniqueCode.Equals(uniqueCode));
|
||||
if (receiptDetail != null)
|
||||
{
|
||||
receiptDetail.Qty = qty;
|
||||
receiptDetail.UpdateTime = DateTime.Now;
|
||||
receiptDetail.UpdateBy = Wtm.LoginUserInfo.ITCode;
|
||||
_unitwork.Update(receiptDetail);
|
||||
return JsonMore(null);
|
||||
}
|
||||
return JsonMore(null, 500, $"未找到唯一码{uniqueCode}的单据!");
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user