入库单批量新增 主子表

新增物料表
This commit is contained in:
zgf committed 2023-08-16 09:38:39 +08:00
1 parent f8ee359644
commit f4505ff18d
31 files changed
+949 -9

No files matched your search

@@ -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();
}
}
}