Compare commits

..
10 Commits
Author SHA1 Message Date
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
147 changed files with 2459 additions and 1328 deletions

No files matched your search

+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 });
}
}
}
+226 -24
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,41 +20,239 @@ 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
{
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, false, false);
// 下发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")]
@@ -32,9 +32,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 +49,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,10 +12,6 @@ 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; }
@@ -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,8 +3,6 @@
<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:row>
</wt:searchpanel>
@@ -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,75 @@ 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.已下发;
}
else
{
task.ErrorMsg = res.Msg;
}
task.UpdateTime = DateTime.Now;
task.UpdateBy = "WMS";
_unitwork.Update(task);
}
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.MaterialSpec),
// this.MakeGridHeader(x => x.MaterialUnit),
// this.MakeGridHeader(x => x.Batch),
// this.MakeGridHeader(x => x.Lot),
//this.MakeGridHeader(x => x.ManufactureDate),
//this.MakeGridHeader(x => x.ExpirationDate),
//this.MakeGridHeader(x => x.CompanyCode),
@@ -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,7 +109,6 @@ 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.MaterialCode, x => x.MaterialCode)
.CheckContain(Searcher.MaterialType, x => x.MaterialType)
@@ -127,7 +124,6 @@ namespace HHWMS.Web
{
ID = x.ID,
ZoneCode = x.ZoneCode,
UniqueCode = x.UniqueCode,
ContainerCode = x.ContainerCode,
LocationCode = x.LocationCode,
MaterialCode = x.MaterialCode,
@@ -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,125 @@ namespace HHWMS.Web.Controllers
}
#endregion Index
[HttpPost]
public ActionResult TaskIn(string containerCode, bool inv, bool agv)
{
if (Wtm == null)
{
Wtm = _context;
}
// 判断containerCode是否为空
if (string.IsNullOrEmpty(containerCode))
{
return JsonMore(null, 500, "容器编码为空!请检查后重新提交!");
}
// 查询container表code为containercode的值
var container = _unitWork.FindSingle<Container>(u => u.Code == containerCode);
if (container == null)
{
return JsonMore(null, 500, $"库内没有编码为 {containerCode} 的容器!");
}
// 如果 container的库位不为空,或者islock为true,则返回错误信息
if (!string.IsNullOrEmpty(container.LocationCode) || container.IsLock == ContainerLockEnum.任务锁)
{
return JsonMore(null, 500, $"容器 {containerCode} 已被锁定或已在库内!");
}
container.IsLock = ContainerLockEnum.任务锁;
container.UpdateTime = DateTime.Now;
container.UpdateBy = Wtm?.LoginUserInfo?.ITCode??"WMS";
// _unitWork.Update(container);
//查找仓位
var location = _unitWork.Find<Location>(u => u.Status == LocationStatus.空仓位
&& u.Type == container.Type
&& !u.IsStop)
.OrderByDescending(x => x.Layer)
.ThenByDescending(x => x.Line)
.FirstOrDefault();
// 判断location是否为空
if (location == null)
{
return JsonMore(null, 500, "库内没有空闲仓位!");
}
location.Status = LocationStatus.任务锁;
location.UpdateTime = DateTime.Now;
location.UpdateBy = Wtm?.LoginUserInfo?.ITCode??"WMS";
_unitWork.Update(location);
if (inv) //有货
{
_unitWork.Add<Inventory>(new Inventory()
{
ZoneCode = ZoneCodeEnum.立库,
ContainerCode = containerCode,
LocationCode = location.Code,
MaterialCode = "123456",
MaterialName = "矿泉水",
Qty = 1,
TaskStatus = InventoryTaskStatus.任务中,
CreateTime = DateTime.Now
});
}
_unitWork.Update(container);
//创建容器编码为containercode的任务
var task = new TaskHeader
{
ZoneCode = ZoneCodeEnum.立库,
TaskNo = _unitWork.GetSerialNumber("In"),
TaskType = TaskTypeEnum.立库入库,
ContainerCode = containerCode,
FromLocation = "",
ToLocation = location.Code,
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);
if (agv)
{
// 调用AGV接口
var task_id = Wtm.ConfigInfo.AppSettings
.FirstOrDefault(x => x.Key == "OutIn").Value;
var res2 = Wtm.CallAPI<ShipOutController.agvResult>("ACS", "task_mould_do", HttpMethodEnum.POST, new
{
task_id = task_id
});
}
return JsonMore(null);
}
}
}
@@ -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,86 @@
<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>
<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>
<div id="receiptin">
<a-space direction="vertical" fill>
<a-space>
<template #split>
<a-divider direction="vertical"/>
</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-input :style="{width:'150px'}" placeholder="扫描箱号" v-model="ContainerCode" allow-clear/>
<a-switch v-model="inv">
<template #checked>
载货
</template>
<template #unchecked>
空箱
</template>
</a-switch>
<a-switch v-model="agv">
<template #checked>
出库口
</template>
<template #unchecked>
入库口
</template>
</a-switch>
</a-space>
<a-space>
<a-button @@click="handleClick"
:loading="loading1"
type="primary" size="large">
入库
</a-button>
</a-space>
</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
const app = createApp({
data() {
return {
form: {
code: '',
boxCode: '',
boxSize: [],
size: '',
uniqueCode: ''
},
options: [],
value: '',
tableData: [],
bindingData: [],
dataIndex: [],
rules: {
boxCode: [
{ validator: validatePass, trigger: 'blur' }
]
ContainerCode: '',
loading1:false,
inv:false,
agv:false,
data: reactive([])
}
}
},
mounted: function () {
// 获取所有单据编码
$.ajax({
type: "post",
dataType: "json",
data: {},
url: "/receipt/ReceiptIn/SelectReceiptCode",
success: function (json) {
app.options = json.Data;
},
error: function (json) {
alert("加载失败");
}
});
},
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');
handleClick() {
var _this = this;
if (_this.ContainerCode == ""){
_this.$message.error("请扫描箱号!");
return;
}
_this.loading1 = !_this.loading1
let postData = new URLSearchParams();
postData.append('containerCode', _this.ContainerCode);
postData.append('inv', _this.inv);
postData.append('agv', _this.agv);
axios.post("/receipt/ReceiptIn/TaskIn", postData)
.then(function (json) {
_this.loading1 = !_this.loading1;
if (json.data.Code == 200){
_this.ContainerCode = '';
_this.$message.success("入库任务创建成功!");
}
else{
_this.$message({
message: '入库失败!',
type: 'warning'
});
_this.$message.error(json.data.Msg);
}
},
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'
.catch(function (error) {
_this.$message.error(error);
});
}
});
}
},
// 扫描周转箱
scanBox(Box) {
var _this = this;
_this.form.size = '';
_this.form.boxSize = [];
});
app.use(ArcoVue)
.use(ArcoVueIcon)
.mount('#receiptin');
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);
}
}
});
</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)
@@ -232,81 +232,6 @@ namespace HHWMS.Web.Controllers
}
#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",
const { createApp, reactive, ref } = Vue
const app = createApp({
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
};
ContainerCode: '',
loading1:false,
loading2:false,
data: reactive([])
}
},
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) {
handleClick() {
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"
_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{
url = "/shipment/ShipOut/ScanBox"
_this.$message.error(json.data.Msg);
}
$.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",
})
.catch(function (error) {
_this.$message.error(error);
});
},
});
},
// 拣货
onSubmit() {
handleAGVTask(val) {
var _this = this;
if (_this.form.uniqueCode == "") {
_this.$message({
message: "未选择出库明细!",
type: "warning",
duration: "10000",
});
return;
_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("任务创建成功!");
}
// 提交已绑定数据
$.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);
else{
_this.$message.error(json.data.Msg);
}
});
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",
})
.catch(function (error) {
_this.$message.error(error);
});
}
},
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: '已取消'
});
});
}
},
});
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);
}
}
@@ -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;
@@ -0,0 +1,79 @@
// WTM默认页面 Wtm buidin page
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using HHWMS.Web;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
namespace WalkingTec.Mvvm.Mvc.Admin.Controllers
{
[Area("_Admin")]
[ActionDescription("MenuKey.InterfaceLog")]
public class InterfaceLogController : BaseController
{
[ActionDescription("Sys.Search")]
public IActionResult Index()
{
var vm = Wtm.CreateVM<InterfaceLogListVM>();
return PartialView(vm);
}
[ActionDescription("Sys.Search")]
[HttpPost]
public string Search(InterfaceLogSearcher searcher)
{
var vm = Wtm.CreateVM<InterfaceLogListVM>(passInit:true);
if (ModelState.IsValid)
{
vm.Searcher = searcher;
return vm.GetJson(false);
}
else
{
return vm.GetError();
}
}
[HttpGet]
[ActionDescription("Sys.Details")]
public IActionResult Details(string id)
{
var vm = Wtm.CreateVM<InterfaceLogVM>(id);
return PartialView(vm);
}
[ActionDescription("Sys.Export")]
[HttpPost]
public IActionResult ExportExcel(InterfaceLogListVM vm)
{
return vm.GetExportData();
}
[HttpPost]
[ActionDescription("Sys.BatchDelete")]
public ActionResult BatchDelete(string[] IDs)
{
var vm = Wtm.CreateVM<InterfaceLogBatchVM>(Ids: IDs);
return PartialView(vm);
}
[HttpPost]
[ActionDescription("Sys.BatchDelete")]
public ActionResult DoBatchDelete(InterfaceLogBatchVM vm, IFormCollection nouse)
{
if (!ModelState.IsValid || !vm.DoBatchDelete())
{
return PartialView("BatchDelete", vm);
}
else
{
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchDeleteSuccess", vm.Ids.Length]);
}
}
}
}
@@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using HHWMS.Web;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
namespace WalkingTec.Mvvm.Mvc.Admin.Controllers
{
[Area("_Admin")]
[ActionDescription("MenuKey.JobLog")]
public class JobLogController : BaseController
{
[ActionDescription("Sys.Search")]
public IActionResult Index()
{
var vm = Wtm.CreateVM<JobLogListVM>();
return PartialView(vm);
}
[ActionDescription("Sys.Search")]
[HttpPost]
public string Search(JobLogSearcher searcher)
{
var vm = Wtm.CreateVM<JobLogListVM>(passInit:true);
if (ModelState.IsValid)
{
vm.Searcher = searcher;
return vm.GetJson(false);
}
else
{
return vm.GetError();
}
}
[HttpGet]
[ActionDescription("Sys.Details")]
public IActionResult Details(string id)
{
var vm = Wtm.CreateVM<JobLogVM>(id);
return PartialView(vm);
}
[ActionDescription("Sys.Export")]
[HttpPost]
public IActionResult ExportExcel(JobLogListVM vm)
{
return vm.GetExportData();
}
[HttpPost]
[ActionDescription("Sys.BatchDelete")]
public ActionResult BatchDelete(string[] IDs)
{
var vm = Wtm.CreateVM<JobLogBatchVM>(Ids: IDs);
return PartialView(vm);
}
[HttpPost]
[ActionDescription("Sys.BatchDelete")]
public ActionResult DoBatchDelete(JobLogBatchVM vm, IFormCollection nouse)
{
if (!ModelState.IsValid || !vm.DoBatchDelete())
{
return PartialView("BatchDelete", vm);
}
else
{
return FFResult().CloseDialog().RefreshGrid().Alert(Localizer["Sys.BatchDeleteSuccess", vm.Ids.Length]);
}
}
}
}
@@ -0,0 +1,34 @@
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;
namespace HHWMS.Web
{
public partial class InterfaceLogBatchVM : BaseBatchVM<InterfaceLog, InterfaceLog_BatchEdit>
{
public InterfaceLogBatchVM()
{
ListVM = new InterfaceLogListVM();
LinkedVM = new InterfaceLog_BatchEdit();
}
}
/// <summary>
/// Class to define batch edit fields
/// </summary>
public class InterfaceLog_BatchEdit : BaseVM
{
protected override void InitVM()
{
}
}
}
@@ -0,0 +1,26 @@
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;
namespace HHWMS.Web
{
public partial class InterfaceLogTemplateVM : BaseTemplateVM
{
protected override void InitVM()
{
}
}
public class InterfaceLogImportVM : BaseImportVM<InterfaceLogTemplateVM, InterfaceLog>
{
}
}
Loaded 100 of 147 files, more files were not shown because too many files have changed in this diff. Show more