入库操作页面测试
This commit is contained in:
parent
028d206936
commit
85a2ad05c3
@ -6,6 +6,8 @@ using WalkingTec.Mvvm.Mvc;
|
||||
using WalkingTec.Mvvm.Core.Extensions;
|
||||
using HHWMS.Web;
|
||||
using HHWMS.Web.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Linq;
|
||||
|
||||
namespace HHWMS.Web.Controllers
|
||||
{
|
||||
@ -28,18 +30,26 @@ namespace HHWMS.Web.Controllers
|
||||
|
||||
[ActionDescription("Sys.Search")]
|
||||
[HttpPost]
|
||||
public string Search(ReceiptInSearcher searcher)
|
||||
public string Search(ReceiptDetailListVM vm)
|
||||
{
|
||||
var vm = Wtm.CreateVM<ReceiptInListVM>(passInit: true);
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
vm.Searcher = searcher;
|
||||
return vm.GetJson(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return vm.GetError();
|
||||
}
|
||||
vm.Searcher.Page = vm.FC.GetValue<int>("Page");
|
||||
vm.Searcher.Limit = vm.FC.GetValue<int>("Limit");
|
||||
vm.Searcher.ReceiptHeaderId = vm.FC.GetValue<int>("Code");
|
||||
return vm.GetJson(false);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public ActionResult<dynamic> SelectReceipt(string Code)
|
||||
{
|
||||
var data = _unitwork.Find<ReceiptHeader>(x => x.Code == Code).Include(x => x.ReceiptDetails).FirstOrDefault();
|
||||
var result = data.ReceiptDetails;
|
||||
return JsonMore(result);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public IActionResult Test(string Code, string code2, string code3, string code4)
|
||||
{
|
||||
return FFResult().Message("success");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@ -6,7 +6,7 @@ using WalkingTec.Mvvm.Core.Extensions;
|
||||
|
||||
namespace HHWMS.Web
|
||||
{
|
||||
public partial class ReceiptInListVM : BasePagedListVM<ReceiptHeader_View, ReceiptInSearcher>
|
||||
public partial class ReceiptInListVM : BasePagedListVM<ReceiptDetail_View, ReceiptInSearcher>
|
||||
{
|
||||
public ReceiptDetailListVM2 Details { get; set; } = new ReceiptDetailListVM2();
|
||||
public List<ComboSelectListItem> Codes { get; set; }
|
||||
@ -16,7 +16,7 @@ namespace HHWMS.Web
|
||||
Codes = DC.Set<ReceiptHeader>().Select(x => new ComboSelectListItem
|
||||
{
|
||||
Text = x.Code,
|
||||
Value = x.Code
|
||||
Value = x.ID
|
||||
}).ToList();
|
||||
}
|
||||
protected override List<GridAction> InitGridAction()
|
||||
@ -34,21 +34,21 @@ namespace HHWMS.Web
|
||||
};*/
|
||||
}
|
||||
|
||||
protected override IEnumerable<IGridColumn<ReceiptHeader_View>> InitGridHeader()
|
||||
protected override IEnumerable<IGridColumn<ReceiptDetail_View>> InitGridHeader()
|
||||
{
|
||||
return new List<GridColumn<ReceiptHeader_View>>{
|
||||
this.MakeGridHeader(x => x.Code)
|
||||
return new List<GridColumn<ReceiptDetail_View>>{
|
||||
this.MakeGridHeader(x => x.MaterialCode)
|
||||
};
|
||||
}
|
||||
|
||||
public override IOrderedQueryable<ReceiptHeader_View> GetSearchQuery()
|
||||
public override IOrderedQueryable<ReceiptDetail_View> GetSearchQuery()
|
||||
{
|
||||
var query = DC.Set<ReceiptHeader>()
|
||||
.CheckContain(Searcher.Code, x => x.Code)
|
||||
.Select(x => new ReceiptHeader_View
|
||||
var query = DC.Set<ReceiptDetail>()
|
||||
.Where(x => x.ReceiptHeaderId.Equals(Searcher.ReceiptHeaderId))
|
||||
.Select(x => new ReceiptDetail_View
|
||||
{
|
||||
ID = x.ID,
|
||||
Code = x.Code
|
||||
MaterialCode = x.MaterialCode
|
||||
})
|
||||
.OrderBy(x => x.ID);
|
||||
return query;
|
||||
|
||||
@ -7,12 +7,24 @@ namespace HHWMS.Web
|
||||
{
|
||||
public partial class ReceiptInSearcher : BaseSearcher
|
||||
{
|
||||
[Display(Name = "Inventory.ReceiptCode")]
|
||||
public int ReceiptHeaderId { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.SourceCode")]
|
||||
public String SourceCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.ReceiptCode")]
|
||||
public String Code { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.BoxCode")]
|
||||
public String BoxCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.Size")]
|
||||
public String Size { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.UniqueCode")]
|
||||
public String UniqueCode { get; set; }
|
||||
|
||||
[Display(Name = "Inventory.BillType")]
|
||||
public String BillType { get; set; }
|
||||
|
||||
|
||||
@ -3,109 +3,115 @@
|
||||
|
||||
<div class="layui-bg-gray" style="padding: 16px;">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-md6">
|
||||
|
||||
<div class="layui-col-md3">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-hide" id="ID-table-demo-data"></table>
|
||||
<wt:searchpanel vm="@Model" reset-btn="true" grid-id="header" expanded="true">
|
||||
<wt:row items-per-row="ItemsPerRowEnum.One">
|
||||
<wt:combobox field="Searcher.Code" items="Codes" hide-label="true" />
|
||||
</wt:row>
|
||||
</wt:searchpanel>
|
||||
<wt:grid vm="@Model" id="header" url="/receipt/ReceiptIn/Search"
|
||||
hidden-checkbox="true"
|
||||
hidden-grid-index="true"
|
||||
need-show-filter="false"
|
||||
need-show-print="false" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
</div>
|
||||
|
||||
<div class="layui-col-md9">
|
||||
<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"
|
||||
/>
|
||||
<form class="layui-form layui-form-pane" action="form.html">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">单号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="Code" autocomplete="off" placeholder="请输入" lay-verify="required" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">周转箱编码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="BoxCode" autocomplete="off" placeholder="请输入" lay-verify="required" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">料盘尺寸</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="Size" lay-filter="size">
|
||||
<option value=""></option>
|
||||
<option value="0" selected>6mm</option>
|
||||
<option value="1">8mm</option>
|
||||
<option value="2">16mm</option>
|
||||
<option value="3">24mm</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">唯一码</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="UniqueCode" autocomplete="off" placeholder="请输入" lay-verify="required" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<button class="layui-btn" lay-submit lay-filter="sub">确认</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
</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 // 是否显示分页
|
||||
});
|
||||
});
|
||||
var boxId = "";
|
||||
function scanBox(data) {
|
||||
boxId = data;
|
||||
}
|
||||
|
||||
table.render({
|
||||
elem:"header"
|
||||
, height: 'full-200'
|
||||
, page: false // 是否显示分页
|
||||
})
|
||||
layui.use(['form'], function () {
|
||||
var form = layui.form;
|
||||
var layer = layui.layer;
|
||||
// 提交事件
|
||||
form.on('submit(sub)', function (data) {
|
||||
var field = data.field; // 获取表单字段值
|
||||
// 显示填写结果,仅作演示用
|
||||
layer.alert(JSON.stringify(field), {
|
||||
title: '当前填写的字段值'
|
||||
});
|
||||
// 此处可执行 Ajax 等操作
|
||||
// …
|
||||
return false; // 阻止默认 form 跳转
|
||||
});
|
||||
});
|
||||
|
||||
layui.use(['form','table'], function () {
|
||||
var table = layui.table;
|
||||
var form = layui.form;
|
||||
var layer = layui.layer;
|
||||
|
||||
table.reload('header', {
|
||||
height: 'full-300'
|
||||
, page: false // 是否显示分页
|
||||
});
|
||||
|
||||
form.render("select");
|
||||
|
||||
form.on('select(size)', function(data){
|
||||
|
||||
});
|
||||
|
||||
form.on('submit(sub)', function (data) {
|
||||
var field = data.field; // 获取表单字段值
|
||||
// 显示填写结果,仅作演示用
|
||||
layer.alert(JSON.stringify(field), {
|
||||
title: '当前填写的字段值'
|
||||
});
|
||||
// 此处可执行 Ajax 等操作
|
||||
// …
|
||||
return false; // 阻止默认 form 跳转
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user