Compare commits
21
Commits
base
...
c67f0fb317
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c67f0fb317 | ||
|
|
ec33bdf946 | ||
|
|
0d346bd155 | ||
|
|
6897508f8d | ||
|
|
40a6810713 | ||
|
|
caab84071c | ||
|
|
9bfee8930c | ||
|
|
5b1912ff07 | ||
|
|
eacc0551a2 | ||
|
|
a869449034 | ||
|
|
c286bf55d7 | ||
|
|
a64e3a36f4 | ||
|
|
2453e8405b | ||
|
|
9f6f95828c | ||
|
|
265b4a1f3f | ||
|
|
894ec3e0b0 | ||
|
|
d1781f7326 | ||
|
|
0ced05961b | ||
|
|
9872a308f7 | ||
|
|
faa3f5a9d3 | ||
|
|
8b4c33283c |
No files matched your search
@@ -1,4 +1,6 @@
|
||||
# wtm custom
|
||||
.DS_Store
|
||||
Desktop.ini
|
||||
|
||||
demo/WalkingTec.Mvvm.Demo/wwwroot/layuiadminsrc
|
||||
.Publish/
|
||||
|
||||
@@ -96,307 +96,333 @@ namespace HHWMS.Web
|
||||
{
|
||||
var taskno = response.TaskId.Split("-")[0];
|
||||
//wcs 任务反馈
|
||||
var task = _unitwork.Find<TaskHeader>(x => x.TaskNo.Equals(taskno) && x.Status != TaskStatusEnum.完成).Include(x => x.TaskDetails).FirstOrDefault();
|
||||
|
||||
if (task != null)
|
||||
var task = _unitwork.Find<TaskHeader>(x => x.TaskNo.Equals(taskno)
|
||||
&& x.Status != TaskStatusEnum.完成)
|
||||
.Include(x => x.TaskDetails).FirstOrDefault();
|
||||
using (var tran = Wtm.DC.Database.BeginTransaction())
|
||||
{
|
||||
if (task.Status != TaskStatusEnum.完成 && response.Result == (int)TaskStatusEnum.完成)
|
||||
try
|
||||
{
|
||||
var newTask = new TaskHeader
|
||||
if (task != null)
|
||||
{
|
||||
TaskDetails = new List<TaskDetail>()
|
||||
};
|
||||
var tasktolocatioin = _unitwork.FindSingle<Location>(x => x.Code.Equals(task.ToLocation));
|
||||
var taskfromlocatioin = _unitwork.FindSingle<Location>(x => x.Code.Equals(task.FromLocation));
|
||||
switch (task.TaskType)
|
||||
{
|
||||
case TaskTypeEnum.散料盒入库:
|
||||
// 更新库位
|
||||
// 起始库位为空
|
||||
// 目标库位为有货
|
||||
// 更新库存
|
||||
task.Status = TaskStatusEnum.完成;
|
||||
taskfromlocatioin.Status = LocationStatus.空仓位;
|
||||
taskfromlocatioin.ContainerCode = "";
|
||||
_unitwork.Update(taskfromlocatioin);
|
||||
|
||||
tasktolocatioin.Status = tasktolocatioin.Length == 1 ? LocationStatus.满货 : LocationStatus.有货;
|
||||
if (!_unitwork.IsExit<Inventory>(x => x.ContainerCode == tasktolocatioin.Code))
|
||||
{
|
||||
tasktolocatioin.Status = LocationStatus.空容器;
|
||||
}
|
||||
tasktolocatioin.ContainerCode = task.ContainerCode;
|
||||
_unitwork.Update(tasktolocatioin);
|
||||
|
||||
_unitwork.BatchUpdate<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode),
|
||||
x => new Inventory
|
||||
{
|
||||
LocationCode = tasktolocatioin.Code,
|
||||
TaskStatus = InventoryTaskStatus.无任务,
|
||||
UpdateTime = DateTime.Now,
|
||||
UpdateBy = "wcs"
|
||||
});
|
||||
break;
|
||||
case TaskTypeEnum.散料盒出库:
|
||||
// 更新库位
|
||||
// 起始库位为空
|
||||
// 目标库位为有货
|
||||
// 更新库存
|
||||
task.Status = TaskStatusEnum.完成;
|
||||
|
||||
//taskfromlocatioin.Status = LocationStatus.空仓位;
|
||||
//taskfromlocatioin.ContainerCode = "";
|
||||
//_unitwork.Update(taskfromlocatioin);
|
||||
|
||||
tasktolocatioin.Status = LocationStatus.有货;
|
||||
tasktolocatioin.ContainerCode = task.ContainerCode;
|
||||
_unitwork.Update(tasktolocatioin);
|
||||
|
||||
_unitwork.BatchUpdate<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode),
|
||||
x => new Inventory
|
||||
{
|
||||
LocationCode = tasktolocatioin.Code,
|
||||
UpdateTime = DateTime.Now,
|
||||
UpdateBy = "wcs"
|
||||
});
|
||||
|
||||
break;
|
||||
case TaskTypeEnum.盘料盒入库:
|
||||
// 更新库位
|
||||
// 起始库位为空
|
||||
// 目标库位为有货
|
||||
// 更新库存
|
||||
task.Status = TaskStatusEnum.完成;
|
||||
|
||||
taskfromlocatioin.ContainerCode = "";
|
||||
taskfromlocatioin.Status = LocationStatus.空仓位;
|
||||
_unitwork.Update(taskfromlocatioin);
|
||||
|
||||
var invCount = _unitwork.GetCount<Inventory>(x => x.ContainerCode == tasktolocatioin.ContainerCode);
|
||||
tasktolocatioin.Width = invCount;
|
||||
if (invCount == tasktolocatioin.Length)
|
||||
{
|
||||
tasktolocatioin.Status = LocationStatus.满货;
|
||||
}
|
||||
else if (invCount < tasktolocatioin.Length && invCount != 0)
|
||||
{
|
||||
tasktolocatioin.Status = LocationStatus.有货;
|
||||
}
|
||||
else if (invCount == 0)
|
||||
{
|
||||
tasktolocatioin.Status = LocationStatus.空容器;
|
||||
}
|
||||
_unitwork.Update(tasktolocatioin);
|
||||
|
||||
_unitwork.BatchUpdate<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode),
|
||||
x => new Inventory
|
||||
{
|
||||
LocationCode = tasktolocatioin.Code,
|
||||
TaskStatus = InventoryTaskStatus.无任务,
|
||||
UpdateTime = DateTime.Now,
|
||||
UpdateBy = "wcs"
|
||||
});
|
||||
|
||||
break;
|
||||
case TaskTypeEnum.盘料盒出库:
|
||||
// 更新库位
|
||||
// 起始库位为空
|
||||
// 目标库位为有货
|
||||
// 更新库存
|
||||
task.Status = TaskStatusEnum.完成;
|
||||
|
||||
tasktolocatioin.ContainerCode = task.ContainerCode;
|
||||
tasktolocatioin.Status = LocationStatus.任务锁;
|
||||
_unitwork.Update(tasktolocatioin);
|
||||
|
||||
// 料盒出库是为了入,还是为了出 1是出,2是入
|
||||
if (task.Station == "1")
|
||||
{
|
||||
// 下发盘料出库
|
||||
var plrTask = _unitwork.Find<TaskHeader>(x => x.TaskType.Equals(TaskTypeEnum.盘料出库)
|
||||
&& x.ContainerCode.Contains(task.ContainerCode))
|
||||
.Include(x => x.TaskDetails).FirstOrDefault();
|
||||
if (plrTask != null)
|
||||
{
|
||||
var details = plrTask.TaskDetails.Where(x => !string.IsNullOrEmpty(x.ContainerCode)
|
||||
&& x.ContainerCode.Equals(task.ContainerCode)
|
||||
&& !string.IsNullOrEmpty(x.ToLocation));
|
||||
foreach (var detail in details)
|
||||
{
|
||||
detail.Status = TaskStatusEnum.待下发;
|
||||
detail.UpdateTime = DateTime.Now;
|
||||
}
|
||||
plrTask.Status = TaskStatusEnum.待下发;
|
||||
_unitwork.Update(plrTask);
|
||||
}
|
||||
}
|
||||
else if (task.Station == "2")
|
||||
{
|
||||
// 下发盘料入库
|
||||
var plrTask = _unitwork.Find<TaskHeader>(x => x.TaskType.Equals(TaskTypeEnum.盘料入库) && !string.IsNullOrEmpty(x.ContainerCode)
|
||||
&& x.ContainerCode.Contains(task.ContainerCode))
|
||||
.Include(x => x.TaskDetails).FirstOrDefault();
|
||||
if (plrTask != null)
|
||||
{
|
||||
plrTask.Status = TaskStatusEnum.待下发;
|
||||
// 更新目的仓位
|
||||
var to = _unitwork.FindSingle<Location>(x => x.ContiguousCode == task.ToLocation
|
||||
&& x.Type.Equals(LocationTypeEnum.机械臂工位))?.Code;
|
||||
plrTask.ToLocation = to;
|
||||
// 更新明细为待下发
|
||||
var details = plrTask.TaskDetails.Where(x =>!string.IsNullOrEmpty(x.ContainerCode) && x.ContainerCode.Contains(task.ContainerCode));
|
||||
|
||||
foreach(var item in details)
|
||||
{
|
||||
item.Status = TaskStatusEnum.待下发;
|
||||
item.UpdateTime = DateTime.Now;
|
||||
}
|
||||
_unitwork.Update(plrTask);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TaskTypeEnum.盘料入库:
|
||||
var ll = response.TaskId.Split("-")[1];
|
||||
//更新库存数据
|
||||
var taskdetail = task.TaskDetails.First(x => x.FromLocation == ll);
|
||||
var invIn = _unitwork.Find<Inventory>(n => n.UniqueCode == taskdetail.UniqueCode
|
||||
&& n.ContainerCode == task.FromLocation
|
||||
&& n.TaskStatus == InventoryTaskStatus.任务中).FirstOrDefault();
|
||||
if (invIn != null)
|
||||
{
|
||||
invIn.ContainerCode = taskdetail.ContainerCode;
|
||||
invIn.LocationCode = taskdetail.ContainerCode;
|
||||
invIn.Lot = taskdetail.ToLocation;
|
||||
_unitwork.Update(invIn);
|
||||
}
|
||||
task.TaskDetails.First(x => x.FromLocation == ll).Status = TaskStatusEnum.完成;
|
||||
var containerCode = task.TaskDetails.First(x => x.FromLocation == ll).ContainerCode;
|
||||
// 查询料塔 是否还有 此料盒 已下发,未完成的盘料入库任务 有不操作,没有 创建料盒入库任务
|
||||
if (!task.TaskDetails.Any(x => x.Status < TaskStatusEnum.完成 && !string.IsNullOrEmpty(x.ContainerCode) && x.ContainerCode.Equals(containerCode)))
|
||||
{
|
||||
var station = _unitwork.Find<Location>(x => x.Code == task.FromLocation).FirstOrDefault();
|
||||
// 创建料盒入库任务
|
||||
// 查找回库的任务起点,
|
||||
var fromLocation = _unitwork.FindSingle<Location>(x => x.Code.Equals(task.ToLocation)).ContiguousCode;
|
||||
newTask.ZoneCode = ZoneCodeEnum.盘料库;
|
||||
if (task.TaskNo.Contains("PLoop"))
|
||||
{
|
||||
newTask.TaskNo = _unitwork.GetSerialNumber("PLoopin", 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
newTask.TaskNo = _unitwork.GetSerialNumber("in", 4);
|
||||
}
|
||||
newTask.TaskType = TaskTypeEnum.盘料盒入库;
|
||||
newTask.ContainerCode = containerCode;
|
||||
newTask.FromLocation = fromLocation;
|
||||
newTask.ToLocation = containerCode;
|
||||
newTask.Status = TaskStatusEnum.待下发;
|
||||
newTask.CreateTime = DateTime.Now;
|
||||
_unitwork.Add(newTask);
|
||||
//更新料塔占用
|
||||
station.ContainerCode = "";
|
||||
_unitwork.Update(station);
|
||||
}
|
||||
// 查询料塔 是否还有已下发,未完成的盘料入库任务
|
||||
if (!task.TaskDetails.Any(x => x.Status < TaskStatusEnum.完成))
|
||||
{
|
||||
task.Status = TaskStatusEnum.完成;
|
||||
}
|
||||
|
||||
break;
|
||||
case TaskTypeEnum.盘料出库:
|
||||
var lll = response.TaskId.Split("-")[1];
|
||||
var taskde = task.TaskDetails.First(x => x.FromLocation == lll);
|
||||
taskde.Status = TaskStatusEnum.完成;
|
||||
|
||||
//更新托盘物料数量
|
||||
var container = _unitwork.Find<Location>(n => n.Code == task.ContainerCode).FirstOrDefault();
|
||||
container.Width -= 1;
|
||||
if (container.Width < 0) container.Width = 0;
|
||||
_unitwork.Update(container);
|
||||
|
||||
//更新物料在料塔上的位置
|
||||
var tolocation = _unitwork.Find<Location>(n => n.Code == task.ToLocation).FirstOrDefault();
|
||||
var inv = _unitwork.Find<Inventory>(n => n.UniqueCode == taskde.UniqueCode
|
||||
&& n.ContainerCode == task.ContainerCode
|
||||
&& n.TaskStatus == InventoryTaskStatus.任务中).FirstOrDefault();
|
||||
if (inv != null)
|
||||
{
|
||||
inv.ContainerCode = tolocation.ContainerCode;
|
||||
inv.LocationCode = task.ToLocation;
|
||||
inv.Lot = taskde.ToLocation;
|
||||
_unitwork.Update(inv);
|
||||
}
|
||||
// 查询工位 是否还有已下发,未完成的盘料出库任务 有不操作,没有 创建料盒入库任务
|
||||
if (!task.TaskDetails.Any(x => x.Status < TaskStatusEnum.完成))
|
||||
{
|
||||
task.Status = TaskStatusEnum.完成;
|
||||
// 查找回库的任务起点,
|
||||
var fromLocation = _unitwork.FindSingle<Location>(x => x.Code.Equals(task.FromLocation)).ContiguousCode;
|
||||
// 下发盘料盒回库任务,回原位
|
||||
newTask.ZoneCode = ZoneCodeEnum.盘料库;
|
||||
if (task.TaskNo.Contains("PLoop"))
|
||||
{
|
||||
newTask.TaskNo = _unitwork.GetSerialNumber("PLoopin", 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
newTask.TaskNo = _unitwork.GetSerialNumber("in", 4);
|
||||
}
|
||||
newTask.TaskType = TaskTypeEnum.盘料盒入库;
|
||||
newTask.ContainerCode = task.ContainerCode;
|
||||
newTask.FromLocation = fromLocation;
|
||||
newTask.ToLocation = task.ContainerCode;
|
||||
newTask.Status = TaskStatusEnum.待下发;
|
||||
newTask.CreateTime = DateTime.Now;
|
||||
_unitwork.Add(newTask);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if(task.TaskType == TaskTypeEnum.盘料盒入库
|
||||
|| task.TaskType == TaskTypeEnum.散料盒入库)
|
||||
{
|
||||
var invList = _unitwork.Find<Inventory>(x => x.ContainerCode == task.ContainerCode
|
||||
&& x.TaskStatus == InventoryTaskStatus.任务中)
|
||||
.ToList();
|
||||
var listInvtran = new List<InventoryTransaction>();
|
||||
foreach (var inv in invList)
|
||||
if (task.Status != TaskStatusEnum.完成 && response.Result == (int)TaskStatusEnum.完成)
|
||||
{
|
||||
listInvtran.Add(new InventoryTransaction
|
||||
var newTask = new TaskHeader
|
||||
{
|
||||
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
|
||||
});
|
||||
TaskDetails = new List<TaskDetail>()
|
||||
};
|
||||
var tasktolocatioin = _unitwork.FindSingle<Location>(x => x.Code.Equals(task.ToLocation));
|
||||
var taskfromlocatioin = _unitwork.FindSingle<Location>(x => x.Code.Equals(task.FromLocation));
|
||||
switch (task.TaskType)
|
||||
{
|
||||
case TaskTypeEnum.散料盒入库:
|
||||
// 更新库位
|
||||
// 起始库位为空
|
||||
// 目标库位为有货
|
||||
// 更新库存
|
||||
task.Status = TaskStatusEnum.完成;
|
||||
taskfromlocatioin.Status = LocationStatus.空仓位;
|
||||
taskfromlocatioin.ContainerCode = "";
|
||||
_unitwork.Update(taskfromlocatioin);
|
||||
|
||||
tasktolocatioin.Status = tasktolocatioin.Length == 1 ? LocationStatus.满货 : LocationStatus.有货;
|
||||
if (!_unitwork.IsExit<Inventory>(x => x.ContainerCode == tasktolocatioin.Code))
|
||||
{
|
||||
tasktolocatioin.Status = LocationStatus.空容器;
|
||||
}
|
||||
tasktolocatioin.ContainerCode = task.ContainerCode;
|
||||
_unitwork.Update(tasktolocatioin);
|
||||
|
||||
break;
|
||||
case TaskTypeEnum.散料盒出库:
|
||||
// 更新库位
|
||||
// 起始库位为空
|
||||
// 目标库位为有货
|
||||
// 更新库存
|
||||
task.Status = TaskStatusEnum.完成;
|
||||
|
||||
//taskfromlocatioin.Status = LocationStatus.空仓位;
|
||||
//taskfromlocatioin.ContainerCode = "";
|
||||
//_unitwork.Update(taskfromlocatioin);
|
||||
|
||||
tasktolocatioin.Status = LocationStatus.有货;
|
||||
tasktolocatioin.ContainerCode = task.ContainerCode;
|
||||
_unitwork.Update(tasktolocatioin);
|
||||
|
||||
_unitwork.BatchUpdate<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode),
|
||||
x => new Inventory
|
||||
{
|
||||
LocationCode = tasktolocatioin.Code,
|
||||
UpdateTime = DateTime.Now,
|
||||
UpdateBy = "wcs"
|
||||
});
|
||||
|
||||
break;
|
||||
case TaskTypeEnum.盘料盒入库:
|
||||
// 更新库位
|
||||
// 起始库位为空
|
||||
// 目标库位为有货
|
||||
// 更新库存
|
||||
task.Status = TaskStatusEnum.完成;
|
||||
|
||||
taskfromlocatioin.ContainerCode = "";
|
||||
taskfromlocatioin.Status = LocationStatus.空仓位;
|
||||
_unitwork.Update(taskfromlocatioin);
|
||||
|
||||
var invCount = _unitwork.GetCount<Inventory>(x => x.ContainerCode == tasktolocatioin.ContainerCode);
|
||||
tasktolocatioin.Width = invCount;
|
||||
if (invCount == tasktolocatioin.Length)
|
||||
{
|
||||
tasktolocatioin.Status = LocationStatus.满货;
|
||||
}
|
||||
else if (invCount < tasktolocatioin.Length && invCount != 0)
|
||||
{
|
||||
tasktolocatioin.Status = LocationStatus.有货;
|
||||
}
|
||||
else if (invCount == 0)
|
||||
{
|
||||
tasktolocatioin.Status = LocationStatus.空容器;
|
||||
}
|
||||
_unitwork.Update(tasktolocatioin);
|
||||
|
||||
break;
|
||||
case TaskTypeEnum.盘料盒出库:
|
||||
// 更新库位
|
||||
// 起始库位为空
|
||||
// 目标库位为有货
|
||||
// 更新库存
|
||||
task.Status = TaskStatusEnum.完成;
|
||||
|
||||
tasktolocatioin.ContainerCode = task.ContainerCode;
|
||||
tasktolocatioin.Status = LocationStatus.任务锁;
|
||||
_unitwork.Update(tasktolocatioin);
|
||||
|
||||
// 料盒出库是为了入,还是为了出 1是出,2是入
|
||||
if (task.Station == "1")
|
||||
{
|
||||
// 下发盘料出库
|
||||
var plcTaskList = _unitwork.Find<TaskHeader>(x => x.TaskType.Equals(TaskTypeEnum.盘料出库)
|
||||
&& x.ContainerCode.Contains(task.ContainerCode))
|
||||
.Include(x => x.TaskDetails)
|
||||
.ToList();
|
||||
if (plcTaskList.Any())
|
||||
{
|
||||
foreach (var plcTask in plcTaskList)
|
||||
{
|
||||
var details = plcTask.TaskDetails.Where(x =>
|
||||
!string.IsNullOrEmpty(x.ContainerCode)
|
||||
&& x.ContainerCode.Equals(task.ContainerCode)
|
||||
&& !string.IsNullOrEmpty(x.ToLocation));
|
||||
foreach (var detail in details)
|
||||
{
|
||||
detail.Status = TaskStatusEnum.待下发;
|
||||
detail.UpdateTime = DateTime.Now;
|
||||
}
|
||||
|
||||
plcTask.Status = TaskStatusEnum.待下发;
|
||||
_unitwork.Update(plcTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (task.Station == "2")
|
||||
{
|
||||
// 下发盘料入库
|
||||
var plrTask = _unitwork.Find<TaskHeader>(x => x.TaskType.Equals(TaskTypeEnum.盘料入库) && !string.IsNullOrEmpty(x.ContainerCode)
|
||||
&& x.ContainerCode.Contains(task.ContainerCode))
|
||||
.Include(x => x.TaskDetails).FirstOrDefault();
|
||||
if (plrTask != null)
|
||||
{
|
||||
plrTask.Status = TaskStatusEnum.待下发;
|
||||
// 更新目的仓位
|
||||
var to = _unitwork.FindSingle<Location>(x => x.ContiguousCode == task.ToLocation
|
||||
&& x.Type.Equals(LocationTypeEnum.机械臂工位))?.Code;
|
||||
plrTask.ToLocation += $" {to}";
|
||||
// 更新明细为待下发
|
||||
var details = plrTask.TaskDetails.Where(x => !string.IsNullOrEmpty(x.ContainerCode) && x.ContainerCode.Contains(task.ContainerCode));
|
||||
|
||||
foreach (var item in details)
|
||||
{
|
||||
item.Status = TaskStatusEnum.待下发;
|
||||
item.UpdateTime = DateTime.Now;
|
||||
}
|
||||
_unitwork.Update(plrTask);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TaskTypeEnum.盘料入库:
|
||||
var ll = response.TaskId.Split("-")[1];
|
||||
//更新库存数据
|
||||
var taskdetail = task.TaskDetails.First(x => x.FromLocation == ll);
|
||||
var invIn = _unitwork.Find<Inventory>(n => n.UniqueCode == taskdetail.UniqueCode
|
||||
&& n.ContainerCode == task.FromLocation
|
||||
&& n.TaskStatus == InventoryTaskStatus.任务中).FirstOrDefault();
|
||||
if (invIn != null)
|
||||
{
|
||||
invIn.ContainerCode = taskdetail.ContainerCode;
|
||||
invIn.LocationCode = taskdetail.ContainerCode;
|
||||
invIn.Lot = taskdetail.ToLocation;
|
||||
_unitwork.Update(invIn);
|
||||
}
|
||||
task.TaskDetails.First(x => x.FromLocation == ll).Status = TaskStatusEnum.完成;
|
||||
var containerCode = task.TaskDetails.First(x => x.FromLocation == ll).ContainerCode;
|
||||
// 查询料塔 是否还有 此料盒 已下发,未完成的盘料入库任务 有不操作,没有 创建料盒入库任务
|
||||
if (!task.TaskDetails.Any(x => x.Status < TaskStatusEnum.完成 && !string.IsNullOrEmpty(x.ContainerCode) && x.ContainerCode.Equals(containerCode)))
|
||||
{
|
||||
var station = _unitwork.Find<Location>(x => x.Code == task.FromLocation).FirstOrDefault();
|
||||
// 创建料盒入库任务
|
||||
// 根据子任务容器编码,查找回库的任务起点,(主任务会有多个容器编码)
|
||||
var fromLocation = _unitwork.FindSingle<Location>(x =>
|
||||
x.ContainerCode.Equals(containerCode)
|
||||
&& x.Type == LocationTypeEnum.堆垛机工位
|
||||
).Code;
|
||||
newTask.ZoneCode = ZoneCodeEnum.盘料库;
|
||||
if (task.TaskNo.Contains("PLoop"))
|
||||
{
|
||||
newTask.TaskNo = _unitwork.GetSerialNumber("PLoopin", 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
newTask.TaskNo = _unitwork.GetSerialNumber("in", 4);
|
||||
}
|
||||
newTask.TaskType = TaskTypeEnum.盘料盒入库;
|
||||
newTask.ContainerCode = containerCode;
|
||||
newTask.FromLocation = fromLocation;
|
||||
newTask.ToLocation = containerCode;
|
||||
newTask.Status = TaskStatusEnum.待下发;
|
||||
newTask.CreateTime = DateTime.Now;
|
||||
_unitwork.Add(newTask);
|
||||
//更新料塔占用
|
||||
station.ContainerCode = "";
|
||||
_unitwork.Update(station);
|
||||
}
|
||||
// 查询料塔 是否还有已下发,未完成的盘料入库任务
|
||||
if (!task.TaskDetails.Any(x => x.Status < TaskStatusEnum.完成))
|
||||
{
|
||||
task.Status = TaskStatusEnum.完成;
|
||||
}
|
||||
|
||||
break;
|
||||
case TaskTypeEnum.盘料出库:
|
||||
var lll = response.TaskId.Split("-")[1];
|
||||
var taskde = task.TaskDetails.First(x => x.FromLocation == lll);
|
||||
taskde.Status = TaskStatusEnum.完成;
|
||||
|
||||
//更新托盘物料数量
|
||||
var container = _unitwork.Find<Location>(n => n.Code == task.ContainerCode).FirstOrDefault();
|
||||
container.Width -= 1;
|
||||
if (container.Width < 0) container.Width = 0;
|
||||
_unitwork.Update(container);
|
||||
|
||||
//更新物料在料塔上的位置
|
||||
var tolocation = _unitwork.Find<Location>(n => n.Code == task.ToLocation).FirstOrDefault();
|
||||
var inv = _unitwork.Find<Inventory>(n => n.UniqueCode == taskde.UniqueCode
|
||||
&& n.ContainerCode == task.ContainerCode
|
||||
&& n.TaskStatus == InventoryTaskStatus.任务中).FirstOrDefault();
|
||||
if (inv != null)
|
||||
{
|
||||
inv.ContainerCode = tolocation?.ContainerCode;
|
||||
inv.LocationCode = task.ToLocation;
|
||||
inv.Lot = taskde.ToLocation;
|
||||
_unitwork.Update(inv);
|
||||
}
|
||||
// 查询工位 是否还有已下发,未完成的盘料出库任务 有不操作,没有 创建料盒入库任务
|
||||
if (!task.TaskDetails.Any(x => x.Status < TaskStatusEnum.完成))
|
||||
{
|
||||
task.Status = TaskStatusEnum.完成;
|
||||
// 查找此托盘是否存在任务 如果有两个盘料出库的任务,不新建回库任务
|
||||
var sameContainerCount = _unitwork.Find<TaskHeader>(x =>
|
||||
x.TaskType.Equals(TaskTypeEnum.盘料出库)
|
||||
&& x.ContainerCode.Equals(task.ContainerCode)).Count();
|
||||
if (sameContainerCount > 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
// 查找回库的任务起点,
|
||||
var fromLocation = _unitwork.FindSingle<Location>(x => x.Code.Equals(task.FromLocation)).ContiguousCode;
|
||||
// 下发盘料盒回库任务,回原位
|
||||
newTask.ZoneCode = ZoneCodeEnum.盘料库;
|
||||
if (task.TaskNo.Contains("PLoop"))
|
||||
{
|
||||
newTask.TaskNo = _unitwork.GetSerialNumber("PLoopin", 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
newTask.TaskNo = _unitwork.GetSerialNumber("in", 4);
|
||||
}
|
||||
newTask.TaskType = TaskTypeEnum.盘料盒入库;
|
||||
newTask.ContainerCode = task.ContainerCode;
|
||||
newTask.FromLocation = fromLocation;
|
||||
newTask.ToLocation = task.ContainerCode;
|
||||
newTask.Status = TaskStatusEnum.待下发;
|
||||
newTask.CreateTime = DateTime.Now;
|
||||
_unitwork.Add(newTask);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (task.TaskType == TaskTypeEnum.盘料盒入库
|
||||
|| task.TaskType == TaskTypeEnum.散料盒入库)
|
||||
{
|
||||
var invList = _unitwork.Find<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode)
|
||||
&& x.TaskStatus.Equals(InventoryTaskStatus.任务中)
|
||||
&& string.IsNullOrEmpty(x.SourceCode)
|
||||
)
|
||||
.ToList();
|
||||
var listInvtran = new List<InventoryTransaction>();
|
||||
foreach (var inv in invList)
|
||||
{
|
||||
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,
|
||||
ContainerCode = task.ContainerCode,
|
||||
CompanyCode = inv.CompanyCode,
|
||||
LocationCode = inv.LocationCode,
|
||||
SupplierCode = inv.SupplierCode,
|
||||
Qty = inv.Qty,
|
||||
CreateTime = DateTime.Now
|
||||
});
|
||||
}
|
||||
_unitwork.BatchAdd(listInvtran.ToArray());
|
||||
|
||||
_unitwork.BatchUpdate<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode)
|
||||
&& string.IsNullOrEmpty(x.SourceCode),
|
||||
x => new Inventory
|
||||
{
|
||||
LocationCode = tasktolocatioin.Code,
|
||||
TaskStatus = InventoryTaskStatus.无任务,
|
||||
UpdateTime = DateTime.Now,
|
||||
UpdateBy = "wcs"
|
||||
});
|
||||
}
|
||||
_unitwork.Update(task);
|
||||
if (task.Status == TaskStatusEnum.完成)
|
||||
{
|
||||
_unitwork.Delete(task);
|
||||
}
|
||||
}
|
||||
_unitwork.BatchAdd(listInvtran.ToArray());
|
||||
}
|
||||
_unitwork.Update(task);
|
||||
if (task.Status == TaskStatusEnum.完成)
|
||||
else
|
||||
{
|
||||
_unitwork.Delete(task);
|
||||
return ApiResult();
|
||||
}
|
||||
tran.Commit();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
tran.Rollback();
|
||||
return JsonMore(null, 500, ex.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return ApiResult();
|
||||
}
|
||||
return ApiResult();
|
||||
}
|
||||
@@ -451,11 +477,11 @@ namespace HHWMS.Web
|
||||
// 料盒出库是为了入,还是为了出 1是出,2是入
|
||||
/*if (task.Station == "1")
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
else if (task.Station == "2")
|
||||
{
|
||||
|
||||
|
||||
}*/
|
||||
// 测试 创建盘料出库任务
|
||||
var locationList = _unitwork.Find<Location>(x => x.Row == tasktolocatioin.Row && "T,G2".Contains(x.Type)).ToList();
|
||||
|
||||
@@ -27,9 +27,6 @@ namespace HHWMS.Web.Controllers
|
||||
[ActionDescription("Sys.Search")]
|
||||
public ActionResult Index()
|
||||
{
|
||||
var inv = _unitwork.Find<Inventory>(x => x.TaskStatus != InventoryTaskStatus.任务中)
|
||||
.ToList()
|
||||
.GroupBy(x => x.ContainerCode);
|
||||
var vm = Wtm.CreateVM<ContainerListVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
@@ -50,13 +50,13 @@ namespace HHWMS.Web
|
||||
return data?.Text ?? a.ZoneCode;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.Code, 120),
|
||||
this.MakeGridHeader(x => x.Type)
|
||||
this.MakeGridHeader(x => x.Type,120)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = Types.FirstOrDefault(x => x.Value.ToString() == a.Type);
|
||||
return data?.Text ?? a.Type;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.Status)
|
||||
this.MakeGridHeader(x => x.Status,120)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = LocationStatus.FirstOrDefault(x => x.Value.ToString() == a.Status);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
@@ -10,7 +11,7 @@ namespace HHWMS.Web
|
||||
public String Code { get; set; }
|
||||
|
||||
[Display(Name = "Location.Type")]
|
||||
public String Type { get; set; }
|
||||
public List<string> Type { get; set; }
|
||||
|
||||
[Display(Name = "Location.Status")]
|
||||
public String Status { get; set; }
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<wt:display field="Entity.ContiguousCode" /> *@
|
||||
</wt:row>
|
||||
|
||||
<wt:grid vm="@Model.Inventorys" height="300" hidden-checkbox="true" hidden-grid-index="true" use-local-data="true" hidden-panel="true"/>
|
||||
<wt:grid vm="@Model.Inventorys" height="300" hidden-checkbox="true" use-local-data="true" hidden-panel="true"/>
|
||||
|
||||
<wt:row align="AlignEnum.Right">
|
||||
<wt:closebutton />
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" />
|
||||
<wt:textbox field="Searcher.Code" />
|
||||
@* <wt:combobox field="Searcher.Type" items="Types" />
|
||||
<wt:combobox field="Searcher.Type" items="Types" multi-select="true"/>
|
||||
@*
|
||||
<wt:combobox field="Searcher.Status" items="LocationStatus" />
|
||||
<wt:textbox field="Searcher.Row" />
|
||||
<wt:textbox field="Searcher.Line" />
|
||||
|
||||
@@ -17,11 +17,29 @@
|
||||
</el-row>
|
||||
<div style="margin: 20px 0;"></div>
|
||||
@* 富文本 *@
|
||||
<el-input type="textarea"
|
||||
@* <el-input type="textarea"
|
||||
:autosize="{ minRows: 4}"
|
||||
readonly
|
||||
v-model="gendCode">
|
||||
</el-input>
|
||||
</el-input> *@
|
||||
<el-divider></el-divider>
|
||||
<el-table :data="invTable" max-height="400" stripe border
|
||||
style="width: 100%">
|
||||
<el-table-column fixed="left"
|
||||
label="操作"
|
||||
width="120"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button @@click.native.prevent="deleteRow(scope.$index, invTable)"
|
||||
type="text"
|
||||
size="small">
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column>
|
||||
<el-table-column label="批次" width="220" align="center" prop="Batch"></el-table-column>
|
||||
</el-table>
|
||||
<el-button style="float: right" type="primary" @@click="print">打印</el-button>
|
||||
</el-row>
|
||||
|
||||
@@ -30,46 +48,20 @@
|
||||
el: "#print",
|
||||
data() {
|
||||
return {
|
||||
invTable:[],
|
||||
printData:[],
|
||||
gendCode: '',
|
||||
qrcode: '',
|
||||
num: 1,
|
||||
clear: false,
|
||||
template: {
|
||||
"panels": [
|
||||
{
|
||||
"index": 0,
|
||||
"height": 20,
|
||||
"width": 30,
|
||||
"paperHeader": 43.5,
|
||||
"paperFooter": 56.69,
|
||||
"printElements": [
|
||||
{
|
||||
"options": {
|
||||
"left": 0,
|
||||
"top": 2,
|
||||
"height": 52,
|
||||
"width": 81,
|
||||
"title": "",
|
||||
"field": "uniqueCode",
|
||||
"testData": "",
|
||||
"textType": "qrcode",
|
||||
"barcodeMode": "CODE39"
|
||||
},
|
||||
"printElementType": {
|
||||
"type": "text"
|
||||
}
|
||||
}
|
||||
],
|
||||
"paperNumberLeft": 55.5,
|
||||
"paperNumberTop": 34.5,
|
||||
"paperNumberDisabled": true
|
||||
}
|
||||
]
|
||||
}
|
||||
template: {"panels":[{"index":0,"height":25,"width":35,"paperHeader":43.5,"paperFooter":70.86614173228347,"printElements":[{"options":{"left":7.5,"top":0,"height":18,"width":86,"field":"code","testData":"A10209612024042800000001","fontFamily":"Microsoft YaHei"},"printElementType":{"type":"text"}},{"options":{"left":50,"top":20,"height":43,"width":48,"title":"123123","field":"batch","testData":"123123","textType":"qrcode"},"printElementType":{"type":"text"}},{"options":{"left":2,"top":20,"height":43,"width":48,"title":"123457","field":"qr","testData":"1231231","textType":"qrcode"},"printElementType":{"type":"text"}}],"paperNumberLeft":69,"paperNumberTop":48,"paperNumberDisabled":true}]}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 删除已绑定行
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1);
|
||||
},
|
||||
scanCode() {
|
||||
var _this = this;
|
||||
// 调用后台方法,判断是否在物料表内
|
||||
@@ -86,9 +78,11 @@
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
_this.qrcode = "";
|
||||
}
|
||||
if (_this.clear) {
|
||||
_this.gendCode = "";
|
||||
_this.invTable = [];
|
||||
_this.printData = [];
|
||||
}
|
||||
},
|
||||
@@ -137,10 +131,14 @@
|
||||
else{
|
||||
// console.log(json);
|
||||
json.Data.forEach(function (item) {
|
||||
_this.gendCode += item.UniqueCode + '\n';
|
||||
_this.gendCode += item.Batch + '\n';
|
||||
_this.printData.push({ uniqueCode: item.UniqueCode });
|
||||
_this.printData.push({ uniqueCode: item.Batch });
|
||||
// _this.gendCode += item.UniqueCode + '\n';
|
||||
// _this.gendCode += item.Batch + '\n';
|
||||
_this.invTable.push({
|
||||
"UniqueCode": item.UniqueCode,
|
||||
"Batch": item.Batch
|
||||
});
|
||||
// _this.printData.push({ uniqueCode: item.UniqueCode });
|
||||
// _this.printData.push({ uniqueCode: item.Batch });
|
||||
});
|
||||
|
||||
}
|
||||
@@ -157,6 +155,10 @@
|
||||
},
|
||||
print() {
|
||||
var _this = this;
|
||||
_this.printData = [];
|
||||
this.invTable.forEach(function (item) {
|
||||
_this.printData.push({ qr: item.UniqueCode,code: item.UniqueCode,batch: item.Batch });
|
||||
});
|
||||
// _this.gendCode = "";
|
||||
hiprint.init();
|
||||
var hiprintTemplate = new hiprint.PrintTemplate({
|
||||
|
||||
+17
-15
@@ -26,27 +26,28 @@ namespace HHWMS.Web
|
||||
protected override IEnumerable<IGridColumn<InventoryTransaction_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<InventoryTransaction_View>>{
|
||||
this.MakeGridHeader(x => x.ZoneCode),
|
||||
this.MakeGridHeader(x => x.Type),
|
||||
this.MakeGridHeader(x => x.ContainerCode),
|
||||
this.MakeGridHeader(x => x.LocationCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialSpec),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.ZoneCode,120),
|
||||
this.MakeGridHeader(x => x.BillType,120),
|
||||
this.MakeGridHeader(x => x.Type,230),
|
||||
this.MakeGridHeader(x => x.ContainerCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.LocationCode,150),
|
||||
this.MakeGridHeader(x => x.MaterialCode,120),
|
||||
this.MakeGridHeader(x => x.MaterialType,120),
|
||||
this.MakeGridHeader(x => x.MaterialName,120),
|
||||
this.MakeGridHeader(x => x.MaterialSpec,120),
|
||||
this.MakeGridHeader(x => x.MaterialUnit,120),
|
||||
this.MakeGridHeader(x => x.Batch,120),
|
||||
this.MakeGridHeader(x => x.Lot),
|
||||
this.MakeGridHeader(x => x.ManufactureDate),
|
||||
this.MakeGridHeader(x => x.ExpirationDate),
|
||||
this.MakeGridHeader(x => x.CompanyCode),
|
||||
this.MakeGridHeader(x => x.ManufactureDate).SetHide(),
|
||||
this.MakeGridHeader(x => x.ExpirationDate).SetHide(),
|
||||
this.MakeGridHeader(x => x.CompanyCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.SupplierCode),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.BillType),
|
||||
this.MakeGridHeader(x => x.SourceCode),
|
||||
this.MakeGridHeader(x => x.BillCode),
|
||||
this.MakeGridHeader(x => x.BillDetailId),
|
||||
this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeader(x => x.Status).SetHide(),
|
||||
this.MakeGridHeader(x => x.CreateTime,200),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
@@ -93,6 +94,7 @@ namespace HHWMS.Web
|
||||
BillCode = x.BillCode,
|
||||
BillDetailId = x.BillDetailId,
|
||||
Status = x.Status,
|
||||
CreateTime = x.CreateTime
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ namespace HHWMS.Web
|
||||
{
|
||||
[Display(Name = "Task.ZoneCode")]
|
||||
public String ZoneCode { get; set; }
|
||||
[Display(Name = "InventoryTransaction.Type")]
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
public String Type { get; set; }
|
||||
[Display(Name = "Task.ContainerCode")]
|
||||
public String ContainerCode { get; set; }
|
||||
|
||||
@@ -57,30 +57,31 @@ namespace HHWMS.Web
|
||||
}),
|
||||
this.MakeGridHeader(x => x.UniqueCode).SetWidth(230),
|
||||
this.MakeGridHeader(x => x.ContainerCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.LocationCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialSpec),
|
||||
this.MakeGridHeader(x => x.LocationCode,150),
|
||||
this.MakeGridHeader(x => x.MaterialCode,120),
|
||||
this.MakeGridHeader(x => x.MaterialType,120),
|
||||
this.MakeGridHeader(x => x.MaterialName,120),
|
||||
this.MakeGridHeader(x => x.MaterialSpec,120),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.Lot),
|
||||
this.MakeGridHeader(x => x.Batch,120),
|
||||
this.MakeGridHeader(x => x.Lot,80),
|
||||
//this.MakeGridHeader(x => x.ManufactureDate),
|
||||
//this.MakeGridHeader(x => x.ExpirationDate),
|
||||
//this.MakeGridHeader(x => x.CompanyCode),
|
||||
//this.MakeGridHeader(x => x.SupplierCode),
|
||||
this.MakeGridHeader(x => x.TaskQty).SetHide(),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.Qty,80),
|
||||
//this.MakeGridHeader(x => x.SourceCode),
|
||||
//this.MakeGridHeader(x => x.ReceiptCode),
|
||||
//this.MakeGridHeader(x => x.ReceiptDetailId),
|
||||
//this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeader(x => x.TaskStatus)
|
||||
this.MakeGridHeader(x => x.TaskStatus,120)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = InventoryTaskStatus.FirstOrDefault(x => x.Value.ToString() == a.TaskStatus);
|
||||
return data?.Text ?? a.TaskStatus;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.CreateTime,220),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
@@ -122,7 +123,7 @@ namespace HHWMS.Web
|
||||
.CheckContain(Searcher.Lot, x => x.Lot)
|
||||
.CheckContain(Searcher.SourceCode, x => x.SourceCode)
|
||||
.CheckContain(Searcher.ReceiptCode, x => x.ReceiptCode)
|
||||
.CheckContain(Searcher.Status, x => x.Status)
|
||||
.CheckContain(Searcher.TaskStatus, x => x.Status)
|
||||
.Select(x => new Inventory_View
|
||||
{
|
||||
ID = x.ID,
|
||||
@@ -148,6 +149,7 @@ namespace HHWMS.Web
|
||||
ReceiptDetailId = x.ReceiptDetailId,
|
||||
Status = x.Status,
|
||||
TaskStatus = x.TaskStatus,
|
||||
CreateTime = x.CreateTime,
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
|
||||
|
||||
namespace HHWMS.Web
|
||||
@@ -14,8 +15,10 @@ namespace HHWMS.Web
|
||||
{
|
||||
[Display(Name = "Task.ZoneCode")]
|
||||
public String ZoneCode { get; set; }
|
||||
[Display(Name = "Inventory.LocationCode")]
|
||||
[Display(Name = "Container.LocationCode")]
|
||||
public String LocationCode { get; set; }
|
||||
[Display(Name = "Inventory.TaskStatus", Description = "任务状态")]
|
||||
public string TaskStatus { get; set; }
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
public String UniqueCode { get; set; }
|
||||
[Display(Name = "Inventory.MaterialCode")]
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
<wt:combobox field="Searcher.ZoneCode" items="ZoneCodes" />
|
||||
<wt:textbox field="Searcher.UniqueCode" />
|
||||
<wt:textbox field="Searcher.MaterialCode" />
|
||||
<wt:textbox field="Searcher.Batch" />
|
||||
<wt:textbox field="Searcher.Batch" />
|
||||
<wt:combobox field="Searcher.TaskStatus" items="InventoryTaskStatus" />
|
||||
<wt:textbox field="Searcher.LocationCode" />
|
||||
@*<wt:textbox field="Searcher.MaterialType" />
|
||||
<wt:textbox field="Searcher.MaterialName" />
|
||||
<wt:textbox field="Searcher.MaterialSpec" />
|
||||
|
||||
@@ -7,6 +7,7 @@ using HHWMS.Web.Models;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@@ -132,11 +133,19 @@ namespace HHWMS.Web.Controllers
|
||||
[ActionDescription("Sys.Create")]
|
||||
public ActionResult CreateDetails(ReceiptDetailVM vm)
|
||||
{
|
||||
var header = _unitwork.FindSingle<ReceiptHeader>(x => x.ID == vm.Entity.ReceiptHeaderId);
|
||||
var header = _unitwork.Find<ReceiptHeader>(x => x.ID == vm.Entity.ReceiptHeaderId)
|
||||
.Include(x => x.ReceiptDetails)
|
||||
.FirstOrDefault();
|
||||
|
||||
if(header.FirstStatus != ReceiptStatusEnum.新建)
|
||||
{
|
||||
return FFResult().Alert("主单据不是新建状态,不能新建明细!");
|
||||
}
|
||||
|
||||
if (header.ReceiptDetails.Any(x => x.Status != ReceiptStatusEnum.新建))
|
||||
{
|
||||
return FFResult().Alert("主单据存在已入库的明细,不能新建明细!");
|
||||
}
|
||||
var plList = vm.Entity.MaterialCode.Split("\n");
|
||||
var slList = vm.Entity.Lot.Split("\n");
|
||||
var detailList = new List<ReceiptDetail>();
|
||||
@@ -168,18 +177,31 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
}
|
||||
var uniqueGroup = detailList.GroupBy(x => x.UniqueCode);
|
||||
|
||||
if (uniqueGroup.Any(x => x.Count() > 1))
|
||||
{
|
||||
return FFResult().Alert("新增明细中,存在重复的唯一码!");
|
||||
var codeList = uniqueGroup.Where(x => x.Count() > 1)
|
||||
.Select(x => x.Key)
|
||||
.ToList();
|
||||
return FFResult().Alert($"新增明细中,存在重复的唯一码!{String.Join(", ", codeList.ToArray())}");
|
||||
}
|
||||
|
||||
// 判断唯一码是否已在库内
|
||||
var reDetailList = _unitwork.Find<ReceiptDetail>(x => x.Status == ReceiptStatusEnum.新建)
|
||||
.Select(x => x.UniqueCode)
|
||||
.Select(x => new { x.UniqueCode, x.ReceiptHeader.Code })
|
||||
.ToList();
|
||||
if (reDetailList.Intersect(detailList.Select(x => x.UniqueCode)).Count() > 0)
|
||||
var reDel = reDetailList.Select(x => x.UniqueCode)
|
||||
.Intersect(detailList.Select(x => x.UniqueCode));
|
||||
if (reDel.Count() > 0)
|
||||
{
|
||||
return FFResult().Alert("新增明细中,存在已添加的唯一码!");
|
||||
var tt= reDetailList.Where(x => reDel.Contains(x.UniqueCode))
|
||||
.ToList();
|
||||
var returnStr = "";
|
||||
foreach (var item in tt)
|
||||
{
|
||||
returnStr += $"单号:{item.Code};唯一码:{item.UniqueCode};";
|
||||
}
|
||||
return FFResult().Alert($"新增明细中,存在已添加的唯一码!{returnStr}");
|
||||
}
|
||||
|
||||
// 判断唯一码是否已在库内
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace HHWMS.Web.Controllers
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptHeaderVM>();
|
||||
vm.Entity.Code = _unitwork.GetSerialNumber("R");
|
||||
vm.Entity.BillType = "In";
|
||||
vm.Entity.AppointmentTime = DateTime.Now;
|
||||
return PartialView(vm);
|
||||
}
|
||||
@@ -66,6 +67,10 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
if(_unitwork.IsExit<ReceiptHeader>(x => x.Code == vm.Entity.Code))
|
||||
{
|
||||
return FFResult().Alert($"入库单号 {vm.Entity.Code} 重复!");
|
||||
}
|
||||
vm.Entity.FirstStatus = ReceiptStatusEnum.新建;
|
||||
vm.DoAdd();
|
||||
if (!ModelState.IsValid)
|
||||
@@ -258,10 +263,16 @@ namespace HHWMS.Web.Controllers
|
||||
/// <returns></returns>
|
||||
public ActionResult CountCommit(string code, string uniqueCode, int qty)
|
||||
{
|
||||
var receiptDetail = _unitwork.FindSingle<ReceiptDetail>(x => x.UniqueCode.Equals(uniqueCode));
|
||||
if (qty <= 0)
|
||||
{
|
||||
return JsonMore(null, 500, $"数量必须大于0!");
|
||||
}
|
||||
var receiptDetail = _unitwork.FindSingle<ReceiptDetail>(x => x.UniqueCode.Equals(uniqueCode)
|
||||
&& x.ReceiptHeaderId.ToString() == code);
|
||||
if (receiptDetail != null)
|
||||
{
|
||||
receiptDetail.Qty = qty;
|
||||
receiptDetail.Lot = "1";
|
||||
receiptDetail.UpdateTime = DateTime.Now;
|
||||
receiptDetail.UpdateBy = Wtm.LoginUserInfo.ITCode;
|
||||
_unitwork.Update(receiptDetail);
|
||||
|
||||
@@ -133,6 +133,7 @@ namespace HHWMS.Web.Controllers
|
||||
public ActionResult Details(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptHeaderHistoryVM>(id);
|
||||
vm.Details.SearcherMode = ListVMSearchModeEnum.MasterDetail;
|
||||
return PartialView(vm);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -137,77 +137,127 @@ namespace HHWMS.Web.Controllers
|
||||
return JsonMore(null, 500, $"尺寸{item.Key}的盘料盒无法满足入库需求,剩余数量{num}");
|
||||
|
||||
}*/
|
||||
var receiptHeaderList = _unitWork.Find<ReceiptHeader>(x =>
|
||||
data.Select(x => x.ReceiptCode).ToList().Contains(x.Code))
|
||||
.Include(x => x.ReceiptDetails).ToList();
|
||||
// 查找明细,修改对应状态,并且 绑定物料周转箱
|
||||
foreach (Binding item in data)
|
||||
|
||||
using (var tran = Wtm.DC.Database.BeginTransaction())
|
||||
{
|
||||
// 更新入库单明细状态
|
||||
var header = receiptHeaderList.First(x => x.Code.Equals(item.ReceiptCode));
|
||||
var receipt = header.ReceiptDetails.First(x => x.UniqueCode.Equals(item.UniqueCode));
|
||||
//var receipt = _unitWork.FindSingle<ReceiptDetail>(x => x.UniqueCode == item.UniqueCode);
|
||||
if (receipt != null)
|
||||
try
|
||||
{
|
||||
receipt.CompletedQty = receipt.Qty;
|
||||
receipt.Status = ReceiptStatusEnum.收完;
|
||||
if (!header.ReceiptDetails.Any(x => x.Status < ReceiptStatusEnum.收完))
|
||||
// 先捡货,后入库
|
||||
if (_unitWork.IsExit<Inventory>(x => !string.IsNullOrEmpty(x.SourceCode)
|
||||
&& x.LocationCode == data.First().BoxCode))
|
||||
{
|
||||
header.FirstStatus = ReceiptStatusEnum.收完;
|
||||
_unitWork.Update(header);
|
||||
return JsonMore(null, 500, "周转箱存在未捡货任务,请捡货完成后再执行入库操作!");
|
||||
}
|
||||
/*
|
||||
//单据明细验证
|
||||
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);
|
||||
}*/
|
||||
|
||||
var receiptHeaderList = _unitWork.Find<ReceiptHeader>(x =>
|
||||
data.Select(x => x.ReceiptCode).ToList().Contains(x.Code))
|
||||
.Include(x => x.ReceiptDetails).ToList();
|
||||
// 查找明细,修改对应状态,并且 绑定物料周转箱
|
||||
foreach (Binding item in data)
|
||||
{
|
||||
// 更新入库单明细状态
|
||||
var header = receiptHeaderList.First(x => x.Code.Equals(item.ReceiptCode));
|
||||
var receipt = header.ReceiptDetails.FirstOrDefault(x =>
|
||||
x.UniqueCode.Equals(item.UniqueCode)
|
||||
&& x.Status < ReceiptStatusEnum.收完);
|
||||
//var receipt = _unitWork.FindSingle<ReceiptDetail>(x => x.UniqueCode == item.UniqueCode);
|
||||
if (receipt != null)
|
||||
{
|
||||
receipt.CompletedQty = receipt.Qty;
|
||||
receipt.Status = ReceiptStatusEnum.收完;
|
||||
_unitWork.Update(receipt);
|
||||
if (!header.ReceiptDetails.Any(x => x.Status < ReceiptStatusEnum.收完))
|
||||
{
|
||||
header.FirstStatus = ReceiptStatusEnum.收完;
|
||||
_unitWork.Update(header);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"入库单{item.ReceiptCode}不存在{item.UniqueCode}的明细!");
|
||||
}
|
||||
|
||||
// 新建库存
|
||||
var inventory = new Inventory
|
||||
{
|
||||
ZoneCode = ZoneCodeEnum.盘料库,
|
||||
UniqueCode = item.UniqueCode,
|
||||
Flag = item.Size,
|
||||
MaterialCode = receipt.MaterialCode,
|
||||
MaterialType = receipt.MaterialType,
|
||||
MaterialName = receipt.MaterialName,
|
||||
MaterialSpec = receipt.MaterialSpec,
|
||||
Batch = receipt.Batch,
|
||||
MaterialUnit = receipt.MaterialUnit,
|
||||
SupplierCode = receipt.SupplierCode,
|
||||
Qty = receipt.Qty,
|
||||
Lot = item.Index.ToString(),
|
||||
ContainerCode = item.BoxCode,
|
||||
Status = "0",
|
||||
TaskStatus = InventoryTaskStatus.任务中
|
||||
};
|
||||
_unitWork.Add(inventory);
|
||||
}
|
||||
|
||||
var boxcode = data.First().BoxCode;
|
||||
//根据提交的uniquecode,创建入库任务
|
||||
var invList = _unitWork.Find<Inventory>(x =>
|
||||
data.Select(y => y.UniqueCode).ToList().Contains(x.UniqueCode)
|
||||
&& x.TaskStatus == InventoryTaskStatus.任务中
|
||||
&& x.ContainerCode.Equals(boxcode))
|
||||
.ToList();
|
||||
if (invList.Count == 0)
|
||||
{
|
||||
return JsonMore(null, 500, $"站台{boxcode}没有绑定数据,请正确操作!");
|
||||
}
|
||||
|
||||
var task = new TaskHeader
|
||||
{
|
||||
TaskNo = _unitWork.GetSerialNumber("pin", 4),
|
||||
TaskType = TaskTypeEnum.盘料入库,
|
||||
Status = TaskStatusEnum.待下发,
|
||||
ZoneCode = ZoneCodeEnum.盘料库,
|
||||
FromLocation = boxcode,
|
||||
TaskDetails = new List<TaskDetail>(),
|
||||
};
|
||||
foreach (var item in invList)
|
||||
{
|
||||
var detail = new TaskDetail
|
||||
{
|
||||
UniqueCode = item.UniqueCode,
|
||||
FromLocation = item.Lot,
|
||||
Status = TaskStatusEnum.新建,
|
||||
CreateTime = DateTime.Now
|
||||
};
|
||||
task.TaskDetails.Add(detail);
|
||||
}
|
||||
|
||||
_unitWork.Add(task);
|
||||
|
||||
tran.Commit();
|
||||
}
|
||||
_unitWork.Update(receipt);
|
||||
// 新建库存
|
||||
var inventory = new Inventory
|
||||
catch (Exception ex)
|
||||
{
|
||||
ZoneCode = ZoneCodeEnum.盘料库,
|
||||
UniqueCode = item.UniqueCode,
|
||||
Flag = item.Size,
|
||||
MaterialCode = receipt.MaterialCode,
|
||||
MaterialType = receipt.MaterialType,
|
||||
MaterialName = receipt.MaterialName,
|
||||
MaterialSpec = receipt.MaterialSpec,
|
||||
Batch = receipt.Batch,
|
||||
MaterialUnit = receipt.MaterialUnit,
|
||||
SupplierCode = receipt.SupplierCode,
|
||||
Qty = receipt.Qty,
|
||||
Lot = item.Index.ToString(),
|
||||
ContainerCode = item.BoxCode,
|
||||
Status = "0",
|
||||
TaskStatus = InventoryTaskStatus.任务中
|
||||
};
|
||||
_unitWork.Add(inventory);
|
||||
tran.Rollback();
|
||||
return JsonMore(null, 500, ex.Message);
|
||||
}
|
||||
|
||||
}
|
||||
var boxcode = data.First().BoxCode;
|
||||
//创建入库任务
|
||||
var invList = _unitWork.Find<Inventory>(x => x.ContainerCode.Equals(boxcode))
|
||||
.ToList();
|
||||
if (invList.Count == 0)
|
||||
{
|
||||
return JsonMore(null, 500, $"站台{boxcode}没有绑定数据,请正确操作!");
|
||||
}
|
||||
var task = new TaskHeader
|
||||
{
|
||||
TaskNo = _unitWork.GetSerialNumber("pin", 4),
|
||||
TaskType = TaskTypeEnum.盘料入库,
|
||||
Status = TaskStatusEnum.待下发,
|
||||
ZoneCode = ZoneCodeEnum.盘料库,
|
||||
FromLocation = boxcode,
|
||||
TaskDetails = new List<TaskDetail>(),
|
||||
};
|
||||
foreach (var item in invList)
|
||||
{
|
||||
var detail = new TaskDetail
|
||||
{
|
||||
UniqueCode = item.UniqueCode,
|
||||
FromLocation = item.Lot,
|
||||
Status = TaskStatusEnum.新建,
|
||||
CreateTime = DateTime.Now
|
||||
};
|
||||
task.TaskDetails.Add(detail);
|
||||
}
|
||||
_unitWork.Add(task);
|
||||
|
||||
return JsonMore(null);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection.Emit;
|
||||
using System.Threading.Tasks;
|
||||
using HHWMS.Web.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -112,7 +113,9 @@ public class ReceiptSLInController : BaseController
|
||||
{
|
||||
return JsonMore(null, 500, $"{boxCode}站台没有料箱,无法入库!");
|
||||
}
|
||||
return JsonMore(null);
|
||||
var data = _unitWork.Find<Inventory>(x => x.LocationCode == boxCode
|
||||
&& x.TaskStatus == InventoryTaskStatus.任务中).ToList();
|
||||
return JsonMore(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -128,7 +131,8 @@ public class ReceiptSLInController : BaseController
|
||||
[HttpPost]
|
||||
public ActionResult ScanUniqueCode(string uniqueCode)
|
||||
{
|
||||
var receiptDetail = _unitWork.FindSingle<ReceiptDetail>(x => x.UniqueCode.Equals(uniqueCode));
|
||||
var receiptDetail = _unitWork.FindSingle<ReceiptDetail>(x => x.UniqueCode.Equals(uniqueCode)
|
||||
&& x.Status == ReceiptStatusEnum.新建);
|
||||
if (receiptDetail != null)
|
||||
{
|
||||
if (receiptDetail.Status == ReceiptStatusEnum.收完)
|
||||
@@ -139,7 +143,7 @@ public class ReceiptSLInController : BaseController
|
||||
}
|
||||
return JsonMore(null, 500, $"{uniqueCode}不存在!");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 绑定
|
||||
/// </summary>
|
||||
@@ -151,49 +155,82 @@ public class ReceiptSLInController : BaseController
|
||||
var receiptHeaderList = _unitWork.Find<ReceiptHeader>(x =>
|
||||
data.Select(x => x.ReceiptCode).ToList().Contains(x.ID.ToString()))
|
||||
.Include(x => x.ReceiptDetails).ToList();
|
||||
|
||||
// 查找明细,修改对应状态,并且 绑定物料周转箱
|
||||
foreach (Binding item in data.OrderBy(x => x.ReceiptCode))
|
||||
using (var tran = Wtm.DC.Database.BeginTransaction())
|
||||
{
|
||||
// 更新入库单明细状态
|
||||
var header = receiptHeaderList.Find(x => x.ID.ToString().Equals(item.ReceiptCode));
|
||||
var receipt = header.ReceiptDetails.First(x => x.UniqueCode.Equals(item.UniqueCode));
|
||||
if (receipt != null)
|
||||
try
|
||||
{
|
||||
if (receipt.Status == ReceiptStatusEnum.收完) continue;
|
||||
receipt.CompletedQty += item.BindQty;
|
||||
}
|
||||
if(receipt.CompletedQty == receipt.Qty)
|
||||
{
|
||||
receipt.Status = ReceiptStatusEnum.收完;
|
||||
if (!header.ReceiptDetails.Any(x => x.Status < ReceiptStatusEnum.收完))
|
||||
/*
|
||||
var errDetails = _unitWork.Find<ReceiptDetail>(x => data.Select(x => x.UniqueCode).ToList()
|
||||
.Contains(x.UniqueCode)
|
||||
&& x.Status != ReceiptStatusEnum.新建).ToList();
|
||||
if (errDetails.Any())
|
||||
{
|
||||
header.FirstStatus = ReceiptStatusEnum.收完;
|
||||
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)
|
||||
&& x.Status == ReceiptStatusEnum.新建);
|
||||
if (receipt != null)
|
||||
{
|
||||
if (receipt.Status == ReceiptStatusEnum.收完) continue;
|
||||
receipt.CompletedQty += item.BindQty;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"入库单{item.ReceiptCode}不存在{item.UniqueCode}的明细!");
|
||||
}
|
||||
if (receipt.CompletedQty == receipt.Qty)
|
||||
{
|
||||
receipt.Status = ReceiptStatusEnum.收完;
|
||||
if (!header.ReceiptDetails.Any(x => x.Status < ReceiptStatusEnum.收完))
|
||||
{
|
||||
header.FirstStatus = ReceiptStatusEnum.收完;
|
||||
}
|
||||
}
|
||||
var station = _unitWork.FindSingle<Location>(x => x.Code == item.BoxCode);
|
||||
// 新建库存
|
||||
var inventory = new Inventory
|
||||
{
|
||||
ZoneCode = ZoneCodeEnum.散料库,
|
||||
UniqueCode = item.UniqueCode,
|
||||
MaterialCode = receipt.MaterialCode,
|
||||
MaterialType = receipt.MaterialType,
|
||||
MaterialName = receipt.MaterialName,
|
||||
MaterialSpec = receipt.MaterialSpec,
|
||||
Batch = receipt.Batch,
|
||||
MaterialUnit = receipt.MaterialUnit,
|
||||
SupplierCode = receipt.SupplierCode,
|
||||
Qty = item.BindQty,
|
||||
LocationCode = item.BoxCode,
|
||||
ContainerCode = station.ContainerCode,
|
||||
ReceiptCode = item.ReceiptCode,
|
||||
Status = "0",
|
||||
TaskStatus = InventoryTaskStatus.任务中,
|
||||
Flag = item.Size,
|
||||
};
|
||||
_unitWork.Add(inventory);
|
||||
}
|
||||
_unitWork.BatchUpdate(receiptHeaderList.ToArray());
|
||||
|
||||
tran.Commit();
|
||||
}
|
||||
var station = _unitWork.FindSingle<Location>(x => x.Code == item.BoxCode);
|
||||
// 新建库存
|
||||
var inventory = new Inventory
|
||||
catch (Exception ex)
|
||||
{
|
||||
ZoneCode = ZoneCodeEnum.散料库,
|
||||
UniqueCode = item.UniqueCode,
|
||||
MaterialCode = receipt.MaterialCode,
|
||||
MaterialType = receipt.MaterialType,
|
||||
MaterialName = receipt.MaterialName,
|
||||
MaterialSpec = receipt.MaterialSpec,
|
||||
Batch = receipt.Batch,
|
||||
MaterialUnit = receipt.MaterialUnit,
|
||||
SupplierCode = receipt.SupplierCode,
|
||||
Qty = item.BindQty,
|
||||
LocationCode = item.BoxCode,
|
||||
ContainerCode = station.ContainerCode,
|
||||
Status = "0",
|
||||
TaskStatus = InventoryTaskStatus.任务中,
|
||||
Flag = item.Size,
|
||||
};
|
||||
_unitWork.Add(inventory);
|
||||
tran.Rollback();
|
||||
return JsonMore(null, 500, ex.Message);
|
||||
}
|
||||
}
|
||||
_unitWork.BatchUpdate(receiptHeaderList.ToArray());
|
||||
return JsonMore(null);
|
||||
}
|
||||
/// <summary>
|
||||
@@ -221,52 +258,92 @@ public class ReceiptSLInController : BaseController
|
||||
{
|
||||
return JsonMore(null, 500, $"{boxCode}站台没有料箱,无法入库!");
|
||||
}
|
||||
// 判断箱号是否合理
|
||||
var box = _unitWork.FindSingle<Location>(x => x.ContainerCode.Equals(station.ContainerCode)
|
||||
&& x.Type != LocationTypeEnum.散料库站台);
|
||||
|
||||
if (box != null)
|
||||
using (var tran = Wtm.DC.Database.BeginTransaction())
|
||||
{
|
||||
//if(box.Type != LocationTypeEnum.散料库站台)
|
||||
//{
|
||||
// return JsonMore(null, 500, $"{boxCode}不在站台,无法入库!");
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// 查找目标库位,托盘回原库位
|
||||
var toLocation = _unitWork.FindSingle<Location>(x => x.Code.Equals(box.Code));
|
||||
try
|
||||
{
|
||||
// 判断箱号是否合理
|
||||
var box = _unitWork.FindSingle<Location>(x => x.ContainerCode.Equals(station.ContainerCode)
|
||||
&& x.Type != LocationTypeEnum.散料库站台);
|
||||
|
||||
if (toLocation != null)
|
||||
if (box != null)
|
||||
{
|
||||
// 创建任务
|
||||
var task = new TaskHeader
|
||||
{
|
||||
ZoneCode = ZoneCodeEnum.散料库,
|
||||
TaskNo = _unitWork.GetSerialNumber("CIn"),
|
||||
TaskType = TaskTypeEnum.散料盒入库,
|
||||
ContainerCode = toLocation.Code,
|
||||
FromLocation = station.Code,
|
||||
ToLocation = toLocation.Code,
|
||||
Status = TaskStatusEnum.待下发,
|
||||
CreateBy = Wtm.LoginUserInfo.ITCode,
|
||||
CreateTime = DateTime.Now
|
||||
};
|
||||
_unitWork.Add(task);
|
||||
//if(box.Type != LocationTypeEnum.散料库站台)
|
||||
//{
|
||||
// return JsonMore(null, 500, $"{boxCode}不在站台,无法入库!");
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// 查找目标库位,托盘回原库位
|
||||
var toLocation = _unitWork.FindSingle<Location>(x => x.Code.Equals(box.Code));
|
||||
|
||||
toLocation.Status = LocationStatus.任务锁;
|
||||
toLocation.Length = isFull ? 1 : 0; // 是否满盘
|
||||
_unitWork.Update(toLocation);
|
||||
if (toLocation != null)
|
||||
{
|
||||
// 创建任务
|
||||
var task = new TaskHeader
|
||||
{
|
||||
ZoneCode = ZoneCodeEnum.散料库,
|
||||
TaskNo = _unitWork.GetSerialNumber("CIn"),
|
||||
TaskType = TaskTypeEnum.散料盒入库,
|
||||
ContainerCode = toLocation.Code,
|
||||
FromLocation = station.Code,
|
||||
ToLocation = toLocation.Code,
|
||||
Status = TaskStatusEnum.待下发,
|
||||
CreateBy = Wtm.LoginUserInfo.ITCode,
|
||||
CreateTime = DateTime.Now
|
||||
};
|
||||
_unitWork.Add(task);
|
||||
|
||||
toLocation.Status = LocationStatus.任务锁;
|
||||
toLocation.Length = isFull ? 1 : 0; // 是否满盘
|
||||
_unitWork.Update(toLocation);
|
||||
|
||||
var listInvtran = new List<InventoryTransaction>();
|
||||
var invList = _unitWork.Find<Inventory>(x =>
|
||||
x.ContainerCode.Equals(task.ContainerCode)
|
||||
&& x.TaskStatus == InventoryTaskStatus.任务中
|
||||
).ToList();
|
||||
foreach (var inv in invList)
|
||||
{
|
||||
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
|
||||
});
|
||||
}
|
||||
_unitWork.BatchAdd(listInvtran.ToArray());
|
||||
tran.Commit();
|
||||
}
|
||||
else
|
||||
{
|
||||
return JsonMore(null, 500, $"库内无可用仓位,无法入库!");
|
||||
}
|
||||
//}
|
||||
return JsonMore(data: null);
|
||||
}
|
||||
else
|
||||
{
|
||||
return JsonMore(null, 500, $"库内无可用仓位,无法入库!");
|
||||
return JsonMore(null, 500, $"{boxCode}不正确!");
|
||||
}
|
||||
//}
|
||||
return JsonMore(data: null);
|
||||
}
|
||||
else
|
||||
{
|
||||
return JsonMore(null, 500, $"{boxCode}不正确!");
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
tran.Rollback();
|
||||
return JsonMore(null, 500, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -39,7 +41,8 @@ public class ReceiptShelfInController : BaseController
|
||||
[HttpPost]
|
||||
public ActionResult ScanUniqueCode(string uniqueCode)
|
||||
{
|
||||
var receiptDetail = _unitWork.FindSingle<ReceiptDetail>(x => x.UniqueCode.Equals(uniqueCode));
|
||||
var receiptDetail = _unitWork.FindSingle<ReceiptDetail>(x => x.UniqueCode.Equals(uniqueCode)
|
||||
&& x.Status == ReceiptStatusEnum.新建);
|
||||
if (receiptDetail != null)
|
||||
{
|
||||
if (receiptDetail.Status == ReceiptStatusEnum.收完)
|
||||
@@ -50,7 +53,7 @@ public class ReceiptShelfInController : BaseController
|
||||
}
|
||||
return JsonMore(null, 500, $"{uniqueCode}不存在!");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 绑定
|
||||
/// </summary>
|
||||
@@ -66,68 +69,100 @@ public class ReceiptShelfInController : BaseController
|
||||
var invList = new List<Inventory>();
|
||||
var listInvtran = new List<InventoryTransaction>();
|
||||
|
||||
// 查找明细,修改对应状态,并且 绑定物料周转箱
|
||||
foreach (Binding item in data.OrderBy(x => x.ReceiptCode))
|
||||
using (var tran = Wtm.DC.Database.BeginTransaction())
|
||||
{
|
||||
// 更新入库单明细状态
|
||||
var header = receiptHeaderList.Find(x => x.ID.ToString().Equals(item.ReceiptCode));
|
||||
var receipt = header.ReceiptDetails.First(x => x.UniqueCode.Equals(item.UniqueCode));
|
||||
if (receipt != null)
|
||||
try
|
||||
{
|
||||
receipt.Status = ReceiptStatusEnum.收完;
|
||||
if (!header.ReceiptDetails.Any(x => x.Status < ReceiptStatusEnum.收完))
|
||||
var errDetails = _unitWork.Find<ReceiptDetail>(x =>
|
||||
data.Select(y => y.ID).ToList().Contains(x.ID)
|
||||
&& x.Status != ReceiptStatusEnum.新建).ToList();
|
||||
if (errDetails.Any())
|
||||
{
|
||||
header.FirstStatus = ReceiptStatusEnum.收完;
|
||||
var msg = "以下明细不是新建状态:\n";
|
||||
foreach (var errDetail in errDetails)
|
||||
{
|
||||
msg += $"{errDetail.UniqueCode}\n";
|
||||
}
|
||||
return JsonMore(null, 500, msg);
|
||||
}
|
||||
receipt.UpdateTime = DateTime.Now;
|
||||
}
|
||||
|
||||
// 新建库存
|
||||
invList.Add(new Inventory
|
||||
{
|
||||
ZoneCode = ZoneCodeEnum.货架库,
|
||||
LocationCode = item.BoxCode,
|
||||
UniqueCode = item.UniqueCode,
|
||||
MaterialCode = receipt.MaterialCode,
|
||||
MaterialType = receipt.MaterialType,
|
||||
MaterialName = receipt.MaterialName,
|
||||
MaterialSpec = receipt.MaterialSpec,
|
||||
Batch = receipt.Batch,
|
||||
MaterialUnit = receipt.MaterialUnit,
|
||||
SupplierCode = receipt.SupplierCode,
|
||||
Qty = receipt.Qty,
|
||||
Status = "0",
|
||||
TaskStatus = InventoryTaskStatus.无任务,
|
||||
CreateBy = Wtm.LoginUserInfo.ITCode,
|
||||
CreateTime = DateTime.Now
|
||||
}); ;
|
||||
|
||||
foreach (var inv in invList)
|
||||
{
|
||||
listInvtran.Add(new InventoryTransaction
|
||||
|
||||
// 查找明细,修改对应状态,并且 绑定物料周转箱
|
||||
foreach (Binding item in data.OrderBy(x => x.ReceiptCode))
|
||||
{
|
||||
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
|
||||
});
|
||||
// 更新入库单明细状态
|
||||
var header = receiptHeaderList.Find(x => x.ID.ToString().Equals(item.ReceiptCode));
|
||||
var receipt = header.ReceiptDetails.FirstOrDefault(x => x.UniqueCode.Equals(item.UniqueCode)
|
||||
&& x.Status == ReceiptStatusEnum.新建
|
||||
);
|
||||
if (receipt != null)
|
||||
{
|
||||
receipt.Status = ReceiptStatusEnum.收完;
|
||||
if (!header.ReceiptDetails.Any(x => x.Status < ReceiptStatusEnum.收完))
|
||||
{
|
||||
header.FirstStatus = ReceiptStatusEnum.收完;
|
||||
}
|
||||
receipt.UpdateTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"入库单{item.ReceiptCode}不存在{item.UniqueCode}的新建状态明细!");
|
||||
}
|
||||
|
||||
// 新建库存
|
||||
invList.Add(new Inventory
|
||||
{
|
||||
ZoneCode = ZoneCodeEnum.货架库,
|
||||
ContainerCode = item.BoxCode,
|
||||
LocationCode = item.BoxCode,
|
||||
UniqueCode = item.UniqueCode,
|
||||
MaterialCode = receipt.MaterialCode,
|
||||
MaterialType = receipt.MaterialType,
|
||||
MaterialName = receipt.MaterialName,
|
||||
MaterialSpec = receipt.MaterialSpec,
|
||||
Batch = receipt.Batch,
|
||||
MaterialUnit = receipt.MaterialUnit,
|
||||
SupplierCode = receipt.SupplierCode,
|
||||
Qty = receipt.Qty,
|
||||
Status = "0",
|
||||
TaskStatus = InventoryTaskStatus.无任务,
|
||||
CreateBy = Wtm.LoginUserInfo.ITCode,
|
||||
CreateTime = DateTime.Now
|
||||
});
|
||||
}
|
||||
foreach (var inv in invList)
|
||||
{
|
||||
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
|
||||
});
|
||||
}
|
||||
_unitWork.BatchAdd(invList.ToArray());
|
||||
_unitWork.BatchAdd(listInvtran.ToArray());
|
||||
_unitWork.BatchUpdate(receiptHeaderList.ToArray());
|
||||
|
||||
tran.Commit();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tran.Rollback();
|
||||
return JsonMore(null, 500, ex.Message);
|
||||
}
|
||||
}
|
||||
_unitWork.BatchAdd(invList.ToArray());
|
||||
_unitWork.BatchAdd(listInvtran.ToArray());
|
||||
_unitWork.BatchUpdate(receiptHeaderList.ToArray());
|
||||
return JsonMore(null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+67
-32
@@ -15,42 +15,77 @@ namespace HHWMS.Web
|
||||
{
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
if (SearcherMode == ListVMSearchModeEnum.MasterDetail)
|
||||
{
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "receipt"),
|
||||
};
|
||||
return new List<GridAction>();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.Create,
|
||||
Localizer["Sys.Create"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.Edit,
|
||||
Localizer["Sys.Edit"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.Delete,
|
||||
Localizer["Sys.Delete"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.Details,
|
||||
Localizer["Sys.Details"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.BatchEdit,
|
||||
Localizer["Sys.BatchEdit"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.BatchDelete,
|
||||
Localizer["Sys.BatchDelete"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.Import,
|
||||
Localizer["Sys.Import"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptDetailHistory", GridActionStandardTypesEnum.ExportExcel,
|
||||
Localizer["Sys.Export"], "receipt"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override IEnumerable<IGridColumn<ReceiptDetailHistory_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<ReceiptDetailHistory_View>>{
|
||||
this.MakeGridHeader(x => x.Code_view),
|
||||
this.MakeGridHeader(x => x.ZoneCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialSpec),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.Lot),
|
||||
this.MakeGridHeader(x => x.ManufactureDate),
|
||||
this.MakeGridHeader(x => x.ExpirationDate),
|
||||
this.MakeGridHeader(x => x.CompanyCode),
|
||||
this.MakeGridHeader(x => x.SupplierCode),
|
||||
this.MakeGridHeader(x => x.CompletedQty),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.InventoryStatus),
|
||||
this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
if (SearcherMode == ListVMSearchModeEnum.MasterDetail)
|
||||
{
|
||||
return new List<GridColumn<ReceiptDetailHistory_View>>
|
||||
{
|
||||
this.MakeGridHeader(x => x.UniqueCode).SetWidth(230),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.SupplierCode),
|
||||
this.MakeGridHeader(x => x.CompletedQty),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.Status)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<GridColumn<ReceiptDetailHistory_View>>
|
||||
{
|
||||
this.MakeGridHeader(x => x.Code_view),
|
||||
this.MakeGridHeader(x => x.ZoneCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.UniqueCode).SetWidth(230),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialSpec),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.Lot).SetHide(),
|
||||
this.MakeGridHeader(x => x.ManufactureDate).SetHide(),
|
||||
this.MakeGridHeader(x => x.ExpirationDate).SetHide(),
|
||||
this.MakeGridHeader(x => x.CompanyCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.SupplierCode),
|
||||
this.MakeGridHeader(x => x.CompletedQty),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.InventoryStatus),
|
||||
this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<ReceiptDetailHistory_View> GetSearchQuery()
|
||||
@@ -58,14 +93,13 @@ namespace HHWMS.Web
|
||||
var query = DC.Set<ReceiptDetailHistory>()
|
||||
.CheckEqual(Searcher.ReceiptHeaderHistoryId, x=>x.ReceiptHeaderHistoryId)
|
||||
.CheckContain(Searcher.ZoneCode, x=>x.ZoneCode)
|
||||
.CheckContain(Searcher.UniqueCode, x=>x.UniqueCode)
|
||||
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
|
||||
.CheckContain(Searcher.MaterialType, x=>x.MaterialType)
|
||||
.CheckContain(Searcher.MaterialName, x=>x.MaterialName)
|
||||
.CheckContain(Searcher.MaterialSpec, x=>x.MaterialSpec)
|
||||
.CheckContain(Searcher.Batch, x=>x.Batch)
|
||||
.CheckContain(Searcher.Lot, x=>x.Lot)
|
||||
.CheckContain(Searcher.CompanyCode, x=>x.CompanyCode)
|
||||
.CheckContain(Searcher.SupplierCode, x=>x.SupplierCode)
|
||||
.CheckContain(Searcher.InventoryStatus, x=>x.InventoryStatus)
|
||||
.CheckEqual(Searcher.Status, x=>x.Status)
|
||||
.Select(x => new ReceiptDetailHistory_View
|
||||
@@ -73,6 +107,7 @@ namespace HHWMS.Web
|
||||
ID = x.ID,
|
||||
Code_view = x.ReceiptHeaderHistory.Code,
|
||||
ZoneCode = x.ZoneCode,
|
||||
UniqueCode = x.UniqueCode,
|
||||
MaterialCode = x.MaterialCode,
|
||||
MaterialType = x.MaterialType,
|
||||
MaterialName = x.MaterialName,
|
||||
|
||||
+14
-4
@@ -17,24 +17,34 @@ namespace HHWMS.Web
|
||||
public int? ReceiptHeaderHistoryId { get; set; }
|
||||
[Display(Name = "Task.ZoneCode")]
|
||||
public String ZoneCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
public String UniqueCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.MaterialCode")]
|
||||
public String MaterialCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.MaterialType")]
|
||||
public String MaterialType { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.MaterialName")]
|
||||
public String MaterialName { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.MaterialSpec")]
|
||||
public String MaterialSpec { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.MaterialUnit")]
|
||||
public String MaterialUnit { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.Batch")]
|
||||
public String Batch { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.Lot")]
|
||||
public String Lot { get; set; }
|
||||
[Display(Name = "Inventory.CompanyCode")]
|
||||
public String CompanyCode { get; set; }
|
||||
[Display(Name = "Inventory.SupplierCode")]
|
||||
public String SupplierCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.Status")]
|
||||
public String InventoryStatus { get; set; }
|
||||
|
||||
[Display(Name = "Receipt.Status")]
|
||||
public ReceiptStatusEnum? Status { get; set; }
|
||||
|
||||
|
||||
@@ -29,17 +29,18 @@ namespace HHWMS.Web
|
||||
{
|
||||
return new List<GridColumn<ReceiptDetail_View>>{
|
||||
this.MakeGridHeader(x => x.Code_view),
|
||||
this.MakeGridHeader(x => x.ZoneCode),
|
||||
this.MakeGridHeader(x => x.ZoneCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.UniqueCode).SetWidth(230),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialSpec),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.Lot),
|
||||
this.MakeGridHeader(x => x.ManufactureDate),
|
||||
this.MakeGridHeader(x => x.ExpirationDate),
|
||||
this.MakeGridHeader(x => x.CompanyCode),
|
||||
this.MakeGridHeader(x => x.Lot).SetHide(),
|
||||
this.MakeGridHeader(x => x.ManufactureDate).SetHide(),
|
||||
this.MakeGridHeader(x => x.ExpirationDate).SetHide(),
|
||||
this.MakeGridHeader(x => x.CompanyCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.SupplierCode),
|
||||
this.MakeGridHeader(x => x.CompletedQty),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
|
||||
+6
-6
@@ -32,15 +32,15 @@ namespace HHWMS.Web
|
||||
protected override IEnumerable<IGridColumn<ReceiptHeaderHistory_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<ReceiptHeaderHistory_View>>{
|
||||
this.MakeGridHeader(x => x.SourceCode),
|
||||
this.MakeGridHeader(x => x.SourceCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.Code),
|
||||
this.MakeGridHeader(x => x.BillType),
|
||||
this.MakeGridHeader(x => x.CompanyCode),
|
||||
this.MakeGridHeader(x => x.SupplierCode),
|
||||
this.MakeGridHeader(x => x.TotalQty),
|
||||
this.MakeGridHeader(x => x.TotalLines),
|
||||
this.MakeGridHeader(x => x.CompanyCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.SupplierCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.TotalQty).SetHide(),
|
||||
this.MakeGridHeader(x => x.TotalLines).SetHide(),
|
||||
this.MakeGridHeader(x => x.FirstStatus),
|
||||
this.MakeGridHeader(x => x.LastStatus),
|
||||
this.MakeGridHeader(x => x.LastStatus).SetHide(),
|
||||
this.MakeGridHeader(x => x.AppointmentTime),
|
||||
this.MakeGridHeader(x => x.Remark),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
|
||||
+4
-2
@@ -12,17 +12,19 @@ namespace HHWMS.Web
|
||||
{
|
||||
public partial class ReceiptHeaderHistoryVM : BaseCRUDVM<ReceiptHeaderHistory>
|
||||
{
|
||||
|
||||
public ReceiptDetailHistoryListVM Details { get; set; } = new ReceiptDetailHistoryListVM();
|
||||
public ReceiptHeaderHistoryVM()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
Details.CopyContext(this);
|
||||
Details.Searcher.ReceiptHeaderHistoryId = Entity.ID;
|
||||
}
|
||||
|
||||
public override void DoAdd()
|
||||
{
|
||||
{
|
||||
base.DoAdd();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace HHWMS.Web
|
||||
{
|
||||
InitVM();
|
||||
return new List<GridColumn<ReceiptHeader_View>>{
|
||||
//this.MakeGridHeader(x => x.SourceCode),
|
||||
this.MakeGridHeader(x => x.ID).SetHide(),
|
||||
this.MakeGridHeader(x => x.Code).SetFormat((a,b) =>
|
||||
{
|
||||
string rv = UIService.MakeScriptButton(ButtonTypesEnum.Link,a.Code,$"details('{a.ID}')");
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:combobox field="Searcher.ReceiptHeaderId" items="Searcher.AllReceiptHeaders" empty-text="@Localizer["Sys.All"]" />
|
||||
<wt:textbox field="Searcher.ZoneCode" />
|
||||
<wt:textbox field="Searcher.UniqueCode" />
|
||||
<wt:textbox field="Searcher.MaterialCode" />
|
||||
<wt:textbox field="Searcher.MaterialType" />
|
||||
<wt:textbox field="Searcher.MaterialName" />
|
||||
<wt:textbox field="Searcher.MaterialSpec" />
|
||||
<wt:textbox field="Searcher.MaterialUnit" />
|
||||
<wt:textbox field="Searcher.Batch" />
|
||||
<wt:textbox field="Searcher.Lot" />
|
||||
<wt:textbox field="Searcher.InventoryStatus" />
|
||||
<wt:combobox field="Searcher.Status" empty-text="@Localizer["Sys.All"]" />
|
||||
</wt:row>
|
||||
|
||||
@@ -4,15 +4,13 @@
|
||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:combobox field="Searcher.ReceiptHeaderHistoryId" items="Searcher.AllReceiptHeaderHistorys" empty-text="@Localizer["Sys.All"]" />
|
||||
<wt:textbox field="Searcher.ZoneCode" />
|
||||
<wt:textbox field="Searcher.UniqueCode" />
|
||||
<wt:textbox field="Searcher.MaterialCode" />
|
||||
<wt:textbox field="Searcher.MaterialType" />
|
||||
<wt:textbox field="Searcher.MaterialName" />
|
||||
<wt:textbox field="Searcher.MaterialSpec" />
|
||||
<wt:textbox field="Searcher.MaterialUnit" />
|
||||
<wt:textbox field="Searcher.Batch" />
|
||||
<wt:textbox field="Searcher.Lot" />
|
||||
<wt:textbox field="Searcher.CompanyCode" />
|
||||
<wt:textbox field="Searcher.SupplierCode" />
|
||||
<wt:textbox field="Searcher.InventoryStatus" />
|
||||
<wt:combobox field="Searcher.Status" empty-text="@Localizer["Sys.All"]" />
|
||||
</wt:row>
|
||||
|
||||
@@ -3,13 +3,23 @@
|
||||
<el-row id="count" :gutter="20">
|
||||
<el-col :span="14">
|
||||
<el-card class="box-card">
|
||||
<el-table :data="tableData" height="450" border
|
||||
<el-table :data="tableData" height="450"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column type="index"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column>
|
||||
<el-table-column label="编码" align="center" prop="MaterialCode"></el-table-column>
|
||||
<el-table-column label="规格型号" align="center" prop="MaterialSpec"></el-table-column>
|
||||
<el-table-column label="批次" align="center" prop="Batch"></el-table-column>
|
||||
<el-table-column label="数量" align="center" prop="Qty"></el-table-column>
|
||||
<el-table-column label="数量" align="center" prop="Qty">
|
||||
<template scope="scope">
|
||||
<span v-if="scope.row.Lot == '1'" style="color:#37B328">{{ scope.row.Qty }}</span>
|
||||
<span v-else>{{ scope.row.Qty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="Lot" align="center" prop="Lot" v-if="false"></el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
@@ -29,7 +39,7 @@
|
||||
<el-input v-model="form.batch" placeholder="批次" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="qty">
|
||||
<el-input v-model.number="form.qty" ref="qty" :placeholder="qtyPlaceholder"></el-input>
|
||||
<el-input v-model.number="form.qty" ref="qty" :placeholder="qtyPlaceholder" @@change="count"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item style="float:right">
|
||||
<el-button type="primary" @@click="onSubmit">确定</el-button>
|
||||
@@ -41,7 +51,7 @@
|
||||
<script>
|
||||
var str = "";
|
||||
@{
|
||||
<text>str = @Model.Entity.ID; </text>
|
||||
<text>str = @Model.Entity.ID; </text>
|
||||
}
|
||||
|
||||
var app = new Vue({
|
||||
@@ -70,7 +80,7 @@ var app = new Vue({
|
||||
app.tableData = json.Data;
|
||||
},
|
||||
error: function (json) {
|
||||
console.log("加载失败");
|
||||
alyer.alert("加载失败");
|
||||
}
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
@@ -78,12 +88,19 @@ var app = new Vue({
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
count() {
|
||||
this.onSubmit();
|
||||
},
|
||||
// 绑定
|
||||
onSubmit() {
|
||||
var _this = this;
|
||||
var qty = _this.form.qty;
|
||||
if (qty == "")
|
||||
qty = parseInt(_this.qtyPlaceholder);
|
||||
|
||||
// 正则表达式 校验qty为正整数
|
||||
if (!/^[1-9]\d*$/.test(qty)) {
|
||||
layer.alert("数量必须为正整数");
|
||||
return;
|
||||
}
|
||||
// 提交已绑定数据
|
||||
$.ajax({
|
||||
type: "post",
|
||||
@@ -92,38 +109,29 @@ var app = new Vue({
|
||||
url: "/receipt/ReceiptHeader/CountCommit",
|
||||
success: function (json) {
|
||||
if (json.Code == 200) {
|
||||
_this.$message({
|
||||
message: "点数成功!",
|
||||
});
|
||||
layer.msg("点数成功!")
|
||||
var isExit = _this.tableData.findIndex(function (value) {
|
||||
return value.UniqueCode == _this.form.uniqueCode;
|
||||
});
|
||||
_this.tableData[isExit].Qty = qty;
|
||||
_this.tableData[isExit].Lot = "1";
|
||||
_this.$refs['form'].resetFields();
|
||||
_this.qtyPlaceholder = "数量";
|
||||
_this.$refs.uniqueCode.focus();
|
||||
} else {
|
||||
_this.$message({
|
||||
message: "失败!",
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
layer.alert("失败!" + json.Msg);
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
_this.$message({
|
||||
message: "失败!",
|
||||
type: "error",
|
||||
duration: "10000",
|
||||
});
|
||||
layer.alert("失败!");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
// 扫描唯一码
|
||||
scanUniqueCode(data) {
|
||||
var _this = this;
|
||||
|
||||
|
||||
//1. 判断唯一码是否合理,调用后台,并返回唯一码对应的数量
|
||||
var isExit = this.tableData.findIndex(function (value) {
|
||||
return value.UniqueCode == data;
|
||||
@@ -137,10 +145,7 @@ var app = new Vue({
|
||||
_this.$refs.qty.focus();
|
||||
}
|
||||
else {
|
||||
this.$message({
|
||||
message: '唯一码' + data + '在此入库单据中不存在!',
|
||||
type: 'warning'
|
||||
});
|
||||
layer.alert( '唯一码' + data + '在此入库单据中不存在!')
|
||||
this.$refs['form'].resetFields();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
@* <wt:textbox field="Entity.SourceCode" /> *@
|
||||
<wt:textbox field="Entity.Code" />
|
||||
<wt:textbox field="Entity.Code" readonly/>
|
||||
<wt:combobox field="Entity.BillType" items="ReceiptTypes"/>
|
||||
@* <wt:textbox field="Entity.CompanyCode" />
|
||||
<wt:textbox field="Entity.SupplierCode" />
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<wt:display field="Entity.AppointmentTime" />
|
||||
@* <wt:display field="Entity.Remark" /> *@
|
||||
</wt:row>
|
||||
<wt:grid vm="@Model.Details" height="300" hidden-checkbox="true" hidden-grid-index="true" use-local-data="true" hidden-panel="true" />
|
||||
<wt:grid vm="@Model.Details" height="300" hidden-checkbox="true" use-local-data="true" hidden-panel="true" />
|
||||
|
||||
<wt:row align="AlignEnum.Right">
|
||||
<wt:closebutton />
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
@model HHWMS.Web.ReceiptHeaderVM
|
||||
@model HHWMS.Web.ReceiptHeaderVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:textbox field="Entity.SourceCode" />
|
||||
<wt:textbox field="Entity.Code" />
|
||||
<wt:textbox field="Entity.BillType" />
|
||||
<wt:textbox field="Entity.Code" readonly/>
|
||||
<wt:textbox field="Entity.BillType" readonly/>
|
||||
<wt:textbox field="Entity.CompanyCode" />
|
||||
<wt:textbox field="Entity.SupplierCode" />
|
||||
<wt:textbox field="Entity.TotalQty" />
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
@model HHWMS.Web.ReceiptHeaderHistoryVM
|
||||
@model HHWMS.Web.ReceiptHeaderHistoryVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:display field="Entity.SourceCode" />
|
||||
<wt:display field="Entity.Code" />
|
||||
<wt:display field="Entity.BillType" />
|
||||
<wt:display field="Entity.CompanyCode" />
|
||||
<wt:display field="Entity.SupplierCode" />
|
||||
<wt:display field="Entity.TotalQty" />
|
||||
<wt:display field="Entity.TotalLines" />
|
||||
<wt:display field="Entity.FirstStatus" />
|
||||
<wt:display field="Entity.LastStatus" />
|
||||
<wt:display field="Entity.AppointmentTime" />
|
||||
<wt:display field="Entity.Remark" />
|
||||
</wt:row>
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:display field="Entity.Code" />
|
||||
<wt:display field="Entity.BillType" />
|
||||
<wt:display field="Entity.FirstStatus" />
|
||||
<wt:display field="Entity.AppointmentTime" />
|
||||
<wt:display field="Entity.Remark" />
|
||||
</wt:row>
|
||||
<wt:grid vm="@Model.Details" height="300" hidden-checkbox="true" use-local-data="true" hidden-panel="true" />
|
||||
|
||||
<wt:row align="AlignEnum.Right">
|
||||
<wt:closebutton />
|
||||
</wt:row>
|
||||
|
||||
@@ -40,8 +40,13 @@
|
||||
<el-form-item label="唯一码" prop="uniqueCode">
|
||||
<el-input v-model="form.uniqueCode" @@change="scanUniqueCode" ref="uniqueCode"></el-input>
|
||||
</el-form-item>
|
||||
<el-table :data="bindingData" height="450" border
|
||||
<el-table :data="bindingData"
|
||||
ref="tableData"
|
||||
height="450" border
|
||||
style="width: 100%">
|
||||
<el-table-column type="index"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column fixed="left"
|
||||
label="操作"
|
||||
width="120"
|
||||
@@ -61,7 +66,7 @@
|
||||
<el-table-column label="料盘尺寸" align="center" prop="size" :formatter="sizeFormatter"></el-table-column>
|
||||
</el-table>
|
||||
<el-form-item style="float:right">
|
||||
<el-button type="primary" @@click="onSubmit">绑定入库</el-button>
|
||||
<el-button type="primary" @@click="onSubmit" :disabled="disabledButton">绑定入库</el-button>
|
||||
<el-button @@click="resetForm('form')">重置</el-button>
|
||||
@* <el-button type="primary" @@click="inOperation">启动入库</el-button> *@
|
||||
</el-form-item>
|
||||
@@ -102,7 +107,8 @@
|
||||
boxCode: [
|
||||
{ validator: validatePass, trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
},
|
||||
disabledButton : false
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -127,7 +133,16 @@
|
||||
//绑定单据
|
||||
onSubmit() {
|
||||
var _this = this;
|
||||
|
||||
if (_this.bindingData.length == 0){
|
||||
_this.$message({
|
||||
message: "待入库清单为空!",
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var loadIndex = layer.load(1);
|
||||
_this.disabledButton = true;
|
||||
// 提交已绑定数据
|
||||
$.ajax({
|
||||
type: "post",
|
||||
@@ -135,6 +150,8 @@
|
||||
data: { data: _this.bindingData },
|
||||
url: "/receipt/ReceiptIn/BindingData",
|
||||
success: function (json) {
|
||||
layer.close(loadIndex);
|
||||
_this.disabledButton = false;
|
||||
if (json.Code == 200) {
|
||||
_this.$message({
|
||||
message: '入库成功!',
|
||||
@@ -144,12 +161,14 @@
|
||||
}
|
||||
else {
|
||||
_this.$message({
|
||||
message: '入库失败!',
|
||||
message: '入库失败!'+json.Msg,
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
layer.close(loadIndex);
|
||||
_this.disabledButton = false;
|
||||
_this.$message({
|
||||
message: '入库失败!',
|
||||
type: 'error'
|
||||
@@ -261,11 +280,11 @@
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
// 重新扫描箱号后,待绑定列表清空
|
||||
_this.bindingData = [];
|
||||
_this.changeselect(_this.value);
|
||||
|
||||
|
||||
// _this.$refs.uniqueCode.focus();
|
||||
},
|
||||
// 选择尺寸后
|
||||
@@ -318,11 +337,14 @@
|
||||
this.bindingData.push({
|
||||
receiptCode: this.form.code,
|
||||
boxCode: this.form.boxCode,
|
||||
index: this.dataIndex.shift(),
|
||||
index: this.dataIndex.sort(function(a,b){return a-b}).shift(),
|
||||
uniqueCode: data,
|
||||
size: this.form.size
|
||||
})
|
||||
this.form.uniqueCode = '';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.tableData.bodyWrapper.scrollTop = this.$refs.tableData.bodyWrapper.scrollHeight
|
||||
})
|
||||
},
|
||||
// 删除已绑定行
|
||||
deleteRow(index, rows) {
|
||||
|
||||
@@ -42,7 +42,12 @@
|
||||
<el-switch v-model="form.isFull"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-table :data="bindingData" stripe max-height="450" border style="width: 100%">
|
||||
<el-table :data="bindingData"
|
||||
ref="tableData"
|
||||
stripe max-height="450" border style="width: 100%">
|
||||
<el-table-column type="index"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column fixed="left" label="操作" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button @@click.native.prevent="deleteRow(scope.$index, bindingData)"
|
||||
@@ -78,9 +83,9 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-form-item style="float: right">
|
||||
<el-button type="primary" @@click="onSubmit">绑定</el-button>
|
||||
<el-button type="primary" @@click="onSubmit" :disabled="disabledButton">绑定</el-button>
|
||||
<el-button @@click="resetForm('form')">重置</el-button>
|
||||
<el-button type="success" @@click="back">回库</el-button>
|
||||
<el-button type="success" @@click="back" :disabled="disabledbackbutton">回库</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -93,10 +98,12 @@
|
||||
return {
|
||||
form: {
|
||||
code: "",
|
||||
size: "",
|
||||
size: "1",
|
||||
uniqueCode: "",
|
||||
isFull: false
|
||||
},
|
||||
disabledButton : false,
|
||||
disabledbackbutton: true,// true不可回库,false可回库
|
||||
boxSize: [
|
||||
{ label: "8mm", value: "8" },
|
||||
{ label: "10mm", value: "10" },
|
||||
@@ -170,6 +177,7 @@
|
||||
// 扫描散料箱
|
||||
scanBox(data) {
|
||||
var _this = this;
|
||||
_this.bindingData = [];
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
@@ -184,7 +192,20 @@
|
||||
});
|
||||
}
|
||||
else {
|
||||
json.Data.forEach(function (item) {
|
||||
_this.bindingData.push({
|
||||
"receiptCode":item.ReceiptCode,
|
||||
"boxCode": item.ContainerCode,
|
||||
"uniqueCode": item.UniqueCode,
|
||||
"qty": item.Qty,
|
||||
"bindQty": item.Qty,
|
||||
"size": item.Flag,
|
||||
"band":1
|
||||
})
|
||||
});
|
||||
|
||||
_this.$refs.uniqueCode.focus();
|
||||
_this.disabledbackbutton = false;
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
@@ -203,7 +224,16 @@
|
||||
// 绑定
|
||||
onSubmit() {
|
||||
var _this = this;
|
||||
|
||||
if (_this.bindingData.length == 0){
|
||||
_this.$message({
|
||||
message: "待入库清单为空!",
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var loadIndex = layer.load(1);
|
||||
_this.disabledButton = true;
|
||||
// 提交已绑定数据
|
||||
$.ajax({
|
||||
type: "post",
|
||||
@@ -211,20 +241,28 @@
|
||||
data: { data: _this.bindingData },
|
||||
url: "/receipt/ReceiptSLIn/BindingData",
|
||||
success: function (json) {
|
||||
layer.close(loadIndex);
|
||||
_this.disabledButton = false;
|
||||
if (json.Code == 200) {
|
||||
_this.$message({
|
||||
message: "绑定成功!",
|
||||
});
|
||||
_this.bindingData = [];
|
||||
// _this.bindingData = [];
|
||||
_this.bindingData.forEach(function (item) {
|
||||
item.band = 1;
|
||||
})
|
||||
_this.disabledbackbutton = false;
|
||||
} else {
|
||||
_this.$message({
|
||||
message: "绑定失败!",
|
||||
message: "绑定失败!"+ json.Msg,
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
layer.close(loadIndex);
|
||||
_this.disabledButton = false;
|
||||
_this.$message({
|
||||
message: "绑定失败!",
|
||||
type: "error",
|
||||
@@ -289,6 +327,10 @@
|
||||
bindQty: json.Data.Qty - json.Data.CompletedQty,
|
||||
size: _this.form.size,
|
||||
});
|
||||
_this.disabledbackbutton = true;
|
||||
_this.$nextTick(() => {
|
||||
_this.$refs.tableData.bodyWrapper.scrollTop = _this.$refs.tableData.bodyWrapper.scrollHeight
|
||||
})
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
@@ -304,10 +346,20 @@
|
||||
},
|
||||
// 删除已绑定行
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1);
|
||||
if (rows[index].band == 1) {
|
||||
this.$message({
|
||||
message: "已绑定物料不能移除!",
|
||||
type: "warning",
|
||||
duration: "1000",
|
||||
});
|
||||
return;
|
||||
}
|
||||
else {
|
||||
rows.splice(index, 1);
|
||||
}
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
console.log(index, row, this.bindingData);
|
||||
// console.log(index, row, this.bindingData);
|
||||
if (row.qty < row.bindQty) {
|
||||
this.$message({
|
||||
message: "数量不能大于剩余绑定数量!" + row.qty,
|
||||
@@ -354,6 +406,7 @@
|
||||
message: "回库任务创建成功!"
|
||||
});
|
||||
_this.resetForm('form');
|
||||
_this.disabledbackbutton = true;
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
|
||||
@@ -20,40 +20,45 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="bindingData" stripe max-height="450" border style="width: 100%">
|
||||
<el-table-column fixed="left" label="操作" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button @@click.native.prevent="deleteRow(scope.$index, bindingData)"
|
||||
type="text"
|
||||
size="small">
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="位置"
|
||||
align="center"
|
||||
prop="boxCode">
|
||||
</el-table-column>
|
||||
<el-table-column label="唯一码"
|
||||
align="center"
|
||||
prop="uniqueCode">
|
||||
</el-table-column>
|
||||
<el-table-column label="物料码"
|
||||
align="center"
|
||||
prop="materialCode">
|
||||
</el-table-column>
|
||||
<el-table-column label="名称"
|
||||
align="center"
|
||||
prop="materialName">
|
||||
</el-table-column>
|
||||
<el-table-column label="数量"
|
||||
align="center"
|
||||
prop="bindQty">
|
||||
</el-table-column>
|
||||
|
||||
<el-table :data="bindingData"
|
||||
ref="tableData"
|
||||
stripe max-height="450" border style="width: 100%">
|
||||
<el-table-column type="index"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column fixed="left" label="操作" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button @@click.native.prevent="deleteRow(scope.$index, bindingData)"
|
||||
type="text"
|
||||
size="small">
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="位置"
|
||||
align="center"
|
||||
prop="boxCode">
|
||||
</el-table-column>
|
||||
<el-table-column label="唯一码"
|
||||
align="center"
|
||||
prop="uniqueCode">
|
||||
</el-table-column>
|
||||
<el-table-column label="物料码"
|
||||
align="center"
|
||||
prop="materialCode">
|
||||
</el-table-column>
|
||||
<el-table-column label="名称"
|
||||
align="center"
|
||||
prop="materialName">
|
||||
</el-table-column>
|
||||
<el-table-column label="数量"
|
||||
align="center"
|
||||
prop="bindQty">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-form-item style="float: right">
|
||||
<el-button type="primary" @@click="onSubmit">入库</el-button>
|
||||
<el-button type="primary" @@click="onSubmit" :disabled="disabledButton">入库</el-button>
|
||||
<el-button @@click="resetForm('form')">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -69,7 +74,8 @@
|
||||
uniqueCode: "",
|
||||
locationCode: ""
|
||||
},
|
||||
bindingData: []
|
||||
bindingData: [],
|
||||
disabledButton : false
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -88,11 +94,20 @@
|
||||
// });
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
// 绑定
|
||||
onSubmit() {
|
||||
var _this = this;
|
||||
|
||||
if (_this.bindingData.length == 0){
|
||||
_this.$message({
|
||||
message: "待入库清单为空!",
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var loadIndex = layer.load(1);
|
||||
_this.disabledButton = true;
|
||||
// 提交已绑定数据
|
||||
$.ajax({
|
||||
type: "post",
|
||||
@@ -100,6 +115,8 @@
|
||||
data: { data: _this.bindingData },
|
||||
url: "/receipt/ReceiptShelfIn/BindingData",
|
||||
success: function (json) {
|
||||
layer.close(loadIndex);
|
||||
_this.disabledButton = false;
|
||||
if (json.Code == 200) {
|
||||
_this.$message({
|
||||
message: "入库成功!",
|
||||
@@ -107,13 +124,15 @@
|
||||
_this.bindingData = [];
|
||||
} else {
|
||||
_this.$message({
|
||||
message: "入库失败!",
|
||||
message: "入库失败!"+json.Msg,
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
layer.close(loadIndex);
|
||||
_this.disabledButton = false;
|
||||
_this.$message({
|
||||
message: "入库失败!",
|
||||
type: "error",
|
||||
@@ -130,7 +149,14 @@
|
||||
// 扫描唯一码
|
||||
scanUniqueCode(data) {
|
||||
var _this = this;
|
||||
|
||||
if (_this.form.locationCode == ""){
|
||||
_this.$message({
|
||||
message: "位置不能为空!",
|
||||
type: "warning",
|
||||
duration: "1000",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
//1. 判断唯一码是否合理,调用后台,并返回唯一码对应的数量
|
||||
var isExit = this.bindingData.findIndex(function (value) {
|
||||
return value.uniqueCode == data;
|
||||
@@ -155,9 +181,11 @@
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
_this.form.uniqueCode = '';
|
||||
} else {
|
||||
// 3.已扫描增加
|
||||
_this.bindingData.push({
|
||||
id:json.Data.ID,
|
||||
receiptCode: json.Data.ReceiptHeaderId,
|
||||
uniqueCode: json.Data.UniqueCode,
|
||||
materialCode: json.Data.MaterialCode,
|
||||
@@ -166,6 +194,9 @@
|
||||
bindQty: json.Data.Qty,
|
||||
boxCode: _this.form.locationCode
|
||||
});
|
||||
_this.$nextTick(() => {
|
||||
_this.$refs.tableData.bodyWrapper.scrollTop = _this.$refs.tableData.bodyWrapper.scrollHeight
|
||||
})
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
@@ -183,7 +214,7 @@
|
||||
deleteRow(index, rows) {
|
||||
rows.splice(index, 1);
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
});
|
||||
</script>
|
||||
@@ -54,7 +54,8 @@ public class ShipOutController : BaseController
|
||||
// 判断箱号是否合理
|
||||
if (box != null)
|
||||
{
|
||||
var inv = _unitWork.Find<Inventory>(x => x.LocationCode.Equals(code));
|
||||
var inv = _unitWork.Find<Inventory>(x => x.LocationCode.Equals(code)
|
||||
&& x.TaskStatus == InventoryTaskStatus.任务中);
|
||||
return JsonMore(inv);
|
||||
|
||||
}
|
||||
@@ -88,38 +89,33 @@ public class ShipOutController : BaseController
|
||||
[HttpPost]
|
||||
public ActionResult Pick(string uniqueCode, decimal qty,string station)
|
||||
{
|
||||
var shipment = _unitWork.Find<ShipmentDetail>(x => x.UniqueCode.Equals(uniqueCode))
|
||||
.Include(x => x.ShipmentHeader)
|
||||
.FirstOrDefault();
|
||||
|
||||
using (var tran = Wtm.DC.Database.BeginTransaction())
|
||||
{
|
||||
try
|
||||
{
|
||||
var shipment = _unitWork.Find<ShipmentDetail>(x => x.UniqueCode.Equals(uniqueCode)
|
||||
&& x.Status != ShipStatusEnum.拣货完成)
|
||||
.FirstOrDefault();
|
||||
if (shipment == null)
|
||||
{
|
||||
return JsonMore(null, 500, "未找到该出库单!");
|
||||
}
|
||||
|
||||
shipment.Status = ShipStatusEnum.拣货完成;
|
||||
shipment.UpdateTime = DateTime.Now;
|
||||
shipment.UpdateBy = Wtm.LoginUserInfo.ITCode;
|
||||
|
||||
|
||||
if (!shipment.ShipmentHeader.ShipmentDetails.Any(x => x.Status < ShipStatusEnum.拣货完成))
|
||||
{
|
||||
shipment.ShipmentHeader.FirstStatus = ShipStatusEnum.拣货完成;
|
||||
}
|
||||
else
|
||||
{
|
||||
shipment.ShipmentHeader.FirstStatus = ShipStatusEnum.拣货中;
|
||||
}
|
||||
shipment.UpdateBy = Wtm.LoginUserInfo.ITCode;
|
||||
shipment.UpdateTime = DateTime.Now;
|
||||
shipment.UpdateBy = Wtm.LoginUserInfo?.ITCode??"WMS";
|
||||
_unitWork.Update(shipment);
|
||||
|
||||
var inv = _unitWork.FindSingle<Inventory>(x => x.UniqueCode.Equals(uniqueCode) && x.LocationCode == station);
|
||||
if (inv == null && string.IsNullOrEmpty(station))
|
||||
{
|
||||
inv = _unitWork.FindSingle<Inventory>(x => x.UniqueCode.Equals(uniqueCode) && x.ZoneCode == ZoneCodeEnum.货架库);
|
||||
}
|
||||
if (inv != null)
|
||||
{
|
||||
//回传MES
|
||||
/*
|
||||
var qr = _unitWork.FindSingle<MaterialQr>(x => x.UniqueCode.Equals(inv.UniqueCode))?.QRCode;
|
||||
|
||||
var bizData = new InStore
|
||||
@@ -154,8 +150,9 @@ public class ShipOutController : BaseController
|
||||
};
|
||||
var client = new ServiceReference1.portTypeClient();
|
||||
var result = client.bizOperationV1Async(request).Result;
|
||||
//var result = new bizOperationV1Response();
|
||||
//result.Status = "Y";
|
||||
*/
|
||||
var result = new bizOperationV1Response();
|
||||
result.Status = "Y";
|
||||
if (result.Status == "Y")
|
||||
{
|
||||
// 删除库存,扣账,记录库存交易 todo,根据站台查询是否还有未拣货的物料,如果没有就清空站台占用
|
||||
@@ -175,6 +172,9 @@ public class ShipOutController : BaseController
|
||||
CompanyCode = inv.CompanyCode,
|
||||
LocationCode = inv.LocationCode,
|
||||
SupplierCode = inv.SupplierCode,
|
||||
BillCode = shipment.ShipmentHeaderId.ToString(),
|
||||
BillDetailId = shipment.ID,
|
||||
ContainerCode = inv.ContainerCode,
|
||||
Qty = inv.Qty,
|
||||
CreateTime = DateTime.Now
|
||||
};
|
||||
@@ -203,15 +203,32 @@ public class ShipOutController : BaseController
|
||||
_unitWork.Update(Sation);
|
||||
}
|
||||
}
|
||||
|
||||
Wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: JsonConvert.SerializeObject(request), result: "success");
|
||||
|
||||
// 更新单据状态
|
||||
var header = _unitWork.Find<ShipmentHeader>(x => x.ID.Equals(shipment.ShipmentHeaderId))
|
||||
.FirstOrDefault();
|
||||
var details = _unitWork.Find<ShipmentDetail>(x => x.ShipmentHeaderId == shipment.ShipmentHeaderId)
|
||||
.ToList();
|
||||
if (details.All(x => x.Status == ShipStatusEnum.拣货完成))
|
||||
{
|
||||
header.FirstStatus = ShipStatusEnum.拣货完成;
|
||||
}
|
||||
else
|
||||
{
|
||||
header.FirstStatus = ShipStatusEnum.拣货中;
|
||||
}
|
||||
header.UpdateTime = DateTime.Now;
|
||||
header.UpdateBy = Wtm.LoginUserInfo?.ITCode??"WMS";
|
||||
_unitWork.Update(header);
|
||||
|
||||
// Wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: JsonConvert.SerializeObject(request), result: "success");
|
||||
tran.Commit();
|
||||
return JsonMore(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
tran.Rollback();
|
||||
Wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: JsonConvert.SerializeObject(request), result: "error");
|
||||
// Wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: JsonConvert.SerializeObject(request), result: "error");
|
||||
return JsonMore(null, 500, $"回传MES失败,失败原因{result.Message}");
|
||||
}
|
||||
}
|
||||
@@ -253,7 +270,8 @@ public class ShipOutController : BaseController
|
||||
return JsonMore(null, 500, $"{boxCode}站台没有料箱,无法入库!");
|
||||
}
|
||||
//判断是否拣货完成
|
||||
if (_unitWork.IsExit<Inventory>(x => x.LocationCode.Equals(station.Code)))
|
||||
if (_unitWork.IsExit<Inventory>(x => x.LocationCode.Equals(station.Code)
|
||||
&& x.TaskStatus == InventoryTaskStatus.任务中))
|
||||
{
|
||||
return JsonMore(null, 500, $"站台{boxCode}存在未拣货物料,无法回库!");
|
||||
}
|
||||
|
||||
@@ -258,7 +258,9 @@ namespace HHWMS.Web.Controllers
|
||||
var details = data.FirstOrDefault().ShipmentDetails.Where(x => x.Status < ShipStatusEnum.分配完成);
|
||||
foreach (var item in details)
|
||||
{
|
||||
var invQty = _unitwork.Find<Inventory>(x => x.UniqueCode.Equals(item.UniqueCode));
|
||||
var invQty = _unitwork.FindSingle<Inventory>(x =>
|
||||
x.UniqueCode.Equals(item.UniqueCode)
|
||||
&& x.TaskStatus == InventoryTaskStatus.无任务);
|
||||
item.InventoryStatus = invQty != null ? "满足" : "不足";
|
||||
}
|
||||
return JsonMore(details);
|
||||
@@ -289,6 +291,7 @@ namespace HHWMS.Web.Controllers
|
||||
var invList = _unitwork.Find<Inventory>(x => x.ZoneCode.Equals(ZoneCodeEnum.货架库)
|
||||
&& x.TaskStatus.Equals(InventoryTaskStatus.无任务)
|
||||
&& details.Contains(x.UniqueCode))
|
||||
.OrderBy(x => x.LocationCode)
|
||||
.ToList();
|
||||
//var details = data.ShipmentDetails.Where(x => invList.Contains(x.UniqueCode));
|
||||
return JsonMore(invList);
|
||||
@@ -323,7 +326,7 @@ namespace HHWMS.Web.Controllers
|
||||
_unitwork.Update(shipment);
|
||||
|
||||
var ids = data.Select(x => x.ID).ToList();
|
||||
if(ids.Count > 0) {
|
||||
if(ids.Count > 0) {
|
||||
var invList = _unitwork.Find<Inventory>(x => ids.Contains(x.ID))
|
||||
.ToList();
|
||||
|
||||
|
||||
@@ -133,6 +133,7 @@ namespace HHWMS.Web.Controllers
|
||||
public ActionResult Details(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ShipmentHeaderHistoryVM>(id);
|
||||
vm.Details.SearcherMode = ListVMSearchModeEnum.MasterDetail;
|
||||
return PartialView(vm);
|
||||
}
|
||||
#endregion
|
||||
|
||||
+64
-32
@@ -15,50 +15,81 @@ namespace HHWMS.Web
|
||||
{
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
if (SearcherMode == ListVMSearchModeEnum.MasterDetail)
|
||||
{
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "shipment"),
|
||||
};
|
||||
return new List<GridAction>();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.Create,
|
||||
Localizer["Sys.Create"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.Edit,
|
||||
Localizer["Sys.Edit"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.Delete,
|
||||
Localizer["Sys.Delete"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.Details,
|
||||
Localizer["Sys.Details"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.BatchEdit,
|
||||
Localizer["Sys.BatchEdit"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.BatchDelete,
|
||||
Localizer["Sys.BatchDelete"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.Import,
|
||||
Localizer["Sys.Import"], "shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetailHistory", GridActionStandardTypesEnum.ExportExcel,
|
||||
Localizer["Sys.Export"], "shipment"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override IEnumerable<IGridColumn<ShipmentDetailHistory_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<ShipmentDetailHistory_View>>{
|
||||
this.MakeGridHeader(x => x.Code_view),
|
||||
this.MakeGridHeader(x => x.ZoneCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialSpec),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.Lot),
|
||||
this.MakeGridHeader(x => x.ManufactureDate),
|
||||
this.MakeGridHeader(x => x.ExpirationDate),
|
||||
this.MakeGridHeader(x => x.CompanyCode),
|
||||
this.MakeGridHeader(x => x.SupplierCode),
|
||||
this.MakeGridHeader(x => x.CompletedQty),
|
||||
this.MakeGridHeader(x => x.DividedQty),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.InventoryStatus),
|
||||
this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
if (SearcherMode == ListVMSearchModeEnum.MasterDetail)
|
||||
{
|
||||
return new List<GridColumn<ShipmentDetailHistory_View>>{
|
||||
this.MakeGridHeader(x => x.UniqueCode).SetWidth(220),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.Status)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<GridColumn<ShipmentDetailHistory_View>>
|
||||
{
|
||||
this.MakeGridHeader(x => x.Code_view).SetWidth(150),
|
||||
this.MakeGridHeader(x => x.ZoneCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.UniqueCode).SetWidth(230),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialSpec),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.Lot).SetHide(),
|
||||
this.MakeGridHeader(x => x.ManufactureDate),
|
||||
this.MakeGridHeader(x => x.ExpirationDate).SetHide(),
|
||||
this.MakeGridHeader(x => x.CompanyCode),
|
||||
this.MakeGridHeader(x => x.SupplierCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.CompletedQty),
|
||||
this.MakeGridHeader(x => x.DividedQty),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.InventoryStatus),
|
||||
this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<ShipmentDetailHistory_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<ShipmentDetailHistory>()
|
||||
.CheckEqual(Searcher.ShipmentHeaderHistoryId, x=>x.ShipmentHeaderHistoryId)
|
||||
.CheckEqual(Searcher.ShipmentHeaderHistoryId, x=>x.ShipmentHeaderHistoryId)
|
||||
.CheckContain(Searcher.ZoneCode, x=>x.ZoneCode)
|
||||
.CheckContain(Searcher.UniqueCode, x=>x.UniqueCode)
|
||||
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
|
||||
.CheckContain(Searcher.MaterialType, x=>x.MaterialType)
|
||||
.CheckContain(Searcher.MaterialName, x=>x.MaterialName)
|
||||
@@ -73,6 +104,7 @@ namespace HHWMS.Web
|
||||
{
|
||||
ID = x.ID,
|
||||
Code_view = x.ShipmentHeaderHistory.Code,
|
||||
UniqueCode = x.UniqueCode,
|
||||
ZoneCode = x.ZoneCode,
|
||||
MaterialCode = x.MaterialCode,
|
||||
MaterialType = x.MaterialType,
|
||||
|
||||
+4
@@ -19,6 +19,10 @@ namespace HHWMS.Web
|
||||
public String ZoneCode { get; set; }
|
||||
[Display(Name = "Inventory.MaterialCode")]
|
||||
public String MaterialCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
public String UniqueCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.MaterialType")]
|
||||
public String MaterialType { get; set; }
|
||||
[Display(Name = "Inventory.MaterialName")]
|
||||
|
||||
@@ -60,19 +60,20 @@ namespace HHWMS.Web
|
||||
}
|
||||
else
|
||||
return new List<GridColumn<ShipmentDetail_View>>{
|
||||
this.MakeGridHeader(x => x.Code_view),
|
||||
this.MakeGridHeader(x => x.ZoneCode),
|
||||
this.MakeGridHeader(x => x.Code_view).SetWidth(150),
|
||||
this.MakeGridHeader(x => x.ZoneCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.UniqueCode).SetWidth(230),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialType),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialSpec),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.Lot),
|
||||
this.MakeGridHeader(x => x.Lot).SetHide(),
|
||||
this.MakeGridHeader(x => x.ManufactureDate),
|
||||
this.MakeGridHeader(x => x.ExpirationDate),
|
||||
this.MakeGridHeader(x => x.ExpirationDate).SetHide(),
|
||||
this.MakeGridHeader(x => x.CompanyCode),
|
||||
this.MakeGridHeader(x => x.SupplierCode),
|
||||
this.MakeGridHeader(x => x.SupplierCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.CompletedQty),
|
||||
this.MakeGridHeader(x => x.DividedQty),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
|
||||
+1
-7
@@ -32,17 +32,11 @@ namespace HHWMS.Web
|
||||
protected override IEnumerable<IGridColumn<ShipmentHeaderHistory_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<ShipmentHeaderHistory_View>>{
|
||||
this.MakeGridHeader(x => x.SourceCode),
|
||||
this.MakeGridHeader(x => x.Code),
|
||||
this.MakeGridHeader(x => x.BillType),
|
||||
this.MakeGridHeader(x => x.CompanyCode),
|
||||
this.MakeGridHeader(x => x.SupplierCode),
|
||||
this.MakeGridHeader(x => x.TotalQty),
|
||||
this.MakeGridHeader(x => x.TotalLines),
|
||||
this.MakeGridHeader(x => x.FirstStatus),
|
||||
this.MakeGridHeader(x => x.LastStatus),
|
||||
this.MakeGridHeader(x => x.Remark),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
this.MakeGridHeaderAction(width: 300)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+4
-2
@@ -12,17 +12,19 @@ namespace HHWMS.Web
|
||||
{
|
||||
public partial class ShipmentHeaderHistoryVM : BaseCRUDVM<ShipmentHeaderHistory>
|
||||
{
|
||||
|
||||
public ShipmentDetailHistoryListVM Details { get; set; } = new ShipmentDetailHistoryListVM();
|
||||
public ShipmentHeaderHistoryVM()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
Details.CopyContext(this);
|
||||
Details.Searcher.ShipmentHeaderHistoryId = Entity.ID;
|
||||
}
|
||||
|
||||
public override void DoAdd()
|
||||
{
|
||||
{
|
||||
base.DoAdd();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<el-card class="box-card" :span="16">
|
||||
<el-form ref="form" :model="form" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="form.type"
|
||||
placeholder="请选择类型"
|
||||
@@ -26,7 +26,8 @@
|
||||
</el-row>
|
||||
<el-row v-show="showTable">
|
||||
<el-divider></el-divider>
|
||||
<el-table :data="invTable" height="200" stripe border @@row-click="selectdata"
|
||||
<el-table :data="invTable" height="200" stripe border
|
||||
@@row-click="selectdata"
|
||||
style="width: 100%">
|
||||
<el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column>
|
||||
<el-table-column label="编码" align="center" prop="MaterialCode"></el-table-column>
|
||||
@@ -39,7 +40,7 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="唯一码" prop="uniqueCode">
|
||||
<el-input v-model="form.uniqueCode" ref="uniqueCode" readonly></el-input>
|
||||
<el-input v-model="form.uniqueCode" ref="uniqueCode" @@change="scanUnique"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -90,7 +91,7 @@
|
||||
taskType: [
|
||||
{ label: "散料站台", value: "slbox" },
|
||||
{ label: "料塔周转箱", value: "lt" },
|
||||
{ label: "唯一码", value: "uniqueCode" },
|
||||
{ label: "货架库", value: "pk" },
|
||||
],
|
||||
invTable:[],
|
||||
showTable: false,
|
||||
@@ -106,6 +107,48 @@
|
||||
this.form.batch = data.Batch;
|
||||
this.form.qty = data.Qty;
|
||||
},
|
||||
// 扫描二维码
|
||||
scanUnique(data) {
|
||||
if (this.form.type == "pk") {
|
||||
this.form.uniqueCode = data;
|
||||
this.onSubmit();
|
||||
}
|
||||
else{
|
||||
if (this.invTable.length == 0) {
|
||||
this.$message({
|
||||
message: "待拣物料列表为空!",
|
||||
type: "error",
|
||||
duration: "10000",
|
||||
});
|
||||
this.form.uniqueCode = "";
|
||||
return;
|
||||
}
|
||||
var _this = this;
|
||||
|
||||
var t = _this.invTable.findIndex(function (value, index, arr) {
|
||||
return value.UniqueCode == data;
|
||||
});
|
||||
|
||||
if (t == -1) {
|
||||
_this.$message({
|
||||
message: "扫描失败 " + data + " 不存在!",
|
||||
type: "error",
|
||||
duration: "10000",
|
||||
});
|
||||
_this.form.uniqueCode = "";
|
||||
} else {
|
||||
var value = _this.invTable[t];
|
||||
_this.form.uniqueCode = value.UniqueCode;
|
||||
_this.form.materialCode = value.MaterialCode;
|
||||
_this.form.materialSpec = value.MaterialSpec;
|
||||
_this.form.batch = value.Batch;
|
||||
_this.form.qty = value.Qty;
|
||||
|
||||
_this.onSubmit();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
select(data) {
|
||||
this.form.code = "";
|
||||
this.form.type = data;
|
||||
@@ -129,51 +172,54 @@
|
||||
return;
|
||||
}
|
||||
let url = "";
|
||||
if (_this.form.type == "uniqueCode") {
|
||||
url = "/shipment/ShipOut/ScanUniqueCode"
|
||||
if (_this.form.type == "pk") {
|
||||
// url = "/shipment/ShipOut/ScanUniqueCode"
|
||||
// _this.form.uniqueCode = data;
|
||||
//this.onSubmit();
|
||||
}
|
||||
else{
|
||||
url = "/shipment/ShipOut/ScanBox"
|
||||
}
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: { code: _this.form.code, type: _this.form.type },
|
||||
url: url,
|
||||
success: function (json) {
|
||||
if (json.Code != 200) {
|
||||
_this.$message({
|
||||
message: "扫描失败!" + json.Msg,
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
_this.form.code = "";
|
||||
} else {
|
||||
if (_this.form.type == "uniqueCode") {
|
||||
_this.form.uniqueCode = json.Data.UniqueCode;
|
||||
_this.form.materialCode = json.Data.MaterialCode;
|
||||
_this.form.materialSpec = json.Data.MaterialSpec;
|
||||
_this.form.batch = json.Data.Batch;
|
||||
_this.form.qty = json.Data.Qty;
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: { code: _this.form.code, type: _this.form.type },
|
||||
url: url,
|
||||
success: function (json) {
|
||||
if (json.Code != 200) {
|
||||
_this.$message({
|
||||
message: "扫描失败!" + json.Msg,
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
_this.form.code = "";
|
||||
} else {
|
||||
_this.showTable = true;
|
||||
_this.invTable = json.Data;
|
||||
if (_this.invTable.length == 0
|
||||
&& _this.form.type == "slbox"
|
||||
&& _this.form.code.startsWith("C")) {
|
||||
_this.showBack = true;
|
||||
if (_this.form.type == "uniqueCode") {
|
||||
_this.form.uniqueCode = json.Data.UniqueCode;
|
||||
_this.form.materialCode = json.Data.MaterialCode;
|
||||
_this.form.materialSpec = json.Data.MaterialSpec;
|
||||
_this.form.batch = json.Data.Batch;
|
||||
_this.form.qty = json.Data.Qty;
|
||||
} else {
|
||||
_this.showTable = true;
|
||||
_this.invTable = json.Data;
|
||||
if (_this.invTable.length == 0
|
||||
&& _this.form.type == "slbox"
|
||||
&& _this.form.code.startsWith("C")) {
|
||||
_this.showBack = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
_this.$message({
|
||||
message: "扫描失败!",
|
||||
type: "error",
|
||||
duration: "10000",
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
error: function (json) {
|
||||
_this.$message({
|
||||
message: "扫描失败!",
|
||||
type: "error",
|
||||
duration: "10000",
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
// 拣货
|
||||
onSubmit() {
|
||||
@@ -208,13 +254,27 @@
|
||||
&& _this.form.code.startsWith("C")) {
|
||||
_this.showBack = true;
|
||||
}
|
||||
_this.$refs['form'].resetFields();
|
||||
if (_this.form.type == "pk") {
|
||||
_this.form.code = "";
|
||||
_this.form.uniqueCode = "";
|
||||
}
|
||||
// 清空下面表单 不清空code
|
||||
_this.form.uniqueCode = "";
|
||||
_this.form.materialCode = "";
|
||||
_this.form.materialSpec = "";
|
||||
_this.form.batch = "";
|
||||
_this.form.qty = "";
|
||||
// _this.$refs['form'].resetFields();
|
||||
} else {
|
||||
_this.$message({
|
||||
message: "提交失败!",
|
||||
message: "提交失败!"+json.Msg,
|
||||
type: "warning",
|
||||
duration: "10000",
|
||||
});
|
||||
if (_this.form.type == "pk"){
|
||||
_this.form.code = "";
|
||||
_this.form.uniqueCode = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
@@ -238,6 +298,14 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (_this.invTable.length > 0) {
|
||||
_this.$message({
|
||||
message: "存在未拣货库存,不能创建回库任务!",
|
||||
type: "error",
|
||||
duration: "1000",
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定执行回库动作?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:combobox field="Searcher.ShipmentHeaderId" items="Searcher.AllShipmentHeaders" empty-text="@Localizer["Sys.All"]" />
|
||||
<wt:textbox field="Searcher.ZoneCode" />
|
||||
<wt:textbox field="Searcher.UniqueCode" />
|
||||
<wt:textbox field="Searcher.MaterialCode" />
|
||||
<wt:textbox field="Searcher.MaterialType" />
|
||||
<wt:textbox field="Searcher.MaterialName" />
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:combobox field="Searcher.ShipmentHeaderHistoryId" items="Searcher.AllShipmentHeaderHistorys" empty-text="@Localizer["Sys.All"]" />
|
||||
<wt:textbox field="Searcher.ZoneCode" />
|
||||
<wt:textbox field="Searcher.UniqueCode" />
|
||||
<wt:textbox field="Searcher.MaterialCode" />
|
||||
<wt:textbox field="Searcher.MaterialType" />
|
||||
<wt:textbox field="Searcher.MaterialName" />
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
app.tableData = json.Data;
|
||||
},
|
||||
error: function (json) {
|
||||
console.log("加载失败");
|
||||
alert.log("加载失败");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<wt:display field="Entity.LastStatus" />
|
||||
<wt:display field="Entity.Remark" /> *@
|
||||
</wt:row>
|
||||
<wt:grid vm="@Model.Details" height="300" hidden-checkbox="true" hidden-grid-index="true" use-local-data="true" hidden-panel="true" />
|
||||
<wt:grid vm="@Model.Details" height="300" hidden-checkbox="true" use-local-data="true" hidden-panel="true" />
|
||||
|
||||
<wt:row align="AlignEnum.Right">
|
||||
<wt:closebutton />
|
||||
|
||||
@@ -3,28 +3,34 @@
|
||||
|
||||
<el-row id="shelfinv" :gutter="20">
|
||||
<el-card class="box-card">
|
||||
<el-table :data="tableData" max-height="600" border
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column label="位置" align="center" prop="LocationCode"></el-table-column>
|
||||
<el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column>
|
||||
<el-table-column label="编码" align="center" prop="MaterialCode"></el-table-column>
|
||||
<el-table-column label="批次" align="center" prop="Batch"></el-table-column>
|
||||
<el-table-column label="数量" align="center" prop="Qty"></el-table-column>
|
||||
</el-table>
|
||||
<el-table :data="tableData" max-height="600" border
|
||||
style="width: 100%">
|
||||
<el-table-column type="index"
|
||||
width="50">
|
||||
</el-table-column>
|
||||
<el-table-column label="位置" align="center" prop="LocationCode"></el-table-column>
|
||||
<el-table-column label="唯一码" width="220" align="center" prop="UniqueCode"></el-table-column>
|
||||
<el-table-column label="编码" align="center" prop="MaterialCode"></el-table-column>
|
||||
<el-table-column label="批次" align="center" prop="Batch"></el-table-column>
|
||||
<el-table-column label="数量" align="center" prop="Qty"></el-table-column>
|
||||
</el-table>
|
||||
<el-row style="float:right">
|
||||
<el-button type="primary" @@click="print">打印</el-button>
|
||||
<el-button type="success" @@click="pick">全部拣货</el-button>
|
||||
|
||||
<el-button type="primary" @@click="print">打印</el-button>
|
||||
|
||||
<el-button @@click="toExcel">导出</el-button>
|
||||
|
||||
<el-button type="success" @@click="pick">全部拣货</el-button>
|
||||
|
||||
</el-row>
|
||||
|
||||
|
||||
</el-card>
|
||||
</el-row>
|
||||
|
||||
<script src="/lib/xlsx.js"></script>
|
||||
<script>
|
||||
Vue.prototype.XLSX = XLSX;
|
||||
var str = "";
|
||||
@{
|
||||
<text>str = @Model.Entity.ID; </text>
|
||||
<text>str = @Model.Entity.ID; </text>
|
||||
}
|
||||
|
||||
var app = new Vue({
|
||||
@@ -45,11 +51,34 @@
|
||||
app.tableData = json.Data;
|
||||
},
|
||||
error: function (json) {
|
||||
console.log("加载失败");
|
||||
layer.alert("加载失败");
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
toExcel(){
|
||||
// element-ui 导出excel
|
||||
let tableData = [
|
||||
['序号','位置', '唯一码','编码','批次', '数量']//导出表头
|
||||
] // 表格表头
|
||||
this.tableData.forEach ((item,index)=> {
|
||||
let rowData = []
|
||||
//导出内容的字段
|
||||
rowData = [
|
||||
index+1,
|
||||
item.LocationCode,
|
||||
item.UniqueCode,
|
||||
item.MaterialCode,
|
||||
item.Batch,
|
||||
item.Qty,
|
||||
]
|
||||
tableData.push(rowData)
|
||||
})
|
||||
let ws = this.XLSX.utils.aoa_to_sheet(tableData)
|
||||
let wb = this.XLSX.utils.book_new()
|
||||
this.XLSX.utils.book_append_sheet(wb, ws, '货架库存') // 工作簿名称
|
||||
this.XLSX.writeFile(wb, '货架库存.xlsx') // 保存的文件名
|
||||
},
|
||||
pick() {
|
||||
var _this = this;
|
||||
|
||||
@@ -147,4 +176,5 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
@@ -1,19 +1,13 @@
|
||||
@model HHWMS.Web.ShipmentHeaderHistoryVM
|
||||
@model HHWMS.Web.ShipmentHeaderHistoryVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:display field="Entity.SourceCode" />
|
||||
<wt:display field="Entity.Code" />
|
||||
<wt:display field="Entity.BillType" />
|
||||
<wt:display field="Entity.CompanyCode" />
|
||||
<wt:display field="Entity.SupplierCode" />
|
||||
<wt:display field="Entity.TotalQty" />
|
||||
<wt:display field="Entity.TotalLines" />
|
||||
<wt:display field="Entity.FirstStatus" />
|
||||
<wt:display field="Entity.LastStatus" />
|
||||
<wt:display field="Entity.Remark" />
|
||||
</wt:row>
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:display field="Entity.Code" />
|
||||
<wt:display field="Entity.BillType" />
|
||||
</wt:row>
|
||||
<wt:grid vm="@Model.Details" height="300" hidden-checkbox="true" use-local-data="true" hidden-panel="true" />
|
||||
|
||||
<wt:row align="AlignEnum.Right">
|
||||
<wt:closebutton />
|
||||
</wt:row>
|
||||
|
||||
@@ -3,13 +3,7 @@
|
||||
|
||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:textbox field="Searcher.SourceCode" />
|
||||
<wt:textbox field="Searcher.Code" />
|
||||
<wt:textbox field="Searcher.BillType" />
|
||||
<wt:textbox field="Searcher.CompanyCode" />
|
||||
<wt:textbox field="Searcher.SupplierCode" />
|
||||
<wt:combobox field="Searcher.FirstStatus" empty-text="@Localizer["Sys.All"]" />
|
||||
<wt:combobox field="Searcher.LastStatus" empty-text="@Localizer["Sys.All"]" />
|
||||
</wt:row>
|
||||
</wt:searchpanel>
|
||||
<wt:grid vm="@Model" url="/shipment/ShipmentHeaderHistory/Search"/>
|
||||
@@ -25,7 +25,7 @@ namespace HHWMS.Web
|
||||
{
|
||||
var _unitwork = new UnitWork(Wtm);
|
||||
List<Inventory> inventories = _unitwork.Find<Inventory>(x => x.Status == "0"
|
||||
&& x.TaskStatus == InventoryTaskStatus.无任务)
|
||||
&& x.TaskStatus == InventoryTaskStatus.无任务)
|
||||
.ToList();
|
||||
var Invs = inventories.Take(20).ToList();
|
||||
|
||||
@@ -36,8 +36,8 @@ namespace HHWMS.Web
|
||||
INITEMS = new INITEMS
|
||||
{
|
||||
INITEM = new List<INITEMItem>()
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -48,15 +48,16 @@ namespace HHWMS.Web
|
||||
//var inv = _unitwork.FindById<Inventory>(int.Parse(id));
|
||||
var qr = _unitwork.FindSingle<MaterialQr>(x => x.UniqueCode.Equals(inv.UniqueCode))?.QRCode;
|
||||
bizData.INWMS.INITEMS.INITEM.Add(
|
||||
new INITEMItem()
|
||||
{
|
||||
ERPSN = qr,
|
||||
WMSSN = inv?.UniqueCode,
|
||||
QTY = ((int?)inv?.Qty).ToString(),
|
||||
TYPE = "2",
|
||||
FLAG = "1"
|
||||
});
|
||||
new INITEMItem()
|
||||
{
|
||||
ERPSN = qr,
|
||||
WMSSN = inv?.UniqueCode,
|
||||
QTY = ((int?)inv?.Qty).ToString(),
|
||||
TYPE = "2",
|
||||
FLAG = "1"
|
||||
});
|
||||
}
|
||||
|
||||
var str = JsonConvert.SerializeObject(bizData);
|
||||
var request = new ServiceReference1.bizOperationV1Request
|
||||
{
|
||||
@@ -77,32 +78,43 @@ namespace HHWMS.Web
|
||||
UpdateBy = "invjob",
|
||||
UpdateTime = DateTime.Now
|
||||
});
|
||||
Wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: JsonConvert.SerializeObject(request), result: "success");
|
||||
Wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: JsonConvert.SerializeObject(request),
|
||||
result: "success");
|
||||
//return FFResult().Message("库存回传成功").RefreshGrid();
|
||||
}
|
||||
else
|
||||
{
|
||||
Wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: JsonConvert.SerializeObject(request), result: "error");
|
||||
Wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: JsonConvert.SerializeObject(request),
|
||||
result: "error");
|
||||
//return FFResult().Message($"{result.Message}").RefreshGrid();
|
||||
}
|
||||
}
|
||||
|
||||
#region 更新时间
|
||||
|
||||
var job = _unitwork.FindSingle<SysJob>(x => x.JobName == context.JobDetail.Key.Name);
|
||||
if (job != null)
|
||||
{
|
||||
job.LastFireTime = TimeZoneInfo.ConvertTimeFromUtc(context.FireTimeUtc.DateTime, TimeZoneInfo.Local);
|
||||
job.LastFireTime =
|
||||
TimeZoneInfo.ConvertTimeFromUtc(context.FireTimeUtc.DateTime, TimeZoneInfo.Local);
|
||||
// 只执行一次 没有下次执行时间
|
||||
if (context.NextFireTimeUtc != null)
|
||||
{
|
||||
job.NextFireTime = TimeZoneInfo.ConvertTimeFromUtc(context.NextFireTimeUtc.Value.DateTime, TimeZoneInfo.Local);
|
||||
job.NextFireTime = TimeZoneInfo.ConvertTimeFromUtc(context.NextFireTimeUtc.Value.DateTime,
|
||||
TimeZoneInfo.Local);
|
||||
}
|
||||
|
||||
_unitwork.Update<SysJob>(job);
|
||||
}
|
||||
Wtm.DoLog("任务下发", ActionLogTypesEnum.Job, "SendWcsJob");
|
||||
|
||||
Wtm.DoLog("库存回传", ActionLogTypesEnum.Job, "InvBackJob");
|
||||
|
||||
#endregion 更新时间
|
||||
}
|
||||
catch { }
|
||||
catch
|
||||
{
|
||||
Wtm.DoLog("库存回传", ActionLogTypesEnum.Job, "InvBackJob", result:"error");
|
||||
}
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ namespace HHWMS.Web
|
||||
if (count > 0)
|
||||
{
|
||||
var taskList = CreateWCSTask(task, _unitwork);
|
||||
|
||||
foreach (var item in taskList)
|
||||
{
|
||||
task.ErrorMsg += JsonConvert.SerializeObject(item);
|
||||
@@ -75,7 +76,7 @@ namespace HHWMS.Web
|
||||
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, item).Result.Data;
|
||||
//if (true)
|
||||
if (res.Success)
|
||||
{
|
||||
{
|
||||
var locationList = _unitwork.Find<Location>(x => task.FromLocation.Equals(x.Code) || task.ToLocation.Equals(x.Code)).ToList();
|
||||
var begin = locationList.FirstOrDefault(x => x.Code.Equals(task.FromLocation));
|
||||
var end = locationList.FirstOrDefault(x => x.Code.Equals(task.ToLocation));
|
||||
@@ -119,7 +120,7 @@ namespace HHWMS.Web
|
||||
{
|
||||
task.ErrorMsg += $"任务下发失败:{ex.Message}";
|
||||
}
|
||||
if (task.TaskDetails.Count(x => x.Status == TaskStatusEnum.待下发) == 0 && (task.TaskType == TaskTypeEnum.盘料入库 || task.TaskType == TaskTypeEnum.盘料出库))
|
||||
if (task.TaskDetails.Count(x => x.Status <= TaskStatusEnum.待下发) == 0 && (task.TaskType == TaskTypeEnum.盘料入库 || task.TaskType == TaskTypeEnum.盘料出库))
|
||||
{
|
||||
task.Status = TaskStatusEnum.已下发;
|
||||
}
|
||||
@@ -147,7 +148,9 @@ namespace HHWMS.Web
|
||||
Wtm.DoLog("任务下发", ActionLogTypesEnum.Job, "SendWcsJob");
|
||||
#endregion 更新时间
|
||||
}
|
||||
catch { }
|
||||
catch(Exception ex) {
|
||||
Wtm.DoLog(ex.Message, ActionLogTypesEnum.Job, "SendWcsJob");
|
||||
}
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -240,7 +243,7 @@ namespace HHWMS.Web
|
||||
newTask.Station = "2";
|
||||
_unitwork.Add(newTask);
|
||||
|
||||
task.ContainerCode += container.ContainerCode;
|
||||
task.ContainerCode += $" {container.ContainerCode}";
|
||||
// 更新库位
|
||||
container.Status = LocationStatus.任务锁;
|
||||
_unitwork.Update(container);
|
||||
@@ -380,7 +383,10 @@ namespace HHWMS.Web
|
||||
if (task != null)
|
||||
{
|
||||
|
||||
var locationList = _unitwork.Find<Location>(x => task.FromLocation.Equals(x.Code) || task.ToLocation.Equals(x.Code)).ToList();
|
||||
var locationList = _unitwork.Find<Location>(x => task.FromLocation.Equals(x.Code)
|
||||
|| task.ToLocation.Equals(x.Code)
|
||||
|| "G1,G2,T".Contains(x.Type)).ToList();
|
||||
|
||||
var begin = locationList.FirstOrDefault(x => x.Code.Equals(task.FromLocation));
|
||||
var end = locationList.FirstOrDefault(x => x.Code.Equals(task.ToLocation));
|
||||
// 根据不同任务类型 创建任务
|
||||
@@ -418,6 +424,11 @@ namespace HHWMS.Web
|
||||
{
|
||||
if (container.Any(x => x == item.ContainerCode))
|
||||
{
|
||||
var g1 = locationList.First(x => x.ContainerCode.Equals(item.ContainerCode)
|
||||
&& x.Type.Equals(LocationTypeEnum.堆垛机工位));
|
||||
|
||||
end = locationList.First(x => x.Code.Equals(g1.ContiguousCode));
|
||||
|
||||
taskInfoList.Add(new TaskInfo
|
||||
{
|
||||
TaskId = $"{task.TaskNo}-{item.FromLocation}",
|
||||
|
||||
@@ -43,7 +43,8 @@ namespace HHWMS.Web
|
||||
foreach (var shipmentDetail in shipmentDetails)
|
||||
{
|
||||
var inventorys = _unitwork.Find<Inventory>(x => x.UniqueCode == shipmentDetail.UniqueCode
|
||||
&& x.TaskStatus == InventoryTaskStatus.无任务).ToList();
|
||||
&& x.TaskStatus == InventoryTaskStatus.无任务
|
||||
&& x.ZoneCode != ZoneCodeEnum.货架库).ToList();
|
||||
if (inventorys.Count <= 0)
|
||||
{
|
||||
continue;
|
||||
@@ -173,8 +174,10 @@ namespace HHWMS.Web
|
||||
var gLoc = _unitwork.Find<Location>(x => x.ContainerCode == item.Key
|
||||
&& x.Row == location.Row
|
||||
&& x.Type.Equals(LocationTypeEnum.堆垛机工位)).FirstOrDefault();
|
||||
var cTask = _unitwork.Find<TaskHeader>(x => x.ContainerCode == item.Key
|
||||
&& x.TaskType == TaskTypeEnum.盘料盒出库).FirstOrDefault();
|
||||
var cTask = _unitwork.Find<TaskHeader>(x =>
|
||||
x.ContainerCode.Equals(item.Key)
|
||||
&& x.TaskType == TaskTypeEnum.盘料盒出库
|
||||
).FirstOrDefault();
|
||||
//查找料塔工位 T
|
||||
var tLoc = _unitwork.Find<Location>(x => x.Row == row
|
||||
&& x.Type.Equals(LocationTypeEnum.料塔))
|
||||
@@ -194,7 +197,7 @@ namespace HHWMS.Web
|
||||
gLoc = _unitwork.Find<Location>(x => string.IsNullOrEmpty(x.ContainerCode)
|
||||
&& x.Row == location.Row
|
||||
&& x.Type.Equals(LocationTypeEnum.堆垛机工位)).FirstOrDefault();
|
||||
|
||||
|
||||
if (gLoc != null)
|
||||
{
|
||||
// 工位为空,先判断是否有去此工位的任务
|
||||
@@ -289,8 +292,16 @@ namespace HHWMS.Web
|
||||
_unitwork.Update(tLoc);
|
||||
_unitwork.Update(containerTask);
|
||||
}
|
||||
else if (tLoc != null)
|
||||
else
|
||||
{
|
||||
// 新建盘料出库之前,判断此托盘是否存在此料盒的入库任务,如果有,不再新建盘料出库任务
|
||||
var isExit = _unitwork.Find<TaskHeader>(x =>
|
||||
x.TaskType == TaskTypeEnum.盘料盒入库
|
||||
&& x.ContainerCode.Equals(task.ContainerCode)).Any();
|
||||
if (isExit)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
task.ZoneCode = ZoneCodeEnum.盘料库;
|
||||
task.TaskNo = _unitwork.GetSerialNumber("pout", 4);
|
||||
task.TaskType = TaskTypeEnum.盘料出库;
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using HHWMS.Web.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Quartz;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
@@ -24,10 +25,48 @@ namespace HHWMS.Web
|
||||
_unitwork.BatchDelete<ReceiptHeader>(x => x.FirstStatus == ReceiptStatusEnum.收完);
|
||||
}
|
||||
|
||||
var errorRec = _unitwork.Find<ReceiptHeader>(x =>
|
||||
x.FirstStatus < ReceiptStatusEnum.收完
|
||||
&& x.CreateTime < DateTime.Now.AddDays(-1))
|
||||
.Include(u =>
|
||||
u.ReceiptDetails)
|
||||
.ToList();
|
||||
foreach (var rec in errorRec.Where(x =>
|
||||
x.ReceiptDetails.Any()
|
||||
&& x.ReceiptDetails.All(y => y.Status == ReceiptStatusEnum.收完)))
|
||||
{
|
||||
rec.FirstStatus = ReceiptStatusEnum.收完;
|
||||
_unitwork.Update(rec);
|
||||
|
||||
}
|
||||
|
||||
if (_unitwork.IsExit<ShipmentHeader>(x => x.FirstStatus == ShipStatusEnum.拣货完成))
|
||||
{
|
||||
_unitwork.BatchDelete<ShipmentHeader>(x => x.FirstStatus == ShipStatusEnum.拣货完成);
|
||||
}
|
||||
// 清理当前之前的状态不正确的出库单
|
||||
var errorShip = _unitwork.Find<ShipmentHeader>(x =>
|
||||
x.FirstStatus < ShipStatusEnum.拣货完成
|
||||
&& x.FirstStatus > ShipStatusEnum.新建
|
||||
&& x.CreateTime < DateTime.Now.AddDays(-1))
|
||||
.Include(u => u.ShipmentDetails)
|
||||
.ToList();
|
||||
foreach (var ship in errorShip)
|
||||
{
|
||||
if (ship.ShipmentDetails.All(x => x.Status != ShipStatusEnum.新建))
|
||||
{
|
||||
var invs = _unitwork.GetCount<Inventory>(x =>
|
||||
ship.ShipmentDetails.Select(y => y.UniqueCode).ToList()
|
||||
.Contains(x.UniqueCode)
|
||||
&& !string.IsNullOrEmpty(x.SourceCode));
|
||||
if (invs == 0)
|
||||
{
|
||||
_unitwork.Delete(errorShip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Wtm.DoLog("清理过期单据", ActionLogTypesEnum.Job, "TestJob");
|
||||
|
||||
#region 更新时间
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
@@ -12,6 +12,13 @@ namespace HHWMS.Web.Controllers
|
||||
[ActionDescription("任务明细历史")]
|
||||
public partial class TaskDetailHistoryController : BaseController
|
||||
{
|
||||
private readonly IUnitWork _unitwork;
|
||||
|
||||
public TaskDetailHistoryController(IUnitWork unitwork)
|
||||
{
|
||||
_unitwork = unitwork;
|
||||
}
|
||||
|
||||
#region Search
|
||||
[ActionDescription("Sys.Search")]
|
||||
public ActionResult Index()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
@@ -133,6 +133,7 @@ namespace HHWMS.Web.Controllers
|
||||
public ActionResult Details(string id)
|
||||
{
|
||||
var vm = Wtm.CreateVM<TaskHeaderHistoryVM>(id);
|
||||
vm.Details.SearcherMode = ListVMSearchModeEnum.MasterDetail;
|
||||
return PartialView(vm);
|
||||
}
|
||||
#endregion
|
||||
|
||||
+13
-2
@@ -1,5 +1,12 @@
|
||||
using HHWMS.Web.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web.Models;
|
||||
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
@@ -10,15 +17,19 @@ namespace HHWMS.Web
|
||||
ListVM = new TaskDetailHistoryListVM();
|
||||
LinkedVM = new TaskDetailHistory_BatchEdit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Class to define batch edit fields
|
||||
/// </summary>
|
||||
public class TaskDetailHistory_BatchEdit : BaseVM
|
||||
{
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+6
-20
@@ -13,28 +13,14 @@ namespace HHWMS.Web
|
||||
public partial class TaskDetailHistoryTemplateVM : BaseTemplateVM
|
||||
{
|
||||
public ExcelPropety TaskHeader_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.TaskHeaderId);
|
||||
[Display(Name = "Inventory.ReceiptCode")]
|
||||
public ExcelPropety OrderCode_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.OrderCode);
|
||||
[Display(Name = "Inventory.ReceiptDetailId")]
|
||||
public ExcelPropety OrderDetailId_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.OrderDetailId);
|
||||
[Display(Name = "Inventory.MaterialCode")]
|
||||
public ExcelPropety MaterialCode_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.MaterialCode);
|
||||
[Display(Name = "Inventory.MaterialName")]
|
||||
public ExcelPropety MaterialName_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.MaterialName);
|
||||
[Display(Name = "Inventory.MaterialSpec")]
|
||||
public ExcelPropety MaterialSpec_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.MaterialSpec);
|
||||
[Display(Name = "Inventory.MaterialUnit")]
|
||||
public ExcelPropety MaterialUnit_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.MaterialUnit);
|
||||
[Display(Name = "Inventory.Batch")]
|
||||
public ExcelPropety Batch_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.Batch);
|
||||
[Display(Name = "Inventory.Lot")]
|
||||
public ExcelPropety Lot_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.Lot);
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
public ExcelPropety UniqueCode_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.UniqueCode);
|
||||
[Display(Name = "Task.ContainerCode")]
|
||||
public ExcelPropety ContainerCode_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.ContainerCode);
|
||||
[Display(Name = "Inventory.Qty")]
|
||||
public ExcelPropety Qty_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.Qty);
|
||||
[Display(Name = "TaskDetail.InventoryId")]
|
||||
public ExcelPropety InventoryId_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.InventoryId);
|
||||
[Display(Name = "Task.FromLocation")]
|
||||
public ExcelPropety FromLocation_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.FromLocation);
|
||||
[Display(Name = "Task.ToLocation")]
|
||||
public ExcelPropety ToLocation_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.ToLocation);
|
||||
[Display(Name = "TaskDetail.Status")]
|
||||
public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.Status);
|
||||
|
||||
|
||||
+33
-29
@@ -15,7 +15,13 @@ namespace HHWMS.Web
|
||||
{
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
if (SearcherMode == ListVMSearchModeEnum.MasterDetail)
|
||||
{
|
||||
return new List<GridAction>();
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("TaskDetailHistory", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"taskManage", dialogWidth: 800),
|
||||
this.MakeStandardAction("TaskDetailHistory", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "taskManage", dialogWidth: 800),
|
||||
@@ -26,55 +32,53 @@ namespace HHWMS.Web
|
||||
this.MakeStandardAction("TaskDetailHistory", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "taskManage", dialogWidth: 800),
|
||||
this.MakeStandardAction("TaskDetailHistory", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "taskManage"),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override IEnumerable<IGridColumn<TaskDetailHistory_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<TaskDetailHistory_View>>{
|
||||
if (SearcherMode == ListVMSearchModeEnum.MasterDetail)
|
||||
{
|
||||
return new List<GridColumn<TaskDetailHistory_View>>{
|
||||
this.MakeGridHeader(x => x.TaskNo_view),
|
||||
this.MakeGridHeader(x => x.OrderCode),
|
||||
this.MakeGridHeader(x => x.OrderDetailId),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialName),
|
||||
this.MakeGridHeader(x => x.MaterialSpec),
|
||||
this.MakeGridHeader(x => x.MaterialUnit),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.Lot),
|
||||
this.MakeGridHeader(x => x.UniqueCode),
|
||||
this.MakeGridHeader(x => x.ContainerCode),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.InventoryId),
|
||||
this.MakeGridHeader(x => x.FromLocation),
|
||||
this.MakeGridHeader(x => x.ToLocation),
|
||||
this.MakeGridHeader(x => x.Status),
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return new List<GridColumn<TaskDetailHistory_View>>{
|
||||
this.MakeGridHeader(x => x.TaskNo_view),
|
||||
this.MakeGridHeader(x => x.UniqueCode),
|
||||
this.MakeGridHeader(x => x.ContainerCode),
|
||||
this.MakeGridHeader(x => x.FromLocation),
|
||||
this.MakeGridHeader(x => x.ToLocation),
|
||||
this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<TaskDetailHistory_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<TaskDetailHistory>()
|
||||
.CheckEqual(Searcher.TaskHeaderId, x=>x.TaskHeaderId)
|
||||
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
|
||||
.CheckContain(Searcher.MaterialName, x=>x.MaterialName)
|
||||
.CheckContain(Searcher.MaterialSpec, x=>x.MaterialSpec)
|
||||
.CheckContain(Searcher.Batch, x=>x.Batch)
|
||||
.CheckContain(Searcher.Lot, x=>x.Lot)
|
||||
.CheckContain(Searcher.UniqueCode, x=>x.UniqueCode)
|
||||
.CheckContain(Searcher.ContainerCode, x=>x.ContainerCode)
|
||||
.CheckEqual(Searcher.Status, x=>x.Status)
|
||||
.CheckContain(Searcher.FromLocation, x=>x.FromLocation)
|
||||
.CheckContain(Searcher.ToLocation, x=>x.ToLocation)
|
||||
.Select(x => new TaskDetailHistory_View
|
||||
{
|
||||
ID = x.ID,
|
||||
TaskNo_view = x.TaskHeader.TaskNo,
|
||||
OrderCode = x.OrderCode,
|
||||
OrderDetailId = x.OrderDetailId,
|
||||
MaterialCode = x.MaterialCode,
|
||||
MaterialName = x.MaterialName,
|
||||
MaterialSpec = x.MaterialSpec,
|
||||
MaterialUnit = x.MaterialUnit,
|
||||
Batch = x.Batch,
|
||||
Lot = x.Lot,
|
||||
TaskNo_view = $"{x.TaskHeader.TaskNo}-{x.FromLocation}",
|
||||
UniqueCode = x.UniqueCode,
|
||||
ContainerCode = x.ContainerCode,
|
||||
Qty = x.Qty,
|
||||
InventoryId = x.InventoryId,
|
||||
FromLocation = x.FromLocation,
|
||||
ToLocation = x.ToLocation,
|
||||
Status = x.Status,
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
|
||||
+8
-12
@@ -12,22 +12,18 @@ namespace HHWMS.Web
|
||||
{
|
||||
public partial class TaskDetailHistorySearcher : BaseSearcher
|
||||
{
|
||||
[Display(Name = "Task.TaskNo")]
|
||||
public List<ComboSelectListItem> AllTaskHeaders { get; set; }
|
||||
[Display(Name = "Task.TaskNo")]
|
||||
public int? TaskHeaderId { get; set; }
|
||||
[Display(Name = "Inventory.MaterialCode")]
|
||||
public String MaterialCode { get; set; }
|
||||
[Display(Name = "Inventory.MaterialName")]
|
||||
public String MaterialName { get; set; }
|
||||
[Display(Name = "Inventory.MaterialSpec")]
|
||||
public String MaterialSpec { get; set; }
|
||||
[Display(Name = "Inventory.Batch")]
|
||||
public String Batch { get; set; }
|
||||
[Display(Name = "Inventory.Lot")]
|
||||
public String Lot { get; set; }
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
public String UniqueCode { get; set; }
|
||||
[Display(Name = "Task.ContainerCode")]
|
||||
public String ContainerCode { get; set; }
|
||||
[Display(Name = "TaskDetail.Status")]
|
||||
public TaskStatusEnum? Status { get; set; }
|
||||
[Display(Name = "Task.FromLocation")]
|
||||
public String FromLocation { get; set; }
|
||||
[Display(Name = "Task.ToLocation")]
|
||||
public String ToLocation { get; set; }
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
|
||||
@@ -36,14 +36,14 @@ namespace HHWMS.Web
|
||||
this.MakeGridHeader(x => x.OrderCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.OrderDetailId).SetHide(),
|
||||
this.MakeGridHeader(x => x.UniqueCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.MaterialName).SetHide(),
|
||||
this.MakeGridHeader(x => x.MaterialSpec).SetHide(),
|
||||
this.MakeGridHeader(x => x.MaterialUnit).SetHide(),
|
||||
this.MakeGridHeader(x => x.Batch).SetHide(),
|
||||
this.MakeGridHeader(x => x.Lot).SetHide(),
|
||||
this.MakeGridHeader(x => x.ContainerCode),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.Qty).SetHide(),
|
||||
this.MakeGridHeader(x => x.InventoryId).SetHide(),
|
||||
this.MakeGridHeader(x => x.FromLocation),
|
||||
this.MakeGridHeader(x => x.ToLocation),
|
||||
@@ -55,6 +55,7 @@ namespace HHWMS.Web
|
||||
public override IOrderedQueryable<TaskDetail_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<TaskDetail>()
|
||||
.CheckEqual(Searcher.TaskHeaderId,x => x.TaskHeaderId)
|
||||
.CheckContain(Searcher.UniqueCode, x=>x.UniqueCode)
|
||||
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
|
||||
.CheckContain(Searcher.FromLocation, x=>x.FromLocation)
|
||||
@@ -62,7 +63,7 @@ namespace HHWMS.Web
|
||||
.Select(x => new TaskDetail_View
|
||||
{
|
||||
ID = x.ID,
|
||||
TaskNo_view = x.TaskHeader.TaskNo,
|
||||
TaskNo_view = $"{x.TaskHeader.TaskNo}-{x.FromLocation}",
|
||||
OrderCode = x.OrderCode,
|
||||
OrderDetailId = x.OrderDetailId,
|
||||
UniqueCode = x.UniqueCode,
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace HHWMS.Web
|
||||
this.MakeGridHeader(x => x.OrderCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.OrderDetailId).SetHide(),
|
||||
this.MakeGridHeader(x => x.UniqueCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.MaterialName).SetHide(),
|
||||
this.MakeGridHeader(x => x.MaterialSpec).SetHide(),
|
||||
this.MakeGridHeader(x => x.MaterialUnit).SetHide(),
|
||||
|
||||
@@ -12,6 +12,8 @@ namespace HHWMS.Web
|
||||
{
|
||||
public partial class TaskDetailSearcher : BaseSearcher
|
||||
{
|
||||
[Display(Name = "Task.TaskNo")]
|
||||
public List<ComboSelectListItem> AllTaskHeaders { get; set; }
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
public String UniqueCode { get; set; }
|
||||
|
||||
@@ -24,10 +26,10 @@ namespace HHWMS.Web
|
||||
public String FromLocation { get; set; }
|
||||
[Display(Name = "Task.ToLocation")]
|
||||
public String ToLocation { get; set; }
|
||||
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
AllTaskHeaders = DC.Set<TaskHeader>().GetSelectListItems(Wtm, y => y.TaskNo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+11
-9
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@@ -33,16 +33,17 @@ namespace HHWMS.Web
|
||||
{
|
||||
return new List<GridColumn<TaskHeaderHistory_View>>{
|
||||
this.MakeGridHeader(x => x.ZoneCode),
|
||||
this.MakeGridHeader(x => x.TaskNo),
|
||||
this.MakeGridHeader(x => x.TaskType),
|
||||
this.MakeGridHeader(x => x.FromLocation),
|
||||
this.MakeGridHeader(x => x.ToLocation),
|
||||
this.MakeGridHeader(x => x.TaskNo).SetWidth(220),
|
||||
this.MakeGridHeader(x => x.TaskType,150),
|
||||
this.MakeGridHeader(x => x.FromLocation,150),
|
||||
this.MakeGridHeader(x => x.ToLocation,150),
|
||||
this.MakeGridHeader(x => x.Station),
|
||||
this.MakeGridHeader(x => x.ContainerCode),
|
||||
this.MakeGridHeader(x => x.RoadWay),
|
||||
this.MakeGridHeader(x => x.Priority),
|
||||
this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeader(x => x.ContainerCode,150),
|
||||
this.MakeGridHeader(x => x.RoadWay).SetHide(),
|
||||
this.MakeGridHeader(x => x.Priority).SetHide(),
|
||||
this.MakeGridHeader(x => x.Status,150),
|
||||
this.MakeGridHeader(x => x.ErrorMsg),
|
||||
this.MakeGridHeader(x => x.CreateTime,220),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
@@ -72,6 +73,7 @@ namespace HHWMS.Web
|
||||
Priority = x.Priority,
|
||||
Status = x.Status,
|
||||
ErrorMsg = x.ErrorMsg,
|
||||
CreateTime = x.CreateTime
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
@@ -12,13 +12,15 @@ namespace HHWMS.Web
|
||||
{
|
||||
public partial class TaskHeaderHistoryVM : BaseCRUDVM<TaskHeaderHistory>
|
||||
{
|
||||
|
||||
public TaskDetailHistoryListVM Details { get; set; } = new TaskDetailHistoryListVM();
|
||||
public TaskHeaderHistoryVM()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
Details.CopyContext(this);
|
||||
Details.Searcher.TaskHeaderId = Entity.ID;
|
||||
}
|
||||
|
||||
public override void DoAdd()
|
||||
|
||||
@@ -68,6 +68,7 @@ namespace HHWMS.Web
|
||||
this.MakeGridHeader(x => x.Status, 150),
|
||||
this.MakeGridHeader(x => x.CreateTime, 150).SetHide(),
|
||||
this.MakeGridHeader(x => x.ErrorMsg, 150).SetHide(),
|
||||
this.MakeGridHeader(x => x.CreateTime,220),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
@@ -97,6 +98,7 @@ namespace HHWMS.Web
|
||||
Priority = x.Priority,
|
||||
Status = x.Status,
|
||||
ErrorMsg = x.ErrorMsg,
|
||||
CreateTime = x.CreateTime
|
||||
})
|
||||
.OrderByDescending(x => x.ID);
|
||||
return query;
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:textbox field="Searcher.UniqueCode" />
|
||||
<wt:textbox field="Searcher.MaterialCode" />
|
||||
<wt:textbox field="Searcher.FromLocation" />
|
||||
<wt:textbox field="Searcher.ToLocation" />
|
||||
</wt:row>
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:combobox field="Searcher.TaskHeaderId" items="Searcher.AllTaskHeaders" empty-text="@Localizer["Sys.All"]" />
|
||||
|
||||
<wt:textbox field="Searcher.UniqueCode"/>
|
||||
<wt:textbox field="Searcher.MaterialCode"/>
|
||||
<wt:textbox field="Searcher.FromLocation"/>
|
||||
<wt:textbox field="Searcher.ToLocation"/>
|
||||
</wt:row>
|
||||
</wt:searchpanel>
|
||||
<wt:grid vm="@Model" url="/taskManage/TaskDetail/Search"/>
|
||||
@@ -4,17 +4,10 @@
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:combobox field="Entity.TaskHeaderId" items="AllTaskHeaders"/>
|
||||
<wt:textbox field="Entity.OrderCode" />
|
||||
<wt:textbox field="Entity.OrderDetailId" />
|
||||
<wt:textbox field="Entity.MaterialCode" />
|
||||
<wt:textbox field="Entity.MaterialName" />
|
||||
<wt:textbox field="Entity.MaterialSpec" />
|
||||
<wt:textbox field="Entity.MaterialUnit" />
|
||||
<wt:textbox field="Entity.Batch" />
|
||||
<wt:textbox field="Entity.Lot" />
|
||||
<wt:textbox field="Entity.UniqueCode" />
|
||||
<wt:textbox field="Entity.ContainerCode" />
|
||||
<wt:textbox field="Entity.Qty" />
|
||||
<wt:textbox field="Entity.InventoryId" />
|
||||
<wt:textbox field="Entity.FromLocation" />
|
||||
<wt:textbox field="Entity.ToLocation" />
|
||||
<wt:combobox field="Entity.Status" />
|
||||
</wt:row>
|
||||
<wt:row align="AlignEnum.Right">
|
||||
|
||||
@@ -5,17 +5,10 @@
|
||||
<wt:quote>@Localizer["Sys.DeleteConfirm"]</wt:quote>
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:display field="Entity.TaskHeader.TaskNo" />
|
||||
<wt:display field="Entity.OrderCode" />
|
||||
<wt:display field="Entity.OrderDetailId" />
|
||||
<wt:display field="Entity.MaterialCode" />
|
||||
<wt:display field="Entity.MaterialName" />
|
||||
<wt:display field="Entity.MaterialSpec" />
|
||||
<wt:display field="Entity.MaterialUnit" />
|
||||
<wt:display field="Entity.Batch" />
|
||||
<wt:display field="Entity.Lot" />
|
||||
<wt:display field="Entity.UniqueCode" />
|
||||
<wt:display field="Entity.ContainerCode" />
|
||||
<wt:display field="Entity.Qty" />
|
||||
<wt:display field="Entity.InventoryId" />
|
||||
<wt:display field="Entity.FromLocation" />
|
||||
<wt:display field="Entity.ToLocation" />
|
||||
<wt:display field="Entity.Status" />
|
||||
</wt:row>
|
||||
<wt:hidden field="Entity.ID" />
|
||||
|
||||
@@ -4,17 +4,10 @@
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:display field="Entity.TaskHeader.TaskNo" />
|
||||
<wt:display field="Entity.OrderCode" />
|
||||
<wt:display field="Entity.OrderDetailId" />
|
||||
<wt:display field="Entity.MaterialCode" />
|
||||
<wt:display field="Entity.MaterialName" />
|
||||
<wt:display field="Entity.MaterialSpec" />
|
||||
<wt:display field="Entity.MaterialUnit" />
|
||||
<wt:display field="Entity.Batch" />
|
||||
<wt:display field="Entity.Lot" />
|
||||
<wt:display field="Entity.UniqueCode" />
|
||||
<wt:display field="Entity.ContainerCode" />
|
||||
<wt:display field="Entity.Qty" />
|
||||
<wt:display field="Entity.InventoryId" />
|
||||
<wt:display field="Entity.FromLocation" />
|
||||
<wt:display field="Entity.ToLocation" />
|
||||
<wt:display field="Entity.Status" />
|
||||
</wt:row>
|
||||
<wt:row align="AlignEnum.Right">
|
||||
|
||||
@@ -4,17 +4,10 @@
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:combobox field="Entity.TaskHeaderId" items="AllTaskHeaders"/>
|
||||
<wt:textbox field="Entity.OrderCode" />
|
||||
<wt:textbox field="Entity.OrderDetailId" />
|
||||
<wt:textbox field="Entity.MaterialCode" />
|
||||
<wt:textbox field="Entity.MaterialName" />
|
||||
<wt:textbox field="Entity.MaterialSpec" />
|
||||
<wt:textbox field="Entity.MaterialUnit" />
|
||||
<wt:textbox field="Entity.Batch" />
|
||||
<wt:textbox field="Entity.Lot" />
|
||||
<wt:textbox field="Entity.UniqueCode" />
|
||||
<wt:textbox field="Entity.ContainerCode" />
|
||||
<wt:textbox field="Entity.Qty" />
|
||||
<wt:textbox field="Entity.InventoryId" />
|
||||
<wt:textbox field="Entity.FromLocation" />
|
||||
<wt:textbox field="Entity.ToLocation" />
|
||||
<wt:combobox field="Entity.Status" />
|
||||
</wt:row>
|
||||
<wt:hidden field="Entity.ID" />
|
||||
|
||||
@@ -4,13 +4,10 @@
|
||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:combobox field="Searcher.TaskHeaderId" items="Searcher.AllTaskHeaders" empty-text="@Localizer["Sys.All"]" />
|
||||
<wt:textbox field="Searcher.MaterialCode" />
|
||||
<wt:textbox field="Searcher.MaterialName" />
|
||||
<wt:textbox field="Searcher.MaterialSpec" />
|
||||
<wt:textbox field="Searcher.Batch" />
|
||||
<wt:textbox field="Searcher.Lot" />
|
||||
<wt:textbox field="Searcher.UniqueCode" />
|
||||
<wt:textbox field="Searcher.ContainerCode" />
|
||||
<wt:combobox field="Searcher.Status" empty-text="@Localizer["Sys.All"]" />
|
||||
<wt:textbox field="Searcher.FromLocation" />
|
||||
<wt:textbox field="Searcher.ToLocation" />
|
||||
</wt:row>
|
||||
</wt:searchpanel>
|
||||
<wt:grid vm="@Model" url="/taskManage/TaskDetailHistory/Search"/>
|
||||
@@ -1,20 +1,18 @@
|
||||
@model HHWMS.Web.TaskHeaderHistoryVM
|
||||
@model HHWMS.Web.TaskHeaderHistoryVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:display field="Entity.ZoneCode" />
|
||||
<wt:display field="Entity.TaskNo" />
|
||||
<wt:display field="Entity.TaskType" />
|
||||
<wt:display field="Entity.FromLocation" />
|
||||
<wt:display field="Entity.ToLocation" />
|
||||
<wt:display field="Entity.Station" />
|
||||
<wt:display field="Entity.ContainerCode" />
|
||||
<wt:display field="Entity.RoadWay" />
|
||||
<wt:display field="Entity.Priority" />
|
||||
<wt:display field="Entity.Status" />
|
||||
<wt:display field="Entity.ErrorMsg" />
|
||||
</wt:row>
|
||||
<wt:grid vm="@Model.Details" height="300" hidden-checkbox="true" hidden-grid-index="true" use-local-data="true" />
|
||||
<wt:row align="AlignEnum.Right">
|
||||
<wt:closebutton />
|
||||
</wt:row>
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace HHWMS.Web
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
|
||||
// ef生成表 添加字段注释,只有本项目的表才添加,需要在DisplayAttribute,添加Description
|
||||
var ddd = modelBuilder.Model.GetEntityTypes();
|
||||
ddd = ddd.Where(x => x.ClrType.FullName.Contains("HHWMS.Web")).ToList();
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace MESTOWMSService
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
_wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: materails, result: "error");
|
||||
_wtm.DoLog(ex.Message, ActionLogTypesEnum.Normal, "mes", request: materails, result: "error");
|
||||
return new Result { Status = "N", Message = ex.Message};
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,6 @@ namespace MESTOWMSService
|
||||
{
|
||||
try
|
||||
{
|
||||
_wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: outOrder);
|
||||
var data = JsonConvert.DeserializeObject<MesOut>(outOrder);
|
||||
// 生成出库单和明细
|
||||
var shipment = new ShipmentHeader
|
||||
@@ -102,18 +101,20 @@ namespace MESTOWMSService
|
||||
}
|
||||
else
|
||||
{
|
||||
return new Result { Status = "N", Message = $"物料不存在库内!" };
|
||||
_wtm.DoLog($"{item.SN}物料不存在库内!", ActionLogTypesEnum.Normal, "mes", request: outOrder, result: "error");
|
||||
return new Result { Status = "N", Message = $"{item.SN}物料不存在库内!" };
|
||||
}
|
||||
}
|
||||
if(shipment.ShipmentDetails.Count > 0)
|
||||
{
|
||||
_unitwork.Add(shipment);
|
||||
}
|
||||
_wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: outOrder);
|
||||
return new Result();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_wtm.DoLog("", ActionLogTypesEnum.Normal, "mes", request: outOrder, result: "error");
|
||||
_wtm.DoLog(ex.Message, ActionLogTypesEnum.Normal, "mes", request: outOrder, result: "error");
|
||||
return new Result { Status = "N", Message = ex.Message };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
@@ -24,7 +25,7 @@ namespace HHWMS.Web.Models
|
||||
[Display(Name = "Container.LocationCode", Description = "库位编码")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string LocationCode { get; set; }
|
||||
|
||||
|
||||
[Display(Name = "Inventory.UniqueCode", Description = "唯一编码")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string UniqueCode { get; set; }
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace HHWMS.Web.Models
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string ZoneCode { get; set; }
|
||||
|
||||
[Display(Name = "InventoryTransaction.Type", Description = "交易类型")]
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string Type { get; set; }
|
||||
|
||||
|
||||
@@ -22,6 +22,10 @@ namespace HHWMS.Web.Models
|
||||
[Display(Name = "Inventory.ReceiptDetailId", Description = "明细ID")]
|
||||
public int? OrderDetailId { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.UniqueCode", Description = "唯一码")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string UniqueCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.MaterialCode", Description = "物料编码")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string MaterialCode { get; set; }
|
||||
@@ -56,6 +60,14 @@ namespace HHWMS.Web.Models
|
||||
[Display(Name = "TaskDetail.InventoryId", Description = "库存Id")]
|
||||
public int? InventoryId { get; set; }
|
||||
|
||||
[Display(Name = "Task.FromLocation", Description = "起始仓位")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string FromLocation { get; set; }
|
||||
|
||||
[Display(Name = "Task.ToLocation", Description = "目标仓位")]
|
||||
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||
public string ToLocation { get; set; }
|
||||
|
||||
[Display(Name = "TaskDetail.Status", Description = "状态")]
|
||||
public TaskStatusEnum? Status { get; set; }
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
},
|
||||
"HHWMS.Web": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
|
||||
|
||||
@@ -22,17 +22,17 @@
|
||||
},
|
||||
|
||||
"Connections": [
|
||||
//{
|
||||
// "Key": "default",
|
||||
// "Value": "Server=127.0.0.1;Port=3306;Database=8357wms;Uid=root;Password=abc123*;Character Set=utf8mb4;",
|
||||
// "DBType": "mysql"
|
||||
//}
|
||||
{
|
||||
"Key": "default",
|
||||
"Value": "Data Source=.;Initial Catalog=8357wms;User=sa;Password=abc123*;Persist Security Info=True",
|
||||
"DbContext": "DataContext",
|
||||
"DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
|
||||
"Value": "Server=127.0.0.1;Port=3306;Database=8wms;Uid=root;Password=abc123*;Character Set=utf8mb4;",
|
||||
"DBType": "mysql"
|
||||
}
|
||||
// {
|
||||
// "Key": "default",
|
||||
// "Value": "Data Source=.;Initial Catalog=8wms;User=sa;Password=abc123*;Persist Security Info=True",
|
||||
// "DbContext": "DataContext",
|
||||
// "DBType": "sqlserver" //DataBase, you can choose mysql,sqlserver,pgsql,sqlite,oracle
|
||||
// }
|
||||
//{
|
||||
// "Key": "default",
|
||||
// "Value": "Data Source=10.18.106.4;Initial Catalog=8357wms;User=wms;Password=abc123*;Persist Security Info=True",
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user