任务明细 出库明细 库存分析 启动出库

This commit is contained in:
zgf committed 2023-09-03 18:52:40 +08:00
1 parent eef6df7099
commit f5423e78fe
28 files changed
+500 -77

No files matched your search

@@ -0,0 +1,76 @@
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 TaskDetailListVM2 : BasePagedListVM<TaskDetail_View, TaskDetailSearcher>
{
protected override List<GridAction> InitGridAction()
{
return new List<GridAction>
{
this.MakeAction("TaskDetail","Cancel",Localizer["TaskHeader.Cancel"],Localizer["TaskHeader.Cancel"],GridActionParameterTypesEnum.SingleId,"taskManage"),
};
}
protected override IEnumerable<IGridColumn<TaskDetail_View>> InitGridHeader()
{
return new List<GridColumn<TaskDetail_View>>{
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(),
this.MakeGridHeader(x => x.MaterialUnit).SetHide(),
this.MakeGridHeader(x => x.Batch).SetHide(),
this.MakeGridHeader(x => x.Lot).SetHide(),
this.MakeGridHeader(x => x.ContainerCode),
this.MakeGridHeader(x => x.Qty),
this.MakeGridHeader(x => x.InventoryId).SetHide(),
this.MakeGridHeader(x => x.FromLocation),
this.MakeGridHeader(x => x.ToLocation),
this.MakeGridHeader(x => x.Status),
this.MakeGridHeaderAction(width: 200)
};
}
public override IOrderedQueryable<TaskDetail_View> GetSearchQuery()
{
var query = DC.Set<TaskDetail>()
.Where(x => x.TaskHeaderId == Searcher.TaskHeaderId)
.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,
MaterialUnit = x.MaterialUnit,
Batch = x.Batch,
Lot = x.Lot,
ContainerCode = x.ContainerCode,
Qty = x.Qty,
InventoryId = x.InventoryId,
FromLocation = x.FromLocation,
ToLocation = x.ToLocation,
Status = x.Status,
})
.OrderBy(x => x.ID);
return query;
}
}
}
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
@@ -14,6 +14,10 @@ namespace HHWMS.Web
{
[Display(Name = "Inventory.UniqueCode")]
public String UniqueCode { get; set; }
[Display(Name = "Task.TaskNo")]
public int? TaskHeaderId { get; set; }
[Display(Name = "Inventory.MaterialCode")]
public String MaterialCode { get; set; }
[Display(Name = "Task.FromLocation")]
@@ -13,11 +13,14 @@ namespace HHWMS.Web
public partial class TaskHeaderListVM : BasePagedListVM<TaskHeader_View, TaskHeaderSearcher>
{
public List<ComboSelectListItem> ZoneCodes { get; set; }
public TaskDetailListVM2 TaskDetails { get; set; } = new TaskDetailListVM2();
protected override void InitVM()
{
var vm = Wtm.CreateVM<TaskHeaderVM>();
ZoneCodes = vm.ZoneCodes;
TaskDetails.CopyContext(this);
}
protected override List<GridAction> InitGridAction()
@@ -49,7 +52,12 @@ namespace HHWMS.Web
var data = ZoneCodes.FirstOrDefault(x => x.Value.ToString() == a.ZoneCode);
return data?.Text ?? a.ZoneCode;
}),
this.MakeGridHeader(x => x.TaskNo),
this.MakeGridHeader(x => x.TaskNo)
.SetFormat((a,b) =>
{
string rv = UIService.MakeScriptButton(ButtonTypesEnum.Link,a.TaskNo,$"details('{a.ID}')");
return rv;
}),
this.MakeGridHeader(x => x.TaskType),
this.MakeGridHeader(x => x.FromLocation),
this.MakeGridHeader(x => x.ToLocation),
@@ -89,7 +97,7 @@ namespace HHWMS.Web
Status = x.Status,
ErrorMsg = x.ErrorMsg,
})
.OrderBy(x => x.ID);
.OrderByDescending(x => x.ID);
return query;
}