93 lines
3.4 KiB
Plaintext
93 lines
3.4 KiB
Plaintext
|
|
|
|||
|
|
@{
|
|||
|
|
ViewBag.Title = "kcView";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
<div style="width:100%">
|
|||
|
|
<table class="t1" style="width:100%">
|
|||
|
|
<tr>
|
|||
|
|
<td class="ltd" style="width:70px">仓库:</td>
|
|||
|
|
<td class="rtd" style="width:150px">@Html.DropDownList("sign", ViewBag.kD as SelectList, "----请选择----", new { @class = "l-text" })</td>
|
|||
|
|
<td class="ltd" style="width:70px">物资名称:</td>
|
|||
|
|
<td class="rtd" style="width:150px"><input id="key" class="l-text" /></td>
|
|||
|
|
<td class="rtd"><div id="search" class="l-button">查询</div></td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</div>
|
|||
|
|
<div id="maingrid"></div>
|
|||
|
|
|
|||
|
|
@using Newtonsoft.Json;
|
|||
|
|
@section scripts{
|
|||
|
|
<script type="text/javascript" src="@Url.Content("~/Scripts/public.js")"></script>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var openf;
|
|||
|
|
function edit(item) {
|
|||
|
|
var id;
|
|||
|
|
if (item.text === "增加") {
|
|||
|
|
id = "";
|
|||
|
|
}
|
|||
|
|
else if (item.text === "修改") {
|
|||
|
|
var r = liger.get("maingrid").getSelectedRow();
|
|||
|
|
if (!r) {
|
|||
|
|
$.ligerDialog.alert("请选择要修改的数据!");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
id = r.id;
|
|||
|
|
}
|
|||
|
|
openf = $.ligerDialog.open({
|
|||
|
|
url: "@Url.Action("kcMessage")?id=" + id,
|
|||
|
|
title: item.text,
|
|||
|
|
width: 380,
|
|||
|
|
height: 350
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function init() {
|
|||
|
|
liger.get("maingrid").reload();
|
|||
|
|
openf.close();
|
|||
|
|
}
|
|||
|
|
$(function () {
|
|||
|
|
$("#search").click(function () {
|
|||
|
|
liger.get("maingrid").set("parms", { key: $("#key").val(), sign: $("#sign").val() });
|
|||
|
|
liger.get("maingrid").changePage("first");
|
|||
|
|
liger.get("maingrid").reload();
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
$("#maingrid").ligerGrid({
|
|||
|
|
height: '100%',
|
|||
|
|
columns: [
|
|||
|
|
{ display: '编号', name: 'id', align: 'left', width: 60 },
|
|||
|
|
{ display: '物资id', name: 'wzid', align: 'left', width: 60 },
|
|||
|
|
{
|
|||
|
|
display: '仓库', name: 'sign', align: 'left', width: 60,
|
|||
|
|
render: function (r, i, v) {
|
|||
|
|
if (v) {
|
|||
|
|
var json =@Html.Raw(JsonConvert.SerializeObject(ViewBag.kD));
|
|||
|
|
for (i in json) {
|
|||
|
|
if (json[i]["Value"] == v)
|
|||
|
|
return json[i]["Text"];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{ display: '物资名称', name: 'wzmc', align: 'left', width: 150 },
|
|||
|
|
{ display: '数量', name: 'sl', width: 60 },
|
|||
|
|
{ display: '操作时间', name: 'czsj', width: 180, render: function (r, i, v) { if (v) return formatTime(v) } },
|
|||
|
|
],
|
|||
|
|
url: "@Url.Action("getkcPage")",
|
|||
|
|
pageSize: 10,
|
|||
|
|
rownumbers: true,
|
|||
|
|
usePager: true,
|
|||
|
|
heightDiff: -20,
|
|||
|
|
toolbar: {
|
|||
|
|
items: [
|
|||
|
|
{ text: '增加', click: edit, icon: 'add' },
|
|||
|
|
{ line: true },
|
|||
|
|
{ text: '修改', click: edit, icon: 'modify' }
|
|||
|
|
]
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
}
|
|||
|
|
|