112 lines
3.7 KiB
Plaintext
112 lines
3.7 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="key" 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 === "增加") {
|
|
id = "";
|
|
openf = $.ligerDialog.open({
|
|
url: "@Url.Action("town_add")?id=" + id,
|
|
title: item.text,
|
|
width: 500,
|
|
height: 300
|
|
});
|
|
}
|
|
else if (item.text === "修改") {
|
|
var r = liger.get("maingrid").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要修改的数据!");
|
|
return;
|
|
}
|
|
id = r.townCode;
|
|
openf = $.ligerDialog.open({
|
|
url: "@Url.Action("town_add")?id=" + id,
|
|
title: item.text,
|
|
width: 500,
|
|
height: 300
|
|
});
|
|
}
|
|
else if(item.text="删除")
|
|
{
|
|
var r = liger.get("maingrid").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要删除的数据!");
|
|
return;
|
|
}
|
|
id = r.townCode;
|
|
$.ajax({
|
|
url: "@Url.Action("town_del")", type: "post", dataType: "json", data: { id: id },
|
|
success: function (data) {
|
|
$.ligerDialog.alert(data.Message);
|
|
if(data.State==1)
|
|
{
|
|
liger.get("maingrid").reload();
|
|
}
|
|
}, error: function (e) {
|
|
$.ligerDialog.aler(e.responseText);
|
|
}
|
|
})
|
|
}
|
|
|
|
}
|
|
function init() {
|
|
liger.get("maingrid").reload();
|
|
openf.close();
|
|
}
|
|
$(function () {
|
|
$("#search").click(function () {
|
|
liger.get("maingrid").set("parms", { key: $("#key").val() });
|
|
liger.get("maingrid").changePage("first");
|
|
liger.get("maingrid").reload();
|
|
})
|
|
|
|
$("#maingrid").ligerGrid({
|
|
height: '100%',
|
|
columns: [
|
|
{ display: '编码', name: 'townCode', align: 'left', width: 60 },
|
|
{ display: '街道、乡镇名称', name: 'townName', align: 'left', width: 260 },
|
|
{ display: '经度', name: 'x', align: 'left', width: 260 },
|
|
{ display: '纬度', name: 'y', align: 'left', width: 260 }
|
|
|
|
|
|
],
|
|
url: "@Url.Action("gettownlist")",
|
|
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>
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|