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

232 lines
9.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@model dccdc.Models.DictionariesViewModel.TjxmViewModel
@section scripts{
<script type="text/javascript">
$(function () {
//2023-11-23 xulu 添加默认值
if ($("#default_value").val() == "") {
$("#default_value").val("未见明显异常")
}
var a = $('#projectid').val();
if (a == "0")
{
$.ajax({
type: "post",
url: "@Url.Action("GetIdentityMaxId")?tableName=exam_project_maintain&needcount=1",
success: function (data)
{
$('#projectid').val(data);
}
});
}
$("#maingrid").ligerGrid({
height: '100%',
columns: [
{ display: '编号', name: 'id', align: 'left', width: 50 },
{ display: '结果参考', name: 'test_result', align: 'left', width: 800 },
{ display: '是否合格', name: 'is_qualified', width: 60 },
{ display: '是否启用', name: 'status', width: 60 }
],
url: "@Url.Action("TjjgJsonResult")?id="+@Model.project_id,
rownumbers: true,
usePager: true,
heightDiff: -5,
toolbar: {
items: [
{ text: '增加', click: edit, icon: 'add' },
{ line: true },
{ text: '修改', click: edit, icon: 'modify' }
]
}
});
});
var openf;
function edit(item) {
var project_id;
var urlparam="";
if (item.text === "增加") {
if (@Model.project_id == "") {
$.ligerDialog.alert("请添加体检项目后再试!");
return;
}
project_id = @Model.project_id;
urlparam = "?projectid=" + project_id;
}
else if (item.text === "修改") {
var r = liger.get("maingrid").getSelectedRow();
if (!r) {
$.ligerDialog.alert("请选择要修改的数据!");
return;
}
urlparam = "?id=" + r.id;
}
openf= $.ligerDialog.open({
url: '@Url.Action("Tjjg")'+urlparam,
title: item.text,
width: 380,
height: 200
});
}
function init() {
liger.get("maingrid").reload();
openf.close();
}
//保存提交后发生
function success(data) {
if (data.State == "1")
{
$.ligerDialog.alert(data.Message,
function ()
{
if (data.list.length == 2 )
{
window.parent.addTreeItem(data.list);
}
else if (data.list.length == 1) {
window.parent.UpdateTreeItem(data.list);
}
});
}
else if (data.State == "0")
{
$.ligerDialog.alert(data.Message);
}
}
$("#exam_prepose_condition_maintain_id").change(function() {
document.getElementById("prepose_condition").value = $("#exam_prepose_condition_maintain_id option:selected").text();
});
//删除前-弹窗提醒
function ConfirmDelete() {
var x = confirm("Are you sure you want to delete?");
if (x)
ShanChu();
else
return ;
}
//删除请求
function ShanChu (){
//赋值 ID项目名称
var id = $("#id").val();
//ajax请求
$.ajax({
url:'@Url.Action("Shanchu")',
data: {ID:id },
type: 'post',
cache: false,
dataType: 'json',
success: function () {}
});
//调用父级,节点删除
window.parent.removeTreeItem();
}
</script>
}
@using (Ajax.BeginForm("TjxmwhJsonResult", new AjaxOptions { HttpMethod = "Post", OnSuccess = "success" }))
{
@Html.HiddenFor(m => m.id);
<table class="t1" style="width: 100%">
<tr>
<td class="ltd" width="100px">项目编号:</td>
<td class="rtd"> @Html.TextBoxFor(m => m.project_id, new { @class = "l-text", id = "projectid" }) @Html.ValidationMessageFor(m => m.project_id)</td>
<td class="ltd" width="100px">项目名称:</td>
<td class="rtd"> @Html.TextBoxFor(m => m.project_name, new { @class = "l-text" }) @Html.ValidationMessageFor(m => m.project_name)<label style="color:red">*</label></td>
</tr>
<tr>
<td class="ltd" width="100px">体检小组:</td>
<td class="rtd">
@Model.exam_group
@Html.HiddenFor(m => m.exam_group_maintain_id)
@Html.HiddenFor(m => m.exam_group)
</td>
<td class="ltd" width="100px">项目别名:</td>
<td class="rtd"> @Html.TextBoxFor(m => m.project_alias, new { @class = "l-text" }) </td>
</tr>
<tr>
<td class="ltd" width="100px">前置条件:</td>
<td class="rtd">@Html.HiddenFor(m => m.prepose_condition, new { id = "prepose_condition" }) @Html.DropDownListFor(m => m.exam_prepose_condition_maintain_id, ViewData["qzx"] as SelectList, "----请选择----", new { id = "exam_prepose_condition_maintain_id" })<label style="color:red">*</label></td>
<td class="ltd" width="100px">收费项目:</td>
<td class="rtd">@Html.HiddenFor(m => m.charge_project) @Html.DropDownListFor(m => m.charge_project_maintain_id, ViewData["ChargeProjectList"] as SelectList, "----请选择----", new { @id = "charge_project_maintain_id" })</td>
</tr>
<tr>
<td class="ltd" width="100px">判断模式:</td>
<td class="rtd"> @Html.DropDownListFor(m => m.model, ViewData["pdms"] as SelectList, new { @id = "dl" }) </td>
<td class="ltd" width="100px">计量单位:</td>
<td class="rtd"> @Html.TextBoxFor(m => m.unit, new { @class = "l-text" }) </td>
</tr>
<tr>
<td class="ltd" width="100px">最大值:</td>
<td class="rtd"> @Html.TextBoxFor(m => m.max, new { @class = "l-text" }) </td>
<td class="ltd" width="100px">最小值:</td>
<td class="rtd"> @Html.TextBoxFor(m => m.min, new { @class = "l-text" }) </td>
</tr>
<tr>
<td class="ltd" width="100px">临界最大值:</td>
<td class="rtd"> @Html.TextBoxFor(m => m.critical_max, new { @class = "l-text" }) </td>
<td class="ltd" width="100px">临界最小值:</td>
<td class="rtd"> @Html.TextBoxFor(m => m.critical_min, new { @class = "l-text" }) </td>
</tr>
<tr>
<td class="ltd" width="100px">标准值:</td>
<td class="rtd"> @Html.TextBoxFor(m => m.standard_value, new { @class = "l-text" }) </td>
<td class="ltd" width="100px">默认值:</td>
<td class="rtd"> @Html.TextBoxFor(m => m.default_value, new { @id = "default_value", @class = "l-text"}) @Html.ValidationMessageFor(m => m.default_value)<label style="color:red">*</label></td>
</tr>
<tr>
<td class="ltd" width="100px">序号:</td>
<td class="rtd"> @Html.TextBoxFor(m => m.bar_code, new { @class = "l-text" }) </td>
<td class="ltd" width="100px">排序:</td>
<td class="rtd"> @Html.TextBoxFor(m => m.order_id, new { @class = "l-text" }) </td>
</tr>
<tr>
<td class="ltd" width="100px">是否常规项:</td>
<td class="rtd">
@Html.RadioButtonFor(m => m.is_general, "是")
<span>是</span> @Html.RadioButtonFor(m => m.is_general, "否")
<span> 否 </span>
</td>
<td class="ltd" width="100px">是否启用:</td>
<td class="rtd">
@Html.RadioButtonFor(m => m.status, "是")
<span>是</span> @Html.RadioButtonFor(m => m.status, "否")<span> 否</span>
</td>
</tr>
<tr>
<td class="ltd" width="100px">LIS对照</td>
<td class="rtd">
@Html.TextBoxFor(m => m.lis, new { @class = "l-text" })
</td>
<td class="ltd" width="100px">特殊配置:</td>
<td class="rtd">
@Html.DropDownListFor(m => m.special_conf, ViewData["SpecialConf"] as SelectList, "一般", new { @id = "special_conf" })
</td>
</tr>
<tr>
<td colspan="3">
<div align="center">
<button type="submit" id="submitid" class="l-button">保存</button>
</div>
</td>
<td colspan="5">
<div align="center">
<button type="button" id="shanchu" onclick="ConfirmDelete()" class="l-button">删除</button>
</div>
</td>
</tr>
</table>
}
<div id="maingrid"></div>