入库单批量新增 主子表
新增物料表
This commit is contained in:
1 parent
f8ee359644
commit
f4505ff18d
31 files changed
+949
-9
No files matched your search
@@ -140,6 +140,7 @@ namespace HHWMS.Web.Controllers
|
|||||||
public ActionResult Details(string id)
|
public ActionResult Details(string id)
|
||||||
{
|
{
|
||||||
var vm = Wtm.CreateVM<LocationVM>(id);
|
var vm = Wtm.CreateVM<LocationVM>(id);
|
||||||
|
vm.Inventorys.SearcherMode = ListVMSearchModeEnum.MasterDetail;
|
||||||
return PartialView(vm);
|
return PartialView(vm);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -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 MaterialController : BaseController
|
||||||
|
{
|
||||||
|
private readonly IUnitWork _unitwork;
|
||||||
|
|
||||||
|
public MaterialController(IUnitWork unitwork)
|
||||||
|
{
|
||||||
|
_unitwork = unitwork;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Search
|
||||||
|
[ActionDescription("Sys.Search")]
|
||||||
|
public ActionResult Index()
|
||||||
|
{
|
||||||
|
var vm = Wtm.CreateVM<MaterialListVM>();
|
||||||
|
return PartialView(vm);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ActionDescription("Sys.Search")]
|
||||||
|
[HttpPost]
|
||||||
|
public string Search(MaterialSearcher searcher)
|
||||||
|
{
|
||||||
|
var vm = Wtm.CreateVM<MaterialListVM>(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<MaterialVM>();
|
||||||
|
return PartialView(vm);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[ActionDescription("Sys.Create")]
|
||||||
|
public ActionResult Create(MaterialVM 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<MaterialVM>(id);
|
||||||
|
return PartialView(vm);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ActionDescription("Sys.Edit")]
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateFormItemOnly]
|
||||||
|
public ActionResult Edit(MaterialVM 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<MaterialVM>(id);
|
||||||
|
return PartialView(vm);
|
||||||
|
}
|
||||||
|
|
||||||
|
[ActionDescription("Sys.Delete")]
|
||||||
|
[HttpPost]
|
||||||
|
public ActionResult Delete(string id, IFormCollection nouse)
|
||||||
|
{
|
||||||
|
var vm = Wtm.CreateVM<MaterialVM>(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<MaterialVM>(id);
|
||||||
|
return PartialView(vm);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region BatchEdit
|
||||||
|
[HttpPost]
|
||||||
|
[ActionDescription("Sys.BatchEdit")]
|
||||||
|
public ActionResult BatchEdit(string[] IDs)
|
||||||
|
{
|
||||||
|
var vm = Wtm.CreateVM<MaterialBatchVM>(Ids: IDs);
|
||||||
|
return PartialView(vm);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[ActionDescription("Sys.BatchEdit")]
|
||||||
|
public ActionResult DoBatchEdit(MaterialBatchVM 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<MaterialBatchVM>(Ids: IDs);
|
||||||
|
return PartialView(vm);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[ActionDescription("Sys.BatchDelete")]
|
||||||
|
public ActionResult DoBatchDelete(MaterialBatchVM 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<MaterialImportVM>();
|
||||||
|
return PartialView(vm);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[ActionDescription("Sys.Import")]
|
||||||
|
public ActionResult Import(MaterialImportVM 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(MaterialListVM vm)
|
||||||
|
{
|
||||||
|
return vm.GetExportData();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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 MaterialBatchVM : BaseBatchVM<Material, Material_BatchEdit>
|
||||||
|
{
|
||||||
|
public MaterialBatchVM()
|
||||||
|
{
|
||||||
|
ListVM = new MaterialListVM();
|
||||||
|
LinkedVM = new Material_BatchEdit();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Class to define batch edit fields
|
||||||
|
/// </summary>
|
||||||
|
public class Material_BatchEdit : BaseVM
|
||||||
|
{
|
||||||
|
|
||||||
|
protected override void InitVM()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
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 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")]
|
||||||
|
public ExcelPropety MaterialType_Excel = ExcelPropety.CreateProperty<Material>(x => x.MaterialType);
|
||||||
|
[Display(Name = "Inventory.MaterialName")]
|
||||||
|
public ExcelPropety MaterialName_Excel = ExcelPropety.CreateProperty<Material>(x => x.MaterialName);
|
||||||
|
[Display(Name = "Inventory.MaterialSpec")]
|
||||||
|
public ExcelPropety MaterialSpec_Excel = ExcelPropety.CreateProperty<Material>(x => x.MaterialSpec);
|
||||||
|
[Display(Name = "Inventory.MaterialUnit")]
|
||||||
|
public ExcelPropety MaterialUnit_Excel = ExcelPropety.CreateProperty<Material>(x => x.MaterialUnit);
|
||||||
|
[Display(Name = "Inventory.Batch")]
|
||||||
|
public ExcelPropety Batch_Excel = ExcelPropety.CreateProperty<Material>(x => x.Batch);
|
||||||
|
[Display(Name = "Inventory.Lot")]
|
||||||
|
public ExcelPropety Lot_Excel = ExcelPropety.CreateProperty<Material>(x => x.Lot);
|
||||||
|
[Display(Name = "Inventory.CompanyCode")]
|
||||||
|
public ExcelPropety CompanyCode_Excel = ExcelPropety.CreateProperty<Material>(x => x.CompanyCode);
|
||||||
|
[Display(Name = "Inventory.SupplierCode")]
|
||||||
|
public ExcelPropety SupplierCode_Excel = ExcelPropety.CreateProperty<Material>(x => x.SupplierCode);
|
||||||
|
[Display(Name = "Inventory.Qty")]
|
||||||
|
public ExcelPropety Qty_Excel = ExcelPropety.CreateProperty<Material>(x => x.Qty);
|
||||||
|
|
||||||
|
protected override void InitVM()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MaterialImportVM : BaseImportVM<MaterialTemplateVM, Material>
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
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 MaterialListVM : BasePagedListVM<Material_View, MaterialSearcher>
|
||||||
|
{
|
||||||
|
protected override List<GridAction> InitGridAction()
|
||||||
|
{
|
||||||
|
return new List<GridAction>
|
||||||
|
{
|
||||||
|
this.MakeStandardAction("Material", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"configs", dialogWidth: 800),
|
||||||
|
this.MakeStandardAction("Material", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "configs", dialogWidth: 800),
|
||||||
|
this.MakeStandardAction("Material", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "configs", dialogWidth: 800),
|
||||||
|
this.MakeStandardAction("Material", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "configs", dialogWidth: 800),
|
||||||
|
this.MakeStandardAction("Material", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "configs", dialogWidth: 800),
|
||||||
|
this.MakeStandardAction("Material", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "configs", dialogWidth: 800),
|
||||||
|
this.MakeStandardAction("Material", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "configs", dialogWidth: 800),
|
||||||
|
this.MakeStandardAction("Material", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "configs"),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected override IEnumerable<IGridColumn<Material_View>> InitGridHeader()
|
||||||
|
{
|
||||||
|
return new List<GridColumn<Material_View>>{
|
||||||
|
this.MakeGridHeader(x => x.UniqueCode).SetWidth(220),
|
||||||
|
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),
|
||||||
|
this.MakeGridHeader(x => x.MaterialSpec),
|
||||||
|
this.MakeGridHeader(x => x.MaterialUnit).SetWidth(80),
|
||||||
|
this.MakeGridHeader(x => x.Batch).SetWidth(150),
|
||||||
|
this.MakeGridHeader(x => x.Lot).SetHide(),
|
||||||
|
this.MakeGridHeader(x => x.CompanyCode).SetHide(),
|
||||||
|
this.MakeGridHeader(x => x.SupplierCode),
|
||||||
|
this.MakeGridHeader(x => x.Qty),
|
||||||
|
this.MakeGridHeaderAction(width: 200)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
MaterialSpec = x.MaterialSpec,
|
||||||
|
MaterialUnit = x.MaterialUnit,
|
||||||
|
Batch = x.Batch,
|
||||||
|
Lot = x.Lot,
|
||||||
|
CompanyCode = x.CompanyCode,
|
||||||
|
SupplierCode = x.SupplierCode,
|
||||||
|
Qty = x.Qty,
|
||||||
|
})
|
||||||
|
.OrderBy(x => x.ID);
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Material_View : Material{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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 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; }
|
||||||
|
|
||||||
|
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 MaterialVM : BaseCRUDVM<Material>
|
||||||
|
{
|
||||||
|
|
||||||
|
public MaterialVM()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
@model HHWMS.Web.MaterialBatchVM
|
||||||
|
@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.MaterialBatchVM
|
||||||
|
@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,24 @@
|
|||||||
|
@model HHWMS.Web.MaterialVM
|
||||||
|
@inject IStringLocalizer<Program> Localizer;
|
||||||
|
|
||||||
|
<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" />
|
||||||
|
<wt:textbox field="Entity.MaterialSpec" />
|
||||||
|
<wt:textbox field="Entity.MaterialUnit" />
|
||||||
|
<wt:textbox field="Entity.Batch" />
|
||||||
|
<wt:textbox field="Entity.Lot" />
|
||||||
|
<wt:textbox field="Entity.CompanyCode" />
|
||||||
|
<wt:textbox field="Entity.SupplierCode" />
|
||||||
|
<wt:textbox field="Entity.Qty" />
|
||||||
|
</wt:row>
|
||||||
|
<wt:row align="AlignEnum.Right">
|
||||||
|
<wt:submitbutton />
|
||||||
|
<wt:closebutton />
|
||||||
|
</wt:row>
|
||||||
|
</wt:form>
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
@model HHWMS.Web.MaterialVM
|
||||||
|
@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.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" />
|
||||||
|
<wt:display field="Entity.MaterialSpec" />
|
||||||
|
<wt:display field="Entity.MaterialUnit" />
|
||||||
|
<wt:display field="Entity.Batch" />
|
||||||
|
<wt:display field="Entity.Lot" />
|
||||||
|
<wt:display field="Entity.CompanyCode" />
|
||||||
|
<wt:display field="Entity.SupplierCode" />
|
||||||
|
<wt:display field="Entity.Qty" />
|
||||||
|
</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,23 @@
|
|||||||
|
@model HHWMS.Web.MaterialVM
|
||||||
|
@inject IStringLocalizer<Program> Localizer;
|
||||||
|
|
||||||
|
<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" />
|
||||||
|
<wt:display field="Entity.MaterialSpec" />
|
||||||
|
<wt:display field="Entity.MaterialUnit" />
|
||||||
|
<wt:display field="Entity.Batch" />
|
||||||
|
<wt:display field="Entity.Lot" />
|
||||||
|
<wt:display field="Entity.CompanyCode" />
|
||||||
|
<wt:display field="Entity.SupplierCode" />
|
||||||
|
<wt:display field="Entity.Qty" />
|
||||||
|
</wt:row>
|
||||||
|
<wt:row align="AlignEnum.Right">
|
||||||
|
<wt:closebutton />
|
||||||
|
</wt:row>
|
||||||
|
</wt:form>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
@model HHWMS.Web.MaterialVM
|
||||||
|
@inject IStringLocalizer<Program> Localizer;
|
||||||
|
|
||||||
|
<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" />
|
||||||
|
<wt:textbox field="Entity.MaterialSpec" />
|
||||||
|
<wt:textbox field="Entity.MaterialUnit" />
|
||||||
|
<wt:textbox field="Entity.Batch" />
|
||||||
|
<wt:textbox field="Entity.Lot" />
|
||||||
|
<wt:textbox field="Entity.CompanyCode" />
|
||||||
|
<wt:textbox field="Entity.SupplierCode" />
|
||||||
|
<wt:textbox field="Entity.Qty" />
|
||||||
|
</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.MaterialImportVM
|
||||||
|
@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,11 @@
|
|||||||
|
@model HHWMS.Web.MaterialListVM
|
||||||
|
@inject IStringLocalizer<Program> Localizer;
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<wt:grid vm="@Model" url="/configs/Material/Search"/>
|
||||||
@@ -10,7 +10,7 @@ namespace HHWMS.Web
|
|||||||
{
|
{
|
||||||
protected override List<GridAction> InitGridAction()
|
protected override List<GridAction> InitGridAction()
|
||||||
{
|
{
|
||||||
if (SearcherMode == ListVMSearchModeEnum.MasterDetail)
|
if (SearcherMode != ListVMSearchModeEnum.MasterDetail)
|
||||||
{
|
{
|
||||||
return new List<GridAction>
|
return new List<GridAction>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using WalkingTec.Mvvm.Core;
|
using WalkingTec.Mvvm.Core;
|
||||||
using WalkingTec.Mvvm.Mvc;
|
using WalkingTec.Mvvm.Mvc;
|
||||||
using WalkingTec.Mvvm.Core.Extensions;
|
using WalkingTec.Mvvm.Core.Extensions;
|
||||||
|
using HHWMS.Web.Models;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace HHWMS.Web.Controllers
|
namespace HHWMS.Web.Controllers
|
||||||
{
|
{
|
||||||
@@ -39,6 +41,15 @@ namespace HHWMS.Web.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ActionDescription("Sys.Search")]
|
||||||
|
[HttpPost]
|
||||||
|
public string Search2(ReceiptDetailListVM2 vm)
|
||||||
|
{
|
||||||
|
vm.Searcher.Page = vm.FC.GetValue<int>("Page");
|
||||||
|
vm.Searcher.Limit = vm.FC.GetValue<int>("Limit");
|
||||||
|
return vm.GetJson(false);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Create
|
#region Create
|
||||||
@@ -71,6 +82,67 @@ namespace HHWMS.Web.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ActionDescription("Sys.Create")]
|
||||||
|
public ActionResult Create2(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 Create2(ReceiptDetailVM vm)
|
||||||
|
{
|
||||||
|
if (!ModelState.IsValid)
|
||||||
|
{
|
||||||
|
return PartialView(vm);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vm.DoAdd();
|
||||||
|
if (!ModelState.IsValid)
|
||||||
|
{
|
||||||
|
vm.DoReInit();
|
||||||
|
return PartialView(vm);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return FFResult().CloseDialog().RefreshGrid(index: 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[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 materialCodeList = vm.Entity.MaterialCode.Split("\n");
|
||||||
|
var detailList = new List<ReceiptDetail>();
|
||||||
|
foreach(var item in materialCodeList)
|
||||||
|
{
|
||||||
|
detailList.Add(new ReceiptDetail
|
||||||
|
{
|
||||||
|
MaterialCode = item,
|
||||||
|
ReceiptHeaderId = vm.Entity.ReceiptHeaderId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
_unitwork.BatchAdd(detailList.ToArray());
|
||||||
|
return FFResult().CloseDialog().RefreshGrid(index: 1);
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Edit
|
#region Edit
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using System;
|
using System;
|
||||||
using WalkingTec.Mvvm.Core;
|
using WalkingTec.Mvvm.Core;
|
||||||
@@ -138,6 +138,7 @@ namespace HHWMS.Web.Controllers
|
|||||||
public ActionResult Details(string id)
|
public ActionResult Details(string id)
|
||||||
{
|
{
|
||||||
var vm = Wtm.CreateVM<ReceiptHeaderVM>(id);
|
var vm = Wtm.CreateVM<ReceiptHeaderVM>(id);
|
||||||
|
vm.Details.SearcherMode = ListVMSearchModeEnum.MasterDetail;
|
||||||
return PartialView(vm);
|
return PartialView(vm);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -0,0 +1,89 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using HHWMS.Web.Models;
|
||||||
|
using WalkingTec.Mvvm.Core;
|
||||||
|
|
||||||
|
namespace HHWMS.Web
|
||||||
|
{
|
||||||
|
public partial class ReceiptDetailListVM2 : BasePagedListVM<ReceiptDetail_View, ReceiptDetailSearcher>
|
||||||
|
{
|
||||||
|
protected override List<GridAction> InitGridAction()
|
||||||
|
{
|
||||||
|
if (SearcherMode != ListVMSearchModeEnum.MasterDetail)
|
||||||
|
{
|
||||||
|
return new List<GridAction>
|
||||||
|
{
|
||||||
|
//this.MakeStandardAction("ReceiptDetail", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"receipt", dialogWidth: 800),
|
||||||
|
this.MakeAction("ReceiptDetail","Create2",Localizer["Sys.Create"],Localizer["Sys.Create"],GridActionParameterTypesEnum.NoId,"receipt").SetOnClickScript("CreateDetail"),
|
||||||
|
this.MakeAction("ReceiptDetail","CreateDetail",Localizer["Sys.CreateDetails"],Localizer["Sys.CreateDetails"],GridActionParameterTypesEnum.NoId,"receipt").SetOnClickScript("CreateDetails"),
|
||||||
|
|
||||||
|
this.MakeStandardAction("ReceiptDetail", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "receipt", dialogWidth: 800),
|
||||||
|
this.MakeStandardAction("ReceiptDetail", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "receipt", dialogWidth: 800),
|
||||||
|
this.MakeStandardAction("ReceiptDetail", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "receipt", dialogWidth: 800),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return new List<GridAction>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override IEnumerable<IGridColumn<ReceiptDetail_View>> InitGridHeader()
|
||||||
|
{
|
||||||
|
var result = new List<GridColumn<ReceiptDetail_View>>{
|
||||||
|
this.MakeGridHeader(x => x.Code_view),
|
||||||
|
this.MakeGridHeader(x => x.ZoneCode),
|
||||||
|
this.MakeGridHeader(x => x.MaterialCode),
|
||||||
|
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.ManufactureDate),
|
||||||
|
this.MakeGridHeader(x => x.ExpirationDate),
|
||||||
|
this.MakeGridHeader(x => x.CompanyCode),
|
||||||
|
this.MakeGridHeader(x => x.SupplierCode),
|
||||||
|
this.MakeGridHeader(x => x.CompletedQty),
|
||||||
|
this.MakeGridHeader(x => x.Qty),
|
||||||
|
this.MakeGridHeader(x => x.InventoryStatus),
|
||||||
|
this.MakeGridHeader(x => x.Status)
|
||||||
|
};
|
||||||
|
|
||||||
|
if (SearcherMode != ListVMSearchModeEnum.MasterDetail)
|
||||||
|
{
|
||||||
|
result.Add(this.MakeGridHeaderAction(width: 200));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IOrderedQueryable<ReceiptDetail_View> GetSearchQuery()
|
||||||
|
{
|
||||||
|
var query = DC.Set<ReceiptDetail>()
|
||||||
|
.Where(x => x.ReceiptHeaderId == Searcher.ReceiptHeaderId)
|
||||||
|
.Select(x => new ReceiptDetail_View
|
||||||
|
{
|
||||||
|
ID = x.ID,
|
||||||
|
Code_view = x.ReceiptHeader.Code,
|
||||||
|
ZoneCode = x.ZoneCode,
|
||||||
|
MaterialCode = x.MaterialCode,
|
||||||
|
MaterialType = x.MaterialType,
|
||||||
|
MaterialName = x.MaterialName,
|
||||||
|
MaterialSpec = x.MaterialSpec,
|
||||||
|
MaterialUnit = x.MaterialUnit,
|
||||||
|
Batch = x.Batch,
|
||||||
|
Lot = x.Lot,
|
||||||
|
ManufactureDate = x.ManufactureDate,
|
||||||
|
ExpirationDate = x.ExpirationDate,
|
||||||
|
CompanyCode = x.CompanyCode,
|
||||||
|
SupplierCode = x.SupplierCode,
|
||||||
|
CompletedQty = x.CompletedQty,
|
||||||
|
Qty = x.Qty,
|
||||||
|
InventoryStatus = x.InventoryStatus,
|
||||||
|
Status = x.Status,
|
||||||
|
})
|
||||||
|
.OrderBy(x => x.ID);
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,12 @@ namespace HHWMS.Web
|
|||||||
{
|
{
|
||||||
public partial class ReceiptHeaderListVM : BasePagedListVM<ReceiptHeader_View, ReceiptHeaderSearcher>
|
public partial class ReceiptHeaderListVM : BasePagedListVM<ReceiptHeader_View, ReceiptHeaderSearcher>
|
||||||
{
|
{
|
||||||
|
public ReceiptDetailListVM2 Details { get; set; } = new ReceiptDetailListVM2();
|
||||||
|
|
||||||
|
protected override void InitVM()
|
||||||
|
{
|
||||||
|
Details.CopyContext(this);
|
||||||
|
}
|
||||||
protected override List<GridAction> InitGridAction()
|
protected override List<GridAction> InitGridAction()
|
||||||
{
|
{
|
||||||
return new List<GridAction>
|
return new List<GridAction>
|
||||||
@@ -27,7 +33,11 @@ namespace HHWMS.Web
|
|||||||
{
|
{
|
||||||
return new List<GridColumn<ReceiptHeader_View>>{
|
return new List<GridColumn<ReceiptHeader_View>>{
|
||||||
this.MakeGridHeader(x => x.SourceCode),
|
this.MakeGridHeader(x => x.SourceCode),
|
||||||
this.MakeGridHeader(x => x.Code),
|
this.MakeGridHeader(x => x.Code).SetFormat((a,b) =>
|
||||||
|
{
|
||||||
|
string rv = UIService.MakeScriptButton(ButtonTypesEnum.Link,a.Code,$"details('{a.ID}')");
|
||||||
|
return rv;
|
||||||
|
}),
|
||||||
this.MakeGridHeader(x => x.BillType),
|
this.MakeGridHeader(x => x.BillType),
|
||||||
this.MakeGridHeader(x => x.CompanyCode),
|
this.MakeGridHeader(x => x.CompanyCode),
|
||||||
this.MakeGridHeader(x => x.SupplierCode),
|
this.MakeGridHeader(x => x.SupplierCode),
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using HHWMS.Web.Models;
|
using HHWMS.Web.Models;
|
||||||
using WalkingTec.Mvvm.Core;
|
using WalkingTec.Mvvm.Core;
|
||||||
@@ -7,12 +8,15 @@ namespace HHWMS.Web
|
|||||||
{
|
{
|
||||||
public partial class ReceiptHeaderVM : BaseCRUDVM<ReceiptHeader>
|
public partial class ReceiptHeaderVM : BaseCRUDVM<ReceiptHeader>
|
||||||
{
|
{
|
||||||
|
public ReceiptDetailListVM2 Details = new ReceiptDetailListVM2();
|
||||||
public ReceiptHeaderVM()
|
public ReceiptHeaderVM()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void InitVM()
|
protected override void InitVM()
|
||||||
{
|
{
|
||||||
|
Details.CopyContext(this);
|
||||||
|
Details.Searcher.ReceiptHeaderId = Entity.ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void DoAdd()
|
public override void DoAdd()
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
@model HHWMS.Web.ReceiptDetailVM
|
||||||
|
@inject IStringLocalizer<Program> Localizer;
|
||||||
|
|
||||||
|
<wt:form vm="@Model">
|
||||||
|
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||||
|
<wt:textbox field="Entity.ZoneCode" />
|
||||||
|
<wt:textbox field="Entity.MaterialCode" />
|
||||||
|
<wt:textbox field="Entity.MaterialType" />
|
||||||
|
<wt:textbox field="Entity.MaterialName" />
|
||||||
|
<wt:textbox field="Entity.MaterialSpec" />
|
||||||
|
<wt:textbox field="Entity.MaterialUnit" />
|
||||||
|
<wt:textbox field="Entity.Batch" />
|
||||||
|
<wt:textbox field="Entity.Lot" />
|
||||||
|
<wt:datetime field="Entity.ManufactureDate" />
|
||||||
|
<wt:datetime field="Entity.ExpirationDate" />
|
||||||
|
<wt:textbox field="Entity.CompanyCode" />
|
||||||
|
<wt:textbox field="Entity.SupplierCode" />
|
||||||
|
<wt:textbox field="Entity.CompletedQty" />
|
||||||
|
<wt:textbox field="Entity.Qty" />
|
||||||
|
<wt:textbox field="Entity.InventoryStatus" />
|
||||||
|
<wt:combobox field="Entity.Status" />
|
||||||
|
</wt:row>
|
||||||
|
<wt:hidden field="Entity.ReceiptHeaderId" />
|
||||||
|
<wt:row align="AlignEnum.Right">
|
||||||
|
<wt:submitbutton />
|
||||||
|
<wt:closebutton />
|
||||||
|
</wt:row>
|
||||||
|
</wt:form>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
@model HHWMS.Web.ReceiptDetailVM
|
||||||
|
@inject IStringLocalizer<Program> Localizer;
|
||||||
|
|
||||||
|
<wt:form vm="@Model">
|
||||||
|
<wt:row items-per-row="ItemsPerRowEnum.One">
|
||||||
|
<wt:textarea field="Entity.MaterialCode" />
|
||||||
|
</wt:row>
|
||||||
|
<wt:hidden field="Entity.ReceiptHeaderId" />
|
||||||
|
<wt:row align="AlignEnum.Right">
|
||||||
|
<wt:submitbutton />
|
||||||
|
<wt:closebutton />
|
||||||
|
</wt:row>
|
||||||
|
</wt:form>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
@model HHWMS.Web.ReceiptHeaderVM
|
@model HHWMS.Web.ReceiptHeaderVM
|
||||||
@inject IStringLocalizer<Program> Localizer;
|
@inject IStringLocalizer<Program> Localizer;
|
||||||
|
|
||||||
<wt:form vm="@Model">
|
<wt:form vm="@Model">
|
||||||
@@ -15,6 +15,8 @@
|
|||||||
<wt:display field="Entity.AppointmentTime" />
|
<wt:display field="Entity.AppointmentTime" />
|
||||||
<wt:display field="Entity.Remark" />
|
<wt:display field="Entity.Remark" />
|
||||||
</wt:row>
|
</wt:row>
|
||||||
|
<wt:grid vm="@Model.Details" height="300" hidden-checkbox="true" hidden-grid-index="true" use-local-data="true" hidden-panel="true" />
|
||||||
|
|
||||||
<wt:row align="AlignEnum.Right">
|
<wt:row align="AlignEnum.Right">
|
||||||
<wt:closebutton />
|
<wt:closebutton />
|
||||||
</wt:row>
|
</wt:row>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@model HHWMS.Web.ReceiptHeaderListVM
|
@model HHWMS.Web.ReceiptHeaderListVM
|
||||||
@inject IStringLocalizer<Program> Localizer;
|
@inject IStringLocalizer<Program> Localizer;
|
||||||
|
|
||||||
<wt:searchpanel vm="@Model" reset-btn="true">
|
<wt:searchpanel vm="@Model" reset-btn="true" grid-id="header">
|
||||||
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
<wt:row items-per-row="ItemsPerRowEnum.Three">
|
||||||
<wt:textbox field="Searcher.SourceCode" />
|
<wt:textbox field="Searcher.SourceCode" />
|
||||||
<wt:textbox field="Searcher.Code" />
|
<wt:textbox field="Searcher.Code" />
|
||||||
@@ -10,4 +10,33 @@
|
|||||||
<wt:combobox field="Searcher.LastStatus" empty-text="@Localizer["Sys.All"]" />
|
<wt:combobox field="Searcher.LastStatus" empty-text="@Localizer["Sys.All"]" />
|
||||||
</wt:row>
|
</wt:row>
|
||||||
</wt:searchpanel>
|
</wt:searchpanel>
|
||||||
<wt:grid vm="@Model" url="/receipt/ReceiptHeader/Search"/>
|
<wt:grid vm="@Model" id="header" url="/receipt/ReceiptHeader/Search" limit="7" />
|
||||||
|
<wt:grid vm="@Model.Details" id="detail" url="/receipt/ReceiptDetail/Search2" height="400" />
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var headerId = 0;
|
||||||
|
function details(id) {
|
||||||
|
headerId = id;
|
||||||
|
layui.table.reload('detail', { where: { "Searcher.ReceiptHeaderId": id } });
|
||||||
|
}
|
||||||
|
|
||||||
|
function CreateDetail() {
|
||||||
|
if (headerId == 0) {
|
||||||
|
layui.layer.alert('请选择一个单据');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
ff.OpenDialog('/receipt/ReceiptDetail/Create2/' + headerId, '@Guid.NewGuid()', '添加明细', 600);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function CreateDetails() {
|
||||||
|
if (headerId == 0) {
|
||||||
|
layui.layer.alert('请选择一个单据');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
ff.OpenDialog('/receipt/ReceiptDetail/CreateDetails/' + headerId, '@Guid.NewGuid()', '批量添加明细', 600);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -41,6 +41,8 @@ namespace HHWMS.Web.Controllers
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
public string Search2(SysDictDataListVM2 vm)
|
public string Search2(SysDictDataListVM2 vm)
|
||||||
{
|
{
|
||||||
|
vm.Searcher.Page = vm.FC.GetValue<int>("Page");
|
||||||
|
vm.Searcher.Limit = vm.FC.GetValue<int>("Limit");
|
||||||
return vm.GetJson(false);
|
return vm.GetJson(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
DictType = val.DictType;
|
DictType = val.DictType;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
layui.table.reload('detail', { where: { "Searcher.SysDictTypeId": id } });
|
layui.table.reload('detail', { where: { "Searcher.SysDictTypeId": id , "page": false} });
|
||||||
}
|
}
|
||||||
|
|
||||||
function CreateDictData() {
|
function CreateDictData() {
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ namespace HHWMS.Web
|
|||||||
public DbSet<ShipmentHeaderHistory> ShipmentHeaderHistories { get; set; }
|
public DbSet<ShipmentHeaderHistory> ShipmentHeaderHistories { get; set; }
|
||||||
public DbSet<ShipmentDetailHistory> ShipmentDetailHistories { get; set; }
|
public DbSet<ShipmentDetailHistory> ShipmentDetailHistories { get; set; }
|
||||||
public DbSet<ReportDesign> ReportDesigns { get; set; }
|
public DbSet<ReportDesign> ReportDesigns { get; set; }
|
||||||
|
public DbSet<Material> Materials { get; set; }
|
||||||
public override async Task<bool> DataInit(object allModules, bool IsSpa)
|
public override async Task<bool> DataInit(object allModules, bool IsSpa)
|
||||||
{
|
{
|
||||||
var state = await base.DataInit(allModules, IsSpa);
|
var state = await base.DataInit(allModules, IsSpa);
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
||||||
|
using WalkingTec.Mvvm.Core;
|
||||||
|
|
||||||
|
namespace HHWMS.Web.Models
|
||||||
|
{
|
||||||
|
[Table("Material")]
|
||||||
|
public class Material : BasePoco
|
||||||
|
{
|
||||||
|
[Key]
|
||||||
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
public new int ID { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.UniqueCode", Description = "唯一码")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string UniqueCode { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.QRCode", Description = "二维码")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string QRCode { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.SourceCode", Description = "上游单号")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string SourceCode { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.MaterialCode", Description = "物料编码")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string MaterialCode { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.MaterialType", Description = "物料类型")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string MaterialType { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.MaterialName", Description = "物料名称")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string MaterialName { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.MaterialSpec", Description = "物料规格")]
|
||||||
|
public string MaterialSpec { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.MaterialUnit", Description = "单位")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string MaterialUnit { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.Batch", Description = "批次")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string Batch { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.Lot", Description = "料号")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string Lot { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.CompanyCode", Description = "公司")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string CompanyCode { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.SupplierCode", Description = "供应商")]
|
||||||
|
[StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
|
||||||
|
public string SupplierCode { get; set; }
|
||||||
|
|
||||||
|
[Display(Name = "Inventory.Qty", Description = "数量")]
|
||||||
|
[Column(TypeName = "decimal(12,4)")]
|
||||||
|
public decimal? Qty { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -369,6 +369,9 @@
|
|||||||
<data name="Sys.Create" xml:space="preserve">
|
<data name="Sys.Create" xml:space="preserve">
|
||||||
<value>新建</value>
|
<value>新建</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Sys.CreateDetails" xml:space="preserve">
|
||||||
|
<value>批量新建</value>
|
||||||
|
</data>
|
||||||
<data name="Sys.DataCannotDelete" xml:space="preserve">
|
<data name="Sys.DataCannotDelete" xml:space="preserve">
|
||||||
<value>数据被使用,无法删除</value>
|
<value>数据被使用,无法删除</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -1236,6 +1239,9 @@
|
|||||||
<data name="Inventory.UniqueCode" xml:space="preserve">
|
<data name="Inventory.UniqueCode" xml:space="preserve">
|
||||||
<value>唯一码</value>
|
<value>唯一码</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Inventory.QRCode" xml:space="preserve">
|
||||||
|
<value>二维码</value>
|
||||||
|
</data>
|
||||||
<data name="Inventory.ReceiptCode" xml:space="preserve">
|
<data name="Inventory.ReceiptCode" xml:space="preserve">
|
||||||
<value>单据单号</value>
|
<value>单据单号</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace WalkingTec.Mvvm.Core
|
|||||||
var propType = me.Type;
|
var propType = me.Type;
|
||||||
if (propType == typeof(string))
|
if (propType == typeof(string))
|
||||||
{
|
{
|
||||||
alignType = GridColumnAlignEnum.Left;
|
alignType = GridColumnAlignEnum.Center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user