库位表重新生成,一些数据使用enum type status
加上数据权限zoneCode
This commit is contained in:
1 parent
b0a6dcc035
commit
b005422b01
25 files changed
+361
-541
No files matched your search
@@ -1,25 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using HHWMS.Web.Models;
|
||||
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 LocationListVM : BasePagedListVM<Location_View, LocationSearcher>
|
||||
{
|
||||
public List<ComboSelectListItem> ZoneCodes { get; set; }
|
||||
public List<ComboSelectListItem> Types { get; set; }
|
||||
public List<ComboSelectListItem> LocationStatus { get; set; }
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
var vm = Wtm.CreateVM<LocationVM>();
|
||||
ZoneCodes = vm.ZoneCodes;
|
||||
Types = vm.Types;
|
||||
LocationStatus = vm.LocationStatus;
|
||||
}
|
||||
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
@@ -33,40 +26,25 @@ 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","Print",Localizer["Sys.Print"],Localizer["Sys.Print"],GridActionParameterTypesEnum.MultiIds,"configs")
|
||||
.SetShowDialog(false).SetOnClickScript("print"),
|
||||
|
||||
this.MakeAction("Location","Print",Localizer["Sys.Print"],"",GridActionParameterTypesEnum.MultiIds,"configs")
|
||||
.SetShowDialog(false).SetOnClickScript("print"),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
protected override IEnumerable<IGridColumn<Location_View>> InitGridHeader()
|
||||
{
|
||||
InitVM();
|
||||
return new List<GridColumn<Location_View>>{
|
||||
this.MakeGridHeader(x => x.ZoneCode)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = ZoneCodes.FirstOrDefault(x => x.Value.ToString() == a.ZoneCode);
|
||||
return data?.Text ?? a.ZoneCode;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.Code, 120),
|
||||
this.MakeGridHeader(x => x.Type)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = Types.FirstOrDefault(x => x.Value.ToString() == a.Type);
|
||||
return data?.Text ?? a.Type;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.Status)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = LocationStatus.FirstOrDefault(x => x.Value.ToString() == a.Status);
|
||||
return data?.Text ?? a.Status;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.Row),
|
||||
this.MakeGridHeader(x => x.Line),
|
||||
this.MakeGridHeader(x => x.Layer),
|
||||
this.MakeGridHeader(x => x.RoadWay).SetHide(),
|
||||
this.MakeGridHeader(x => x.Name_view),
|
||||
this.MakeGridHeader(x => x.Code),
|
||||
this.MakeGridHeader(x => x.Type),
|
||||
this.MakeGridHeader(x => x.Status),
|
||||
this.MakeGridHeader(x => x.ContainerCode),
|
||||
this.MakeGridHeader(x => x.RoadWay),
|
||||
this.MakeGridHeader(x => x.Row).SetHide(),
|
||||
this.MakeGridHeader(x => x.Line).SetHide(),
|
||||
this.MakeGridHeader(x => x.Layer).SetHide(),
|
||||
this.MakeGridHeader(x => x.RowFlag).SetHide(),
|
||||
this.MakeGridHeader(x => x.IsStop),
|
||||
this.MakeGridHeader(x => x.Length).SetHide(),
|
||||
this.MakeGridHeader(x => x.Width).SetHide(),
|
||||
@@ -79,29 +57,27 @@ namespace HHWMS.Web
|
||||
public override IOrderedQueryable<Location_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<Location>()
|
||||
.CheckContain(Searcher.Code, x => x.Code)
|
||||
.CheckContain(Searcher.Type, x => x.Type)
|
||||
.CheckContain(Searcher.Status, x => x.Status)
|
||||
.CheckEqual(Searcher.Row, x => x.Row)
|
||||
.CheckEqual(Searcher.Line, x => x.Line)
|
||||
.CheckEqual(Searcher.Layer, x => x.Layer)
|
||||
.CheckEqual(Searcher.RoadWay, x => x.RoadWay)
|
||||
.CheckContain(Searcher.ContainerCode, x => x.ContainerCode)
|
||||
.CheckContain(Searcher.ZoneCode, x => x.ZoneCode)
|
||||
.CheckEqual(Searcher.IsStop, x => x.IsStop)
|
||||
.CheckContain(Searcher.ContiguousCode, x => x.ContiguousCode)
|
||||
.CheckEqual(Searcher.LocationZoneId, x=>x.LocationZoneId)
|
||||
.CheckContain(Searcher.Code, x=>x.Code)
|
||||
.CheckEqual(Searcher.Type, x=>x.Type)
|
||||
.CheckEqual(Searcher.Status, x=>x.Status)
|
||||
.CheckEqual(Searcher.RoadWay, x=>x.RoadWay)
|
||||
.CheckEqual(Searcher.RowFlag, x=>x.RowFlag)
|
||||
.CheckContain(Searcher.ContainerCode, x=>x.ContainerCode)
|
||||
.CheckEqual(Searcher.IsStop, x=>x.IsStop)
|
||||
.Select(x => new Location_View
|
||||
{
|
||||
ID = x.ID,
|
||||
ID = x.ID,
|
||||
Name_view = x.LocationZone.Name,
|
||||
Code = x.Code,
|
||||
Type = x.Type,
|
||||
Status = x.Status,
|
||||
RoadWay = x.RoadWay,
|
||||
Row = x.Row,
|
||||
Line = x.Line,
|
||||
Layer = x.Layer,
|
||||
RoadWay = x.RoadWay,
|
||||
RowFlag = x.RowFlag,
|
||||
ContainerCode = x.ContainerCode,
|
||||
ZoneCode = x.ZoneCode,
|
||||
IsStop = x.IsStop,
|
||||
Length = x.Length,
|
||||
Width = x.Width,
|
||||
@@ -111,9 +87,12 @@ namespace HHWMS.Web
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class Location_View : Location
|
||||
{
|
||||
public class Location_View : Location{
|
||||
[Display(Name = "Location.ZoneCode")]
|
||||
public String Name_view { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user