208 lines
9.5 KiB
Plaintext
208 lines
9.5 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="harmful_factor_name_search" class="l-text" /></td>
|
|
<td class="rtd"><div id="search">查询</div></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div id="harmfulFactorsMaintainList">
|
|
|
|
</div>
|
|
<div id="harmfulFactorsMaintainModify" 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">编码:</td>
|
|
<td class="rtd"><input id="code" class="l-text" name="code" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd" >有害因素名称:</td>
|
|
<td class="rtd"><input id="harmful_factor_name" class="l-text" name="harmful_factor_name" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd" >类别名称:</td>
|
|
<td class="rtd">
|
|
@Html.DropDownList("harmful_factor_type", ViewData["harmful_factor_type_group"] as SelectList, "----请选择----", new { id = "harmful_factor_type" })
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd" >体检类型:</td>
|
|
<td class="rtd">
|
|
@Html.DropDownList("check_type_maintain_id", ViewData["check_type_maintain_id_group"] as SelectList, "----请选择----", new { id = "check_type_maintain_id" })
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd">禁忌状态显示:</td>
|
|
<td class="rtd">
|
|
<select id="status_show_contraindicated" name="status_show_contraindicated">
|
|
<option value="是">是</option>
|
|
<option value="否">否</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd">职业病表现:</td>
|
|
<td class="rtd">
|
|
<select id="status_show_occupationdisease" name="status_show_occupationdisease">
|
|
<option value="是">是</option>
|
|
<option value="否">否</option>
|
|
</select>
|
|
</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">
|
|
$(function () {
|
|
$("#search").ligerButton({
|
|
click: function () {
|
|
liger.get("harmfulFactorsMaintainList").set("parms", { key: $("#harmful_factor_name_search").val() });
|
|
liger.get("harmfulFactorsMaintainList").changePage("first");
|
|
liger.get("harmfulFactorsMaintainList").reload();
|
|
}
|
|
});
|
|
$("#harmfulFactorsMaintainList").ligerGrid({
|
|
url: "@Url.Action("getHarmfulFactorsMaintainList")",
|
|
toolbar: {
|
|
items: [
|
|
{
|
|
text: '添加', click: itemclick, icon: 'add'
|
|
},
|
|
{ line: true },
|
|
{ text: '修改', click: itemclick, icon: "edit" },
|
|
{ line: true },
|
|
{ text: '删除', click: itemclick, icon: 'delete' }
|
|
]
|
|
},
|
|
title: "有害因素列表",
|
|
parms: { key: $("#harmful_factor_name_search").val() },
|
|
columns: [
|
|
{ display: 'ID', name: 'id', align: 'left', width: 100 },
|
|
{ display: '编码', name: 'code', align: 'left', width: 100 },
|
|
{ display: '有害因素名称', name: 'harmful_factor_name', align: 'left', width: 120 },
|
|
{ display: '因素类别ID', name: 'harmful_factor_type', align: 'left', width: 120 },
|
|
{ display: '类别名称', name: 'harmful_factor_type_name', align: 'left', width: 120 },
|
|
{ display: '体检类型', name: 'check_type', align: 'left', width: 120 },
|
|
{ display: '体检类型ID', name: 'check_type_maintain_id', align: 'left', width: 120 },
|
|
{ display: '禁忌状态显示', name: 'status_show_contraindicated', align: 'left', width: 120 },
|
|
{ display: '职业病表现', name: 'status_show_occupationdisease', align: 'left', width: 120 },
|
|
{ display: '是否启用', name: 'status', align: 'left', width: 120 },
|
|
{ display: '拼音', name: 'pinyin_code', align: 'left', width: 120 },
|
|
{ display: '创建者', name: 'creator', align: 'left', width: 120 },
|
|
{ display: '创建时间', name: 'create_time', align: 'left', width: 120 }
|
|
], width: "100%",
|
|
height: "100%",
|
|
rownumbers: true,
|
|
usePager: true,
|
|
fixedCellHeight: false,
|
|
heightDiff: -20
|
|
});
|
|
|
|
});
|
|
function itemclick(item) {
|
|
if (item.text == "添加") {
|
|
$("#code").val("");
|
|
$("#harmful_factor_name").val("");
|
|
$("#status").val("");
|
|
$("#id").val("0");
|
|
$.ligerDialog.open({
|
|
title: "添加有害因素", target: $("#harmfulFactorsMaintainModify"), width: 700, height: 400, buttons: [{
|
|
text: "确定", onclick: function (item, dialg) {
|
|
f_save(dialg);
|
|
|
|
}
|
|
}, { text: "取消", onclick: function (item, dialg) { dialg.hidden(); } }]
|
|
});
|
|
}
|
|
else if (item.text == "修改") {
|
|
var r = liger.get("harmfulFactorsMaintainList").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.aler("请选择要修改的数据!");
|
|
return;
|
|
}
|
|
$("#id").val(r.id);
|
|
$("#code").val(r.code);
|
|
$("#harmful_factor_name").val(r.harmful_factor_name);
|
|
$("#harmful_factor_type").val(r.harmful_factor_type);
|
|
$("#check_type_maintain_id").val(r.check_type_maintain_id);
|
|
$("#status_show_contraindicated").val(r.status_show_contraindicated);
|
|
$("#status_show_occupationdisease").val(r.status_show_occupationdisease);
|
|
$("#status").val(r.status);
|
|
$.ligerDialog.open({
|
|
title: "修改有害因素", target: $("#harmfulFactorsMaintainModify"), 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("harmfulFactorsMaintainList").getSelectedRow();
|
|
if (!r1) {
|
|
$.ligerDialog.alert("请选择要删除的数据!");
|
|
return;
|
|
} else {
|
|
$.ajax({
|
|
url: "@Url.Action("delHarmfulFactorsMaintain")", type: "post", dataType: "json", data: {id:r1.id},
|
|
success: function (d) {
|
|
$.ligerDialog.closeWaitting();
|
|
$.ligerDialog.alert(d.Message, function () {
|
|
if (d.State == 1) {
|
|
liger.get("harmfulFactorsMaintainList").reload();
|
|
return;
|
|
}
|
|
});
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在保存请稍后……");
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
function f_save(dialg) {
|
|
if (!$("#harmful_factor_name").val()) {
|
|
$.ligerDialog.alert("有害因素名称不能为空!");
|
|
return;
|
|
}
|
|
var data = $("#editform").serializeArray();
|
|
var node = { "name": "harmful_factor_type_name", "value": $("#harmful_factor_type option:checked").text() };
|
|
var node2 = { "name": "check_type", "value": $("#check_type_maintain_id option:checked").text() };
|
|
data.push(node,node2);
|
|
$.ajax(
|
|
{
|
|
url: "@Url.Action("saveHarmfulFactorsMaintainType")", type: "post", dataType: "json", data: data,
|
|
success: function (d) {
|
|
$.ligerDialog.closeWaitting();
|
|
$.ligerDialog.alert(d.Message, function () {
|
|
if (d.State == 1) {
|
|
dialg.hidden();
|
|
liger.get("harmfulFactorsMaintainList").reload();
|
|
}
|
|
});
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在保存请稍后……");
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
} |