任务明细 出库明细 库存分析 启动出库
This commit is contained in:
1 parent
eef6df7099
commit
f5423e78fe
28 files changed
+500
-77
No files matched your search
@@ -10,9 +10,20 @@ namespace HHWMS.Web
|
||||
{
|
||||
public partial class ShipmentDetailListVM : BasePagedListVM<ShipmentDetail_View, ShipmentDetailSearcher>
|
||||
{
|
||||
private IUnitWork _unitWork { get; set; }
|
||||
protected override void InitVM()
|
||||
{
|
||||
_unitWork = new UnitWork(Wtm);
|
||||
}
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
if (SearcherMode == ListVMSearchModeEnum.MasterDetail
|
||||
|| SearcherMode == ListVMSearchModeEnum.Custom1)
|
||||
{
|
||||
return new List<GridAction>();
|
||||
}
|
||||
else
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("ShipmentDetail", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"shipment", dialogWidth: 800),
|
||||
this.MakeStandardAction("ShipmentDetail", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "shipment", dialogWidth: 800),
|
||||
@@ -27,7 +38,28 @@ namespace HHWMS.Web
|
||||
|
||||
protected override IEnumerable<IGridColumn<ShipmentDetail_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<ShipmentDetail_View>>{
|
||||
if (SearcherMode == ListVMSearchModeEnum.MasterDetail)
|
||||
{
|
||||
return new List<GridColumn<ShipmentDetail_View>>{
|
||||
this.MakeGridHeader(x => x.UniqueCode).SetWidth(220),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.Status)
|
||||
};
|
||||
}
|
||||
else if (SearcherMode == ListVMSearchModeEnum.Custom1)
|
||||
{
|
||||
return new List<GridColumn<ShipmentDetail_View>>{
|
||||
this.MakeGridHeader(x => x.UniqueCode).SetWidth(220),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
this.MakeGridHeader(x => x.Batch),
|
||||
this.MakeGridHeader(x => x.Qty),
|
||||
this.MakeGridHeader(x => x.InventoryStatus)
|
||||
};
|
||||
}
|
||||
else
|
||||
return new List<GridColumn<ShipmentDetail_View>>{
|
||||
this.MakeGridHeader(x => x.Code_view),
|
||||
this.MakeGridHeader(x => x.ZoneCode),
|
||||
this.MakeGridHeader(x => x.MaterialCode),
|
||||
@@ -52,7 +84,31 @@ namespace HHWMS.Web
|
||||
|
||||
public override IOrderedQueryable<ShipmentDetail_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<ShipmentDetail>()
|
||||
InitVM();
|
||||
if (SearcherMode == ListVMSearchModeEnum.Custom1) {
|
||||
var tt = DC.Set<ShipmentDetail>()
|
||||
.CheckEqual(Searcher.ShipmentHeaderId, x => x.ShipmentHeaderId)
|
||||
.Select(x => new ShipmentDetail_View
|
||||
{
|
||||
ID = x.ID,
|
||||
UniqueCode = x.UniqueCode,
|
||||
MaterialCode = x.MaterialCode,
|
||||
Batch = x.Batch,
|
||||
Qty = x.Qty,
|
||||
InventoryStatus = x.InventoryStatus,
|
||||
Status = x.Status
|
||||
}).ToList();
|
||||
foreach(var item in tt.Where(x => x.Status < ShipStatusEnum.分配完成))
|
||||
{
|
||||
var invQty = _unitWork.Find<Inventory>(x => x.UniqueCode.Equals(item.UniqueCode))
|
||||
.Sum(x => x.Qty);
|
||||
item.InventoryStatus = invQty >= (item.Qty - item.DividedQty) ? "true" : "false";
|
||||
}
|
||||
return (IOrderedQueryable<ShipmentDetail_View>)tt.OrderBy(x => x.ID);
|
||||
}
|
||||
else
|
||||
{
|
||||
var query = DC.Set<ShipmentDetail>()
|
||||
.CheckEqual(Searcher.ShipmentHeaderId, x => x.ShipmentHeaderId)
|
||||
.CheckContain(Searcher.ZoneCode, x => x.ZoneCode)
|
||||
.CheckContain(Searcher.MaterialCode, x => x.MaterialCode)
|
||||
@@ -68,6 +124,7 @@ namespace HHWMS.Web
|
||||
{
|
||||
ID = x.ID,
|
||||
Code_view = x.ShipmentHeader.Code,
|
||||
UniqueCode = x.UniqueCode,
|
||||
ZoneCode = x.ZoneCode,
|
||||
MaterialCode = x.MaterialCode,
|
||||
MaterialType = x.MaterialType,
|
||||
@@ -87,7 +144,8 @@ namespace HHWMS.Web
|
||||
Status = x.Status,
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
return query;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user