tijian_tieying/web/dccdc/Views/wz/wzView.cshtml
2025-02-20 12:14:39 +08:00

97 lines
3.6 KiB
Plaintext

@{
ViewBag.Title = "wzView";
}
<div style="width:100%">
<table class="t1" style="width:100%">
<tr>
<td class="ltd" style="width:120px">物资类别:</td>
<td class="rtd" style="width:120px">@Html.DropDownList("wzlb", ViewBag.wzlbs as SelectList)</td>
<td class="ltd" style="width:120px">物资名称:</td>
<td class="rtd" style="width:120px"><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>
@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("wzMessage")?id=" + id,
title: item.text,
width: 380,
height: 400
});
}
function init() {
liger.get("maingrid").reload();
openf.close();
}
$(function () {
$("#search").click(function () {
liger.get("maingrid").set("parms", { key: $("#key").val(),wzlb:$("#wzlb").val() });
liger.get("maingrid").changePage("first");
liger.get("maingrid").reload();
})
$("#maingrid").ligerGrid({
height: '100%',
columns: [
{ display: '编号', name: 'id', align: 'left', width: 60 },
{ display: '编码', name: 'bm', align: 'left', width: 60 },
{ display: '物资名称', name: 'mc', align: 'left', width: 150 },
{ display: '规格型号', name: 'ggxh', width: 90 },
{ display: '生产厂家', name: 'sccj', width: 90 },
{ display: '计量单位', name: 'jldw', width: 90 },
{ display: '单价', name: 'dj', width: 60 },
{ display: '库存上限', name: 'kcsx', width: 80 },
{ display: '库存下限', name: 'kcxx', width: 80 },
{ display: '添加人', name: 'tjr', width: 80 },
{ display: '添加时间', name: 'tjsj', width: 180, render: function (r, i, v) { if (v) return formatTime(v) } },
{
display: '状态', name: 'zt', width: 80, render: function (r, i, v) {
if (v == 1)
return "正常";
else
return "禁用";
}
}
],
url: "@Url.Action("getwzPage")",
pageSize: 10,
rownumbers: true,
usePager: true,
heightDiff: -20,
toolbar: {
items: [
{ text: '增加', click: edit, icon: 'add' },
{ line: true },
{ text: '修改', click: edit, icon: 'modify' }
]
}
});
});
</script>
}