调整了部分页面的查询条件
入库明细状态增加校验, 前端增加loading,禁用按钮,空提交检测
This commit is contained in:
1 parent
40a6810713
commit
6897508f8d
26 files changed
+227
-106
No files matched your search
@@ -2,6 +2,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using HHWMS.Web.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -71,12 +73,27 @@ public class ReceiptShelfInController : BaseController
|
||||
{
|
||||
try
|
||||
{
|
||||
var errDetails = _unitWork.Find<ReceiptDetail>(x => data.Select(x => x.UniqueCode).ToList()
|
||||
.Contains(x.UniqueCode)
|
||||
&& x.Status != ReceiptStatusEnum.新建).ToList();
|
||||
if (errDetails.Any())
|
||||
{
|
||||
var msg = "以下明细不是新建状态:\n";
|
||||
foreach (var errDetail in errDetails)
|
||||
{
|
||||
msg += $"{errDetail.UniqueCode}\n";
|
||||
}
|
||||
return JsonMore(null, 500, msg);
|
||||
}
|
||||
|
||||
// 查找明细,修改对应状态,并且 绑定物料周转箱
|
||||
foreach (Binding item in data.OrderBy(x => x.ReceiptCode))
|
||||
{
|
||||
// 更新入库单明细状态
|
||||
var header = receiptHeaderList.Find(x => x.ID.ToString().Equals(item.ReceiptCode));
|
||||
var receipt = header.ReceiptDetails.FirstOrDefault(x => x.UniqueCode.Equals(item.UniqueCode));
|
||||
var receipt = header.ReceiptDetails.FirstOrDefault(x => x.UniqueCode.Equals(item.UniqueCode)
|
||||
&& x.Status == ReceiptStatusEnum.新建
|
||||
);
|
||||
if (receipt != null)
|
||||
{
|
||||
receipt.Status = ReceiptStatusEnum.收完;
|
||||
@@ -88,7 +105,7 @@ public class ReceiptShelfInController : BaseController
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"入库单{item.ReceiptCode}不存在{item.UniqueCode}的明细!");
|
||||
throw new Exception($"入库单{item.ReceiptCode}不存在{item.UniqueCode}的新建状态明细!");
|
||||
}
|
||||
|
||||
// 新建库存
|
||||
@@ -110,29 +127,28 @@ public class ReceiptShelfInController : BaseController
|
||||
TaskStatus = InventoryTaskStatus.无任务,
|
||||
CreateBy = Wtm.LoginUserInfo.ITCode,
|
||||
CreateTime = DateTime.Now
|
||||
}); ;
|
||||
|
||||
foreach (var inv in invList)
|
||||
});
|
||||
}
|
||||
foreach (var inv in invList)
|
||||
{
|
||||
listInvtran.Add(new InventoryTransaction
|
||||
{
|
||||
listInvtran.Add(new InventoryTransaction
|
||||
{
|
||||
BillType = "in",
|
||||
ZoneCode = inv.ZoneCode,
|
||||
Type = inv.UniqueCode,
|
||||
MaterialCode = inv.MaterialCode,
|
||||
MaterialName = inv.MaterialName,
|
||||
MaterialSpec = inv.MaterialSpec,
|
||||
MaterialUnit = inv.MaterialUnit,
|
||||
MaterialType = inv.MaterialType,
|
||||
Batch = inv.Batch,
|
||||
Lot = inv.Lot,
|
||||
CompanyCode = inv.CompanyCode,
|
||||
LocationCode = inv.LocationCode,
|
||||
SupplierCode = inv.SupplierCode,
|
||||
Qty = inv.Qty,
|
||||
CreateTime = DateTime.Now
|
||||
});
|
||||
}
|
||||
BillType = "in",
|
||||
ZoneCode = inv.ZoneCode,
|
||||
Type = inv.UniqueCode,
|
||||
MaterialCode = inv.MaterialCode,
|
||||
MaterialName = inv.MaterialName,
|
||||
MaterialSpec = inv.MaterialSpec,
|
||||
MaterialUnit = inv.MaterialUnit,
|
||||
MaterialType = inv.MaterialType,
|
||||
Batch = inv.Batch,
|
||||
Lot = inv.Lot,
|
||||
CompanyCode = inv.CompanyCode,
|
||||
LocationCode = inv.LocationCode,
|
||||
SupplierCode = inv.SupplierCode,
|
||||
Qty = inv.Qty,
|
||||
CreateTime = DateTime.Now
|
||||
});
|
||||
}
|
||||
_unitWork.BatchAdd(invList.ToArray());
|
||||
_unitWork.BatchAdd(listInvtran.ToArray());
|
||||
|
||||
Reference in new issue
Block a user