Compare commits

..
15 Commits
Author SHA1 Message Date
zhougf 96d8309793 修改mqtt订阅位程序启动,定时器只定时消费 2026-04-14 23:34:56 +08:00
zhougf 09098c020a mqtt test 2026-03-22 14:31:52 +08:00
zhougf 55cce81912 mqtt 1 2026-03-07 17:01:46 +08:00
zhougf 17b3236989 添加库存查询条件
入库保存时,依据容器的code,并不是前端传递的code
2026-03-07 11:26:25 +08:00
zhougf 38c126c7b7 力阔入库修改,添加物料绑定 2025-05-25 21:48:11 +08:00
zhougf a3e91357ee 容器出库
库位禁用
演示逻辑修改 task station=1的出库任务需要自动下发入库任务和AGv任务
2024-05-29 17:09:03 +08:00
zhougf a6168a75bf 设计出库口入库流程
托盘、周转箱分区存放
2024-04-30 23:18:05 +08:00
zhougf 70e6866e20 现场初始调试完成,
入库(有货/空容器)
出库,库存出库
AGV任务对接
2024-04-24 10:51:58 +08:00
zhougf b4632cfc33 力阔现场出入库流程
agv任务下发
修改部分实体类错误和页面字段等
layout 添加条码库
添加容器逻辑修改
2024-04-21 22:03:15 +08:00
zhougf 345b5a3d5b Merge branch 'master' into lkwms 2024-04-17 12:03:18 +08:00
zhougf 12e16e0c6c 修改合并冲突 2024-04-17 12:00:53 +08:00
zhougf f8e5ea23a9 基础修改 2024-04-17 11:46:50 +08:00
zhougf 502342b15f 日志分表 任务日志 操作日志 接口日志
添加对应的日志文件
修改主子表的表结构信息
删除无关字段信息
测试添加数据到历史表中
2024-03-15 22:40:45 +08:00
zhougf 4f2ba2a3ee 日志分表 任务日志 操作日志 接口日志
添加对应的日志文件
修改主子表的表结构信息
删除无关字段信息
测试添加数据到历史表中
2024-03-15 18:45:10 +08:00
zhougf ebdd40c518 添加打印模板配置 2024-03-10 02:21:16 +08:00
157 changed files with 3572 additions and 1425 deletions

No files matched your search

+1
View File
@@ -279,3 +279,4 @@ __pycache__/
/nuget.exe
/demo/WalkingTec.Mvvm.VueDemo/ClientApp/yarn.lock
*.lock
.DS_Store
+3 -3
View File
@@ -8,12 +8,12 @@ namespace HHWMS.Web
{
protected JsonResult ApiResult(object data = null, string msg = "success")
{
return new JsonResult(new ApiJsonResult<object> { Data = data, Success = true, Status = true, Msg = msg });
return new JsonResult(new ApiJsonResult<object> { Data = data, Success = true, Msg = msg });
}
protected JsonResult ApiResultError(object data = null, string msg = "faield")
protected JsonResult ApiResultError(object data = null, string msg = "failed")
{
return new JsonResult(new ApiJsonResult<object> { Data = data, Success = false, Status = false, Msg = msg });
return new JsonResult(new ApiJsonResult<object> { Data = data, Success = false, Msg = msg });
}
}
}
+234 -25
View File
@@ -1,13 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using AutoMapper;
using HHWMS.Web.Controllers;
using HHWMS.Web.Models;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using WalkingTec.Mvvm.Core;
namespace HHWMS.Web
{
/// <summary>
/// WCS接口
/// 提供WCS调用接口
/// 调用方向 WCS --> WMS
/// </summary>
[Public]
@@ -16,43 +20,248 @@ namespace HHWMS.Web
[Route("api/[controller]/[action]"), ApiExplorerSettings(GroupName = "User")]
public class IWCSController : ApiController
{
private readonly IUnitWork _unitwork;
private readonly IUnitWork _unitWork;
private readonly IMapper _mapper;
public IWCSController(IUnitWork unitwork, IMapper mapper)
public IWCSController(IUnitWork unitWork, IMapper mapper)
{
_unitwork = unitwork;
_unitWork = unitWork;
_mapper = mapper;
}
/// <summary>
/// 请求入库
/// </summary>
/// <returns></returns>
[HttpPost]
public IActionResult RequestIn(WcsRequest request)
{
var inv = new List<Inventory>();
for (int i = 0; i < 10; i++)
inv.Add(new Inventory
{
ContainerCode = "test" + i
});
//_unitwork.BatchAdd<Inventory>(inv);
_unitwork.DeleteById<Inventory>(1441);
//_unitwork.BatchUpdate<Inventory>(x => x.ID > 1030, x=>new Inventory { Batch = "test"});
return ApiResult();
}
/// <summary>
/// 状态返回
/// </summary>
/// <returns></returns>
[HttpPost]
public IActionResult TaskStatusResult(WcsRequest request)
public IActionResult ReturnStatus(WcsRequest request)
{
// 返回状态 只接收100
if (request.State != 100)
{
return ApiResultError(msg: "State 不为100, 请检查后重新请求!");
}
// 判断任务是否合理
var task = _unitWork.FindSingle<TaskHeader>(x => x.TaskNo.Equals(request.TaskNo));
if (task == null)
{
return ApiResultError(msg: $"任务不存在, 任务号 {request.TaskNo} , 请检查后重新请求!");
}
// 根据任务类型 入/出 处理不同流程
switch (task.TaskType)
{
case TaskTypeEnum.立库入库:
// 1.更新库存
_unitWork.BatchUpdate<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode), x => new Inventory
{
LocationCode = task.ToLocation,
UpdateTime = DateTime.Now,
UpdateBy = "WMS",
TaskStatus = InventoryTaskStatus.无任务
});
// 2.更新容器
_unitWork.BatchUpdate<Container>(x => x.Code.Equals(task.ContainerCode), x => new Container
{
UpdateTime = DateTime.Now,
UpdateBy = "WMS",
IsLock = ContainerLockEnum.未锁,
LocationCode = task.ToLocation
});
var inventoryList = _unitWork.Find<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode))
.ToList();
// 3.更新库位
_unitWork.BatchUpdate<Location>(x => x.Code.Equals(task.ToLocation), x => new Location
{
UpdateTime = DateTime.Now,
UpdateBy = "WMS",
Status = inventoryList.Count > 0 ? LocationStatus.有货 : LocationStatus.空容器,
ContainerCode = task.ContainerCode
});
// 4.插入库存交易
// 1.将任务容器的库存查出来
// if (inventoryList.Count > 0)
// {
// // 2.根据库存生成库存交易出库信息
// var inventoryTransactions = inventoryList.Select(inventory => new InventoryTransaction
// {
// BillType = InventoryTranType.入库,
// MaterialCode = inventory.MaterialCode,
// MaterialName = inventory.MaterialName,
// MaterialUnit = inventory.MaterialUnit,
// Batch = inventory.Batch,
// Lot = inventory.Lot,
// LocationCode = inventory.LocationCode,
// ContainerCode = inventory.ContainerCode,
// Qty = inventory.Qty,
// CreateTime = DateTime.Now,
// CreateBy = "WMS",
// UpdateTime = DateTime.Now,
// UpdateBy = "WMS"
// }).ToList();
//
// // 3.批量插入库存交易
// _unitWork.BatchAdd(inventoryTransactions);
// }
break;
case TaskTypeEnum.立库出库:
_unitWork.BatchUpdate<Container>(x => x.Code.Equals(task.ContainerCode), x => new Container
{
UpdateTime = DateTime.Now,
UpdateBy = "WMS",
IsLock = ContainerLockEnum.未锁,
LocationCode = ""
});
_unitWork.BatchUpdate<Location>(x => x.Code.Equals(task.FromLocation), x => new Location
{
UpdateTime = DateTime.Now,
UpdateBy = "WMS",
Status = LocationStatus.空仓位,
ContainerCode = ""
});
/*
// 1.将任务容器的库存查出来
var inventoryList2 = _unitWork.Find<Inventory>(x => x.ContainerCode.Equals(task.ContainerCode))
.ToList();
if (inventoryList2.Count > 0)
{
// 2.根据库存生成库存交易出库信息
var inventoryTransactions2 = inventoryList2.Select(inventory => new InventoryTransaction
{
BillType = InventoryTranType.出库,
MaterialCode = inventory.MaterialCode,
MaterialName = inventory.MaterialName,
MaterialUnit = inventory.MaterialUnit,
Batch = inventory.Batch,
Lot = inventory.Lot,
LocationCode = inventory.LocationCode,
ContainerCode = inventory.ContainerCode,
Qty = inventory.Qty,
CreateTime = DateTime.Now,
CreateBy = "WMS",
UpdateTime = DateTime.Now,
UpdateBy = "WMS"
}).ToList();
// 3.批量插入库存交易
_unitWork.BatchAdd(inventoryTransactions2);
_unitWork.BatchDelete<Inventory>(inventoryList2);
}
*/
// 如果是出库页面创建的任务,则创建入库任务并联动AGV
/*
if (task.Station == "1")
{
new ReceiptInController(_unitWork, Wtm).TaskIn(task.ContainerCode);
// 下发AGV到出库口的任务
var agv_task_id = Wtm.ConfigInfo.AppSettings.FirstOrDefault(x => x.Key == "OutIn").Value;
var postAgv = new
{
task_id = agv_task_id,
};
var res = Wtm.CallAPI<ShipOutController.agvResult>("ACS", "task_mould_do",
HttpMethodEnum.POST, postAgv);
// if (res.Result.Data.ack == 0)
// {
//
// }
}
*/
break;
default:
return ApiResultError(msg: $"任务类型不正确!任务号{request.TaskNo}");
}
task.Status = TaskStatusEnum.完成;
// 插到历史表,或者接下来流程
_unitWork.Add(new TaskHeaderHistory
{
TaskNo = task.TaskNo,
TaskType = task.TaskType,
FromLocation = task.FromLocation,
ToLocation = task.ToLocation,
ContainerCode = task.ContainerCode,
Status = task.Status,
CreateTime = DateTime.Now,
CreateBy = "WMS"
});
_unitWork.Delete(task);
return ApiResult();
}
/// <summary>
/// 满入
/// </summary>
/// <returns></returns>
[HttpPost]
public IActionResult FullIn(WcsRequest request)
{
var task = _unitWork.FindSingle<TaskHeader>(x => x.TaskNo.Equals(request.TaskNo));
if (task == null)
{
return ApiResultError(msg: $"任务不存在, 任务号 {request.TaskNo} , 请检查后重新请求!");
}
var location = _unitWork.FindSingle<Location>(x => x.Status == LocationStatus.空仓位);
if (location == null)
{
return ApiResultError(msg: "没有空仓位");
}
task.ToLocation = location.Code;
_unitWork.Update(task);
location.Status = LocationStatus.任务锁;
_unitWork.Update(location);
return ApiResult(new
{
locationCode = location.Code
});
}
/// <summary>
/// 空出
/// </summary>
/// <returns></returns>
[HttpPost]
public IActionResult EmptyOut(WcsRequest request)
{
var task = _unitWork.FindSingle<TaskHeader>(x => x.TaskNo.Equals(request.TaskNo));
if (task == null)
{
return ApiResultError(msg: $"任务不存在, 任务号 {request.TaskNo} , 请检查后重新请求!");
}
_unitWork.Add(new TaskHeaderHistory
{
TaskNo = task.TaskNo,
TaskType = task.TaskType,
FromLocation = task.FromLocation,
ToLocation = task.ToLocation,
ContainerCode = task.ContainerCode,
Status = task.Status,
CreateTime = DateTime.Now,
CreateBy = "WMS"
});
_unitWork.Delete(task);
return ApiResult();
}
}
}
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using HHWMS.Web.Models;
@@ -265,8 +266,10 @@ namespace HHWMS.Web.Controllers
vm.MSD.AddModelError(vm.Entity.BatchError, "数量和类型必填,且数量要大于0!");
return PartialView(vm);
}
var maxContainer = _unitwork.Find<Container>(x => x.Type == vm.Entity.Type).ToList().MaxBy(x => x.Code);
int maxNum = 1;
var maxContainer = _unitwork.Find<Container>(x => x.Type == vm.Entity.Type)
.ToList()
.MaxBy(x => x.Code);
int maxNum = 0;
if (maxContainer != null)
int.TryParse(maxContainer?.Code.Substring(1, 4), out maxNum);
// 查询已有的最大托盘值 在此基础上累加
@@ -288,5 +291,89 @@ namespace HHWMS.Web.Controllers
return FFResult().CloseDialog().RefreshGrid();
}
}
[ActionDescription("Inventory.Out")]
public IActionResult Out(int id)
{
var container = _unitwork.FindById<Container>(id);
if (container == null)
{
return FFResult().RefreshGrid().Alert("选定容器不存在!请检查后再执行出库任务!");
}
if (string.IsNullOrEmpty(container.LocationCode))
{
return FFResult().RefreshGrid().Alert("选定容器不在库位!请检查后再执行出库任务!");
}
if (_unitwork.IsExit<TaskHeader>(x => x.ContainerCode.Equals(container.Code)))
{
return FFResult().RefreshGrid().Alert("选定容器已存在任务!请检查后再执行出库任务!");
}
var location = _unitwork.FindSingle<Location>(x => x.Code == container.LocationCode);
if (location != null)
{
location.Status = LocationStatus.任务锁;
location.UpdateTime = DateTime.Now;
location.UpdateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS";
_unitwork.Update(location);
// 查找container,并更新状态
// var container = _unitwork.FindSingle<Container>(x => x.Code == location.ContainerCode);
container.IsLock = ContainerLockEnum.任务锁;
container.UpdateTime = DateTime.Now;
container.UpdateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS";
_unitwork.Update(container);
//创建出库任务
var task = new TaskHeader
{
ZoneCode = ZoneCodeEnum.立库,
TaskNo = _unitwork.GetSerialNumber("Out"),
TaskType = TaskTypeEnum.立库出库,
ContainerCode = location.ContainerCode,
FromLocation = location.Code,
ToLocation = "",
Status = TaskStatusEnum.待下发,
CreateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS",
CreateTime = DateTime.Now
};
_unitwork.Add(task);
// 下发任务到wcs
var postData = new
{
TaskNo = task.TaskNo,
PalletNo = task.ContainerCode,
FromLocation = task.FromLocation,
ToLocation = task.ToLocation
};
try
{
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, postData)
.Result.Data;
if (res.Success)
{
task.Status = TaskStatusEnum.已下发;
}
else
{
task.ErrorMsg = res.Msg;
}
}
catch (Exception ex)
{
task.ErrorMsg = ex.Message;
}
task.UpdateTime = DateTime.Now;
task.UpdateBy = "WMS";
_unitwork.Update(task);
}
return FFResult().RefreshGrid().Message("任务创建成功!");
}
}
}
@@ -6,6 +6,7 @@ using WalkingTec.Mvvm.Mvc;
using WalkingTec.Mvvm.Core.Extensions;
using HHWMS.Web;
using System.Collections.Generic;
using System.Linq;
using HHWMS.Web.Models;
namespace HHWMS.Web.Controllers
@@ -287,5 +288,30 @@ namespace HHWMS.Web.Controllers
return Ok();
}
[ActionDescription("Location.StopLocation")]
public ActionResult StopLocation(string[] ids)
{
_unitwork.BatchUpdate<Location>(x => ids.Contains(x.ID.ToString()),
x => new Location
{
IsStop = true,
UpdateBy = Wtm.LoginUserInfo.ITCode,
UpdateTime = DateTime.Now
});
return FFResult().RefreshGrid().Message("库位禁用成功!");
}
[ActionDescription("Location.LiftLocation")]
public ActionResult LiftLocation(string[] ids)
{
_unitwork.BatchUpdate<Location>(x => ids.Contains(x.ID.ToString()),
x => new Location
{
IsStop = false,
UpdateBy = Wtm.LoginUserInfo.ITCode,
UpdateTime = DateTime.Now
});
return FFResult().RefreshGrid().Message("库位解禁成功!");
}
}
}
@@ -0,0 +1,228 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Mvc;
using WalkingTec.Mvvm.Core.Extensions;
using HHWMS.Web;
namespace HHWMS.Web.Controllers
{
[Area("configs")]
[ActionDescription("打印模板配置")]
public partial class PrintConfigController : BaseController
{
private readonly IUnitWork _unitWork;
public PrintConfigController(IUnitWork unitWork)
{
_unitWork = unitWork;
}
#region Search
[ActionDescription("Sys.Search")]
public ActionResult Index()
{
var vm = Wtm.CreateVM<PrintConfigListVM>();
return PartialView(vm);
}
[ActionDescription("Sys.Search")]
[HttpPost]
public string Search(PrintConfigSearcher searcher)
{
var vm = Wtm.CreateVM<PrintConfigListVM>(passInit: true);
if (ModelState.IsValid)
{
vm.Searcher = searcher;
return vm.GetJson(false);
}
else
{
return vm.GetError();
}
}
#endregion
#region Create
[ActionDescription("Sys.Create")]
public ActionResult Create()
{
var vm = Wtm.CreateVM<PrintConfigVM>();
return PartialView(vm);
}
[HttpPost]
[ActionDescription("Sys.Create")]
public ActionResult Create(PrintConfigVM vm)
{
if (!ModelState.IsValid)
{
return PartialView(vm);
}
else
{
vm.DoAdd();
if (!ModelState.IsValid)
{
vm.DoReInit();
return PartialView(vm);
}
else
{
return FFResult().CloseDialog().RefreshGrid();
}
}
}
#endregion
#region Edit
[ActionDescription("Sys.Edit")]
public ActionResult Edit(string id)
{
var vm = Wtm.CreateVM<PrintConfigVM>(id);
return PartialView(vm);
}
[ActionDescription("Sys.Edit")]
[HttpPost]
[ValidateFormItemOnly]
public ActionResult Edit(PrintConfigVM vm)
{
if (!ModelState.IsValid)
{
return PartialView(vm);
}
else
{
vm.DoEdit();
if (!ModelState.IsValid)
{
vm.DoReInit();
return PartialView(vm);
}
else
{
return FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID);
}
}
}
#endregion
#region Delete
[ActionDescription("Sys.Delete")]
public ActionResult Delete(string id)
{
var vm = Wtm.CreateVM<PrintConfigVM>(id);
return PartialView(vm);
}
[ActionDescription("Sys.Delete")]
[HttpPost]
public ActionResult Delete(string id, IFormCollection nouse)
{
var vm = Wtm.CreateVM<PrintConfigVM>(id);
vm.DoDelete();
if (!ModelState.IsValid)
{
return PartialView(vm);
}
else
{
return FFResult().CloseDialog().RefreshGrid();
}
}
#endregion
#region Details
[ActionDescription("Sys.Details")]
public ActionResult Details(string id)
{
var vm = Wtm.CreateVM<PrintConfigVM>(id);
return PartialView(vm);
}
#endregion
#region BatchEdit
[HttpPost]
[ActionDescription("Sys.BatchEdit")]
public ActionResult BatchEdit(string[] IDs)
{
var vm = Wtm.CreateVM<PrintConfigBatchVM>(Ids: IDs);
return PartialView(vm);
}
[HttpPost]
[ActionDescription("Sys.BatchEdit")]
public ActionResult DoBatchEdit(PrintConfigBatchVM vm, IFormCollection nouse)
{
if (!ModelState.IsValid || !vm.DoBatchEdit())
{
return PartialView("BatchEdit",vm);
}
else
{
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchEditSuccess", vm.Ids.Length]);
}
}
#endregion
#region BatchDelete
[HttpPost]
[ActionDescription("Sys.BatchDelete")]
public ActionResult BatchDelete(string[] IDs)
{
var vm = Wtm.CreateVM<PrintConfigBatchVM>(Ids: IDs);
return PartialView(vm);
}
[HttpPost]
[ActionDescription("Sys.BatchDelete")]
public ActionResult DoBatchDelete(PrintConfigBatchVM vm, IFormCollection nouse)
{
if (!ModelState.IsValid || !vm.DoBatchDelete())
{
return PartialView("BatchDelete",vm);
}
else
{
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchDeleteSuccess", vm.Ids.Length]);
}
}
#endregion
#region Import
[ActionDescription("Sys.Import")]
public ActionResult Import()
{
var vm = Wtm.CreateVM<PrintConfigImportVM>();
return PartialView(vm);
}
[HttpPost]
[ActionDescription("Sys.Import")]
public ActionResult Import(PrintConfigImportVM vm, IFormCollection nouse)
{
if (vm.ErrorListVM.EntityList.Count > 0 || !vm.BatchSaveData())
{
return PartialView(vm);
}
else
{
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.ImportSuccess", vm.EntityList.Count.ToString()]);
}
}
#endregion
#region Export
[ActionDescription("Sys.Export")]
[HttpPost]
public IActionResult ExportExcel(PrintConfigListVM vm)
{
return vm.GetExportData();
}
#endregion
}
}
@@ -31,6 +31,10 @@ namespace HHWMS.Web
this.MakeStandardAction("Container", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
this.MakeStandardAction("Container", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
this.MakeAction("Container","AddContainer",Localizer["Container.AddContainer"],Localizer["Container.AddContainer"],GridActionParameterTypesEnum.NoId,"configs"),
this.MakeAction("Container","Out",Localizer["Inventory.Out"],Localizer["Inventory.Out"],GridActionParameterTypesEnum.SingleId,"configs"),
this.MakeAction("Location","Print",Localizer["Sys.Print"],Localizer["Sys.Print"],GridActionParameterTypesEnum.MultiIds,"configs")
.SetShowDialog(false).SetOnClickScript("print"),
};
}
@@ -33,6 +33,9 @@ namespace HHWMS.Web
this.MakeStandardAction("Location", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
this.MakeStandardAction("Location", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
this.MakeAction("Location","AddLocation",Localizer["Location.AddLocation"],Localizer["Location.AddLocation"],GridActionParameterTypesEnum.NoId,"configs"),
this.MakeAction("Location","StopLocation",Localizer["Location.StopLocation"],Localizer["Location.StopLocation"],GridActionParameterTypesEnum.MultiIds,"configs"),
this.MakeAction("Location","LiftLocation",Localizer["Location.LiftLocation"],Localizer["Location.LiftLocation"],GridActionParameterTypesEnum.MultiIds,"configs"),
this.MakeAction("Location","Print",Localizer["Sys.Print"],Localizer["Sys.Print"],GridActionParameterTypesEnum.MultiIds,"configs")
.SetShowDialog(false).SetOnClickScript("print"),
@@ -12,12 +12,6 @@ namespace HHWMS.Web
{
public partial class MaterialTemplateVM : BaseTemplateVM
{
[Display(Name = "Inventory.UniqueCode")]
public ExcelPropety UniqueCode_Excel = ExcelPropety.CreateProperty<Material>(x => x.UniqueCode);
[Display(Name = "Inventory.QRCode")]
public ExcelPropety QRCode_Excel = ExcelPropety.CreateProperty<Material>(x => x.QRCode);
[Display(Name = "Inventory.SourceCode")]
public ExcelPropety SourceCode_Excel = ExcelPropety.CreateProperty<Material>(x => x.SourceCode);
[Display(Name = "Inventory.MaterialCode")]
public ExcelPropety MaterialCode_Excel = ExcelPropety.CreateProperty<Material>(x => x.MaterialCode);
[Display(Name = "Inventory.MaterialType")]
@@ -25,6 +25,8 @@ namespace HHWMS.Web
this.MakeStandardAction("Material", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "configs", dialogWidth: 800),
this.MakeStandardAction("Material", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
this.MakeStandardAction("Material", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
this.MakeAction("Location","Print",Localizer["Sys.Print"],Localizer["Sys.Print"],GridActionParameterTypesEnum.MultiIds,"configs")
.SetShowDialog(false).SetOnClickScript("print"),
};
}
@@ -32,9 +34,6 @@ namespace HHWMS.Web
protected override IEnumerable<IGridColumn<Material_View>> InitGridHeader()
{
return new List<GridColumn<Material_View>>{
this.MakeGridHeader(x => x.UniqueCode).SetHide(),
this.MakeGridHeader(x => x.QRCode),
this.MakeGridHeader(x => x.SourceCode).SetHide(),
this.MakeGridHeader(x => x.MaterialCode),
this.MakeGridHeader(x => x.MaterialType),
this.MakeGridHeader(x => x.MaterialName),
@@ -52,15 +51,10 @@ namespace HHWMS.Web
public override IOrderedQueryable<Material_View> GetSearchQuery()
{
var query = DC.Set<Material>()
.CheckContain(Searcher.UniqueCode, x=>x.UniqueCode)
.CheckContain(Searcher.QRCode, x=>x.QRCode)
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
.Select(x => new Material_View
{
ID = x.ID,
UniqueCode = x.UniqueCode,
QRCode = x.QRCode,
SourceCode = x.SourceCode,
MaterialCode = x.MaterialCode,
MaterialType = x.MaterialType,
MaterialName = x.MaterialName,
@@ -12,12 +12,11 @@ namespace HHWMS.Web
{
public partial class MaterialSearcher : BaseSearcher
{
[Display(Name = "Inventory.UniqueCode")]
public String UniqueCode { get; set; }
[Display(Name = "Inventory.QRCode")]
public String QRCode { get; set; }
[Display(Name = "Inventory.MaterialCode")]
public String MaterialCode { get; set; }
[Display(Name = "Inventory.MaterialName")]
public String MaterialName { get; set; }
protected override void InitVM()
{
@@ -0,0 +1,35 @@
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
{
public partial class PrintConfigBatchVM : BaseBatchVM<PrintConfig, PrintConfig_BatchEdit>
{
public PrintConfigBatchVM()
{
ListVM = new PrintConfigListVM();
LinkedVM = new PrintConfig_BatchEdit();
}
}
/// <summary>
/// Class to define batch edit fields
/// </summary>
public class PrintConfig_BatchEdit : BaseVM
{
protected override void InitVM()
{
}
}
}
@@ -0,0 +1,33 @@
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
{
public partial class PrintConfigTemplateVM : BaseTemplateVM
{
[Display(Name = "PrintConfig.Name")]
public ExcelPropety Name_Excel = ExcelPropety.CreateProperty<PrintConfig>(x => x.Name);
[Display(Name = "PrintConfig.Template")]
public ExcelPropety Template_Excel = ExcelPropety.CreateProperty<PrintConfig>(x => x.Template);
[Display(Name = "PrintConfig.TestData")]
public ExcelPropety TestData_Excel = ExcelPropety.CreateProperty<PrintConfig>(x => x.TestData);
protected override void InitVM()
{
}
}
public class PrintConfigImportVM : BaseImportVM<PrintConfigTemplateVM, PrintConfig>
{
}
}
@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using HHWMS.Web.Models;
namespace HHWMS.Web
{
public partial class PrintConfigListVM : BasePagedListVM<PrintConfig_View, PrintConfigSearcher>
{
protected override List<GridAction> InitGridAction()
{
return new List<GridAction>
{
this.MakeStandardAction("PrintConfig", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"configs", dialogWidth: 800),
this.MakeStandardAction("PrintConfig", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "configs", dialogWidth: 800),
this.MakeStandardAction("PrintConfig", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "configs", dialogWidth: 800),
this.MakeStandardAction("PrintConfig", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "configs", dialogWidth: 800),
this.MakeStandardAction("PrintConfig", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "configs", dialogWidth: 800),
this.MakeStandardAction("PrintConfig", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "configs", dialogWidth: 800),
this.MakeStandardAction("PrintConfig", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
this.MakeStandardAction("PrintConfig", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
};
}
protected override IEnumerable<IGridColumn<PrintConfig_View>> InitGridHeader()
{
return new List<GridColumn<PrintConfig_View>>{
this.MakeGridHeader(x => x.Name),
this.MakeGridHeader(x => x.Template),
this.MakeGridHeader(x => x.TestData),
this.MakeGridHeaderAction(width: 200)
};
}
public override IOrderedQueryable<PrintConfig_View> GetSearchQuery()
{
var query = DC.Set<PrintConfig>()
.CheckContain(Searcher.Name, x=>x.Name)
.Select(x => new PrintConfig_View
{
ID = x.ID,
Name = x.Name,
Template = x.Template,
TestData = x.TestData,
})
.OrderBy(x => x.ID);
return query;
}
}
public class PrintConfig_View : PrintConfig{
}
}
@@ -0,0 +1,23 @@
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
{
public partial class PrintConfigSearcher : BaseSearcher
{
[Display(Name = "PrintConfig.Name")]
public String Name { get; set; }
protected override void InitVM()
{
}
}
}
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HHWMS.Web.Models;
namespace HHWMS.Web
{
public partial class PrintConfigVM : BaseCRUDVM<PrintConfig>
{
public PrintConfigVM()
{
}
protected override void InitVM()
{
}
public override void DoAdd()
{
base.DoAdd();
}
public override void DoEdit(bool updateAllFields = false)
{
base.DoEdit(updateAllFields);
}
public override void DoDelete()
{
base.DoDelete();
}
}
}
@@ -3,7 +3,7 @@
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="Entity.Type" />
<wt:combobox field="Entity.Type" items="ContainerType"/>
<wt:textbox field="Num" />
<wt:textbox field="Entity.Length" />
<wt:textbox field="Entity.Width" />
@@ -14,3 +14,20 @@
</wt:row>
</wt:searchpanel>
<wt:grid vm="@Model" url="/configs/Container/Search"/>
<script>
let template = {"panels":[{"index":0,"height":60,"width":80,"paperHeader":43.5,"paperFooter":170.07874015748033,"printElements":[{"options":{"left":13.5,"top":22.5,"height":100.5,"width":198,"title":"12345678","field":"code","testData":"12345678","textType":"barcode","barcodeMode":"CODE128A","fontFamily":"Microsoft YaHei","fontSize":20.25,"textAlign":"center","lineHeight":30},"printElementType":{"type":"text"}}],"paperNumberLeft":196,"paperNumberTop":148,"paperNumberDisabled":true}]};
let printData = [];
function print(ids, datas) {
datas.forEach(function (value, index, arr) {
printData.push({ code: value.Code })
});
hiprint.init();
var hiprintTemplate = new hiprint.PrintTemplate({
template: template
});
hiprintTemplate.print(printData);
printData = [];
}
</script>
@@ -5,15 +5,17 @@
<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" />
<wt:combobox field="Searcher.Status" items="LocationStatus" />
<wt:textbox field="Searcher.ContainerCode" />
<wt:combobox field="Searcher.IsStop" empty-text="@Localizer["Sys.All"]" />
<wt:textbox field="Searcher.Row" />
<wt:textbox field="Searcher.Line" />
<wt:textbox field="Searcher.Layer" />
@*
<wt:textbox field="Searcher.RoadWay" />
<wt:textbox field="Searcher.ContainerCode" />
<wt:combobox field="Searcher.IsStop" empty-text="@Localizer["Sys.All"]" /> *@
@*<wt:textbox field="Searcher.ContiguousCode" />*@
<wt:textbox field="Searcher.ContiguousCode" />
*@
</wt:row>
</wt:searchpanel>
<wt:grid vm="@Model" url="/configs/Location/Search"/>
@@ -3,9 +3,6 @@
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="Entity.UniqueCode" />
<wt:textbox field="Entity.QRCode" />
<wt:textbox field="Entity.SourceCode" />
<wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialType" />
<wt:textbox field="Entity.MaterialName" />
@@ -4,9 +4,6 @@
<wt:form vm="@Model">
<wt:quote>@Localizer["Sys.DeleteConfirm"]</wt:quote>
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.UniqueCode" />
<wt:display field="Entity.QRCode" />
<wt:display field="Entity.SourceCode" />
<wt:display field="Entity.MaterialCode" />
<wt:display field="Entity.MaterialType" />
<wt:display field="Entity.MaterialName" />
@@ -3,9 +3,6 @@
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.UniqueCode" />
<wt:display field="Entity.QRCode" />
<wt:display field="Entity.SourceCode" />
<wt:display field="Entity.MaterialCode" />
<wt:display field="Entity.MaterialType" />
<wt:display field="Entity.MaterialName" />
@@ -3,9 +3,6 @@
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="Entity.UniqueCode" />
<wt:textbox field="Entity.QRCode" />
<wt:textbox field="Entity.SourceCode" />
<wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialType" />
<wt:textbox field="Entity.MaterialName" />
@@ -3,9 +3,25 @@
<wt:searchpanel vm="@Model" reset-btn="true">
<wt:row items-per-row="ItemsPerRowEnum.Three">
<wt:textbox field="Searcher.UniqueCode" />
<wt:textbox field="Searcher.QRCode" />
<wt:textbox field="Searcher.MaterialCode" />
<wt:textbox field="Searcher.MaterialCode" />
<wt:textbox field="Searcher.MaterialName" />
</wt:row>
</wt:searchpanel>
<wt:grid vm="@Model" url="/configs/Material/Search"/>
<script>
let template = {"panels":[{"index":0,"height":60,"width":80,"paperHeader":43.5,"paperFooter":170.07874015748033,"printElements":[{"options":{"left":10.5,"top":37.5,"height":50,"width":120,"field":"MaterialCode","fontSize":18,"textAlign":"center","textContentVerticalAlign":"middle"},"printElementType":{"type":"text"}},{"options":{"left":132,"top":37.5,"height":99,"width":90,"title":"123","field":"MaterialCode","textType":"qrcode"},"printElementType":{"type":"text"}},{"options":{"left":10.5,"top":88.5,"height":50,"width":120,"field":"MaterialName","fontSize":12,"textAlign":"center","textContentVerticalAlign":"middle"},"printElementType":{"type":"text"}}],"paperNumberLeft":196,"paperNumberTop":148,"paperNumberDisabled":true}]};
let printData = [];
function print(ids, datas) {
datas.forEach(function (value, index, arr) {
printData.push({ MaterialCode: value.MaterialCode, MaterialName: value.MaterialName })
});
hiprint.init();
var hiprintTemplate = new hiprint.PrintTemplate({
template: template
});
hiprintTemplate.print(printData);
printData = [];
}
</script>
@@ -0,0 +1,12 @@
@model HHWMS.Web.PrintConfigBatchVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:quote>@Localizer["Sys.BatchDeleteConfirm"]</wt:quote>
<wt:hidden field="Ids" />
<wt:grid vm="ListVM" use-local-data="true" height="300" hidden-checkbox="true" hidden-panel="true"/>
<wt:row align="AlignEnum.Right">
<wt:submitbutton theme=" ButtonThemeEnum.Warm" text="@Localizer["Sys.Delete"]"/>
<wt:closebutton />
</wt:row>
</wt:form>
@@ -0,0 +1,14 @@
@model HHWMS.Web.PrintConfigBatchVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<div style="margin-bottom:10px">@Localizer["Sys.BatchEditConfirm"] </div>
<wt:row items-per-row="ItemsPerRowEnum.Two">
</wt:row>
<wt:hidden field="Ids" />
<wt:grid vm="ListVM" use-local-data="true" height="300" hidden-checkbox="true" hidden-panel="true"/>
<wt:row align="AlignEnum.Right">
<wt:submitbutton />
<wt:closebutton />
</wt:row>
</wt:form>
@@ -0,0 +1,14 @@
@model HHWMS.Web.PrintConfigVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="Entity.Name" />
<wt:textbox field="Entity.Template" />
<wt:textbox field="Entity.TestData" />
</wt:row>
<wt:row align="AlignEnum.Right">
<wt:submitbutton />
<wt:closebutton />
</wt:row>
</wt:form>
@@ -0,0 +1,16 @@
@model HHWMS.Web.PrintConfigVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:quote>@Localizer["Sys.DeleteConfirm"]</wt:quote>
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.Name" />
<wt:display field="Entity.Template" />
<wt:display field="Entity.TestData" />
</wt:row>
<wt:hidden field="Entity.ID" />
<wt:row align="AlignEnum.Right">
<wt:submitbutton theme=" ButtonThemeEnum.Warm" text="@Localizer["Sys.Delete"]"/>
<wt:closebutton />
</wt:row>
</wt:form>
@@ -0,0 +1,13 @@
@model HHWMS.Web.PrintConfigVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.Name" />
<wt:display field="Entity.Template" />
<wt:display field="Entity.TestData" />
</wt:row>
<wt:row align="AlignEnum.Right">
<wt:closebutton />
</wt:row>
</wt:form>
@@ -0,0 +1,15 @@
@model HHWMS.Web.PrintConfigVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:textbox field="Entity.Name" />
<wt:textbox field="Entity.Template" />
<wt:textbox field="Entity.TestData" />
</wt:row>
<wt:hidden field="Entity.ID" />
<wt:row align="AlignEnum.Right">
<wt:submitbutton />
<wt:closebutton />
</wt:row>
</wt:form>
@@ -0,0 +1,14 @@
@model HHWMS.Web.PrintConfigImportVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row align="AlignEnum.Right">
<wt:downloadTemplateButton vm="@Model" />
</wt:row>
<wt:upload field="UploadFileId" label-text="@Model.Localizer["Sys.UploadTemplate"]" upload-type="ExcelFile" />
<wt:grid vm="ErrorListVM" use-local-data="true" hidden-checkbox="true" hidden-grid-index="true" hidden-panel="true" height="300"/>
<wt:row align="AlignEnum.Right">
<wt:submitbutton />
<wt:closebutton />
</wt:row>
</wt:form>
@@ -0,0 +1,9 @@
@model HHWMS.Web.PrintConfigListVM
@inject IStringLocalizer<Program> Localizer;
<wt:searchpanel vm="@Model" reset-btn="true">
<wt:row items-per-row="ItemsPerRowEnum.Three">
<wt:textbox field="Searcher.Name" />
</wt:row>
</wt:searchpanel>
<wt:grid vm="@Model" url="/configs/PrintConfig/Search"/>
@@ -225,5 +225,83 @@ namespace HHWMS.Web.Controllers
}
#endregion
[ActionDescription("Inventory.Out")]
public IActionResult Out(int id)
{
var inv = _unitwork.FindById<Inventory>(id);
if (inv == null)
{
return FFResult().RefreshGrid().Alert("选定库存不存在!请检查后再执行出库任务!");
}
if (_unitwork.IsExit<TaskHeader>(x => x.ContainerCode.Equals(inv.ContainerCode)))
{
return FFResult().RefreshGrid().Alert("选定库存已存在任务!请检查后再执行出库任务!");
}
var location = _unitwork.FindSingle<Location>(x => x.Code == inv.LocationCode);
if (location != null)
{
location.Status = LocationStatus.任务锁;
location.UpdateTime = DateTime.Now;
location.UpdateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS";
// _unitwork.Update(location);
// 查找container,并更新状态
var container = _unitwork.FindSingle<Container>(x => x.Code == location.ContainerCode);
container.IsLock = ContainerLockEnum.任务锁;
container.UpdateTime = DateTime.Now;
container.UpdateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS";
// _unitwork.Update(container);
//创建出库任务
var task = new TaskHeader
{
ZoneCode = ZoneCodeEnum.立库,
TaskNo = _unitwork.GetSerialNumber("Out"),
TaskType = TaskTypeEnum.立库出库,
ContainerCode = location.ContainerCode,
FromLocation = location.Code,
ToLocation = "",
Status = TaskStatusEnum.待下发,
CreateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS",
CreateTime = DateTime.Now
};
// _unitwork.Add(task);
// 下发任务到wcs
var postData = new
{
TaskNo = task.TaskNo,
PalletNo = task.ContainerCode,
FromLocation = task.FromLocation,
ToLocation = task.ToLocation
};
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, postData)
.Result.Data;
if (res.Success)
{
task.Status = TaskStatusEnum.已下发;
task.UpdateTime = DateTime.Now;
task.UpdateBy = "WMS";
_unitwork.Add(task);
inv.TaskStatus = InventoryTaskStatus.任务中;
_unitwork.Update(inv);
_unitwork.Update(container);
_unitwork.Update(location);
}
else
{
task.ErrorMsg = res.Msg;
return FFResult().RefreshGrid().Alert("出库任务创建失败!");
}
}
return FFResult().RefreshGrid().Message("任务创建成功!");
}
}
}
@@ -24,7 +24,7 @@ namespace HHWMS.Web
return new List<GridAction>
{
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"inventory", dialogWidth: 800),
this.MakeAction("Inventory","ReturnToMes",Localizer["Inventory.ReturnToMes"],Localizer["Inventory.ReturnToMes"],GridActionParameterTypesEnum.SingleId,"inventory"),
this.MakeAction("Inventory","Out",Localizer["Inventory.Out"],Localizer["Inventory.Out"],GridActionParameterTypesEnum.SingleId,"inventory"),
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "inventory", dialogWidth: 800),
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "inventory", dialogWidth: 800),
this.MakeStandardAction("Inventory", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "inventory", dialogWidth: 800),
@@ -55,16 +55,15 @@ namespace HHWMS.Web
var data = ZoneCodes.FirstOrDefault(x => x.Value.ToString() == a.ZoneCode);
return data?.Text ?? a.ZoneCode;
}),
this.MakeGridHeader(x => x.UniqueCode).SetWidth(230),
this.MakeGridHeader(x => x.ContainerCode).SetHide(),
this.MakeGridHeader(x => x.ContainerCode),
this.MakeGridHeader(x => x.LocationCode),
this.MakeGridHeader(x => x.MaterialCode),
this.MakeGridHeader(x => x.MaterialType),
// 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.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),
@@ -88,7 +87,6 @@ namespace HHWMS.Web
{
return new List<GridColumn<Inventory_View>>{
//this.MakeGridHeader(x => x.ZoneCode),
this.MakeGridHeader(x => x.UniqueCode).SetWidth(230),
//this.MakeGridHeader(x => x.ContainerCode),
//this.MakeGridHeader(x => x.LocationCode),
this.MakeGridHeader(x => x.MaterialCode),
@@ -111,8 +109,8 @@ namespace HHWMS.Web
{
var query = DC.Set<Inventory>()
.CheckContain(Searcher.ZoneCode, x => x.ZoneCode)
.CheckContain(Searcher.UniqueCode, x => x.UniqueCode)
.CheckContain(Searcher.LocationCode, x => x.LocationCode)
.CheckContain(Searcher.ContainerCode, x => x.ContainerCode)
.CheckContain(Searcher.MaterialCode, x => x.MaterialCode)
.CheckContain(Searcher.MaterialType, x => x.MaterialType)
.CheckContain(Searcher.MaterialName, x => x.MaterialName)
@@ -127,7 +125,6 @@ namespace HHWMS.Web
{
ID = x.ID,
ZoneCode = x.ZoneCode,
UniqueCode = x.UniqueCode,
ContainerCode = x.ContainerCode,
LocationCode = x.LocationCode,
MaterialCode = x.MaterialCode,
@@ -14,8 +14,12 @@ 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 = "Task.ContainerCode")]
public String ContainerCode { get; set; }
[Display(Name = "Inventory.UniqueCode")]
public String UniqueCode { get; set; }
[Display(Name = "Inventory.MaterialCode")]
@@ -3,12 +3,12 @@
<wt:searchpanel vm="@Model" reset-btn="true">
<wt:row items-per-row="ItemsPerRowEnum.Three">
<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.MaterialType" />
<wt:textbox field="Searcher.MaterialName" />
<wt:textbox field="Searcher.ContainerCode" />
<wt:textbox field="Searcher.LocationCode" />
@*<wt:textbox field="Searcher.MaterialType" />
<wt:textbox field="Searcher.MaterialSpec" />
<wt:textbox field="Searcher.MaterialUnit" />
<wt:textbox field="Searcher.Batch" />
@@ -89,7 +89,7 @@ namespace HHWMS.Web.Controllers
public ActionResult Create2(int id)
{
var vm = Wtm.CreateVM<ReceiptDetailVM>(passInit: true);
vm.Entity.ReceiptHeaderId = id;
vm.Entity.HeaderId = id;
vm.Entity.ReceiptHeader = new ReceiptHeader();
//vm.Entity.ReceiptHeader.Code = vm.DC.Set<ReceiptHeader>().Find(id).Code;
return PartialView(vm);
@@ -118,114 +118,6 @@ namespace HHWMS.Web.Controllers
}
}
[ActionDescription("Sys.Create")]
public ActionResult CreateDetails(int id)
{
var vm = Wtm.CreateVM<ReceiptDetailVM>(passInit: true);
vm.Entity.ReceiptHeaderId = id;
vm.Entity.ReceiptHeader = new ReceiptHeader();
//vm.Entity.ReceiptHeader.Code = vm.DC.Set<ReceiptHeader>().Find(id).Code;
return PartialView(vm);
}
[HttpPost]
[ActionDescription("Sys.Create")]
public ActionResult CreateDetails(ReceiptDetailVM vm)
{
var header = _unitwork.FindSingle<ReceiptHeader>(x => x.ID == vm.Entity.ReceiptHeaderId);
if(header.FirstStatus != ReceiptStatusEnum.新建)
{
return FFResult().Alert("主单据不是新建状态,不能新建明细!");
}
var plList = vm.Entity.MaterialCode.Split("\n");
var slList = vm.Entity.Lot.Split("\n");
var detailList = new List<ReceiptDetail>();
foreach(var item in plList)
{
if (!string.IsNullOrEmpty(item))
{
detailList.Add(new ReceiptDetail
{
UniqueCode = item,
Status = 0,
ZoneCode = ZoneCodeEnum.盘料库,
ReceiptHeaderId = vm.Entity.ReceiptHeaderId
});
}
}
foreach (var item in slList)
{
if (!string.IsNullOrEmpty(item))
{
detailList.Add(new ReceiptDetail
{
UniqueCode = item,
ZoneCode = ZoneCodeEnum.散料库,
Status = 0,
ReceiptHeaderId = vm.Entity.ReceiptHeaderId
});
}
}
var uniqueGroup = detailList.GroupBy(x => x.UniqueCode);
if (uniqueGroup.Any(x => x.Count() > 1))
{
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 => new { x.UniqueCode, x.ReceiptHeader.Code })
.ToList();
var reDel = reDetailList.Select(x => x.UniqueCode)
.Intersect(detailList.Select(x => x.UniqueCode));
if (reDel.Count() > 0)
{
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}");
}
// 判断唯一码是否已在库内
var invList = _unitwork.Find<Inventory>(x => 1 == 1)
.Select(x => x.UniqueCode)
.ToList();
if(invList.Intersect(detailList.Select(x => x.UniqueCode)).Count() > 0)
{
return FFResult().Alert("新增明细中,存在已在库内的唯一码!");
}
// 补充物料明细
foreach (var item in detailList)
{
var materialqr = _unitwork.FindSingle<MaterialQr>(x => x.UniqueCode.Equals(item.UniqueCode));
if(materialqr == null)
{
return FFResult().Alert("新增明细中,存在不是WMS生成的唯一码!");
}
var material = _unitwork.FindSingle<Material>(x => x.QRCode.Equals(materialqr.QRCode));
item.MaterialCode = material.MaterialCode;
item.MaterialName = material.MaterialName;
item.MaterialSpec = material.MaterialSpec;
item.MaterialType = material.MaterialType;
item.MaterialUnit = material.MaterialUnit;
item.Batch = material.Batch;
item.Qty = material.Qty;
item.SupplierCode = material.SupplierCode;
item.CreateBy = Wtm.LoginUserInfo.ITCode;
item.CreateTime = DateTime.Now;
}
_unitwork.BatchAdd(detailList.ToArray());
return FFResult().CloseDialog().RefreshGrid(index: 1);
}
#endregion
#region Edit
@@ -234,47 +234,5 @@ namespace HHWMS.Web.Controllers
}
#endregion
#region 点数
[ActionDescription("ReceiptHeader.Count")]
public ActionResult Count(string id)
{
var vm = Wtm.CreateVM<ReceiptHeaderVM>(id);
return PartialView(vm);
}
/// <summary>
/// 查所有新建的明细,已开始收货明细不允许点数
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public ActionResult SelectReceiptDetailsByCode(int id)
{
var data = _unitwork.Find<ReceiptHeader>(x => x.ID == id)
.Include(x => x.ReceiptDetails).ToList();
return JsonMore(data.FirstOrDefault().ReceiptDetails.Where(x => x.Status == ReceiptStatusEnum.新建));
}
/// <summary>
/// 修改明细的数量
/// </summary>
/// <param name="code"></param>
/// <param name="uniqueCode"></param>
/// <param name="qty"></param>
/// <returns></returns>
public ActionResult CountCommit(string code, string uniqueCode, int qty)
{
var receiptDetail = _unitwork.FindSingle<ReceiptDetail>(x => x.UniqueCode.Equals(uniqueCode));
if (receiptDetail != null)
{
receiptDetail.Qty = qty;
receiptDetail.UpdateTime = DateTime.Now;
receiptDetail.UpdateBy = Wtm.LoginUserInfo.ITCode;
_unitwork.Update(receiptDetail);
return JsonMore(null);
}
return JsonMore(null, 500, $"未找到唯一码{uniqueCode}的单据!");
}
#endregion
}
}
@@ -1,3 +1,6 @@
using System;
using System.Linq;
using HHWMS.Web.Models;
using Microsoft.AspNetCore.Mvc;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Mvc;
@@ -5,14 +8,16 @@ using WalkingTec.Mvvm.Mvc;
namespace HHWMS.Web.Controllers
{
[Area("receipt")]
[ActionDescription("盘料操作")]
[ActionDescription("入库操作")]
public partial class ReceiptInController : BaseController
{
private readonly IUnitWork _unitWork;
private readonly WTMContext _context;
public ReceiptInController(IUnitWork unitwork)
public ReceiptInController(IUnitWork unitWork, WTMContext wtmContext)
{
_unitWork = unitwork;
_unitWork = unitWork;
_context = wtmContext;
}
#region Index
@@ -24,5 +29,370 @@ namespace HHWMS.Web.Controllers
}
#endregion Index
[HttpGet]
public ActionResult SearchMaterials(string keyword)
{
if (string.IsNullOrEmpty(keyword))
{
return JsonMore(new { Data = new object[] { } });
}
var materials = _unitWork.Find<Material>(x =>
x.MaterialCode.Contains(keyword) ||
x.MaterialName.Contains(keyword))
.Take(10)
.Select(x => new {
MaterialCode = x.MaterialCode,
MaterialName = x.MaterialName,
MaterialSpec = x.MaterialSpec,
MaterialUnit = x.MaterialUnit
})
.ToList();
return JsonMore( materials );
}
[HttpPost]
public ActionResult AddInventory(string containerCode, string materialCode, decimal qty)
{
try
{
if (string.IsNullOrEmpty(containerCode))
{
return JsonMore(null, 500, "容器编码为空!");
}
if (string.IsNullOrEmpty(materialCode))
{
return JsonMore(null, 500, "物料编码为空!");
}
if (qty <= 0)
{
return JsonMore(null, 500, "数量必须大于0!");
}
// 查询容器
var container = _unitWork.FindSingle<Container>(u => u.Code == containerCode);
if (container == null)
{
return JsonMore(null, 500, $"库内没有编码为 {containerCode} 的容器!");
}
// 查询物料信息
var material = _unitWork.FindSingle<Material>(x => x.MaterialCode == materialCode);
if (material == null)
{
return JsonMore(null, 500, $"未找到物料编码为 {materialCode} 的物料信息!");
}
// 创建库存记录
var inventory = new Inventory()
{
ZoneCode = ZoneCodeEnum.立库,
ContainerCode = container.Code,
MaterialCode = material.MaterialCode,
MaterialName = material.MaterialName,
MaterialType = material.MaterialType,
MaterialSpec = material.MaterialSpec,
MaterialUnit = material.MaterialUnit,
Qty = qty,
TaskStatus = InventoryTaskStatus.任务中,
CreateTime = DateTime.Now
};
_unitWork.Add(inventory);
// 创建入库交易记录
var transaction = new InventoryTransaction
{
BillType = InventoryTranType.入库,
MaterialCode = material.MaterialCode,
MaterialName = material.MaterialName,
MaterialUnit = material.MaterialUnit,
ContainerCode = container.Code,
Qty = qty,
CreateTime = DateTime.Now,
CreateBy = "WMS",
UpdateTime = DateTime.Now,
UpdateBy = "WMS"
};
_unitWork.Add(transaction);
return JsonMore(new { Id = inventory.ID });
}
catch (Exception ex)
{
return JsonMore(null, 500, ex.Message);
}
}
[HttpPost]
public ActionResult TaskIn(string containerCode)
{
try
{
if (string.IsNullOrEmpty(containerCode))
{
return JsonMore(null, 500, "容器编码为空!");
}
// 查询容器
var container = _unitWork.FindSingle<Container>(u => u.Code == containerCode);
if (container == null)
{
return JsonMore(null, 500, $"库内没有编码为 {containerCode} 的容器!");
}
// 查询容器的库存
var inventories = _unitWork.Find<Inventory>(x => x.ContainerCode == containerCode).ToList();
// 根据库存情况设置容器状态
if (inventories.Any())
{
container.Status = ContainerStatus.有;
}
else
{
container.Status = ContainerStatus.空;
}
// 查找仓位
var location = _unitWork.Find<Location>(u => u.Status == LocationStatus.空仓位
&& u.Type == container.Type
&& !u.IsStop)
.OrderBy(x => x.Layer)
.ThenBy(x => x.Line)
.FirstOrDefault();
// 判断location是否为空
if (location == null)
{
return JsonMore(null, 500, "库内没有空闲仓位!");
}
// 更新容器状态
container.IsLock = ContainerLockEnum.任务锁;
container.UpdateTime = DateTime.Now;
container.UpdateBy = Wtm?.LoginUserInfo?.ITCode ?? "WMS";
// _unitWork.Update(container);
// 更新仓位状态
location.Status = LocationStatus.任务锁;
location.UpdateTime = DateTime.Now;
location.UpdateBy = Wtm?.LoginUserInfo?.ITCode ?? "WMS";
// _unitWork.Update(location);
// 更新库存记录
// foreach (var inventory in inventories)
// {
// inventory.LocationCode = location.Code;
// _unitWork.Update(inventory);
// }
// 创建入库任务
var task = new TaskHeader
{
ZoneCode = ZoneCodeEnum.立库,
TaskNo = _unitWork.GetSerialNumber("In"),
TaskType = TaskTypeEnum.立库入库,
ContainerCode = container.Code,
FromLocation = "",
ToLocation = location.Code,
Status = TaskStatusEnum.待下发,
CreateTime = DateTime.Now,
CreateBy = Wtm?.LoginUserInfo?.ITCode??"WMS",
};
// _unitWork.Add(task);
// 下发任务到wcs
var postData = new
{
TaskNo = task.TaskNo,
PalletNo = task.ContainerCode,
FromLocation = task.FromLocation,
ToLocation = task.ToLocation
};
try
{
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, postData)
.Result?.Data;
if (res.Success)
{
task.Status = TaskStatusEnum.已下发;
task.UpdateTime = DateTime.Now;
task.UpdateBy = "WMS";
_unitWork.Add(task);
_unitWork.Update(container);
_unitWork.Update(location);
}
else
{
task.ErrorMsg = res.Msg;
return JsonMore(null, 500, res.Msg);
}
}
catch (Exception ex)
{
task.ErrorMsg = ex.Message;
return JsonMore(null, 500, "任务下发失败!");
}
return JsonMore(null);
}
catch (Exception ex)
{
return JsonMore(null, 500, ex.Message);
}
}
[HttpPost]
public ActionResult DeleteInventory(int id)
{
try
{
// 查询库存记录
var inventory = _unitWork.Find<Inventory>(x => x.ID == id).FirstOrDefault();
if (inventory == null)
{
return JsonMore(null, 500, "未找到对应的库存记录!");
}
// 创建出库交易记录
var transaction = new InventoryTransaction
{
BillType = InventoryTranType.出库,
MaterialCode = inventory.MaterialCode,
MaterialName = inventory.MaterialName,
MaterialUnit = inventory.MaterialUnit,
ContainerCode = inventory.ContainerCode,
Qty = inventory.Qty,
CreateTime = DateTime.Now,
CreateBy = "WMS",
UpdateTime = DateTime.Now,
UpdateBy = "WMS"
};
_unitWork.Add(transaction);
// 删除库存记录
_unitWork.Delete(inventory);
return JsonMore(null);
}
catch (Exception ex)
{
return JsonMore(null, 500, ex.Message);
}
}
[HttpPost]
public ActionResult UpdateInventory(int id, decimal qty)
{
try
{
if (qty <= 0)
{
return JsonMore(null, 500, "数量必须大于0!");
}
// 查询库存记录
var inventory = _unitWork.Find<Inventory>(x => x.ID == id).FirstOrDefault();
if (inventory == null)
{
return JsonMore(null, 500, "未找到对应的库存记录!");
}
// 创建出库交易记录(原数量)
var outTransaction = new InventoryTransaction
{
BillType = InventoryTranType.出库,
MaterialCode = inventory.MaterialCode,
MaterialName = inventory.MaterialName,
MaterialUnit = inventory.MaterialUnit,
ContainerCode = inventory.ContainerCode,
Qty = inventory.Qty,
CreateTime = DateTime.Now,
CreateBy = "WMS",
UpdateTime = DateTime.Now,
UpdateBy = "WMS"
};
_unitWork.Add(outTransaction);
// 创建入库交易记录(新数量)
var inTransaction = new InventoryTransaction
{
BillType = InventoryTranType.入库,
MaterialCode = inventory.MaterialCode,
MaterialName = inventory.MaterialName,
MaterialUnit = inventory.MaterialUnit,
ContainerCode = inventory.ContainerCode,
Qty = qty,
CreateTime = DateTime.Now,
CreateBy = "WMS",
UpdateTime = DateTime.Now,
UpdateBy = "WMS"
};
_unitWork.Add(inTransaction);
// 更新库存数量
inventory.Qty = qty;
inventory.UpdateTime = DateTime.Now;
inventory.UpdateBy = Wtm?.LoginUserInfo?.ITCode ?? "WMS";
_unitWork.Update(inventory);
return JsonMore(null);
}
catch (Exception ex)
{
return JsonMore(null, 500, ex.Message);
}
}
[HttpGet]
public JsonResult ValidateContainer(string containerCode)
{
try
{
if (string.IsNullOrEmpty(containerCode))
{
return Json(new { Code = 400, Msg = "容器编码不能为空" });
}
var container = _unitWork.FindSingle<Container>(u => u.Code == containerCode);
if (container == null)
{
return Json(new { Code = 400, Msg = "容器不存在" });
}
if (!string.IsNullOrWhiteSpace(container.LocationCode))
{
return Json(new { Code = 400, Msg = $"{containerCode} 容器状态不正确!已存在任务或者已在库内" });
}
// 获取容器内的物料信息
var inventories = _unitWork.Find<Inventory>(x => x.ContainerCode == containerCode)
.Select(x => new {
Id = x.ID,
ContainerCode = x.ContainerCode,
MaterialCode = x.MaterialCode,
MaterialName = x.MaterialName,
Qty = x.Qty
})
.ToList();
return Json(new {
Code = 200,
Msg = "验证成功",
Data = inventories
});
}
catch (Exception ex)
{
return Json(new { Code = 500, Msg = ex.Message });
}
}
}
}
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
@@ -12,7 +12,7 @@ namespace HHWMS.Web
{
public partial class ReceiptDetailHistoryTemplateVM : BaseTemplateVM
{
public ExcelPropety ReceiptHeaderHistory_Excel = ExcelPropety.CreateProperty<ReceiptDetailHistory>(x => x.ReceiptHeaderHistoryId);
public ExcelPropety ReceiptHeaderHistory_Excel = ExcelPropety.CreateProperty<ReceiptDetailHistory>(x => x.HeaderId);
[Display(Name = "Task.ZoneCode")]
public ExcelPropety ZoneCode_Excel = ExcelPropety.CreateProperty<ReceiptDetailHistory>(x => x.ZoneCode);
[Display(Name = "Inventory.MaterialCode")]
@@ -56,7 +56,7 @@ namespace HHWMS.Web
public override IOrderedQueryable<ReceiptDetailHistory_View> GetSearchQuery()
{
var query = DC.Set<ReceiptDetailHistory>()
.CheckEqual(Searcher.ReceiptHeaderHistoryId, x=>x.ReceiptHeaderHistoryId)
.CheckEqual(Searcher.HeaderId, x=>x.HeaderId)
.CheckContain(Searcher.ZoneCode, x=>x.ZoneCode)
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
.CheckContain(Searcher.MaterialType, x=>x.MaterialType)
@@ -71,7 +71,7 @@ namespace HHWMS.Web
.Select(x => new ReceiptDetailHistory_View
{
ID = x.ID,
Code_view = x.ReceiptHeaderHistory.Code,
HeaderId = x.HeaderId,
ZoneCode = x.ZoneCode,
MaterialCode = x.MaterialCode,
MaterialType = x.MaterialType,
@@ -14,7 +14,7 @@ namespace HHWMS.Web
{
public List<ComboSelectListItem> AllReceiptHeaderHistorys { get; set; }
[Display(Name = "Inventory.ReceiptCode")]
public int? ReceiptHeaderHistoryId { get; set; }
public int? HeaderId { get; set; }
[Display(Name = "Task.ZoneCode")]
public String ZoneCode { get; set; }
[Display(Name = "Inventory.MaterialCode")]
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -16,7 +16,6 @@ namespace HHWMS.Web
public ReceiptDetailHistoryVM()
{
SetInclude(x => x.ReceiptHeaderHistory);
}
protected override void InitVM()
@@ -7,7 +7,7 @@ namespace HHWMS.Web
{
public partial class ReceiptDetailTemplateVM : BaseTemplateVM
{
public ExcelPropety ReceiptHeader_Excel = ExcelPropety.CreateProperty<ReceiptDetail>(x => x.ReceiptHeaderId);
public ExcelPropety ReceiptHeader_Excel = ExcelPropety.CreateProperty<ReceiptDetail>(x => x.HeaderId);
[Display(Name = "Task.ZoneCode")]
public ExcelPropety ZoneCode_Excel = ExcelPropety.CreateProperty<ReceiptDetail>(x => x.ZoneCode);
@@ -52,9 +52,8 @@ namespace HHWMS.Web
public override IOrderedQueryable<ReceiptDetail_View> GetSearchQuery()
{
var query = DC.Set<ReceiptDetail>()
.CheckEqual(Searcher.ReceiptHeaderId, x => x.ReceiptHeaderId)
.CheckEqual(Searcher.HeaderId, x => x.HeaderId)
.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)
@@ -69,7 +68,6 @@ namespace HHWMS.Web
ID = x.ID,
Code_view = x.ReceiptHeader.Code,
ZoneCode = x.ZoneCode,
UniqueCode = x.UniqueCode,
MaterialCode = x.MaterialCode,
MaterialType = x.MaterialType,
MaterialName = x.MaterialName,
@@ -32,7 +32,6 @@ namespace HHWMS.Web
var result = new List<GridColumn<ReceiptDetail_View>>{
//this.MakeGridHeader(x => x.Code_view),
//this.MakeGridHeader(x => x.ZoneCode),
this.MakeGridHeader(x => x.UniqueCode).SetWidth(230),
this.MakeGridHeader(x => x.MaterialCode),
//this.MakeGridHeader(x => x.MaterialType),
this.MakeGridHeader(x => x.MaterialName),
@@ -60,13 +59,12 @@ namespace HHWMS.Web
public override IOrderedQueryable<ReceiptDetail_View> GetSearchQuery()
{
var query = DC.Set<ReceiptDetail>()
.Where(x => x.ReceiptHeaderId == Searcher.ReceiptHeaderId)
.Where(x => x.HeaderId == Searcher.HeaderId)
.Select(x => new ReceiptDetail_View
{
ID = x.ID,
Code_view = x.ReceiptHeader.Code,
ZoneCode = x.ZoneCode,
UniqueCode = x.UniqueCode,
MaterialCode = x.MaterialCode,
MaterialType = x.MaterialType,
MaterialName = x.MaterialName,
@@ -11,14 +11,11 @@ namespace HHWMS.Web
{
public List<ComboSelectListItem> AllReceiptHeaders { get; set; }
[Display(Name = "Inventory.ReceiptCode")]
public int? ReceiptHeaderId { get; set; }
public int? HeaderId { 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; }
@@ -16,7 +16,7 @@ namespace HHWMS.Web
protected override void InitVM()
{
Details.CopyContext(this);
Details.Searcher.ReceiptHeaderId = Entity.ID;
Details.Searcher.HeaderId = Entity.ID;
var CurrentCulture = Wtm.CurrentCulture;
var dictDatas = DC.Set<SysDictData>().ToList();
@@ -1,9 +1,9 @@
@model HHWMS.Web.ReceiptDetailVM
@model HHWMS.Web.ReceiptDetailVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:combobox field="Entity.ReceiptHeaderId" items="AllReceiptHeaders"/>
<wt:combobox field="Entity.HeaderId" items="AllReceiptHeaders" />
<wt:textbox field="Entity.ZoneCode" />
<wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialType" />
@@ -20,7 +20,7 @@
<wt:textbox field="Entity.InventoryStatus" />
<wt:combobox field="Entity.Status" />
</wt:row>
<wt:hidden field="Entity.ReceiptHeaderId" />
<wt:hidden field="Entity.HeaderId" />
<wt:row align="AlignEnum.Right">
<wt:submitbutton />
<wt:closebutton />
@@ -6,7 +6,7 @@
<wt:textarea field="Entity.MaterialCode" label-text="盘料"/>
<wt:textarea field="Entity.Lot" label-text="散料" />
</wt:row>
<wt:hidden field="Entity.ReceiptHeaderId" />
<wt:hidden field="Entity.HeaderId" />
<wt:row align="AlignEnum.Right">
<wt:submitbutton />
<wt:closebutton />
@@ -1,9 +1,9 @@
@model HHWMS.Web.ReceiptDetailVM
@model HHWMS.Web.ReceiptDetailVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:combobox field="Entity.ReceiptHeaderId" items="AllReceiptHeaders"/>
<wt:combobox field="Entity.HeaderId" items="AllReceiptHeaders" />
<wt:textbox field="Entity.ZoneCode" />
<wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialType" />
@@ -1,9 +1,9 @@
@model HHWMS.Web.ReceiptDetailListVM
@model HHWMS.Web.ReceiptDetailListVM
@inject IStringLocalizer<Program> Localizer;
<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:combobox field="Searcher.HeaderId" items="Searcher.AllReceiptHeaders" empty-text="@Localizer["Sys.All"]" />
<wt:textbox field="Searcher.ZoneCode" />
<wt:textbox field="Searcher.MaterialCode" />
<wt:textbox field="Searcher.MaterialType" />
@@ -1,9 +1,9 @@
@model HHWMS.Web.ReceiptDetailHistoryVM
@model HHWMS.Web.ReceiptDetailHistoryVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:combobox field="Entity.ReceiptHeaderHistoryId" items="AllReceiptHeaderHistorys"/>
<wt:combobox field="Entity.HeaderId" items="AllReceiptHeaderHistorys"/>
<wt:textbox field="Entity.ZoneCode" />
<wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialType" />
@@ -1,10 +1,10 @@
@model HHWMS.Web.ReceiptDetailHistoryVM
@model HHWMS.Web.ReceiptDetailHistoryVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:quote>@Localizer["Sys.DeleteConfirm"]</wt:quote>
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.ReceiptHeaderHistory.Code" />
<wt:display field="Entity.ID" />
<wt:display field="Entity.ZoneCode" />
<wt:display field="Entity.MaterialCode" />
<wt:display field="Entity.MaterialType" />
@@ -1,9 +1,9 @@
@model HHWMS.Web.ReceiptDetailHistoryVM
@model HHWMS.Web.ReceiptDetailHistoryVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.ReceiptHeaderHistory.Code" />
<wt:display field="Entity.HeaderId" />
<wt:display field="Entity.ZoneCode" />
<wt:display field="Entity.MaterialCode" />
<wt:display field="Entity.MaterialType" />
@@ -1,9 +1,9 @@
@model HHWMS.Web.ReceiptDetailHistoryVM
@model HHWMS.Web.ReceiptDetailHistoryVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:combobox field="Entity.ReceiptHeaderHistoryId" items="AllReceiptHeaderHistorys"/>
<wt:combobox field="Entity.HeaderId" items="AllReceiptHeaderHistorys" />
<wt:textbox field="Entity.ZoneCode" />
<wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialType" />
@@ -1,9 +1,9 @@
@model HHWMS.Web.ReceiptDetailHistoryListVM
@model HHWMS.Web.ReceiptDetailHistoryListVM
@inject IStringLocalizer<Program> Localizer;
<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:combobox field="Searcher.HeaderId" items="Searcher.AllReceiptHeaderHistorys" empty-text="@Localizer["Sys.All"]" />
<wt:textbox field="Searcher.ZoneCode" />
<wt:textbox field="Searcher.MaterialCode" />
<wt:textbox field="Searcher.MaterialType" />
@@ -17,7 +17,7 @@
var headerId = 0;
function details(id) {
headerId = id;
layui.table.reload('ReceiptDetail', { where: { "Searcher.ReceiptHeaderId": id } });
layui.table.reload('ReceiptDetail', { where: { "Searcher.HeaderId": id } });
}
function CreateDetail() {
@@ -1,342 +1,443 @@
<el-row id="plapp" :gutter="20">
<el-col :span="6">
<el-card class="box-card" :span="8">
<el-select v-model="value" clearable filterable placeholder="请选择单据" size="big" style="width:100%"
@@change="changeselect" @@clear="clearReceipt">
<el-option v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div id="receiptin">
<a-space direction="vertical" fill>
<a-form :model="formData" layout="vertical">
<a-form-item field="containerCode" label="容器编码">
<a-input
v-model="ContainerCode"
placeholder="扫描箱号"
allow-clear
@@keyup.enter="validateContainer"
ref="containerInput"/>
</a-form-item>
<a-form-item field="materialCode" label="物料信息">
<a-auto-complete
v-model="MaterialCode"
:data="materialOptions"
@@search="handleSearch"
@@select="handleSelect"
placeholder="输入物料编码或名称"
ref="materialInput">
</a-auto-complete>
</a-form-item>
<a-form-item field="materialName" label="物料名称">
<a-input v-model="MaterialName" disabled/>
</a-form-item>
<a-form-item field="materialSpec" label="物料型号">
<a-input v-model="MaterialSpec" disabled/>
</a-form-item>
<a-form-item field="qty" label="数量">
<a-input-number v-model="Qty" :min="0" style="width: 100%"/>
</a-form-item>
<a-form-item>
<a-space>
<a-button @@click="handleBind" type="primary">绑定</a-button>
<a-button @@click="handleClick" :loading="loading1" type="primary">入库</a-button>
</a-space>
</a-form-item>
</a-form>
<el-table :data="tableData" height="700" border
style="width: 100%">
<el-table-column prop="name"
label="唯一码"
align="center">
</el-table-column>
</el-table>
</el-card>
</el-col>
<el-col :span="18">
<el-card class="box-card" :span="16">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="单据名称">
<el-input v-model="form.code" readonly></el-input>
</el-form-item>
<el-form-item label="周转箱编码" prop="boxCode">
<el-input v-model="form.boxCode" @@change="scanBox" ref="boxCode"></el-input>
</el-form-item>
<el-form-item label="料盘尺寸" prop="size">
<el-select v-model="form.size" placeholder="请选择料盘尺寸" style="width:100%" @@change="changeSize" clearable>
<el-option v-for="item in form.boxSize"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<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"
ref="tableData"
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="receiptCode" v-if="false"></el-table-column>
<el-table-column label="周转箱" align="center" prop="boxCode"></el-table-column>
<el-table-column label="索引" align="center" prop="index"></el-table-column>
<el-table-column label="唯一码" align="center" prop="uniqueCode"></el-table-column>
<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 @@click="resetForm('form')">重置</el-button>
@* <el-button type="primary" @@click="inOperation">启动入库</el-button> *@
</el-form-item>
</el-form>
</el-card>
</el-col>
</el-row>
<a-table :data="bindList" :columns="columns" :pagination="false">
<template #operations="{ record }">
<a-space>
<a-button type="text" status="danger" @@click="handleDelete(record)">删除</a-button>
<a-button type="text" @@click="handleEdit(record)">修改</a-button>
<a-button type="text" @@click="handleDeduct(record)">扣料</a-button>
</a-space>
</template>
<template #qty="{ record }">
{{ Math.floor(record.Qty) }}
</template>
</a-table>
<a-modal v-model:visible="editModalVisible" title="修改数量" @@ok="handleEditConfirm" @@cancel="handleEditCancel">
<a-form :model="editForm">
<a-form-item field="qty" label="数量">
<a-input-number v-model="editForm.qty" :min="0" :precision="0" style="width: 100%"/>
</a-form-item>
</a-form>
</a-modal>
<a-modal v-model:visible="deductModalVisible" title="扣除数量" @@ok="handleDeductConfirm" @@cancel="handleDeductCancel">
<a-form :model="deductForm">
<a-form-item field="qty" label="扣除数量">
<a-input-number v-model="deductForm.qty" :min="0" :max="deductForm.maxQty" :precision="0" style="width: 100%"/>
</a-form-item>
</a-form>
</a-modal>
</a-space>
</div>
<script>
var app = new Vue({
el: '#plapp',
data() {
var validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入工位编码'));
}
else if (value == 'L01' || value == 'L02') {
callback();
} else {
callback(new Error('请输入正确工位编码'));
}
};
const { createApp, reactive, ref } = Vue
return {
form: {
code: '',
boxCode: '',
boxSize: [],
size: '',
uniqueCode: ''
},
options: [],
value: '',
tableData: [],
bindingData: [],
dataIndex: [],
rules: {
boxCode: [
{ validator: validatePass, trigger: 'blur' }
]
}
}
const app = createApp({
data() {
return {
ContainerCode: '',
MaterialCode: '',
MaterialName: '',
MaterialSpec: '',
Qty: null,
loading1: false,
materialOptions: [],
searchTimer: null,
bindList: [],
editModalVisible: false,
editForm: {
index: -1,
qty: 0
},
mounted: function () {
// 获取所有单据编码
$.ajax({
type: "post",
dataType: "json",
data: {},
url: "/receipt/ReceiptIn/SelectReceiptCode",
success: function (json) {
app.options = json.Data;
},
error: function (json) {
alert("加载失败");
}
});
deductModalVisible: false,
deductForm: {
index: -1,
qty: 0,
maxQty: 0
},
methods: {
sizeFormatter(row) {
return row.size + 'mm';
},
//绑定单据
onSubmit() {
var _this = this;
// 提交已绑定数据
$.ajax({
type: "post",
dataType: "json",
data: { data: _this.bindingData },
url: "/receipt/ReceiptIn/BindingData",
success: function (json) {
if (json.Code == 200) {
_this.$message({
message: '入库成功!',
type: 'success'
});
_this.resetForm('form');
}
else {
_this.$message({
message: '入库失败!',
type: 'warning'
});
}
},
error: function (json) {
_this.$message({
message: '入库失败!',
type: 'error'
});
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
this.form.boxSize = [];
this.bindingData = [];
},
clearReceipt() {
this.tableData = [];
},
// 选择单据后,查询明细
changeselect(data) {
var _this = this;
_this.form.code = data;
// 调用后台方法,查询单据明细数据
if (data != "") {
$.ajax({
type: "post",
dataType: "json",
data: { Code: data },
url: "/receipt/ReceiptIn/SelectReceipt",
success: function (json) {
_this.tableData = json.Data;
// 对比待绑定列表,删除在其表内的明细
_this.bindingData.forEach(function (item) {
_this.tableData.forEach(function (value, index, arr) {
if (value.name == item.uniqueCode) {
arr.splice(index, 1);
}
});
})
},
error: function (json) {
_this.$message({
message: '加载单据明细失败!',
type: 'error'
});
}
});
}
},
// 扫描周转箱
scanBox(Box) {
var _this = this;
_this.form.size = '';
_this.form.boxSize = [];
if (this.form.code == '') {
this.$message({
message: '请先选择单据!',
type: 'warning'
});
return;
}
$.ajax({
type: "post",
dataType: "json",
data: { boxCode: Box },
url: "/receipt/ReceiptIn/ScanBox",
success: function (json) {
if (json.Code != 200) {
_this.$message({
message: "扫描失败!" + json.Msg,
type: "warning",
duration: "10000",
});
_this.form.boxCode = "";
return false;
}
else {
_this.$message({
message: "扫描成功!",
type: "success",
duration: "10000",
});
_this.$refs.uniqueCode.focus();
if (Box == "L02") {
_this.form.boxSize = [{ label: "24mm", value: "24" }, { label: "16mm", value: "16" }, { label: "10mm", value: "10" }]
_this.dataIndex = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
}
else if (Box == "L01") {
_this.form.boxSize = [{ label: "8mm", value: "8" }];
_this.form.size = _this.form.boxSize[0].value;
_this.dataIndex = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
}
else {
_this.$message({
message: '输入周转箱编码不正确!',
type: 'warning'
});
return;
}
}
},
error: function (json) {
_this.$message({
message: "扫描失败!",
type: "error",
duration: "10000",
});
return;
},
});
// 重新扫描箱号后,待绑定列表清空
_this.bindingData = [];
_this.changeselect(_this.value);
// _this.$refs.uniqueCode.focus();
},
// 选择尺寸后
changeSize() {
this.$refs.uniqueCode.focus();
},
// 扫描唯一码
scanUniqueCode(data) {
if (this.form.code == '') {
this.$message({
message: '请先选择单据!',
type: 'warning'
});
return;
}
if (this.dataIndex.length == 0) {
this.$message({
message: '该周转箱已放满!',
type: 'warning'
});
this.form.uniqueCode = '';
return;
}
if (this.form.boxCode == '' || this.form.size == '') {
this.$message({
message: '请先输入周转箱编码并选择料盘尺寸!',
type: 'warning'
});
this.form.uniqueCode = '';
return;
}
var isExit = this.tableData.findIndex(function (value, index, arr) {
return value.name == data;
})
if (isExit == -1) {
this.$message({
message: '唯一码' + data + '不正确!',
type: 'warning'
});
this.form.uniqueCode = '';
return;
}
// 1.明细减少
this.tableData.forEach(function (item, index, arr) {
if (item.name == data) {
arr.splice(index, 1);
}
});
// 2.已扫描增加
this.bindingData.push({
receiptCode: this.form.code,
boxCode: this.form.boxCode,
index: this.dataIndex.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) {
if (this.form.code == rows[index].receiptCode) {
this.tableData.push({ name: rows[index].uniqueCode });
}
this.dataIndex.unshift(rows[index].index);
rows.splice(index, 1);
}
columns: [
{
title: 'ID',
dataIndex: 'Id',
width: 80
},
{
title: '容器编码',
dataIndex: 'ContainerCode',
},
{
title: '物料编码',
dataIndex: 'MaterialCode',
},
{
title: '物料名称',
dataIndex: 'MaterialName',
},
{
title: '物料型号',
dataIndex: 'MaterialSpec',
},
{
title: '数量',
dataIndex: 'Qty',
slotName: 'qty'
},
{
title: '操作',
slotName: 'operations',
width: 120
}
],
formData: {
containerCode: '',
materialCode: '',
materialName: '',
qty: 1
}
});
}
},
mounted() {
// 页面加载完成后,将焦点设置到容器编码输入框
this.$nextTick(() => {
this.$refs.containerInput.focus();
});
},
methods: {
handleSearch(value) {
if (this.searchTimer) {
clearTimeout(this.searchTimer);
}
this.searchTimer = setTimeout(() => {
if (value) {
this.searchMaterials(value);
} else {
this.materialOptions = [];
}
}, 300);
},
searchMaterials(keyword) {
var _this = this;
axios.get(`/receipt/ReceiptIn/SearchMaterials?keyword=${encodeURIComponent(keyword)}`)
.then(function (json) {
if (json.data.Code == 200) {
_this.materialOptions = json.data.Data.map(item => ({
...item,
value: item.MaterialCode,
label: `${item.MaterialCode} - ${item.MaterialName} - ${item.MaterialSpec}`
}));
} else {
_this.$message.error(json.data.Msg);
_this.materialOptions = [];
}
})
.catch(function (error) {
_this.$message.error(error);
_this.materialOptions = [];
});
},
handleSelect(value, option) {
const selectedMaterial = this.materialOptions.find(item => item.value === value);
if (selectedMaterial) {
this.MaterialCode = selectedMaterial.MaterialCode;
this.MaterialName = selectedMaterial.MaterialName;
this.MaterialSpec = selectedMaterial.MaterialSpec;
}
},
handleBind() {
if (!this.ContainerCode) {
this.$notification.error("请扫描箱号!");
return;
}
if (!this.MaterialCode) {
this.$notification.error("请选择物料!");
return;
}
if (!this.Qty || this.Qty <= 0 || !Number.isInteger(this.Qty)) {
this.$notification.error("请输入大于0的正整数!");
return;
}
// 检查已绑定物料的容器编码
if (this.bindList.length > 0) {
const firstBind = this.bindList[0];
if (firstBind.ContainerCode !== this.ContainerCode) {
this.$notification.warning("容器编码已变更,已清空绑定物料");
this.bindList = [];
}
}
// 添加到绑定列表
const bindItem = {
ContainerCode: this.ContainerCode,
MaterialCode: this.MaterialCode,
MaterialName: this.MaterialName,
MaterialSpec: this.MaterialSpec,
Qty: this.Qty
};
// 调用后端添加库存
let postData = new URLSearchParams();
postData.append('containerCode', this.ContainerCode);
postData.append('materialCode', this.MaterialCode);
postData.append('qty', this.Qty);
axios.post("/receipt/ReceiptIn/AddInventory", postData)
.then((json) => {
if (json.data.Code == 200) {
// 添加ID到绑定项
bindItem.Id = json.data.Data.Id;
this.bindList.push(bindItem);
this.$message.success("物料绑定成功");
// 清空表单
this.MaterialCode = '';
this.MaterialName = '';
this.MaterialSpec = '';
this.Qty = null;
// 验证成功后,将焦点设置到物料编码输入框
this.$nextTick(() => {
this.$refs.materialInput.focus();
});
} else {
this.$notification.error(json.data.Msg);
}
})
.catch((error) => {
this.$notification.error("物料绑定失败");
});
},
handleClick() {
if (!this.ContainerCode) {
this.$notification.error('请扫描箱号!');
return;
}
this.loading1 = true;
let postData = new URLSearchParams();
postData.append('containerCode', this.ContainerCode);
axios.post("/receipt/ReceiptIn/TaskIn", postData)
.then((json) => {
this.loading1 = false;
if (json.data.Code == 200) {
this.ContainerCode = '';
this.MaterialCode = '';
this.MaterialName = '';
this.Qty = 1;
this.bindList = [];
this.$notification.success("入库任务创建成功!");
} else {
this.$notification.error({
content: json.data.Msg,
duration: 5000,
closable: true
});
}
})
.catch((error) => {
this.loading1 = false;
this.$notification.error({
content: error,
duration: 5000,
closable: true
});
});
},
validateContainer() {
if (!this.ContainerCode) return;
axios.get(`/receipt/ReceiptIn/ValidateContainer?containerCode=${encodeURIComponent(this.ContainerCode)}`)
.then((json) => {
if (json.data.Code == 200) {
this.$message.success("容器验证成功");
// 更新绑定列表
this.bindList = json.data.Data;
// 验证成功后,将焦点设置到物料编码输入框
this.$nextTick(() => {
this.$refs.materialInput.focus();
});
} else {
this.$message.error(json.data.Msg || "容器验证失败");
this.ContainerCode = '';
this.bindList = [];
}
})
.catch((error) => {
this.$message.error("容器验证失败");
this.ContainerCode = '';
this.bindList = [];
});
},
handleDelete(record) {
const index = this.bindList.findIndex(item => item.Id === record.Id);
if (index > -1) {
// 调用后端删除库存
let postData = new URLSearchParams();
postData.append('id', record.Id);
axios.post("/receipt/ReceiptIn/DeleteInventory", postData)
.then((json) => {
if (json.data.Code == 200) {
this.bindList.splice(index, 1);
this.$message.success("删除成功");
} else {
this.$message.error(json.data.Msg);
}
})
.catch((error) => {
this.$message.error("删除失败");
});
}
},
handleEdit(record) {
this.editForm.index = this.bindList.findIndex(item => item.Id === record.Id);
this.editForm.qty = Math.floor(record.Qty);
this.editModalVisible = true;
},
handleEditConfirm() {
if (this.editForm.index > -1) {
if (!this.editForm.qty || this.editForm.qty <= 0 || !Number.isInteger(this.editForm.qty)) {
this.$notification.error("请输入大于0的正整数!");
return;
}
const record = this.bindList[this.editForm.index];
// 调用后端更新库存
let postData = new URLSearchParams();
postData.append('id', record.Id);
postData.append('qty', this.editForm.qty);
axios.post("/receipt/ReceiptIn/UpdateInventory", postData)
.then((json) => {
if (json.data.Code == 200) {
this.bindList[this.editForm.index].Qty = this.editForm.qty;
this.$notification.success("修改成功");
this.editModalVisible = false;
} else {
this.$notification.error(json.data.Msg);
}
})
.catch((error) => {
this.$notification.error("修改失败");
});
}
},
handleEditCancel() {
this.editModalVisible = false;
this.editForm.index = -1;
this.editForm.qty = 1;
},
handleDeduct(record) {
this.deductForm.index = this.bindList.findIndex(item => item.Id === record.Id);
this.deductForm.qty = null;
this.deductForm.maxQty = Math.floor(record.Qty);
this.deductModalVisible = true;
},
handleDeductConfirm() {
if (this.deductForm.index > -1) {
const record = this.bindList[this.deductForm.index];
if (!this.deductForm.qty) {
this.$notification.error("请输入扣除数量");
return;
}
if (!Number.isInteger(this.deductForm.qty) || this.deductForm.qty <= 0) {
this.$notification.error("请输入大于0的正整数!");
return;
}
if (this.deductForm.qty > record.Qty) {
this.$notification.error("扣除数量不能大于当前数量");
return;
}
const newQty = record.Qty - this.deductForm.qty;
if (newQty == 0) {
// 如果扣除后数量等于0,直接删除
this.handleDelete(record);
} else {
// 调用后端更新库存
let postData = new URLSearchParams();
postData.append('id', record.Id);
postData.append('qty', newQty);
axios.post("/receipt/ReceiptIn/UpdateInventory", postData)
.then((json) => {
if (json.data.Code == 200) {
this.bindList[this.deductForm.index].Qty = newQty;
this.$notification.success("扣除成功");
this.deductModalVisible = false;
} else {
this.$notification.error(json.data.Msg);
}
})
.catch((error) => {
this.$notification.error("扣除失败");
});
}
}
},
handleDeductCancel() {
this.deductModalVisible = false;
this.deductForm.index = -1;
this.deductForm.qty = 1;
this.deductForm.maxQty = 0;
}
}
});
app.use(ArcoVue)
.use(ArcoVueIcon)
.mount('#receiptin');
</script>
@@ -1,3 +1,6 @@
using System;
using System.Linq;
using HHWMS.Web.Models;
using Microsoft.AspNetCore.Mvc;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Mvc;
@@ -24,4 +27,116 @@ public class ShipOutController : BaseController
}
#endregion
[HttpPost]
public IActionResult CallBox()
{
// 查找库位状态为空容器的库位
var location = _unitWork.FindSingle<Location>(x => x.Status == LocationStatus.空容器);
if (location != null)
{
location.Status = LocationStatus.任务锁;
location.UpdateTime = DateTime.Now;
location.UpdateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS";
_unitWork.Update(location);
// 查找container,并更新状态
var container = _unitWork.FindSingle<Container>(x => x.Code == location.ContainerCode);
container.IsLock = ContainerLockEnum.任务锁;
container.UpdateTime = DateTime.Now;
container.UpdateBy = Wtm.LoginUserInfo?.ITCode ?? "WMS";
_unitWork.Update(container);
//创建出库任务
var task = new TaskHeader
{
ZoneCode = ZoneCodeEnum.立库,
TaskNo = _unitWork.GetSerialNumber("Out"),
TaskType = TaskTypeEnum.立库出库,
ContainerCode = location.ContainerCode,
FromLocation = location.Code,
ToLocation = "",
Station = "1",
Status = TaskStatusEnum.待下发,
CreateBy = Wtm.LoginUserInfo?.ITCode??"WMS",
CreateTime = DateTime.Now
};
_unitWork.Add(task);
// 下发任务到wcs
var postData = new
{
TaskNo = task.TaskNo,
PalletNo = task.ContainerCode,
FromLocation = task.FromLocation,
ToLocation = task.ToLocation
};
try
{
var res = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, postData)
.Result.Data;
if (res.Success)
{
task.Status = TaskStatusEnum.已下发;
}
else
{
task.ErrorMsg = res.Msg;
}
}
catch (Exception ex)
{
task.ErrorMsg = ex.Message;
}
task.UpdateTime = DateTime.Now;
task.UpdateBy = "WMS";
_unitWork.Update(task);
return JsonMore(null);
}
else
{
return JsonMore(null, 500, "库内无可用空容器!");
}
}
public IActionResult AgvTask(string type)
{
try
{
var ids = Wtm.ConfigInfo.AppSettings.ToList();
var task_id = type switch
{
"In" => ids.FirstOrDefault(x => x.Key == "In").Value,
"Out" => ids.FirstOrDefault(x => x.Key == "Out").Value,
"Charge" => ids.FirstOrDefault(x => x.Key == "Charge").Value,
"OutIn" => ids.FirstOrDefault(x => x.Key == "OutIn").Value,
_ => throw new Exception("参数错误!")
};
var res = Wtm.CallAPI<agvResult>("ACS", "task_mould_do", HttpMethodEnum.POST, new
{
task_id = task_id
});
if (res.Result.Data.ack != 0)
{
return JsonMore(null, 500, res.Result.Data.msg);
}
return JsonMore(null);
}
catch (Exception ex)
{
return JsonMore(null, 500, ex.Message);
}
}
public class agvResult
{
public int ack { get; set; }
public string msg { get; set; }
public dynamic data { get; set; }
}
}
@@ -66,32 +66,6 @@ namespace HHWMS.Web.Controllers
}
else
{
if (string.IsNullOrEmpty(vm.Entity.UniqueCode))
{
return FFResult().Alert($"唯一码不能为空!");
}
var header = _unitwork.FindSingle<ShipmentHeader>(x => x.ID == vm.Entity.ShipmentHeaderId);
if (header != null && header.FirstStatus != ShipStatusEnum.新建)
{
return FFResult().Alert($"非新建状态的出库单,无法新建明细!");
}
var inv = _unitwork.FindSingle<Inventory>(x => x.UniqueCode == vm.Entity.UniqueCode
&& x.TaskStatus != InventoryTaskStatus.任务中);
if(inv == null)
{
return FFResult().Alert($"{vm.Entity.UniqueCode}不存在或已有任务,检查后重新添加!");
}
if(_unitwork.IsExit<ShipmentDetail>(x => x.UniqueCode == vm.Entity.UniqueCode))
{
return FFResult().Alert($"{vm.Entity.UniqueCode}已在出库单内,请勿重复添加!");
}
vm.Entity.MaterialCode = inv.MaterialCode;
vm.Entity.MaterialName = inv.MaterialName;
vm.Entity.MaterialSpec = inv.MaterialSpec;
vm.Entity.MaterialUnit = inv.MaterialUnit;
vm.Entity.MaterialType = inv.MaterialType;
vm.Entity.Batch = inv.Batch;
vm.Entity.Qty = inv.Qty;
vm.Entity.Status = ShipStatusEnum.新建;
vm.DoAdd();
if (!ModelState.IsValid)
@@ -231,82 +231,7 @@ namespace HHWMS.Web.Controllers
return vm.GetExportData();
}
#endregion
/// <summary>
/// 库位分析
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[ActionDescription("ShipmentHeader.Analyse")]
public ActionResult Analyse(string id)
{
var vm = Wtm.CreateVM<ShipmentHeaderVM>(id);
return PartialView(vm);
}
/// <summary>
/// 返回分析数据
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[ActionDescription("ShipmentHeader.Analyse")]
[HttpPost]
public ActionResult AnalyseData(int id)
{
var data = _unitwork.Find<ShipmentHeader>(x => x.ID == id)
.Include(x => x.ShipmentDetails).ToList();
var details = data.FirstOrDefault().ShipmentDetails.Where(x => x.Status < ShipStatusEnum.分配完成);
foreach (var item in details)
{
var invQty = _unitwork.FindSingle<Inventory>(x =>
x.UniqueCode.Equals(item.UniqueCode)
&& x.TaskStatus == InventoryTaskStatus.无任务);
item.InventoryStatus = invQty != null ? "满足" : "不足";
}
return JsonMore(details);
}
[ActionDescription("ShipmentHeader.ShelfInv")]
public ActionResult ShelfInv(string id)
{
var vm = Wtm.CreateVM<ShipmentHeaderVM>(id);
return PartialView(vm);
}
/// <summary>
/// 货架库存
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[ActionDescription("ShipmentHeader.ShelfInv")]
public ActionResult ShelfInvData(int id)
{
var data = _unitwork.Find<ShipmentHeader>(x => x.ID == id)
.Include(x => x.ShipmentDetails)
.FirstOrDefault();
var details = data.ShipmentDetails.Where(x => x.Status < ShipStatusEnum.分配完成)
.Select(x => x.UniqueCode)
.ToList();
var invList = _unitwork.Find<Inventory>(x => x.ZoneCode.Equals(ZoneCodeEnum.货架库)
&& x.TaskStatus.Equals(InventoryTaskStatus.无任务)
&& details.Contains(x.UniqueCode))
.ToList();
//var details = data.ShipmentDetails.Where(x => invList.Contains(x.UniqueCode));
return JsonMore(invList);
}
/// <summary>
/// 获取库存数据
/// </summary>
/// <param name="uniqueCode"></param>
/// <returns></returns>
[HttpPost]
public ActionResult GetInvData(string uniqueCode)
{
var data = _unitwork.Find<Inventory>(x => x.UniqueCode == uniqueCode).ToList();
return JsonMore(data);
}
/// <summary>
/// 启动出库
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
@@ -12,7 +12,7 @@ namespace HHWMS.Web
{
public partial class ShipmentDetailHistoryTemplateVM : BaseTemplateVM
{
public ExcelPropety ShipmentHeaderHistory_Excel = ExcelPropety.CreateProperty<ShipmentDetailHistory>(x => x.ShipmentHeaderHistoryId);
public ExcelPropety ShipmentHeaderHistory_Excel = ExcelPropety.CreateProperty<ShipmentDetailHistory>(x => x.HeaderId);
[Display(Name = "Task.ZoneCode")]
public ExcelPropety ZoneCode_Excel = ExcelPropety.CreateProperty<ShipmentDetailHistory>(x => x.ZoneCode);
[Display(Name = "Inventory.MaterialCode")]
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -32,7 +32,7 @@ namespace HHWMS.Web
protected override IEnumerable<IGridColumn<ShipmentDetailHistory_View>> InitGridHeader()
{
return new List<GridColumn<ShipmentDetailHistory_View>>{
this.MakeGridHeader(x => x.Code_view),
this.MakeGridHeader(x => x.HeaderId),
this.MakeGridHeader(x => x.ZoneCode),
this.MakeGridHeader(x => x.MaterialCode),
this.MakeGridHeader(x => x.MaterialType),
@@ -57,7 +57,7 @@ namespace HHWMS.Web
public override IOrderedQueryable<ShipmentDetailHistory_View> GetSearchQuery()
{
var query = DC.Set<ShipmentDetailHistory>()
.CheckEqual(Searcher.ShipmentHeaderHistoryId, x=>x.ShipmentHeaderHistoryId)
.CheckEqual(Searcher.ShipmentHeaderHistoryId, x=>x.HeaderId)
.CheckContain(Searcher.ZoneCode, x=>x.ZoneCode)
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
.CheckContain(Searcher.MaterialType, x=>x.MaterialType)
@@ -72,7 +72,7 @@ namespace HHWMS.Web
.Select(x => new ShipmentDetailHistory_View
{
ID = x.ID,
Code_view = x.ShipmentHeaderHistory.Code,
HeaderId = x.HeaderId,
ZoneCode = x.ZoneCode,
MaterialCode = x.MaterialCode,
MaterialType = x.MaterialType,
@@ -98,8 +98,6 @@ namespace HHWMS.Web
}
public class ShipmentDetailHistory_View : ShipmentDetailHistory{
[Display(Name = "Inventory.ShipCode")]
public String Code_view { get; set; }
}
}
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -16,7 +16,6 @@ namespace HHWMS.Web
public ShipmentDetailHistoryVM()
{
SetInclude(x => x.ShipmentHeaderHistory);
}
protected override void InitVM()
@@ -7,7 +7,7 @@ namespace HHWMS.Web
{
public partial class ShipmentDetailTemplateVM : BaseTemplateVM
{
public ExcelPropety ShipmentHeader_Excel = ExcelPropety.CreateProperty<ShipmentDetail>(x => x.ShipmentHeaderId);
public ExcelPropety ShipmentHeader_Excel = ExcelPropety.CreateProperty<ShipmentDetail>(x => x.HeaderId);
[Display(Name = "Task.ZoneCode")]
public ExcelPropety ZoneCode_Excel = ExcelPropety.CreateProperty<ShipmentDetail>(x => x.ZoneCode);
@@ -41,7 +41,6 @@ namespace HHWMS.Web
if (SearcherMode == ListVMSearchModeEnum.MasterDetail)
{
return new List<GridColumn<ShipmentDetail_View>>{
this.MakeGridHeader(x => x.UniqueCode).SetWidth(220),
this.MakeGridHeader(x => x.MaterialCode),
this.MakeGridHeader(x => x.Batch),
this.MakeGridHeader(x => x.Qty),
@@ -51,7 +50,6 @@ namespace HHWMS.Web
else if (SearcherMode == ListVMSearchModeEnum.Custom1)
{
return new List<GridColumn<ShipmentDetail_View>>{
this.MakeGridHeader(x => x.UniqueCode).SetWidth(220),
this.MakeGridHeader(x => x.MaterialCode),
this.MakeGridHeader(x => x.Batch),
this.MakeGridHeader(x => x.Qty),
@@ -87,31 +85,24 @@ namespace HHWMS.Web
InitVM();
if (SearcherMode == ListVMSearchModeEnum.Custom1) {
var tt = DC.Set<ShipmentDetail>()
.CheckEqual(Searcher.ShipmentHeaderId, x => x.ShipmentHeaderId)
.CheckEqual(Searcher.HeaderId, x => x.HeaderId)
.Select(x => new ShipmentDetail_View
{
ID = x.ID,
UniqueCode = x.UniqueCode,
MaterialCode = x.MaterialCode,
Batch = x.Batch,
Qty = x.Qty,
InventoryStatus = x.InventoryStatus,
Status = x.Status
}).ToList();
foreach(var item in tt.Where(x => x.Status < ShipStatusEnum.分配完成))
{
var invQty = _unitWork.Find<Inventory>(x => x.UniqueCode.Equals(item.UniqueCode))
.Sum(x => x.Qty);
item.InventoryStatus = invQty >= (item.Qty - item.DividedQty) ? "true" : "false";
}
return (IOrderedQueryable<ShipmentDetail_View>)tt.OrderBy(x => x.ID);
}
else
{
var query = DC.Set<ShipmentDetail>()
.CheckEqual(Searcher.ShipmentHeaderId, x => x.ShipmentHeaderId)
.CheckEqual(Searcher.HeaderId, x => x.HeaderId)
.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)
@@ -125,7 +116,6 @@ namespace HHWMS.Web
{
ID = x.ID,
Code_view = x.ShipmentHeader.Code,
UniqueCode = x.UniqueCode,
ZoneCode = x.ZoneCode,
MaterialCode = x.MaterialCode,
MaterialType = x.MaterialType,
@@ -12,7 +12,7 @@ namespace HHWMS.Web
public List<ComboSelectListItem> AllShipmentHeaders { get; set; }
[Display(Name = "Inventory.ShipCode")]
public int? ShipmentHeaderId { get; set; }
public int? HeaderId { get; set; }
[Display(Name = "Task.ZoneCode")]
public String ZoneCode { get; set; }
@@ -21,7 +21,7 @@ namespace HHWMS.Web
protected override void InitVM()
{
Details.CopyContext(this);
Details.Searcher.ShipmentHeaderId = Entity.ID;
Details.Searcher.HeaderId = Entity.ID;
var CurrentCulture = Wtm.CurrentCulture;
var dictDatas = DC.Set<SysDictData>().ToList();
@@ -1,299 +1,101 @@
<el-row id="outapp">
<el-card class="box-card" :span="16">
<el-form ref="form" :model="form" label-width="100px">
<el-row>
<el-col :span="4">
<el-form-item label="类型" prop="type">
<el-select v-model="form.type"
placeholder="请选择类型"
style="width: 100%"
@@change="select"
>
<el-option v-for="item in taskType"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="16">
<el-input v-model="form.code"
placeholder="请扫描"
@@change="scanCode">
</el-input>
</el-col>
</el-row>
<el-row v-show="showTable">
<el-divider></el-divider>
<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>
<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>
</el-row>
<el-divider></el-divider>
<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-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料码" prop="materialCode">
<el-input v-model="form.materialCode" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="规格型号" prop="materialSpec">
<el-input v-model="form.materialSpec" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="批次" prop="batch">
<el-input v-model="form.batch" readonly></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数量" prop="qty">
<el-input v-model.number="form.qty" ref="qty" ></el-input>
</el-form-item>
</el-col>
<div id="shipout">
<a-space direction="vertical" fill :size="large">
@* <a-input :style="{width:'320px'}" placeholder="扫描箱号" v-model="ContainerCode" allow-clear/> *@
<a-button @@click="handleClick"
:loading="loading1"
type="primary"
size="large">
呼叫出库
</a-button>
<el-form-item style="float:right">
<el-button type="primary" @@click="onSubmit">拣货</el-button>
<el-button v-show="showBack" type="success" @@click="back">回库</el-button>
</el-form-item>
</el-row>
</el-form>
</el-card>
</el-row>
<a-divider />
<a-space>
<template #split>
<a-divider direction="vertical" />
</template>
<a-button @@click='handleAGVTask("OutIn")'
:loading="loading2"
type="primary"
status="warning"
size="large">
入库
</a-button>
<a-button @@click='handleAGVTask("Charge")'
:loading="loading2"
type="primary"
status="success"
size="large">
充电任务
</a-button>
@* <a-button @@click='handleAGVTask("Out")' *@
@* :loading="loading2" *@
@* type="outline" *@
@* size="large"> *@
@* 到出库点 *@
@* </a-button> *@
</a-space>
</a-space>
</div>
<script>
var app = new Vue({
el: "#outapp",
data() {
return {
form: {
type:"",
code: "",
uniqueCode: "",
materialCode: "",
materialSpec: "",
batch: "",
qty: ""
},
type: "",
taskType: [
{ label: "散料站台", value: "slbox" },
{ label: "料塔周转箱", value: "lt" },
{ label: "唯一码", value: "uniqueCode" },
],
invTable:[],
showTable: false,
showBack: false
};
},
methods: {
// 选中行
selectdata(data) {
this.form.uniqueCode = data.UniqueCode;
this.form.materialCode = data.MaterialCode;
this.form.materialSpec = data.MaterialSpec;
this.form.batch = data.Batch;
this.form.qty = data.Qty;
},
select(data) {
this.form.code = "";
this.form.type = data;
this.invTable = [];
if (this.invTable.length == 0
&& this.form.type == "slbox"
&& this.form.code.startsWith("C")) {
this.showBack = true;
}
},
// 扫描料塔站台号
scanCode(data) {
var _this = this;
if (_this.form.type == "") {
_this.$message({
message: "请先选择操作类型!",
type: "warning",
duration: "10000",
});
_this.form.code = "";
return;
}
let url = "";
if (_this.form.type == "uniqueCode") {
url = "/shipment/ShipOut/ScanUniqueCode"
}
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;
} 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",
});
},
});
},
// 拣货
onSubmit() {
var _this = this;
if (_this.form.uniqueCode == "") {
_this.$message({
message: "未选择出库明细!",
type: "warning",
duration: "10000",
});
return;
}
// 提交已绑定数据
$.ajax({
type: "post",
dataType: "json",
data: { uniqueCode: _this.form.uniqueCode, qty: _this.form.qty, station: _this.form.code },
url: "/shipment/ShipOut/Pick",
success: function (json) {
if (json.Code == 200) {
_this.$message({
message: "拣货成功!",
});
// 删除invTable 对应的 uniqueCode行
_this.invTable.forEach(function (value, index, arr) {
if (value.UniqueCode == _this.form.uniqueCode) {
arr.splice(index, 1);
}
});
if (_this.invTable.length == 0
&& _this.form.type == "slbox"
&& _this.form.code.startsWith("C")) {
_this.showBack = true;
}
if (_this.form.code == "uniqueCode") {
_this.form.code = "";
}
// 清空下面表单 不清空code
_this.form.uniqueCode = "";
_this.form.materialCode = "";
_this.form.materialSpec = "";
_this.form.batch = "";
_this.form.qty = "";
// _this.$refs['form'].resetFields();
} else {
_this.$message({
message: "提交失败!"+json.Msg,
type: "warning",
duration: "10000",
});
}
},
error: function (json) {
_this.$message({
message: "提交失败!",
type: "error",
duration: "10000",
});
},
});
},
// 回库
back() {
var _this = this;
// 创建回库任务
if (_this.form.code == "") {
_this.$message({
message: "箱号为空,不能创建回库任务!",
type: "error",
duration: "1000",
});
return;
}
if (_this.invTable.length > 0) {
_this.$message({
message: "存在未拣货库存,不能创建回库任务!",
type: "error",
duration: "1000",
});
return;
}
this.$confirm('确定执行回库动作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$.ajax({
type: "post",
dataType: "json",
data: { boxCode: _this.form.code, isFull: _this.form.isFull },
url: "/shipment/ShipOut/BoxBack",
success: function (json) {
if (json.Code != 200) {
_this.$message({
message: "回库任务创建失败!" + json.Msg,
type: "warning",
duration: "10000",
});
} else {
_this.$message({
message: "回库任务创建成功!"
});
_this.resetForm('form');
}
},
error: function (json) {
_this.$message({
message: "回库任务创建失败!",
type: "error",
duration: "10000",
});
},
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
const { createApp, reactive, ref } = Vue
const app = createApp({
data() {
return {
ContainerCode: '',
loading1:false,
loading2:false,
data: reactive([])
}
},
methods: {
handleClick() {
var _this = this;
_this.loading1 = !_this.loading1
axios.post("/shipment/Shipout/CallBox", {})
.then(function (json) {
_this.loading1 = !_this.loading1;
if (json.data.Code == 200){
_this.$message.success("呼叫料盒任务创建成功!");
}
},
});
else{
_this.$message.error(json.data.Msg);
}
})
.catch(function (error) {
_this.$message.error(error);
});
},
handleAGVTask(val) {
var _this = this;
_this.loading2 = !_this.loading2
let postData = new URLSearchParams();
postData.append('type', val);
axios.post("/shipment/Shipout/AgvTask", postData)
.then(function (json) {
_this.loading2 = !_this.loading2;
if (json.data.Code == 200){
_this.$message.success("任务创建成功!");
}
else{
_this.$message.error(json.data.Msg);
}
})
.catch(function (error) {
_this.$message.error(error);
});
}
}
});
app.use(ArcoVue)
.use(ArcoVueIcon)
.mount('#shipout');
</script>
@@ -3,8 +3,7 @@
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:combobox field="Entity.ShipmentHeaderId" items="AllShipmentHeaders"/>
<wt:textbox field="Entity.UniqueCode" />
<wt:combobox field="Entity.HeaderId" items="AllShipmentHeaders" />
@* <wt:textbox field="Entity.ZoneCode" />
<wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialType" />
@@ -1,9 +1,9 @@
@model HHWMS.Web.ShipmentDetailVM
@model HHWMS.Web.ShipmentDetailVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:combobox field="Entity.ShipmentHeaderId" items="AllShipmentHeaders"/>
<wt:combobox field="Entity.HeaderId" items="AllShipmentHeaders" />
<wt:textbox field="Entity.ZoneCode" />
<wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialType" />
@@ -3,7 +3,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:combobox field="Searcher.HeaderId" items="Searcher.AllShipmentHeaders" empty-text="@Localizer["Sys.All"]" />
<wt:textbox field="Searcher.ZoneCode" />
<wt:textbox field="Searcher.MaterialCode" />
<wt:textbox field="Searcher.MaterialType" />
@@ -1,9 +1,9 @@
@model HHWMS.Web.ShipmentDetailHistoryVM
@model HHWMS.Web.ShipmentDetailHistoryVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:combobox field="Entity.ShipmentHeaderHistoryId" items="AllShipmentHeaderHistorys"/>
<wt:combobox field="Entity.HeaderId" items="AllShipmentHeaderHistorys" />
<wt:textbox field="Entity.ZoneCode" />
<wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialType" />
@@ -1,10 +1,10 @@
@model HHWMS.Web.ShipmentDetailHistoryVM
@model HHWMS.Web.ShipmentDetailHistoryVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:quote>@Localizer["Sys.DeleteConfirm"]</wt:quote>
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.ShipmentHeaderHistory.Code" />
<wt:display field="Entity.HeaderId" />
<wt:display field="Entity.ZoneCode" />
<wt:display field="Entity.MaterialCode" />
<wt:display field="Entity.MaterialType" />
@@ -1,9 +1,9 @@
@model HHWMS.Web.ShipmentDetailHistoryVM
@model HHWMS.Web.ShipmentDetailHistoryVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.ShipmentHeaderHistory.Code" />
<wt:display field="Entity.HeaderId" />
<wt:display field="Entity.ZoneCode" />
<wt:display field="Entity.MaterialCode" />
<wt:display field="Entity.MaterialType" />
@@ -1,9 +1,9 @@
@model HHWMS.Web.ShipmentDetailHistoryVM
@model HHWMS.Web.ShipmentDetailHistoryVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:combobox field="Entity.ShipmentHeaderHistoryId" items="AllShipmentHeaderHistorys"/>
<wt:combobox field="Entity.HeaderId" items="AllShipmentHeaderHistorys" />
<wt:textbox field="Entity.ZoneCode" />
<wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialType" />
@@ -144,7 +144,7 @@ namespace HHWMS.Web.Controllers
}
else
{
return FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID);
return FFResult().CloseDialog().RefreshGrid(index:1);
}
}
}
@@ -172,7 +172,7 @@ namespace HHWMS.Web.Controllers
}
else
{
return FFResult().CloseDialog().RefreshGrid();
return FFResult().CloseDialog().RefreshGrid(index:1);
}
}
@@ -0,0 +1,78 @@
using System;
using System.Threading.Tasks;
using HHWMS.Web.Models;
using Quartz;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Support.Quartz;
using Microsoft.Extensions.DependencyInjection;
using HHWMS.Web.Services;
using System.Linq;
namespace HHWMS.Web
{
//[QuartzRepeat(5,5, true, -1)]
[PersistJobDataAfterExecution]
[DisallowConcurrentExecution]
public class MqttMessageJob : WtmJob
{
public override async Task Execute(IJobExecutionContext context)
{
try
{
var _unitwork = new UnitWork(Wtm);
var _channel = Wtm.ServiceProvider.GetRequiredService<MqttMessageChannel>();
Wtm.DoLog("执行MQTT消息消费", ActionLogTypesEnum.Job, "MqttMessageJob");
// Drain the channel and process messages
while (_channel.Reader.TryRead(out var message))
{
try
{
message.IsProcessed = true;
message.ProcessTime = DateTime.Now;
message.ProcessResult = "Success";
_unitwork.Add(message);
}
catch(Exception ex)
{
message.IsProcessed = true;
message.ProcessTime = DateTime.Now;
message.ProcessResult = $"Error: {ex.Message}";
_unitwork.Add(message);
}
}
await _unitwork.SaveChangesAsync();
#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
);
if (context.NextFireTimeUtc != null)
{
job.NextFireTime = TimeZoneInfo.ConvertTimeFromUtc(
context.NextFireTimeUtc.Value.DateTime,
TimeZoneInfo.Local
);
}
_unitwork.Update<SysJob>(job);
await _unitwork.SaveChangesAsync();
}
#endregion
}
catch(Exception ex)
{
Wtm.DoLog("处理MQTT消息异常", ActionLogTypesEnum.Job, "MqttMessageJob", request:"error", result:ex.Message);
}
}
}
}
@@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using HHWMS.Web.Models;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using Quartz;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Support.Quartz;
@@ -22,25 +16,60 @@ namespace HHWMS.Web
{
try
{
var _unitwork = new UnitWork(Wtm);
var _unitWork = new UnitWork(Wtm);
var task = _unitWork.FindSingle<TaskHeader>(x => x.Status == TaskStatusEnum.待下发);
if (task != null)
{
// 下发任务到wcs
var postData = new
{
TaskNo = task.TaskNo,
PalletNo = task.ContainerCode,
FromLocation = task.FromLocation,
ToLocation = task.ToLocation
};
var res1 = Wtm.CallAPI<ApiJsonResult<dynamic>>("WCS", "TaskAssign", HttpMethodEnum.POST, postData);
var res = res1.Result.Data;
if (res.Success)
{
task.Status = TaskStatusEnum.已下发;
}
else
{
task.ErrorMsg = res.Msg;
}
task.UpdateTime = DateTime.Now;
task.UpdateBy = "WMS";
_unitWork.Update(task);
}
Wtm.DoLog("下发WCS任务", ActionLogTypesEnum.Job, "SendWcsJob");
#region 更新时间
var job = _unitwork.FindSingle<SysJob>(x => x.JobName == context.JobDetail.Key.Name);
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);
_unitWork.Update<SysJob>(job);
}
Wtm.DoLog("任务下发", ActionLogTypesEnum.Job, "SendWcsJob");
#endregion 更新时间
#endregion
}
catch(Exception ex) {
Wtm.DoLog("下发WCS任务", ActionLogTypesEnum.Job, "SendWcsJob", request:"error", result:ex.Message);
}
catch { }
return Task.CompletedTask;
}
}
@@ -1,43 +0,0 @@
using System;
using System.Threading.Tasks;
using HHWMS.Web.Models;
using Quartz;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Support.Quartz;
namespace HHWMS.Web
{
//[QuartzRepeat(10,10, true, 30)]
//出库单据分解,为每个出库物料创建出库明细,状态为新建,通过唯一码绑定任务与库存
[PersistJobDataAfterExecution]
[DisallowConcurrentExecution]
public class SendWmsJob : WtmJob
{
public override Task Execute(IJobExecutionContext context)
{
try
{
var _unitwork = new UnitWork(Wtm);
#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);
// 只执行一次 没有下次执行时间
if (context.NextFireTimeUtc != null)
{
job.NextFireTime = TimeZoneInfo.ConvertTimeFromUtc(context.NextFireTimeUtc.Value.DateTime, TimeZoneInfo.Local);
}
_unitwork.Update<SysJob>(job);
}
Wtm.DoLog("出库分解", ActionLogTypesEnum.Job, "SendWmsJob");
#endregion 更新时间
}
catch { }
return Task.CompletedTask;
}
}
}
@@ -42,7 +42,9 @@ namespace HHWMS.Web
}
#endregion
}
catch { }
catch(Exception ex) {
Wtm.DoLog("测试", ActionLogTypesEnum.Job, "TestJob", request:"error", result:ex.Message);
}
return Task.CompletedTask;
}
}
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
@@ -12,7 +12,7 @@ namespace HHWMS.Web
{
public partial class TaskDetailHistoryTemplateVM : BaseTemplateVM
{
public ExcelPropety TaskHeader_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.TaskHeaderId);
public ExcelPropety TaskHeader_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.HeaderId);
[Display(Name = "Inventory.ReceiptCode")]
public ExcelPropety OrderCode_Excel = ExcelPropety.CreateProperty<TaskDetailHistory>(x => x.OrderCode);
[Display(Name = "Inventory.ReceiptDetailId")]
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -32,7 +32,7 @@ namespace HHWMS.Web
protected override IEnumerable<IGridColumn<TaskDetailHistory_View>> InitGridHeader()
{
return new List<GridColumn<TaskDetailHistory_View>>{
this.MakeGridHeader(x => x.TaskNo_view),
this.MakeGridHeader(x => x.HeaderId),
this.MakeGridHeader(x => x.OrderCode),
this.MakeGridHeader(x => x.OrderDetailId),
this.MakeGridHeader(x => x.MaterialCode),
@@ -52,7 +52,7 @@ namespace HHWMS.Web
public override IOrderedQueryable<TaskDetailHistory_View> GetSearchQuery()
{
var query = DC.Set<TaskDetailHistory>()
.CheckEqual(Searcher.TaskHeaderId, x=>x.TaskHeaderId)
.CheckEqual(Searcher.TaskHeaderId, x=>x.HeaderId)
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
.CheckContain(Searcher.MaterialName, x=>x.MaterialName)
.CheckContain(Searcher.MaterialSpec, x=>x.MaterialSpec)
@@ -63,7 +63,7 @@ namespace HHWMS.Web
.Select(x => new TaskDetailHistory_View
{
ID = x.ID,
TaskNo_view = x.TaskHeader.TaskNo,
HeaderId = x.HeaderId,
OrderCode = x.OrderCode,
OrderDetailId = x.OrderDetailId,
MaterialCode = x.MaterialCode,
@@ -84,8 +84,6 @@ namespace HHWMS.Web
}
public class TaskDetailHistory_View : TaskDetailHistory{
[Display(Name = "Task.TaskNo")]
public String TaskNo_view { get; set; }
}
}
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@@ -16,7 +16,6 @@ namespace HHWMS.Web
public TaskDetailHistoryVM()
{
SetInclude(x => x.TaskHeader);
}
protected override void InitVM()
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
@@ -12,13 +12,11 @@ namespace HHWMS.Web
{
public partial class TaskDetailTemplateVM : BaseTemplateVM
{
public ExcelPropety TaskHeader_Excel = ExcelPropety.CreateProperty<TaskDetail>(x => x.TaskHeaderId);
public ExcelPropety TaskHeader_Excel = ExcelPropety.CreateProperty<TaskDetail>(x => x.HeaderId);
[Display(Name = "Inventory.ReceiptCode")]
public ExcelPropety OrderCode_Excel = ExcelPropety.CreateProperty<TaskDetail>(x => x.OrderCode);
[Display(Name = "Inventory.ReceiptDetailId")]
public ExcelPropety OrderDetailId_Excel = ExcelPropety.CreateProperty<TaskDetail>(x => x.OrderDetailId);
[Display(Name = "Inventory.UniqueCode")]
public ExcelPropety UniqueCode_Excel = ExcelPropety.CreateProperty<TaskDetail>(x => x.UniqueCode);
[Display(Name = "Inventory.MaterialCode")]
public ExcelPropety MaterialCode_Excel = ExcelPropety.CreateProperty<TaskDetail>(x => x.MaterialCode);
[Display(Name = "Inventory.MaterialName")]
@@ -35,7 +35,6 @@ namespace HHWMS.Web
this.MakeGridHeader(x => x.TaskNo_view),
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.MaterialName).SetHide(),
this.MakeGridHeader(x => x.MaterialSpec).SetHide(),
@@ -55,7 +54,6 @@ namespace HHWMS.Web
public override IOrderedQueryable<TaskDetail_View> GetSearchQuery()
{
var query = DC.Set<TaskDetail>()
.CheckContain(Searcher.UniqueCode, x=>x.UniqueCode)
.CheckContain(Searcher.MaterialCode, x=>x.MaterialCode)
.CheckContain(Searcher.FromLocation, x=>x.FromLocation)
.CheckContain(Searcher.ToLocation, x=>x.ToLocation)
@@ -65,7 +63,6 @@ namespace HHWMS.Web
TaskNo_view = x.TaskHeader.TaskNo,
OrderCode = x.OrderCode,
OrderDetailId = x.OrderDetailId,
UniqueCode = x.UniqueCode,
MaterialCode = x.MaterialCode,
MaterialName = x.MaterialName,
MaterialSpec = x.MaterialSpec,
@@ -28,7 +28,6 @@ namespace HHWMS.Web
this.MakeGridHeader(x => x.TaskNo_view),
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.MaterialName).SetHide(),
this.MakeGridHeader(x => x.MaterialSpec).SetHide(),
@@ -47,14 +46,13 @@ namespace HHWMS.Web
public override IOrderedQueryable<TaskDetail_View> GetSearchQuery()
{
var query = DC.Set<TaskDetail>()
.Where(x => x.TaskHeaderId == Searcher.TaskHeaderId)
.Where(x => x.HeaderId == Searcher.HeaderId)
.Select(x => new TaskDetail_View
{
ID = x.ID,
TaskNo_view = $"{x.TaskHeader.TaskNo}-{x.FromLocation}",
OrderCode = x.OrderCode,
OrderDetailId = x.OrderDetailId,
UniqueCode = x.UniqueCode,
MaterialCode = x.MaterialCode,
MaterialName = x.MaterialName,
MaterialSpec = x.MaterialSpec,
@@ -16,7 +16,7 @@ namespace HHWMS.Web
public String UniqueCode { get; set; }
[Display(Name = "Task.TaskNo")]
public int? TaskHeaderId { get; set; }
public int? HeaderId { get; set; }
[Display(Name = "Inventory.MaterialCode")]
public String MaterialCode { get; set; }
@@ -57,15 +57,15 @@ namespace HHWMS.Web
{
string rv = UIService.MakeScriptButton(ButtonTypesEnum.Link,a.TaskNo,$"details('{a.ID}')");
return rv;
}).SetWidth(220),
}).SetWidth(180),
this.MakeGridHeader(x => x.TaskType,150),
this.MakeGridHeader(x => x.ContainerCode, 150),
this.MakeGridHeader(x => x.FromLocation,150),
this.MakeGridHeader(x => x.ToLocation, 150),
this.MakeGridHeader(x => x.Station,150),
this.MakeGridHeader(x => x.ContainerCode, 150),
this.MakeGridHeader(x => x.Status, 150),
this.MakeGridHeader(x => x.Station,150).SetHide(),
this.MakeGridHeader(x => x.RoadWay, 150).SetHide(),
this.MakeGridHeader(x => x.Priority, 150).SetHide(),
this.MakeGridHeader(x => x.Status, 150),
this.MakeGridHeader(x => x.CreateTime, 150).SetHide(),
this.MakeGridHeader(x => x.ErrorMsg, 150).SetHide(),
this.MakeGridHeaderAction(width: 200)
@@ -1,12 +1,11 @@
@model HHWMS.Web.TaskDetailVM
@model HHWMS.Web.TaskDetailVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:combobox field="Entity.TaskHeaderId" items="AllTaskHeaders"/>
<wt:combobox field="Entity.HeaderId" items="AllTaskHeaders" />
<wt:textbox field="Entity.OrderCode" />
<wt:textbox field="Entity.OrderDetailId" />
<wt:textbox field="Entity.UniqueCode" />
<wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialName" />
<wt:textbox field="Entity.MaterialSpec" />
@@ -1,4 +1,4 @@
@model HHWMS.Web.TaskDetailVM
@model HHWMS.Web.TaskDetailVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
@@ -7,7 +7,6 @@
<wt:display field="Entity.TaskHeader.TaskNo" />
<wt:display field="Entity.OrderCode" />
<wt:display field="Entity.OrderDetailId" />
<wt:display field="Entity.UniqueCode" />
<wt:display field="Entity.MaterialCode" />
<wt:display field="Entity.MaterialName" />
<wt:display field="Entity.MaterialSpec" />
@@ -1,4 +1,4 @@
@model HHWMS.Web.TaskDetailVM
@model HHWMS.Web.TaskDetailVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
@@ -6,7 +6,6 @@
<wt:display field="Entity.TaskHeader.TaskNo" />
<wt:display field="Entity.OrderCode" />
<wt:display field="Entity.OrderDetailId" />
<wt:display field="Entity.UniqueCode" />
<wt:display field="Entity.MaterialCode" />
<wt:display field="Entity.MaterialName" />
<wt:display field="Entity.MaterialSpec" />
@@ -1,12 +1,11 @@
@model HHWMS.Web.TaskDetailVM
@model HHWMS.Web.TaskDetailVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:combobox field="Entity.TaskHeaderId" items="AllTaskHeaders"/>
<wt:combobox field="Entity.HeaderId" items="AllTaskHeaders" />
<wt:textbox field="Entity.OrderCode" />
<wt:textbox field="Entity.OrderDetailId" />
<wt:textbox field="Entity.UniqueCode" />
<wt:textbox field="Entity.MaterialCode" />
<wt:textbox field="Entity.MaterialName" />
<wt:textbox field="Entity.MaterialSpec" />
@@ -1,9 +1,9 @@
@model HHWMS.Web.TaskDetailHistoryVM
@model HHWMS.Web.TaskDetailHistoryVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:combobox field="Entity.TaskHeaderId" items="AllTaskHeaders"/>
<wt:combobox field="Entity.HeaderId" items="AllTaskHeaders" />
<wt:textbox field="Entity.OrderCode" />
<wt:textbox field="Entity.OrderDetailId" />
<wt:textbox field="Entity.MaterialCode" />
@@ -1,10 +1,10 @@
@model HHWMS.Web.TaskDetailHistoryVM
@model HHWMS.Web.TaskDetailHistoryVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:quote>@Localizer["Sys.DeleteConfirm"]</wt:quote>
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.TaskHeader.TaskNo" />
<wt:display field="Entity.HeaderId" />
<wt:display field="Entity.OrderCode" />
<wt:display field="Entity.OrderDetailId" />
<wt:display field="Entity.MaterialCode" />
@@ -1,9 +1,9 @@
@model HHWMS.Web.TaskDetailHistoryVM
@model HHWMS.Web.TaskDetailHistoryVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:display field="Entity.TaskHeader.TaskNo" />
<wt:display field="Entity.HeaderId" />
<wt:display field="Entity.OrderCode" />
<wt:display field="Entity.OrderDetailId" />
<wt:display field="Entity.MaterialCode" />
@@ -1,9 +1,9 @@
@model HHWMS.Web.TaskDetailHistoryVM
@model HHWMS.Web.TaskDetailHistoryVM
@inject IStringLocalizer<Program> Localizer;
<wt:form vm="@Model">
<wt:row items-per-row="ItemsPerRowEnum.Two">
<wt:combobox field="Entity.TaskHeaderId" items="AllTaskHeaders"/>
<wt:combobox field="Entity.HeaderId" items="AllTaskHeaders" />
<wt:textbox field="Entity.OrderCode" />
<wt:textbox field="Entity.OrderDetailId" />
<wt:textbox field="Entity.MaterialCode" />
@@ -14,7 +14,7 @@
</wt:row>
</wt:searchpanel>
<wt:grid vm="@Model" id="TaskHeader" url="/taskManage/TaskHeader/Search" limit="7" />
<wt:grid vm="@Model.TaskDetails" id="TaskDetail" url="/taskManage/TaskDetail/Search2" height="400" />
@* <wt:grid vm="@Model.TaskDetails" id="TaskDetail" url="/taskManage/TaskDetail/Search2" height="400" /> *@
<script>
var headerId = 0;
Loaded 100 of 157 files, more files were not shown because too many files have changed in this diff. Show more