<!DOCTYPE html>
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
<head>
|
<th:block th:include="include :: header('修改定时任务')"/>
|
<th:block th:include="include :: datetimepicker-css"/>
|
</head>
|
<body class="white-bg">
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
<form class="form-horizontal m" id="form-job-edit" th:object="${hiddenDangerCheckJob}">
|
<input id="jobId" name="jobId" type="hidden" th:field="*{jobId}"/>
|
|
|
<input id="createUserId" name="createUserId" type="hidden" th:field="*{createUserId}"/>
|
<input id="createUserName" name="createUserName" type="hidden" th:field="*{createUserName}"/>
|
|
<div class="form-group">
|
<label class="col-sm-3 control-label is-required">排查类型:</label>
|
<div class="col-sm-8">
|
<select name="troubleshootTypeId" th:field="*{troubleshootTypeId}" class="form-control m-b" required
|
id="troubleshootTypeId">
|
<option value="">请选择</option>
|
<option th:each="troubleshootType : ${troubleshootTypeList}" th:text="${troubleshootType.typeName}"
|
th:value="${troubleshootType.typeId}"
|
th:attr="data-typecyclenum=${troubleshootType.typeCycleNum},data-typecycletype=${troubleshootType.typeCycleType}"></option>
|
</select>
|
</div>
|
</div>
|
|
|
<div class="form-group">
|
<label class="col-sm-3 control-label is-required">排查周期:</label>
|
<div class="col-sm-8">
|
<input class="form-control" type="text" id="troubleshootCycleInfo" required readonly="readonly">
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label class="col-sm-3 control-label is-required">任务名称:</label>
|
<div class="col-sm-8">
|
<input class="form-control" th:field="*{jobName}" type="text" name="jobName" id="jobName" required>
|
</div>
|
</div>
|
|
|
<div class="form-group">
|
<label class="col-sm-3 control-label is-required">排查方式:</label>
|
<div class="col-sm-8">
|
<select name="checkType" th:field="*{checkType}" class="form-control m-b" required id="checkType">
|
<option value="1">基础清单排查</option>
|
<option value="2">选择风险单元清单排查</option>
|
</select>
|
</div>
|
</div>
|
|
|
|
<div class="form-group" style="display:block;" id="basicRiskListInfo">
|
<label class="col-sm-3 control-label is-required">基础清单:</label>
|
<div class="col-sm-8">
|
<select class="form-control m-b" th:value="*{riskId}" id="basicRiskList">
|
<option th:each="basic : ${basicRiskList}"
|
th:text="${basic.riskListName}"
|
th:value="${basic.riskListId}"
|
th:selected="${basic.riskListId+''==hiddenDangerCheckJob.riskId+''}"></option>
|
</select>
|
</div>
|
</div>
|
|
|
|
<div class="form-group" id="riskInfo" >
|
<label class="col-sm-3 control-label is-required">风险单元:</label>
|
<div class="col-sm-8">
|
<input id="riskName" th:value="*{riskName}" placeholder="选择风险单元"
|
class="form-control" type="text"
|
onclick="selectRiskList()" maxlength="30" readonly="true" required>
|
<input id="riskId" th:value="*{riskId}" type="hidden">
|
<input id="riskDeptId" th:value="*{riskDeptId}" type="hidden">
|
<input id="riskDeptName" th:value="*{riskDeptName}" type="hidden">
|
<input id="riskPlaceId" th:value="*{riskPlaceId}" type="hidden">
|
<input id="riskPlaceName" th:value="*{riskPlaceName}" type="hidden">
|
<input id="riskType" th:value="*{riskType}" type="hidden">
|
</div>
|
</div>
|
|
|
|
|
|
<div class="form-group">
|
<label class="col-sm-3 control-label is-required">执行人:</label>
|
<div class="col-sm-8">
|
<input id="executeUserName" name="executeUserName" th:field="*{executeUserName}" placeholder="选择执行人" class="form-control" type="text" onclick="selectExecuteUser()" maxlength="30" readonly="true" required>
|
<input id="executeUserId" name="executeUserId" th:field="*{executeUserId}" type="hidden">
|
</div>
|
</div>
|
|
<div class="form-group">
|
<label class="col-sm-3 control-label is-required">执行时间:</label>
|
<div class="col-sm-8">
|
<div class="input-group date">
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
<input name="startTime"
|
th:value="${#dates.format(hiddenDangerCheckJob.startTime, 'yyyy-MM-dd HH:mm:ss')}"
|
class="form-control" type="text" readonly="readonly" required>
|
</div>
|
</div>
|
</div>
|
|
<input id="jobGroup" name="jobGroup" type="hidden" value="HiddenDangerCheckJobLog"/>
|
|
</form>
|
</div>
|
<th:block th:include="include :: footer"/>
|
<th:block th:include="include :: datetimepicker-js"/>
|
<script th:inline="javascript">
|
|
|
/*执行人 选择 start*/
|
function selectExecuteUser() {
|
var url = ctx + "system/user/selectUserListByParentSonCompany";
|
var options = {
|
title: '用户选择',
|
width: "800",
|
url: url,
|
};
|
$.modal.openOptionsByCallback(options, function (layero, index) {
|
var body = layer.getChildFrame('body', index);
|
body.on("click", ".selectUser", function () {
|
var userId = $(this).data("userid");
|
var userName = $(this).data("username");
|
$("#executeUserId").val(userId);
|
$("#executeUserName").val(userName);
|
layer.close(index);
|
});
|
});
|
}
|
/*执行人 选择 end*/
|
|
|
//切换排查类型
|
$("#checkType").on("change", function () {
|
var $thisValue = $(this).val();
|
if($thisValue == "1"){
|
$("#riskInfo").find(":input").attr("disabled", true);
|
$("#riskInfo").hide();
|
$("#basicRiskListInfo").attr("disabled", false);;//基础清单信息
|
$("#basicRiskListInfo").show();
|
|
}else if($thisValue == "2"){
|
$("#basicRiskListInfo").attr("disabled",true);
|
$("#basicRiskListInfo").hide();
|
$("#riskInfo").find(":input").attr("disabled", false);
|
$("#riskInfo").show();
|
}
|
});
|
|
|
|
$(function () {
|
$("#checkType").change();
|
});
|
|
|
$(function () {
|
var hiddenDangerCheckJob = [[${hiddenDangerCheckJob}]];
|
var typeCycleNum = hiddenDangerCheckJob.troubleshootTypeCycleNum;
|
var typeCycleType = hiddenDangerCheckJob.troubleshootTypeCycleType;
|
|
var typeCycleTypeLabel = "";
|
if (typeCycleType == "1") {
|
typeCycleTypeLabel = "小时";
|
} else if (typeCycleType == "2") {
|
typeCycleTypeLabel = "日";
|
} else if (typeCycleType == "3") {
|
typeCycleTypeLabel = "周";
|
} else if (typeCycleType == "4") {
|
typeCycleTypeLabel = "月";
|
} else if (typeCycleType == "5") {
|
typeCycleTypeLabel = "年";
|
}
|
|
var troubleshootCycleInfo = typeCycleNum + typeCycleTypeLabel + "1次";
|
$("#troubleshootCycleInfo").val(troubleshootCycleInfo);
|
});
|
|
$("input[name='startTime']").datetimepicker({
|
format: "yyyy-mm-dd hh:ii:ss",
|
autoclose: true
|
});
|
|
|
/*选择风险单元 选择 start*/
|
function selectRiskList() {
|
var url = ctx + "tr/riskList/selectRiskListByDangerReportMultiple";
|
var options = {
|
title: '选择风险单元',
|
width: "700",
|
height: "500",
|
url: url,
|
callBack: doSubmitSelectRiskList
|
};
|
$.modal.openOptions(options);
|
}
|
|
function doSubmitSelectRiskList(index, layero) {
|
var rows = layero.find("iframe")[0].contentWindow.$("#bootstrap-table").bootstrapTable('getSelections');
|
if (rows.length > 0) {
|
var riskId = "";
|
var riskName = "";
|
var riskDeptId = "";
|
var riskDeptName = "";
|
var riskPlaceId = "";
|
var riskPlaceName = "";
|
var riskType = "";
|
|
$.each(rows, function (i, row) {
|
riskId = riskId!="" ? riskId + "," + row.riskListId : row.riskListId;
|
riskName = riskName!="" ? riskName + "," + row.riskListName : row.riskListName;
|
riskDeptId = riskDeptId!="" ? riskDeptId + "," + row.deptId : row.deptId;
|
riskDeptName = riskDeptName!="" ? riskDeptName + "," + row.deptName : row.deptName;
|
riskPlaceId = riskPlaceId!="" ? riskPlaceId + "," + row.regionId : row.regionId;
|
riskPlaceName = riskPlaceName!="" ? riskPlaceName + "," + row.regionName : row.regionName;
|
riskType = riskType!="" ? riskType + "," + row.riskType : row.riskType;
|
});
|
|
$("#riskId").val(riskId);
|
$("#riskName").val(riskName);
|
$("#riskDeptId").val(riskDeptId);
|
$("#riskDeptName").val(riskDeptName);
|
$("#riskPlaceId").val(riskPlaceId);
|
$("#riskPlaceName").val(riskPlaceName);
|
$("#riskType").val(riskType);
|
layer.close(index);
|
} else {
|
$.modal.alertWarning("请至少选择一个风险单元");
|
}
|
}
|
/*选择风险单元 选择 end*/
|
|
//切换排查类型显示排查周期
|
$("#troubleshootTypeId").on("change", function () {
|
var $thisValue = $(this).val();
|
if ($thisValue) {
|
var typeCycleNum = $(this).find("option:selected").attr('data-typecyclenum');
|
var typeCycleType = $(this).find("option:selected").attr('data-typecycletype');
|
var typeCycleTypeLabel = "";
|
if (typeCycleType == "1") {
|
typeCycleTypeLabel = "小时";
|
} else if (typeCycleType == "2") {
|
typeCycleTypeLabel = "日";
|
} else if (typeCycleType == "3") {
|
typeCycleTypeLabel = "周";
|
} else if (typeCycleType == "4") {
|
typeCycleTypeLabel = "月";
|
} else if (typeCycleType == "5") {
|
typeCycleTypeLabel = "年";
|
}
|
var troubleshootCycleInfo = typeCycleNum + typeCycleTypeLabel + "1次";
|
$("#troubleshootCycleInfo").val(troubleshootCycleInfo);
|
} else {
|
$("#troubleshootCycleInfo").val("");
|
}
|
});
|
|
var prefix = ctx + "tr/hiddenDangerCheckJob";
|
|
$("#form-job-edit").validate({
|
onkeyup: false,
|
focusCleanup: true
|
});
|
|
function submitHandler() {
|
if ($.validate.form()) {
|
var data = $('#form-job-edit').serializeArray();
|
|
var troubleshootTypeName = $("select[name='troubleshootTypeId']").find("option:selected").text();//排查类型名称
|
data.push({"name": "troubleshootTypeName", "value": troubleshootTypeName});
|
|
|
var troubleshootTypeCycleNum = $("#troubleshootTypeId").find("option:selected").attr('data-typecyclenum');
|
var troubleshootTypeCycleType = $("#troubleshootTypeId").find("option:selected").attr('data-typecycletype');
|
data.push({"name": "troubleshootTypeCycleNum", "value": troubleshootTypeCycleNum});
|
data.push({"name": "troubleshootTypeCycleType", "value": troubleshootTypeCycleType});
|
|
|
|
var checkType = $("#checkType").val();//排查类型
|
if(checkType == "1"){//基础清单排查
|
$("#riskInfo").find(":input").attr("disabled", true);
|
$("#riskInfo").hide();
|
var riskId = $("#basicRiskList").find("option:selected").val();//基础清单文件risk_id
|
var riskName = $("#basicRiskList").find("option:selected").text();//基础清单文件risk_name
|
data.push({"name": "riskId", "value": riskId});
|
data.push({"name": "riskName", "value": riskName});
|
}else if(checkType == "2"){//选择风险单元清单排查
|
$("#basicRiskListInfo").attr("disabled",true);
|
$("#basicRiskListInfo").hide();
|
|
var riskId = $("#riskId").val();
|
var riskName = $("#riskName").val();
|
var riskDeptId = $("#riskDeptId").val();
|
var riskDeptName = $("#riskDeptName").val();
|
var riskPlaceId = $("#riskPlaceId").val();
|
var riskPlaceName = $("#riskPlaceName").val();
|
var riskType = $("#riskType").val();
|
data.push({"name": "riskId", "value": riskId});
|
data.push({"name": "riskName", "value": riskName});
|
data.push({"name": "riskDeptId", "value": riskDeptId});
|
data.push({"name": "riskDeptName", "value": riskDeptName});
|
data.push({"name": "riskPlaceId", "value": riskPlaceId});
|
data.push({"name": "riskPlaceName", "value": riskPlaceName});
|
data.push({"name": "riskType", "value": riskType});
|
}
|
|
$.operate.save(prefix + "/edit", data);
|
}
|
}
|
</script>
|
</body>
|
</html>
|