添加工序配置
修改入库页面,任务完成,库存页面等
This commit is contained in:
1 parent
c2b039ea47
commit
5a04ca9d59
41 files changed
+1151
-84
No files matched your search
@@ -249,6 +249,13 @@ namespace HHWMS.Web.Controllers
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Print")]
|
||||
public ActionResult Print(ContainerVM vm)
|
||||
{
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Container.AddContainer")]
|
||||
public ActionResult AddContainer(ContainerVM vm)
|
||||
@@ -265,8 +272,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 zoneid = _unitwork.FindSingle<LocationZone>(x => x.ZoneCode == vm.Entity.Type).ID;
|
||||
var maxContainer = _unitwork.Find<Container>(x => x.Type == vm.Entity.Type).ToList().MaxBy(x => x.ID);
|
||||
int maxNum = 0;
|
||||
if (maxContainer != null)
|
||||
int.TryParse(maxContainer?.Code.Substring(1, 4), out maxNum);
|
||||
// 查询已有的最大托盘值 在此基础上累加
|
||||
@@ -281,7 +290,8 @@ namespace HHWMS.Web.Controllers
|
||||
Status = ContainerStatus.空,
|
||||
Length = vm.Entity.Length,
|
||||
Width = vm.Entity.Width,
|
||||
Height = vm.Entity.Height
|
||||
Height = vm.Entity.Height,
|
||||
ZoneId = zoneid
|
||||
});
|
||||
}
|
||||
_unitwork.BatchAdd<Container>(containerList.ToArray());
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@@ -63,6 +65,15 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DC.Set<Material>().Any(x => x.MaterialCode == vm.Entity.MaterialCode))
|
||||
{
|
||||
return FFResult().Alert($"已存在 物料编码 为{vm.Entity.MaterialCode}的数据");
|
||||
}
|
||||
if (DC.Set<Material>().Any(x => x.MaterialType == vm.Entity.MaterialType))
|
||||
{
|
||||
return FFResult().Alert($"已存在 图号 为{vm.Entity.MaterialType}的数据");
|
||||
}
|
||||
|
||||
vm.DoAdd();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@@ -63,6 +65,20 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!DC.Set<Material>().Any(x => x.MaterialCode == vm.Entity.MaterialCode))
|
||||
{
|
||||
return FFResult().Alert($"物料编码 为{vm.Entity.MaterialCode}的物料基础数据不存在!请先添加物料基础数据!");
|
||||
}
|
||||
if (DC.Set<MaterialProcess>().Any(x => x.MaterialCode == vm.Entity.MaterialCode
|
||||
&& x.ProcessOrder == vm.Entity.ProcessOrder))
|
||||
{
|
||||
return FFResult().Alert($"已存在 工序顺序 为{vm.Entity.ProcessOrder}的数据!");
|
||||
}
|
||||
if (DC.Set<MaterialProcess>().Any(x => x.MaterialCode == vm.Entity.MaterialCode
|
||||
&& x.ProcessCode == vm.Entity.ProcessCode))
|
||||
{
|
||||
return FFResult().Alert($"已存在 工序编码 为{vm.Entity.ProcessCode}的数据!");
|
||||
}
|
||||
vm.DoAdd();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,238 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
[Area("configs")]
|
||||
[ActionDescription("工序配置")]
|
||||
public partial class ProcessConfigController : BaseController
|
||||
{
|
||||
private readonly IUnitWork _unitWork;
|
||||
|
||||
public ProcessConfigController(IUnitWork unitWork)
|
||||
{
|
||||
_unitWork = unitWork;
|
||||
}
|
||||
|
||||
#region Search
|
||||
[ActionDescription("Sys.Search")]
|
||||
public ActionResult Index()
|
||||
{
|
||||
var vm = Wtm.CreateVM<ProcessConfigListVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
[HttpPost]
|
||||
public string Search(ProcessConfigSearcher searcher)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ProcessConfigListVM>(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<ProcessConfigVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Create")]
|
||||
public ActionResult Create(ProcessConfigVM vm)
|
||||
{
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
return PartialView(vm);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DC.Set<ProcessConfig>().Any(x => x.Code == vm.Entity.Code))
|
||||
{
|
||||
return FFResult().Alert($"已存在 工序编码 为{vm.Entity.Code}的数据");
|
||||
}
|
||||
if (DC.Set<ProcessConfig>().Any(x => x.Name == vm.Entity.Name))
|
||||
{
|
||||
return FFResult().Alert($"已存在 工序名称 为{vm.Entity.Name}的数据");
|
||||
}
|
||||
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<ProcessConfigVM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Edit")]
|
||||
[HttpPost]
|
||||
[ValidateFormItemOnly]
|
||||
public ActionResult Edit(ProcessConfigVM 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<ProcessConfigVM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Delete")]
|
||||
[HttpPost]
|
||||
public ActionResult Delete(string id, IFormCollection nouse)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ProcessConfigVM>(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<ProcessConfigVM>(id);
|
||||
return PartialView(vm);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region BatchEdit
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchEdit")]
|
||||
public ActionResult BatchEdit(string[] IDs)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ProcessConfigBatchVM>(Ids: IDs);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchEdit")]
|
||||
public ActionResult DoBatchEdit(ProcessConfigBatchVM 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<ProcessConfigBatchVM>(Ids: IDs);
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.BatchDelete")]
|
||||
public ActionResult DoBatchDelete(ProcessConfigBatchVM 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<ProcessConfigImportVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[ActionDescription("Sys.Import")]
|
||||
public ActionResult Import(ProcessConfigImportVM 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(ProcessConfigListVM vm)
|
||||
{
|
||||
return vm.GetExportData();
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
@@ -40,6 +42,7 @@ namespace HHWMS.Web
|
||||
{
|
||||
InitVM();
|
||||
return new List<GridColumn<Container_View>>{
|
||||
this.MakeGridHeader(x => x.Name_view).SetWidth(80),
|
||||
this.MakeGridHeader(x => x.Code),
|
||||
this.MakeGridHeader(x => x.Type)
|
||||
.SetFormat((a, b) =>
|
||||
@@ -65,6 +68,7 @@ namespace HHWMS.Web
|
||||
public override IOrderedQueryable<Container_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<Container>()
|
||||
.CheckEqual(Searcher.ZoneId, x=>x.ZoneId)
|
||||
.CheckContain(Searcher.Code, x => x.Code)
|
||||
.CheckContain(Searcher.Type, x => x.Type)
|
||||
.CheckEqual(Searcher.IsLock, x => x.IsLock)
|
||||
@@ -73,8 +77,10 @@ namespace HHWMS.Web
|
||||
.CheckEqual(Searcher.Length, x => x.Length)
|
||||
.CheckEqual(Searcher.Width, x => x.Width)
|
||||
.CheckEqual(Searcher.Height, x => x.Height)
|
||||
.DPWhere(Wtm,x => x.ZoneId)
|
||||
.Select(x => new Container_View
|
||||
{
|
||||
Name_view = x.Zone.Name,
|
||||
ID = x.ID,
|
||||
Code = x.Code,
|
||||
Type = x.Type,
|
||||
@@ -92,5 +98,7 @@ namespace HHWMS.Web
|
||||
|
||||
public class Container_View : Container
|
||||
{
|
||||
[Display(Name = "Location.ZoneName")]
|
||||
public String Name_view { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class ContainerSearcher : BaseSearcher
|
||||
{
|
||||
public List<ComboSelectListItem> AllZones { get; set; }
|
||||
[Display(Name = "Location.ZoneCode")]
|
||||
public int? ZoneId { get; set; }
|
||||
|
||||
[Display(Name = "Container.Code")]
|
||||
public String Code { get; set; }
|
||||
|
||||
@@ -33,6 +39,7 @@ namespace HHWMS.Web
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
AllZones = DC.Set<LocationZone>().GetSelectListItems(Wtm, y => y.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,6 +65,7 @@ namespace HHWMS.Web
|
||||
.CheckEqual(Searcher.RowFlag, x=>x.RowFlag)
|
||||
.CheckContain(Searcher.ContainerCode, x=>x.ContainerCode)
|
||||
.CheckEqual(Searcher.IsStop, x=>x.IsStop)
|
||||
.DPWhere(Wtm,x => x.ZoneId)
|
||||
.Select(x => new Location_View
|
||||
{
|
||||
ID = x.ID,
|
||||
|
||||
@@ -461,6 +461,10 @@ namespace HHWMS.Web
|
||||
return moveloc;
|
||||
}
|
||||
}
|
||||
else if (outter != null && outter.Status == LocationStatusEnum.锁定)
|
||||
{
|
||||
return ResponseResult<dynamic>.Error("外侧仓位已被锁定!请稍后再尝试!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -532,7 +536,7 @@ namespace HHWMS.Web
|
||||
&& l.ContainerStatus == LocationStatus.空仓位
|
||||
&& locationPairs.TryGetValue(l.ContiguousCode, out var outer)
|
||||
&& outer.ContainerStatus == LocationStatus.空仓位)
|
||||
.OrderBy(l => l.Height)
|
||||
.OrderBy(l => Math.Abs((decimal)outter.Height - (decimal)l.Height))
|
||||
.ThenBy(l => Math.Abs(outter.RoadWay - l.RoadWay))
|
||||
.ThenBy(l => Math.Abs(outter.Line - l.Line))
|
||||
.ThenBy(l => l.Layer)
|
||||
|
||||
@@ -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 ProcessConfigBatchVM : BaseBatchVM<ProcessConfig, ProcessConfig_BatchEdit>
|
||||
{
|
||||
public ProcessConfigBatchVM()
|
||||
{
|
||||
ListVM = new ProcessConfigListVM();
|
||||
LinkedVM = new ProcessConfig_BatchEdit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class to define batch edit fields
|
||||
/// </summary>
|
||||
public class ProcessConfig_BatchEdit : BaseVM
|
||||
{
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
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 ProcessConfigTemplateVM : BaseTemplateVM
|
||||
{
|
||||
[Display(Name = "Process.Code")]
|
||||
public ExcelPropety Code_Excel = ExcelPropety.CreateProperty<ProcessConfig>(x => x.Code);
|
||||
[Display(Name = "Process.Name")]
|
||||
public ExcelPropety Name_Excel = ExcelPropety.CreateProperty<ProcessConfig>(x => x.Name);
|
||||
[Display(Name = "Process.Zone")]
|
||||
public ExcelPropety Zone_Excel = ExcelPropety.CreateProperty<ProcessConfig>(x => x.Zone);
|
||||
[Display(Name = "Process.Port")]
|
||||
public ExcelPropety Port_Excel = ExcelPropety.CreateProperty<ProcessConfig>(x => x.Port);
|
||||
[Display(Name = "Sys.spare")]
|
||||
public ExcelPropety Spare1_Excel = ExcelPropety.CreateProperty<ProcessConfig>(x => x.Spare1);
|
||||
[Display(Name = "Sys.spare")]
|
||||
public ExcelPropety Spare2_Excel = ExcelPropety.CreateProperty<ProcessConfig>(x => x.Spare2);
|
||||
[Display(Name = "Sys.spare")]
|
||||
public ExcelPropety Spare3_Excel = ExcelPropety.CreateProperty<ProcessConfig>(x => x.Spare3);
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ProcessConfigImportVM : BaseImportVM<ProcessConfigTemplateVM, ProcessConfig>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
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 ProcessConfigListVM : BasePagedListVM<ProcessConfig_View, ProcessConfigSearcher>
|
||||
{
|
||||
public List<ComboSelectListItem> AllZones { get; set; }
|
||||
public List<ComboSelectListItem> AllOutPorts { get; set; }
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
var vm = Wtm.CreateVM<ProcessConfigVM>();
|
||||
AllZones = vm.AllZones;
|
||||
AllOutPorts = vm.AllOutPorts;
|
||||
}
|
||||
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("ProcessConfig", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
protected override IEnumerable<IGridColumn<ProcessConfig_View>> InitGridHeader()
|
||||
{
|
||||
InitVM();
|
||||
return new List<GridColumn<ProcessConfig_View>>{
|
||||
this.MakeGridHeader(x => x.Code),
|
||||
this.MakeGridHeader(x => x.Name),
|
||||
this.MakeGridHeader(x => x.Zone)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = AllZones.FirstOrDefault(x => x.Value.ToString() == a.Zone);
|
||||
return data?.Text ?? a.Zone;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.Port)
|
||||
.SetFormat((a, b) =>
|
||||
{
|
||||
var data = AllOutPorts.FirstOrDefault(x => x.Value.ToString() == a.Port);
|
||||
return data?.Text ?? a.Port;
|
||||
}),
|
||||
this.MakeGridHeader(x => x.Spare1).SetHide(),
|
||||
this.MakeGridHeader(x => x.Spare2).SetHide(),
|
||||
this.MakeGridHeader(x => x.Spare3).SetHide(),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<ProcessConfig_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<ProcessConfig>()
|
||||
.CheckContain(Searcher.Code, x=>x.Code)
|
||||
.CheckContain(Searcher.Name, x=>x.Name)
|
||||
.CheckContain(Searcher.Zone, x=>x.Zone)
|
||||
.CheckContain(Searcher.Port, x=>x.Port)
|
||||
.CheckContain(Searcher.Spare1, x=>x.Spare1)
|
||||
.CheckContain(Searcher.Spare2, x=>x.Spare2)
|
||||
.CheckContain(Searcher.Spare3, x=>x.Spare3)
|
||||
.Select(x => new ProcessConfig_View
|
||||
{
|
||||
ID = x.ID,
|
||||
Code = x.Code,
|
||||
Name = x.Name,
|
||||
Zone = x.Zone,
|
||||
Port = x.Port,
|
||||
Spare1 = x.Spare1,
|
||||
Spare2 = x.Spare2,
|
||||
Spare3 = x.Spare3,
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ProcessConfig_View : ProcessConfig{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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 ProcessConfigSearcher : BaseSearcher
|
||||
{
|
||||
[Display(Name = "Process.Code")]
|
||||
public String Code { get; set; }
|
||||
[Display(Name = "Process.Name")]
|
||||
public String Name { get; set; }
|
||||
[Display(Name = "Process.Zone")]
|
||||
public String Zone { get; set; }
|
||||
[Display(Name = "Process.Port")]
|
||||
public String Port { get; set; }
|
||||
[Display(Name = "Sys.Spare")]
|
||||
public String Spare1 { get; set; }
|
||||
[Display(Name = "Sys.Spare")]
|
||||
public String Spare2 { get; set; }
|
||||
[Display(Name = "Sys.Spare")]
|
||||
public String Spare3 { get; set; }
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
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 ProcessConfigVM : BaseCRUDVM<ProcessConfig>
|
||||
{
|
||||
|
||||
public List<ComboSelectListItem> AllZones { get; set; }
|
||||
public List<ComboSelectListItem> AllOutPorts { get; set; }
|
||||
|
||||
public ProcessConfigVM()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
var vm = Wtm.CreateVM<InventoryVM>();
|
||||
AllZones = new List<ComboSelectListItem>
|
||||
{
|
||||
new ComboSelectListItem { Text = "区域1", Value = "Zone1" },
|
||||
new ComboSelectListItem { Text = "区域2", Value = "Zone2" },
|
||||
new ComboSelectListItem { Text = "区域3", Value = "Zone3" },
|
||||
};
|
||||
AllOutPorts = vm.AllOutPorts;
|
||||
}
|
||||
|
||||
public override void DoAdd()
|
||||
{
|
||||
base.DoAdd();
|
||||
}
|
||||
|
||||
public override void DoEdit(bool updateAllFields = false)
|
||||
{
|
||||
base.DoEdit(updateAllFields);
|
||||
}
|
||||
|
||||
public override void DoDelete()
|
||||
{
|
||||
base.DoDelete();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:combobox field="Searcher.ZoneId" items="Searcher.AllZones" empty-text="@Localizer["Sys.All"]" />
|
||||
<wt:textbox field="Searcher.Code"/>
|
||||
<wt:combobox field="Searcher.Type" items="ContainerType"/>
|
||||
<wt:combobox field="Searcher.IsLock"/>
|
||||
@@ -22,7 +23,6 @@
|
||||
let printData = [];
|
||||
|
||||
function print(ids, datas) {
|
||||
console.log(datas)
|
||||
datas.forEach(function (value, index, arr) {
|
||||
printData.push({code: value.Code})
|
||||
});
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:textbox field="Entity.MaterialCode" />
|
||||
<wt:textbox field="Entity.MaterialType" />
|
||||
<wt:textbox field="Entity.MaterialCode" disabled/>
|
||||
<wt:textbox field="Entity.MaterialType" disabled/>
|
||||
<wt:textbox field="Entity.MaterialName" />
|
||||
<wt:textbox field="Entity.MaterialSpec" />
|
||||
<wt:textbox field="Entity.MaterialUnit" />
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:textbox field="Entity.MaterialCode" />
|
||||
<wt:textbox field="Entity.MaterialCode" disabled/>
|
||||
<wt:textbox field="Entity.ProcessOrder" />
|
||||
<wt:textbox field="Entity.ProcessName" />
|
||||
<wt:textbox field="Entity.ProcessCode" />
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
@model HHWMS.Web.ProcessConfigBatchVM
|
||||
@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.ProcessConfigBatchVM
|
||||
@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,18 @@
|
||||
@model HHWMS.Web.ProcessConfigVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:textbox field="Entity.Code" />
|
||||
<wt:textbox field="Entity.Name" />
|
||||
<wt:combobox field="Entity.Zone" items="AllZones"/>
|
||||
<wt:combobox field="Entity.Port" items="AllOutPorts"/>
|
||||
<wt:textbox field="Entity.Spare1" />
|
||||
<wt:textbox field="Entity.Spare2" />
|
||||
<wt:textbox field="Entity.Spare3" />
|
||||
</wt:row>
|
||||
<wt:row align="AlignEnum.Right">
|
||||
<wt:submitbutton />
|
||||
<wt:closebutton />
|
||||
</wt:row>
|
||||
</wt:form>
|
||||
@@ -0,0 +1,20 @@
|
||||
@model HHWMS.Web.ProcessConfigVM
|
||||
@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.Code" />
|
||||
<wt:display field="Entity.Name" />
|
||||
<wt:display field="Entity.Zone" />
|
||||
<wt:display field="Entity.Port" />
|
||||
<wt:display field="Entity.Spare1" />
|
||||
<wt:display field="Entity.Spare2" />
|
||||
<wt:display field="Entity.Spare3" />
|
||||
</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,17 @@
|
||||
@model HHWMS.Web.ProcessConfigVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:display field="Entity.Code" />
|
||||
<wt:display field="Entity.Name" />
|
||||
<wt:display field="Entity.Zone" />
|
||||
<wt:display field="Entity.Port" />
|
||||
<wt:display field="Entity.Spare1" />
|
||||
<wt:display field="Entity.Spare2" />
|
||||
<wt:display field="Entity.Spare3" />
|
||||
</wt:row>
|
||||
<wt:row align="AlignEnum.Right">
|
||||
<wt:closebutton />
|
||||
</wt:row>
|
||||
</wt:form>
|
||||
@@ -0,0 +1,19 @@
|
||||
@model HHWMS.Web.ProcessConfigVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:textbox field="Entity.Code" disabled/>
|
||||
<wt:textbox field="Entity.Name" disabled/>
|
||||
<wt:combobox field="Entity.Zone" items="AllZones"/>
|
||||
<wt:combobox field="Entity.Port" items="AllOutPorts"/>
|
||||
<wt:textbox field="Entity.Spare1" />
|
||||
<wt:textbox field="Entity.Spare2" />
|
||||
<wt:textbox field="Entity.Spare3" />
|
||||
</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.ProcessConfigImportVM
|
||||
@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,12 @@
|
||||
@model HHWMS.Web.ProcessConfigListVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||
<wt:textbox field="Searcher.Code" />
|
||||
<wt:textbox field="Searcher.Name" />
|
||||
<wt:combobox field="Searcher.Zone" items="AllZones"/>
|
||||
<wt:combobox field="Searcher.Port" items="AllOutPorts"/>
|
||||
</wt:row>
|
||||
</wt:searchpanel>
|
||||
<wt:grid vm="@Model" url="/configs/ProcessConfig/Search"/>
|
||||
Reference in new issue
Block a user