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

202 lines
8.8 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="threshold_project_search" class="l-text" /></td>
<td class="rtd"><div id="search">查询</div></td>
</tr>
</table>
</div>
<div id="thresholdDeviationMaintainList">
</div>
<div id="thresholdDeviationMaintainModify" 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="threshold_project" class="l-text" name="threshold_project" /></td>
</tr>
<tr>
<td class="ltd" width="100px">体检项目:</td>
<td class="rtd">
@Html.DropDownList("exam_project_maintain_id", ViewData["group"] as SelectList, "----请选择----", new { id = "exam_project_maintain_id" })
</td>
</tr>
<tr>
<td class="ltd">性别:</td>
<td class="rtd">
<select id="sex" name="sex">
<option value="男">男</option>
<option value="女">女</option>
</select>
</td>
</tr>
<tr>
<td class="ltd" width="100px">年龄上限:</td>
<td class="rtd"><input id="age_upper" class="l-text" name="age_upper" /></td>
</tr>
<tr>
<td class="ltd" width="100px">年龄下限:</td>
<td class="rtd"><input id="age_lower" class="l-text" name="age_lower" /></td>
</tr>
<tr>
<td class="ltd" width="100px">偏差值:</td>
<td class="rtd"><input id="deviation_value" class="l-text" name="deviation_value" /></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("thresholdDeviationMaintainList").set("parms", { key: $("#threshold_project_search").val() });
liger.get("thresholdDeviationMaintainList").changePage("first");
liger.get("thresholdDeviationMaintainList").reload();
}
});
$("#thresholdDeviationMaintainList").ligerGrid({
url: "@Url.Action("getThresholdDeviationMaintainList")",
toolbar: {
items: [
{
text: '添加', click: itemclick, icon: 'add'
},
{ line: true },
{ text: '修改', click: itemclick, icon: "edit" },
{ line: true },
{ text: '删除', click: itemclick, icon: 'delete' }
]
},
title: "听阈偏差列表",
parms: { key: $("#threshold_project_search").val() },
columns: [
{ name: "id", display: "ID", width: 60, align: "left", },
{ name: "threshold_project", display: "听阈项目", width: 180, align: "left" },
{ name: "exam_project_maintain_id", display: "体检项目ID", width: 80, align: "left" }
, { name: "sex", display: "性别", width: 82, align: "left" }
, { name: "age_upper", display: "年龄上限", width: 82, align: "left" }
, { name: "age_lower", display: "年龄下限", width: 82, align: "left" }
, { name: "deviation_value", display: "偏差值", width: 82, align: "left" }
, { name: "status", display: "状态", width: 82, align: "left" }
, { name: "creator", display: "创建者", width: 82, align: "left" }
, { name: "create_time", display: "创建时间", width: 82, align: "left" }
], width: "100%",
height: "100%",
rownumbers: true,
usePager: true,
heightDiff: -20
});
});
function itemclick(item) {
if (item.text == "添加") {
$("#threshold_project").val("");
$("#exam_project_maintain_id").val("");
$("#sex").val("");
$("#age_upper").val("");
$("#age_lower").val("");
$("#deviation_value").val("");
$("#status").val("");
$("#id").val("0");
$.ligerDialog.open({
title: "添加听阈偏差", target: $("#thresholdDeviationMaintainModify"), 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("thresholdDeviationMaintainList").getSelectedRow();
if (!r) {
$.ligerDialog.aler("请选择要修改的数据!");
return;
}
$("#id").val(r.id);
$("#threshold_project").val(r.threshold_project);
$("#exam_project_maintain_id").val(r.exam_project_maintain_id);
$("#sex").val(r.sex);
$("#age_upper").val(r.age_upper);
$("#age_lower").val(r.age_lower);
$("#deviation_value").val(r.deviation_value);
$("#status").val(r.status);
$.ligerDialog.open({
title: "修改听阈偏差", target: $("#thresholdDeviationMaintainModify"), 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("thresholdDeviationMaintainList").getSelectedRow();
if (!r1) {
$.ligerDialog.alert("请选择要删除的数据!");
return;
} else {
$.ajax({
url: "@Url.Action("delThresholdDeviationMaintain")", type: "post", dataType: "json", data: {id:r1.id},
success: function (d) {
$.ligerDialog.closeWaitting();
$.ligerDialog.alert(d.Message, function () {
if (d.State == 1) {
liger.get("thresholdDeviationMaintainList").reload();
return;
}
});
},
beforeSend: function () {
$.ligerDialog.waitting("正在保存请稍后……");
}
});
}
}
}
function f_save(dialg) {
if (!$("#threshold_project").val()) {
$.ligerDialog.alert("听阈项目不能为空!");
return;
}
var data = $("#editform").serializeArray();
var node = { "name": "project_name", "value": $("#exam_project_maintain_id option:checked").text() };
data.push(node);
$.ajax(
{
url: "@Url.Action("saveThresholdDeviationMaintainType")", type: "post", dataType: "json", data: data,
success: function (d) {
$.ligerDialog.closeWaitting();
$.ligerDialog.alert(d.Message, function () {
if (d.State == 1) {
dialg.hidden();
liger.get("thresholdDeviationMaintainList").reload();
}
});
},
beforeSend: function () {
$.ligerDialog.waitting("正在保存请稍后……");
}
});
}
</script>
}