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

114 lines
3.8 KiB
Plaintext

@{
ViewBag.Title = "辖区医疗机构管理";
}
<table class="t1" style="width:100%">
<tr>
<td class="ltd" style="width:200px">机构名称:</td>
<td class="rtd" style="width:200px"><input id="jgmc" class="l-text" /></td>
<td class="rtd"><input id="search" type="button" value="查询" class="l-button" /></td>
</tr>
</table>
<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 === "删除") {
var r1 = liger.get("maingrid").getSelectedRow();
if (!r1) {
$.ligerDialog.alert("请选择要删除的数据!");
return;
} else {
$.ajax({
url: "@Url.Action("delORG")", type: "post", dataType: "json", data: { id: r1.zoe_code },
success: function (d) {
$.ligerDialog.closeWaitting();
$.ligerDialog.alert(d.Message, function () {
if (d.State == 1) {
liger.get("maingrid").reload();
return;
}
});
},
beforeSend: function () {
$.ligerDialog.waitting("正在保存请稍后……");
}
});
}
}
else {
if (item.text === "增加") {
id = "";
}
else if (item.text === "修改") {
var r = liger.get("maingrid").getSelectedRow();
if (!r) {
$.ligerDialog.alert("请选择要修改的数据!");
return;
}
id = r.zoe_code;
}
openf = $.ligerDialog.open({
url: "@Url.Action("org_add")?id=" + id,
title: item.text,
width: 380,
height: 200
});
}
}
function init() {
liger.get("maingrid").reload();
openf.close();
}
$(function () {
$("#search").click(function () {
liger.get("maingrid").set("parms", { jgmc: $("#jgmc").val() });
liger.get("maingrid").changePage("first");
liger.get("maingrid").reload();
})
$("#maingrid").ligerGrid({
height: '100%',
columns: [
{ display: 'Code', name: 'zoe_code', align: 'left', width: 60 },
{ display: '机构名称', name: 'zoe_value', align: 'left', width: 260 },
{
display: '是否使用', name: 'used', align: 'left', width: 150, render: function (r, i, v) {
if (v == 1)
return "正常";
else
return "禁用";
}
}
],
url: "@Url.Action("getorglist")",
pageSize: 30,
rownumbers: true,
usePager: true,
heightDiff: -20,
toolbar: {
items: [
{ text: '增加', click: edit, icon: 'add' },
{ line: true },
{ text: '修改', click: edit, icon: 'modify' },
{ line: true },
{ text: '删除', click: edit, icon: 'delete' }
]
}
});
});
</script>
}