1. 添加你入库页面验证
2. 库存查询条件 3. 接口任务完成修改 4. 添加物料及物料工序的修改
This commit is contained in:
1 parent
13d3a96f0c
commit
713c3528ad
15 files changed
+281
-155
No files matched your search
@@ -45,6 +45,14 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
[HttpPost]
|
||||
public string Search2(MaterialProcessListVM2 vm)
|
||||
{
|
||||
vm.Searcher.Page = vm.FC.GetValue<int>("Page");
|
||||
vm.Searcher.Limit = vm.FC.GetValue<int>("Limit");
|
||||
return vm.GetJson(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Create
|
||||
@@ -112,6 +120,15 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
var code = _unitWork.FindSingle<MaterialProcess>(x => x.ProcessName == vm.Entity.ProcessName)?.ProcessCode;
|
||||
vm.Entity.ProcessCode = code;
|
||||
// 判断是否重复
|
||||
if (_unitWork.IsExit<MaterialProcess>(x => x.ID != vm.Entity.ID && x.MaterialCode == vm.Entity.MaterialCode
|
||||
&& (x.ProcessOrder == vm.Entity.ProcessOrder
|
||||
|| x.ProcessName == vm.Entity.ProcessName)))
|
||||
{
|
||||
return FFResult().Alert("同一物料的工序或者顺序不能重复,请检查后重新编辑!");
|
||||
}
|
||||
vm.DoEdit();
|
||||
if (!ModelState.IsValid)
|
||||
{
|
||||
@@ -120,7 +137,7 @@ namespace HHWMS.Web.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
return FFResult().CloseDialog().RefreshGridRow(vm.Entity.ID);
|
||||
return FFResult().CloseDialog().RefreshGrid(vm.ParentWindowId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ namespace HHWMS.Web
|
||||
var moveloc = GetMoveLocation(outter);
|
||||
if (moveloc.Status)
|
||||
{
|
||||
string code = moveloc.Data.Code;
|
||||
string code = moveloc.Data.LocationCode;
|
||||
var movelocation = _unitWork.FindSingle<Location>(x => x.Code == code);
|
||||
|
||||
// 生成outter移库任务
|
||||
@@ -435,6 +435,7 @@ namespace HHWMS.Web
|
||||
ZoneId = outter.ZoneId,
|
||||
TaskNo = _unitWork.GetSerialNumber("Move"),
|
||||
TaskType = TaskTypeEnum.移库,
|
||||
RoadWay = 2,
|
||||
ContainerCode = outter.ContainerCode,
|
||||
FromLocation = outter.Code,
|
||||
ToLocation = movelocation.Code,
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace HHWMS.Web
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("MaterialProcess", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("MaterialProcess", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("MaterialProcess", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "configs", dialogWidth: 800,dialogHeight:800),
|
||||
this.MakeStandardAction("MaterialProcess", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("MaterialProcess", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("MaterialProcess", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "configs", dialogWidth: 800),
|
||||
@@ -64,7 +64,7 @@ namespace HHWMS.Web
|
||||
Description = x.Description,
|
||||
IsActive = x.IsActive,
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
.OrderBy(x => x.ProcessOrder);
|
||||
return query;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
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 MaterialProcessListVM2 : BasePagedListVM<MaterialProcess_View, MaterialProcessSearcher>
|
||||
{
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>
|
||||
{
|
||||
this.MakeStandardAction("MaterialProcess", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("MaterialProcess", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "configs", dialogWidth: 800,dialogHeight:800),
|
||||
this.MakeStandardAction("MaterialProcess", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "configs", dialogWidth: 800),
|
||||
this.MakeStandardAction("MaterialProcess", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "configs", dialogWidth: 800),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
protected override IEnumerable<IGridColumn<MaterialProcess_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<MaterialProcess_View>>{
|
||||
this.MakeGridHeader(x => x.MaterialCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.ProcessOrder),
|
||||
this.MakeGridHeader(x => x.ProcessName),
|
||||
this.MakeGridHeader(x => x.ProcessCode).SetHide(),
|
||||
this.MakeGridHeader(x => x.Weight),
|
||||
this.MakeGridHeader(x => x.Description),
|
||||
this.MakeGridHeader(x => x.IsActive).SetHide(),
|
||||
this.MakeGridHeaderAction(width: 200)
|
||||
};
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<MaterialProcess_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<MaterialProcess>()
|
||||
.Where( x=>x.MaterialCode == Searcher.MaterialCode)
|
||||
.Select(x => new MaterialProcess_View
|
||||
{
|
||||
ID = x.ID,
|
||||
MaterialCode = x.MaterialCode,
|
||||
ProcessOrder = x.ProcessOrder,
|
||||
ProcessName = x.ProcessName,
|
||||
ProcessCode = x.ProcessCode,
|
||||
Weight = x.Weight,
|
||||
Description = x.Description,
|
||||
IsActive = x.IsActive,
|
||||
})
|
||||
.OrderBy(x => x.ProcessOrder);
|
||||
return query;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,13 +12,20 @@ namespace HHWMS.Web
|
||||
{
|
||||
public partial class MaterialProcessVM : BaseCRUDVM<MaterialProcess>
|
||||
{
|
||||
|
||||
public List<ComboSelectListItem> Processes { get; set; }
|
||||
public MaterialProcessVM()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
var CurrentCulture = Wtm.CurrentCulture;
|
||||
var processDatas = DC.Set<ProcessConfig>().ToList();
|
||||
Processes = processDatas.Select(x => new ComboSelectListItem
|
||||
{
|
||||
Text = x.Name,
|
||||
Value = x.Name
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public override void DoAdd()
|
||||
|
||||
@@ -12,13 +12,15 @@ namespace HHWMS.Web
|
||||
{
|
||||
public partial class MaterialVM : BaseCRUDVM<Material>
|
||||
{
|
||||
|
||||
public MaterialProcessListVM2 materialProcesses = new MaterialProcessListVM2();
|
||||
public MaterialVM()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
materialProcesses.CopyContext(this);
|
||||
materialProcesses.Searcher.MaterialCode = Entity.MaterialCode;
|
||||
}
|
||||
|
||||
public override void DoAdd()
|
||||
|
||||
@@ -2,21 +2,31 @@
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<wt:form vm="@Model">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<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" />
|
||||
<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 items-per-row="ItemsPerRowEnum.Two">
|
||||
<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" />
|
||||
<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:submitbutton click="test2()" text="刷新"/>
|
||||
</wt:row>
|
||||
</wt:form>
|
||||
<wt:grid vm="@Model.materialProcesses" id="materialProcesses" hidden-checkbox="true" hidden-panel="true" use-local-data="true" height="400" />
|
||||
|
||||
<script>
|
||||
function test2(){
|
||||
let code = $('[name="Entity.MaterialCode"]').val()
|
||||
console.log(1,code)
|
||||
layui.table.reload('materialProcesses', { where: { "Searcher.MaterialCode": code } });
|
||||
}
|
||||
</script>
|
||||
@@ -5,8 +5,8 @@
|
||||
<wt:row items-per-row="ItemsPerRowEnum.Two">
|
||||
<wt:textbox field="Entity.MaterialCode" disabled/>
|
||||
<wt:textbox field="Entity.ProcessOrder" />
|
||||
<wt:textbox field="Entity.ProcessName" />
|
||||
<wt:textbox field="Entity.ProcessCode" />
|
||||
<wt:combobox field="Entity.ProcessName" items="Processes" />
|
||||
<wt:hidden field="Entity.ProcessCode" />
|
||||
<wt:textbox field="Entity.Weight" />
|
||||
<wt:textbox field="Entity.Description" />
|
||||
<wt:switch field="Entity.IsActive" />
|
||||
@@ -17,3 +17,7 @@
|
||||
<wt:closebutton />
|
||||
</wt:row>
|
||||
</wt:form>
|
||||
<script>
|
||||
|
||||
|
||||
</script>
|
||||
Reference in new issue
Block a user