160 lines
6.2 KiB
Plaintext
160 lines
6.2 KiB
Plaintext
|
|
@{
|
|
ViewBag.Title = "不可预约企业维护";
|
|
}
|
|
<div style="width:100%">
|
|
<table class="t1" style="width:100%">
|
|
<tr>
|
|
<td class="ltd" style="width:100px">企业名称:</td>
|
|
<td class="rtd" style="width:120px"><input id="s_name" class="l-text" /></td>
|
|
|
|
<td class="rtd"><div id="search">查询</div></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div id="specialCompanyList">
|
|
|
|
</div>
|
|
<div id="specialCompanyModify" style="display:none">
|
|
<form id="editform">
|
|
<input id="id" type="hidden" name="id" value="0" />
|
|
<table class="t1" style="width:100%">
|
|
<tr>
|
|
<td class="ltd" width="100px">企业名称:</td>
|
|
<td class="rtd"><input id="company_name" class="l-text" name="company_name" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd">状态:</td>
|
|
<td class="rtd">
|
|
<select id="status" name="status">
|
|
<option value="是">是</option>
|
|
<option value="否">否</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
@section scripts{
|
|
<script type="text/javascript">
|
|
var dia;
|
|
function selectedQY(data) {
|
|
dia.close();
|
|
}
|
|
$(function () {
|
|
$("#search").ligerButton({
|
|
click: function () {
|
|
liger.get("specialCompanyList").set("parms", { name: $("#s_name").val() });
|
|
liger.get("specialCompanyList").changePage("first");
|
|
liger.get("specialCompanyList").reload();
|
|
}
|
|
});
|
|
$("#specialCompanyList").ligerGrid({
|
|
url: "@Url.Action("getspecialCompanyList")",
|
|
toolbar: {
|
|
items: [
|
|
{
|
|
text: '添加', click: itemclick, icon: 'add'
|
|
},
|
|
{ line: true },
|
|
{ text: '修改', click: itemclick, icon: "edit" },
|
|
{ line: true },
|
|
{ text: '删除', click: itemclick, icon: 'delete' }
|
|
]
|
|
},
|
|
title: "不可预约企业维护列表",
|
|
parms: { name: $("#company_name").val() },
|
|
columns: [
|
|
{ name: "id", display: "编码", width: 60, align: "left", },
|
|
{ name: "company_name", display: "特殊企业名称", width: 180, align: "left" },
|
|
, { name: "status", display: "状态", width: 82, align: "left" }
|
|
], width: "98%",
|
|
height: "100%",
|
|
rownumbers: true,
|
|
usePager: true,
|
|
heightDiff: -20
|
|
});
|
|
|
|
});
|
|
function itemclick(item) {
|
|
if (item.text == "添加") {
|
|
$("#company_name").val("");
|
|
$("#status").val("");
|
|
$.ligerDialog.open({
|
|
title: "添加特殊企业", target: $("#specialCompanyModify"), width: 418, height: 300, buttons: [{
|
|
text: "确定", onclick: function (item, dialg) {
|
|
f_save(dialg);
|
|
|
|
}
|
|
}, { text: "取消", onclick: function (item, dialg) { dialg.hidden(); } }]
|
|
});
|
|
}
|
|
else if (item.text == "修改") {
|
|
var r = liger.get("specialCompanyList").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要修改的数据!");
|
|
return;
|
|
}
|
|
$("#id").val(r.id);
|
|
$("#company_name").val(r.company_name);
|
|
$("#status").val(r.status);
|
|
$.ligerDialog.open({
|
|
title: "修改特殊企业", target: $("#specialCompanyModify"), width: 418, height: 300, buttons: [{
|
|
text: "确定", onclick: function (item, dialg) {
|
|
f_save(dialg);
|
|
|
|
}
|
|
}, { text: "取消", onclick: function (item, dialg) { dialg.hidden(); } }]
|
|
});
|
|
}
|
|
else if (item.text === "删除") {
|
|
var r1 = liger.get("specialCompanyList").getSelectedRow();
|
|
if (!r1) {
|
|
$.ligerDialog.alert("请选择要删除的数据!");
|
|
return;
|
|
} else {
|
|
$.ajax({
|
|
url: "@Url.Action("delSpecialCompany")", type: "post", dataType: "json", data: {id:r1.id},
|
|
success: function (d) {
|
|
$.ligerDialog.closeWaitting();
|
|
$.ligerDialog.alert(d.Message, function () {
|
|
if (d.State == 1) {
|
|
liger.get("specialCompanyList").reload();
|
|
return;
|
|
}
|
|
});
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在保存请稍后……");
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
function f_save(dialg) {
|
|
if (!$("#company_name").val()) {
|
|
$.ligerDialog.alert("特殊企业名称不能为空!");
|
|
return;
|
|
}
|
|
var data = $("#editform").serializeArray();
|
|
$.ajax(
|
|
{
|
|
url: "@Url.Action("savespecialCompany")", type: "post", dataType: "json", data: data,
|
|
success: function (d) {
|
|
$.ligerDialog.closeWaitting();
|
|
$.ligerDialog.alert(d.Message, function () {
|
|
if (d.State == 1) {
|
|
dialg.hidden();
|
|
liger.get("specialCompanyList").reload();
|
|
}
|
|
});
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在保存请稍后……");
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
}
|
|
|