425 lines
18 KiB
Plaintext
425 lines
18 KiB
Plaintext
@model dccdc.Models.DictionariesViewModel.TjfnViewModel
|
||
|
||
@section scripts{
|
||
<style type="text/css">
|
||
</style>
|
||
<script language="javascript">
|
||
var parentdata;
|
||
$("#zgzt").change(function() {
|
||
document.getElementById("station_status").value = $("#zgzt option:selected").text();
|
||
//切换体检项目
|
||
liger.get("tjxm").set("parms", { "hyysids": $("#harmful_factors_maintain_id").val(), "zgzt": $("#zgzt option:selected").val() });
|
||
liger.get("tjxm").set("url", '@Url.Action("GettjxmByyhyszgzt")');
|
||
|
||
var currrow = liger.get("tjxm").data;
|
||
var project = "";
|
||
for (var i = 0; i < currrow.Rows.length; i++) {
|
||
currrow.Rows[i].id = currrow.Rows[i].id.toString();
|
||
project += currrow.Rows[i].id + ",";
|
||
}
|
||
$("#check_item_ids").val(project);
|
||
sfxminit(project);
|
||
parentdata = currrow;
|
||
if (openf)
|
||
openf.close();
|
||
});
|
||
$("#util_id").change(function() {
|
||
document.getElementById("util_name").value = $("#util_id option:selected").text();
|
||
});
|
||
$("#check_type_maintain_id").change(function() {
|
||
document.getElementById("exam_type").value = $("#check_type_maintain_id option:selected").text();
|
||
});
|
||
|
||
$(function() {
|
||
//体检项目填充
|
||
tjxminit();
|
||
$("#valid_start").ligerDateEditor();
|
||
$("#valid_end").ligerDateEditor();
|
||
|
||
|
||
@if (Model != null) {
|
||
@:$("#util_id").val(@Model.util_id);
|
||
}
|
||
});
|
||
|
||
//有害因素修改重新填充
|
||
function init(idss, lbss, ysss, lbssid) {
|
||
@*$("#harmful_factors_maintain_id").val(idss);
|
||
$("#hazard_type_ids").val(lbssid);
|
||
$("#yhlb").val(lbss);
|
||
$("#ysss").val(ysss);
|
||
liger.get("tjxm").set("parms", { "hyysids": idss, "zgzt": $("#zgzt option:selected").val() });
|
||
liger.get("tjxm").set("url", '@Url.Action("GettjxmByyhyszgzt")');
|
||
|
||
var currrow = liger.get("tjxm").data;
|
||
var project = "";
|
||
for (var i = 0; i < currrow.Rows.length; i++) {
|
||
project += currrow.Rows[i].id + ",";
|
||
}
|
||
$("#check_item_ids").val(project);
|
||
sfxminit(project);
|
||
if (openf)
|
||
openf.close();*@
|
||
$("#harmful_factors_maintain_id").val(idss);
|
||
$("#hazard_type_ids").val(lbssid);
|
||
$("#yhlb").val(lbss);
|
||
$("#ysss").val(ysss);
|
||
var project = $("#check_item_ids").val();
|
||
//根据idss与previewIds判断是否增加了有害因素
|
||
var add = "";
|
||
var del = "";
|
||
var del1 = [];
|
||
var pre = previewIds.split(',');
|
||
var cur = idss.substring(0,idss.length-1).split(',');
|
||
for (var i = pre.length - 1; i >= 0; i--) {
|
||
if (cur.indexOf(pre[i]) == -1) {
|
||
del1.push(pre[i])
|
||
}
|
||
else {
|
||
cur.splice(cur.indexOf(pre[i]),1)
|
||
}
|
||
}
|
||
add = cur.toString();
|
||
del = del1.toString();
|
||
//删除了有害因素
|
||
if (del != ""){
|
||
//删除原有害因素对应的体检项目
|
||
$.ajax({
|
||
url: "@Url.Action("GettjxmByyhyszgzt")", type: "post", dataType: "json", data: { "hyysids": del, "zgzt": $("#zgzt option:selected").val() },
|
||
success: function (d) {
|
||
//将d.Rows中的id从int转换成string
|
||
for (var i = 0; i < d.Rows.length; i++) {
|
||
d.Rows[i].id = d.Rows[i].id.toString();
|
||
}
|
||
//a和b中都具有id为1的元素,所以理想的结果是将a中id=1的元素删除掉,
|
||
var a = parentdata.Rows;
|
||
var b = d.Rows
|
||
//将b数据中的id取出赋给数组c
|
||
var c = b.map(i => i.id)
|
||
//如果c中包含a数组某个元素的id,说明b数组中也有改元素,移除
|
||
var e = a.filter(i => !c.includes(i.id))
|
||
liger.get("tjxm").set("data", { Rows: e });
|
||
var project = ""
|
||
for (var i = 0; i < e.length; i++) {
|
||
project += e[i].id + ",";
|
||
}
|
||
sfxminit(project);
|
||
$("#check_item_ids").val(project);
|
||
var pd = {"Rows":e}
|
||
parentdata = pd;
|
||
}
|
||
});
|
||
}
|
||
//增加了有害因素
|
||
if (add != "") {
|
||
$.ajax({
|
||
url: "@Url.Action("GettjxmByyhyszgzt")", type: "post", dataType: "json", data: { "hyysids": add, "zgzt": $("#zgzt option:selected").val() },
|
||
success: function (d) {
|
||
//将d.Rows中的id从int转换成string
|
||
for (var i = 0; i < d.Rows.length; i++)
|
||
{
|
||
d.Rows[i].id = d.Rows[i].id.toString();
|
||
}
|
||
var currrow = parentdata;
|
||
//在原有项目基础上添加有害因素的体检项目
|
||
if (currrow != null) {
|
||
var addpro = [];
|
||
var prepro = project.split(",");
|
||
for (var i = 0; i < d.Rows.length; i++) {
|
||
if (prepro.indexOf(d.Rows[i].id) == -1) {
|
||
project += d.Rows[i].id + ",";
|
||
addpro.push(d.Rows[i]);
|
||
}
|
||
}
|
||
var preview = parentdata.Rows;
|
||
for (var i = 0; i < addpro.length; i++) {
|
||
preview.push(addpro[i]);
|
||
}
|
||
liger.get("tjxm").set("data", { Rows: preview });
|
||
var pd = { "Rows": preview }
|
||
parentdata = pd;
|
||
}
|
||
//原来未设置体检项目,直接添加
|
||
else {
|
||
for (var i = 0; i < d.Rows.length; i++) {
|
||
project += currrow.Rows[i].id + ",";
|
||
}
|
||
liger.get("tjxm").set("data", { Rows: d.Rows });
|
||
parentdata = d;
|
||
}
|
||
sfxminit(project);
|
||
$("#check_item_ids").val(project);
|
||
|
||
}
|
||
});
|
||
}
|
||
if (openf)
|
||
openf.close();
|
||
}
|
||
|
||
var openf;
|
||
var previewIds;
|
||
function hyys() {
|
||
if ($("#zgzt option:selected").val() == "") {
|
||
$.ligerDialog.alert("请选择在岗状态!",
|
||
function() {
|
||
|
||
});
|
||
} else {
|
||
var ids = $("#harmful_factors_maintain_id").val();
|
||
previewIds = ids;
|
||
openf = $.ligerDialog.open({
|
||
url: "@Url.Action("YhysResult")?ids=" + ids,
|
||
width: 500,
|
||
height: 450
|
||
});
|
||
}
|
||
}
|
||
|
||
function sfxminit(arg) {
|
||
if (liger.get("sfxm")) {
|
||
liger.get("sfxm").set("parms", { "tjxmids": arg });
|
||
liger.get("sfxm").reload();
|
||
return;
|
||
|
||
}
|
||
$("#sfxm").ligerGrid({
|
||
url: "@Url.Action("Getsfxm")",
|
||
parms: { "tjxmids": arg },
|
||
title: "收费项目",
|
||
columns: [
|
||
{ name: "charge_project_name", display: "收费项目", width: 150, align: "left" },
|
||
{ name: "fee", display: "金额", width: 150, align: "left" }
|
||
],
|
||
//width: 467,
|
||
width: 310,
|
||
usePager: false,
|
||
fixedCellHeight: false,
|
||
height: 500
|
||
});
|
||
}
|
||
|
||
var tjxmadd;
|
||
|
||
function TjxmAdd() {
|
||
//2023-11-15 xulu 根据性别获取体检项目
|
||
var scheme_name = $("#scheme_name").val();
|
||
var sex = '';
|
||
if (scheme_name.indexOf("女") != -1) {
|
||
sex = "女";
|
||
}
|
||
else if (scheme_name.indexOf("男") != -1) {
|
||
sex = "男";
|
||
}
|
||
tjxmadd =$.ligerDialog.open({
|
||
url: '@Url.Action("TjxmSel")?strSex='+sex,
|
||
width: 1200,//2023-10-20 xulu 修改950->1300
|
||
height: 600,
|
||
title: "添加体检项目"
|
||
});
|
||
|
||
}
|
||
//2023-11-22 xulu 修改打印项目
|
||
function TjxmModify() {
|
||
var scheme_id = $("#scheme_id").val();
|
||
tjxmModify =$.ligerDialog.open({
|
||
url: '@Url.Action("PrintxmSel", "Dictionaries")?scheme_id=' + scheme_id + '&check_item_ids=' + $("#check_item_ids").val()+'&person_id=',
|
||
width: 1200,
|
||
height: 600,
|
||
title: "修改打印项目"
|
||
});
|
||
}
|
||
//2023-11-22 xulu 更新方案中print_item_ids--仅更新页面数据
|
||
function updatePrintIds(data) {
|
||
var print_ids = "";
|
||
for (var i = 0; i < data.length; i++) {
|
||
print_ids += data[i].project_id;
|
||
if (i < data.length - 1) {
|
||
print_ids += ",";
|
||
}
|
||
}
|
||
$("#print_item_ids").val(print_ids);
|
||
liger.get("print_item").set("parms", { "print_item_ids": print_ids });
|
||
liger.get("print_item").reload();
|
||
tjxmModify.close();
|
||
}
|
||
|
||
function Tjxminit(data) {
|
||
liger.get("tjxm").set("data", { Rows: data });
|
||
var currrow = { Rows: data };
|
||
var project = "";
|
||
//2023-11-22 xulu 更新打印项目列表
|
||
var print_ids = "";
|
||
for (var i = 0; i < currrow.Rows.length; i++) {
|
||
project += currrow.Rows[i].id + ",";
|
||
print_ids += currrow.Rows[i].project_id + ",";
|
||
}
|
||
print_ids = print_ids.substring(0, print_ids.length - 1);
|
||
//debugger;
|
||
sfxminit(project);
|
||
$("#check_item_ids").val(project);
|
||
if ($("#print_item_ids").val() == "") {
|
||
$("#print_item_ids").val(print_ids);
|
||
liger.get("print_item").set("parms", { "print_item_ids": print_ids });
|
||
liger.get("print_item").reload();
|
||
}
|
||
parentdata = currrow;
|
||
tjxmadd.close();
|
||
|
||
}
|
||
|
||
function tjxminit() {
|
||
|
||
$("#tjxm").ligerGrid({
|
||
//url: "@Url.Action("GettjxmByyhyszgzt")",
|
||
url: "@Url.Action("GetFirsttjxmByyhyszgzt")",
|
||
//parms: { "hyysids": $("#harmful_factors_maintain_id").val(), "zgzt": $("#zgzt option:selected").val() },
|
||
parms: { "tjxmids": $("#check_item_ids").val() },
|
||
title: "体检项目",
|
||
cssClass: "notablecss",
|
||
toolbar: {
|
||
items: [
|
||
{
|
||
text: '添加',
|
||
click: TjxmAdd,
|
||
icon: 'add'
|
||
}
|
||
]
|
||
},
|
||
columns: [
|
||
{ name: "id", display: "编号", width: 40, align: "left" },
|
||
{ name: "exam_group", display: "体检小组", width: 80, align: "left" },
|
||
{ name: "project_name", display: "体检项目", width: 150, align: "left" }
|
||
],
|
||
//width: 600,
|
||
width: 300,
|
||
height: 500,
|
||
usePager: false,
|
||
fixedCellHeight: false,
|
||
async:false
|
||
});
|
||
//2023-11-22 xulu 打印项目列表
|
||
$("#print_item").ligerGrid({
|
||
url: "@Url.Action("GetFirsttjxmByPrintItemIds")",
|
||
parms: { "print_item_ids": $("#print_item_ids").val() },
|
||
title: "打印项目",
|
||
cssClass: "notablecss",
|
||
toolbar: {
|
||
items: [
|
||
{
|
||
text: '修改',
|
||
click: TjxmModify,
|
||
icon: 'modify'
|
||
}
|
||
]
|
||
},
|
||
columns: [
|
||
{ name: "id", display: "编号", width: 40, align: "left" },
|
||
{ name: "exam_group", display: "体检小组", width: 80, align: "left" },
|
||
{ name: "project_name", display: "体检项目", width: 150, align: "left" }
|
||
],
|
||
//width: 600,
|
||
width: 300,
|
||
height: 500,
|
||
usePager: false,
|
||
fixedCellHeight: false,
|
||
async:false
|
||
});
|
||
var currrow = liger.get("tjxm").data;
|
||
var project = "";
|
||
for (var i = 0; i < currrow.Rows.length; i++) {
|
||
project += currrow.Rows[i].id + ",";
|
||
}
|
||
sfxminit(project);
|
||
$("#check_item_ids").val(project);
|
||
parentdata = currrow;
|
||
|
||
}
|
||
|
||
function success(data) {
|
||
if (data.State == "1") {
|
||
$.ligerDialog.alert(data.Message,
|
||
function() {
|
||
window.parent.init();
|
||
});
|
||
}
|
||
}
|
||
</script>
|
||
}
|
||
|
||
<div id="edit">
|
||
@using (Ajax.BeginForm("EditSiteTjmx", new AjaxOptions { HttpMethod = "Post", OnSuccess = "success" }))
|
||
{
|
||
|
||
@Html.HiddenFor(m => m.id,new { @id = "scheme_id" })
|
||
@Html.HiddenFor(m => m.check_item_ids, new { @id = "check_item_ids" })
|
||
@Html.HiddenFor(m => m.print_item_ids, new { @id = "print_item_ids" })
|
||
@Html.HiddenFor(m => m.hazard_type_ids, new { @id = "hazard_type_ids" })
|
||
@Html.HiddenFor(m => m.hazards_alias)
|
||
<table class="t1" style="width: 100%">
|
||
<tr>
|
||
<td class="ltd" width="100px">企业名称:</td>
|
||
<td class="rtd" colspan="3">
|
||
@Html.HiddenFor(m => m.util_name, new { @id = "util_name" })
|
||
@Html.DropDownListFor(m => m.util_id, ViewData["sitelist"] as SelectList, "----请选择----", new { @id = "util_id" })
|
||
</td>
|
||
|
||
</tr>
|
||
<tr>
|
||
<td class="ltd" width="100px">方案名称:</td>
|
||
<td class="rtd" colspan="3">@Html.TextBoxFor(m => m.scheme_name, new { @id = "scheme_name", @class = "l-text", style = "width:360px" }) @Html.ValidationMessageFor(m => m.scheme_name) </td>
|
||
|
||
</tr>
|
||
<tr>
|
||
<td class="ltd" width="100px">体检类型:</td>
|
||
<td class="rtd" width="383px">@Html.HiddenFor(m => m.exam_type, new { id = "exam_type" })@Html.DropDownListFor(m => m.check_type_maintain_id, ViewData["TypeList"] as SelectList, "----请选择----", new { id = "check_type_maintain_id" })@Html.ValidationMessageFor(m => m.check_type_maintain_id)</td>
|
||
<td class="ltd" width="100px">有害因素</td>
|
||
<td class="rtd" width="383px">@Html.HiddenFor(m => m.harmful_factors_maintain_id, new { @id = "harmful_factors_maintain_id" }) @Html.TextBoxFor(m => m.hazards, new { @onclick = "hyys();", @id = "ysss", @class = "l-text", style = "width:200px" })</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="ltd" width="100px">在岗状态:</td>
|
||
<td class="rtd">@Html.HiddenFor(m => m.station_status, new { id = "station_status" })@Html.DropDownListFor(m => m.jobs_state_maintain_id, ViewData["zgzt"] as SelectList, "----请选择----", new { id = "zgzt" })@Html.ValidationMessageFor(m => m.jobs_state_maintain_id)</td>
|
||
<td class="ltd" width="100px">有害类别:</td>
|
||
<td class="rtd">@Html.TextBoxFor(m => m.hazard_type_names, new { @id = "yhlb", @class = "l-text", style = "width:200px" })</td>
|
||
</tr>
|
||
</table>
|
||
<table style="width:100%">
|
||
<tr>
|
||
<td style="width:25%">
|
||
<div id="tjxm"></div>
|
||
</td>
|
||
<td style="width:25%">
|
||
<div id="print_item"></div>
|
||
</td>
|
||
<td style="width:50%">
|
||
<div id="sfxm"></div>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
<table class="t1" style="width:100%">
|
||
<tr>
|
||
<td class="ltd" width="100px">方案有效期:</td>
|
||
<td class="rtd" width="383px"><table><tr><td>@Html.TextBoxFor(m => m.valid_start, new { @id = "valid_start" })</td><td>~</td><td>@Html.TextBoxFor(m => m.valid_end, new { @id = "valid_end" })</td></tr></table></td>
|
||
<td class="ltd" width="100px">费用名称:</td>
|
||
<td class="rtd" width="383px">@Html.TextBoxFor(m => m.expense_name, new { @id = "expense_name" })</td>
|
||
</tr>
|
||
<tr>
|
||
<td class="ltd" width="100px">应收金额:</td>
|
||
<td class="rtd">@Html.TextBoxFor(m => m.recievable_amount, new { @id = "recievable_amount" })</td>
|
||
<td class="ltd" width="100px">协议金额:</td>
|
||
<td class="rtd">@Html.TextBoxFor(m => m.agreement_amount, new { @id = "agreement_amount" })</td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<td colspan="4">
|
||
<div align="center">
|
||
<input type="submit" id="submitid" class="l-button" value="保存" />
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
|
||
</table>
|
||
|
||
}
|
||
</div>
|