新增循环测试
This commit is contained in:
1 parent
f4505ff18d
commit
028d206936
21 files changed
+619
-50
No files matched your search
@@ -5,6 +5,7 @@ using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
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;
|
||||
using HHWMS.Web.Models;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
[Area("receipt")]
|
||||
[ActionDescription("入库单操作")]
|
||||
public partial class ReceiptInController : BaseController
|
||||
{
|
||||
private readonly IUnitWork _unitwork;
|
||||
public ReceiptInController(IUnitWork unitwork)
|
||||
{
|
||||
_unitwork = unitwork;
|
||||
}
|
||||
#region Search
|
||||
[ActionDescription("Sys.Search")]
|
||||
public ActionResult Index()
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptInListVM>();
|
||||
return PartialView(vm);
|
||||
}
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
[HttpPost]
|
||||
public string Search(ReceiptInSearcher searcher)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptInListVM>(passInit: true);
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
vm.Searcher = searcher;
|
||||
return vm.GetJson(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return vm.GetError();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using Z.EntityFramework.Plus;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class ReceiptInVM : BaseCRUDVM<ReceiptHeader>
|
||||
{
|
||||
public ReceiptDetailListVM2 Details = new ReceiptDetailListVM2();
|
||||
public ReceiptInVM()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
Details.CopyContext(this);
|
||||
Details.Searcher.ReceiptHeaderId = Entity.ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class ReceiptInListVM : BasePagedListVM<ReceiptHeader_View, ReceiptInSearcher>
|
||||
{
|
||||
public ReceiptDetailListVM2 Details { get; set; } = new ReceiptDetailListVM2();
|
||||
public List<ComboSelectListItem> Codes { get; set; }
|
||||
protected override void InitVM()
|
||||
{
|
||||
Details.CopyContext(this);
|
||||
Codes = DC.Set<ReceiptHeader>().Select(x => new ComboSelectListItem
|
||||
{
|
||||
Text = x.Code,
|
||||
Value = x.Code
|
||||
}).ToList();
|
||||
}
|
||||
protected override List<GridAction> InitGridAction()
|
||||
{
|
||||
return new List<GridAction>();
|
||||
/*{
|
||||
this.MakeStandardAction("ReceiptHeader", GridActionStandardTypesEnum.Create, Localizer["Sys.Create"],"receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptHeader", GridActionStandardTypesEnum.Edit, Localizer["Sys.Edit"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptHeader", GridActionStandardTypesEnum.Delete, Localizer["Sys.Delete"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptHeader", GridActionStandardTypesEnum.Details, Localizer["Sys.Details"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptHeader", GridActionStandardTypesEnum.BatchEdit, Localizer["Sys.BatchEdit"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptHeader", GridActionStandardTypesEnum.BatchDelete, Localizer["Sys.BatchDelete"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptHeader", GridActionStandardTypesEnum.Import, Localizer["Sys.Import"], "receipt", dialogWidth: 800),
|
||||
this.MakeStandardAction("ReceiptHeader", GridActionStandardTypesEnum.ExportExcel, Localizer["Sys.Export"], "receipt"),
|
||||
};*/
|
||||
}
|
||||
|
||||
protected override IEnumerable<IGridColumn<ReceiptHeader_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<ReceiptHeader_View>>{
|
||||
this.MakeGridHeader(x => x.Code)
|
||||
};
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<ReceiptHeader_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<ReceiptHeader>()
|
||||
.CheckContain(Searcher.Code, x => x.Code)
|
||||
.Select(x => new ReceiptHeader_View
|
||||
{
|
||||
ID = x.ID,
|
||||
Code = x.Code
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using HHWMS.Web.Models;
|
||||
using WalkingTec.Mvvm.Core;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class ReceiptInSearcher : BaseSearcher
|
||||
{
|
||||
[Display(Name = "Inventory.SourceCode")]
|
||||
public String SourceCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.ReceiptCode")]
|
||||
public String Code { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.BillType")]
|
||||
public String BillType { get; set; }
|
||||
|
||||
[Display(Name = "Receipt.FirstStatus")]
|
||||
public ReceiptStatusEnum? FirstStatus { get; set; }
|
||||
|
||||
[Display(Name = "Receipt.LastStatus")]
|
||||
public ReceiptStatusEnum? LastStatus { get; set; }
|
||||
|
||||
protected override void InitVM()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
@model HHWMS.Web.ReceiptInListVM
|
||||
@inject IStringLocalizer<Program> Localizer;
|
||||
|
||||
<div class="layui-bg-gray" style="padding: 16px;">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-hide" id="ID-table-demo-data"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<wt:grid vm="@Model" id="header" url="/receipt/ReceiptHeader/Search" limit="7"
|
||||
hidden-checkbox="true"
|
||||
need-show-filter="false"
|
||||
need-show-print="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.use('table', function(){
|
||||
var table = layui.table;
|
||||
|
||||
// 已知数据渲染
|
||||
var inst = table.render({
|
||||
elem: '#ID-table-demo-data'
|
||||
,cols: [[ //标题栏
|
||||
{field: 'id', title: 'ID', width: 80, sort: true}
|
||||
,{field: 'username', title: '用户', width: 120}
|
||||
,{field: 'sign', title: '签名', minWidth: 160}
|
||||
,{field: 'sex', title: '性别', width: 80}
|
||||
,{field: 'city', title: '城市', width: 100}
|
||||
,{field: 'experience', title: '积分', width: 80, sort: true}
|
||||
]]
|
||||
,data: [{ // 赋值已知数据
|
||||
"id": "10001"
|
||||
,"username": "张三1"
|
||||
,"sex": "男"
|
||||
,"city": "浙江杭州"
|
||||
,"sign": "人生恰似一场修行"
|
||||
,"experience": "116"
|
||||
}, {
|
||||
"id": "10002"
|
||||
,"username": "张三2"
|
||||
,"sex": "男"
|
||||
,"city": "浙江杭州"
|
||||
,"sign": "人生恰似一场修行"
|
||||
,"experience": "12"
|
||||
,"LAY_CHECKED": true
|
||||
}, {
|
||||
"id": "10003"
|
||||
,"username": "张三3"
|
||||
,"sex": "男"
|
||||
,"city": "浙江杭州"
|
||||
,"sign": "人生恰似一场修行"
|
||||
,"experience": "65"
|
||||
}, {
|
||||
"id": "10004"
|
||||
,"username": "张三4"
|
||||
,"sex": "男"
|
||||
,"city": "浙江杭州"
|
||||
,"sign": "人生恰似一场修行"
|
||||
,"experience": "777"
|
||||
}, {
|
||||
"id": "10005"
|
||||
,"username": "张三5"
|
||||
,"sex": "男"
|
||||
,"city": "浙江杭州"
|
||||
,"sign": "人生恰似一场修行"
|
||||
,"experience": "86"
|
||||
}, {
|
||||
"id": "10006"
|
||||
,"username": "张三6"
|
||||
,"sex": "男"
|
||||
,"city": "浙江杭州"
|
||||
,"sign": "人生恰似一场修行"
|
||||
,"experience": "12"
|
||||
}, {
|
||||
"id": "10007"
|
||||
,"username": "张三7"
|
||||
,"sex": "男"
|
||||
,"city": "浙江杭州"
|
||||
,"sign": "人生恰似一场修行"
|
||||
,"experience": "16"
|
||||
}, {
|
||||
"id": "10008"
|
||||
,"username": "张三8"
|
||||
,"sex": "男"
|
||||
,"city": "浙江杭州"
|
||||
,"sign": "人生恰似一场修行"
|
||||
,"experience": "106"
|
||||
}]
|
||||
//,skin: 'line' // 表格风格
|
||||
//,even: true
|
||||
, height: 'full-200'
|
||||
,page: false // 是否显示分页
|
||||
});
|
||||
});
|
||||
|
||||
table.render({
|
||||
elem:"header"
|
||||
, height: 'full-200'
|
||||
, page: false // 是否显示分页
|
||||
})
|
||||
</script>
|
||||
Reference in new issue
Block a user