87 lines
3.2 KiB
Plaintext
87 lines
3.2 KiB
Plaintext
@page
|
|
@model Waste.Web.Entry.Pages.Trash.CodeModel
|
|
@{
|
|
ViewData["Title"] = "物品编码";
|
|
}
|
|
<div class="layui-card">
|
|
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
|
<div class="layui-form-item">
|
|
<div class="layui-inline">
|
|
<div class="layui-input-inline">
|
|
<input type="text" class="layui-input" name="Name" id="Name" placeholder="请输入物品名称" />
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<button class="btn btn-primary btn-lg js-search" type="button">查询</button>
|
|
<button class="btn btn-primary btn-lg js-add" type="button">添加</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-card-body">
|
|
<table class="layui-table" id="list" lay-filter="list">
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@section Scripts{
|
|
<script type="text/javascript">
|
|
layui.use(['common'], function () {
|
|
var common = layui.common;
|
|
common.initTable({
|
|
url: '/api/waste/gettypelist'
|
|
, method: 'post'
|
|
, cols: [[
|
|
{
|
|
field: 'code', title: '物品编码'
|
|
},
|
|
{
|
|
field: 'name', title: '物品名称'
|
|
}
|
|
,
|
|
{
|
|
field: 'createtime', title: '创建时间'
|
|
}
|
|
,
|
|
{
|
|
title: '操作', templet: function (d) {
|
|
var html = "<a href='#' class='js-edit' title='编辑' data-id='" + d.id + "'>编辑</a> ";
|
|
html += "<a href='#' class='layui-btn-xs js-delete' title='删除' data-id='" + d.id + "'>删除</a>";
|
|
return html;
|
|
}
|
|
}
|
|
]]
|
|
});
|
|
$(".js-search").on("click", function () {
|
|
common.reloadtable("list", {
|
|
where: {
|
|
queryParam: [{
|
|
"Name": 'Name',
|
|
"Type": QueryCond.Like,
|
|
"Value": $("#Name").val()
|
|
}]
|
|
}
|
|
});
|
|
});
|
|
$(".js-add").on("click", function () {
|
|
common.dialog({
|
|
title: '添加物品编码',
|
|
content: '/Trash/EditType'
|
|
});
|
|
});
|
|
$("body").on("click", ".js-edit", function () {
|
|
var id = $(this).data('id');
|
|
common.dialog({
|
|
title: '编辑物品编码',
|
|
content: '/Trash/EditType?id=' + id
|
|
});
|
|
});
|
|
$("body").on("click", ".js-delete", function () {
|
|
var id = $(this).data('id');
|
|
common.confirm("确定删除?", function () {
|
|
common.uajax({
|
|
url: "/api/waste/deleteTypeform?id=" + id
|
|
});
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
} |