318 lines
14 KiB
Plaintext
318 lines
14 KiB
Plaintext
<!DOCTYPE html
|
||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
<%@ page language="java" pageEncoding="utf-8" %>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||
<style type="text/css">
|
||
.select2-container .select2-selection--single {
|
||
height: 34px;
|
||
line-height: 34px;
|
||
}
|
||
|
||
.select2-selection__arrow {
|
||
margin-top: 3px;
|
||
}
|
||
|
||
.form-horizontal {
|
||
padding-top: 20px;
|
||
}
|
||
.bor{
|
||
border: none;
|
||
|
||
}
|
||
.select2-container--default .select2-selection--multiple{
|
||
border: none;
|
||
}
|
||
.select2-container--default .select2-selection--multiple .select2-selection__choice{
|
||
background-color: white;
|
||
}
|
||
.select2-container--default.select2-container--disabled .select2-selection--multiple{
|
||
background-color: white;
|
||
}
|
||
.select2-container--default.select2-container--focus .select2-selection--multiple{
|
||
border: none;
|
||
}
|
||
</style>
|
||
<script type="text/javascript">
|
||
$(function () {
|
||
jobTypeDropDownInit(); // 作业类型
|
||
initFileList(); //初始化附件
|
||
initFlowList();//初始化时间轴
|
||
inittableList()//初始化安全培训
|
||
});
|
||
|
||
// 作业类型
|
||
function jobTypeDropDownInit() {
|
||
var select_Data = jQuery.parseJSON('${jobTypeList}');
|
||
var select_3 = $("#jobType").select2({
|
||
data: select_Data,
|
||
cache: false,
|
||
placeholder: '请选择',//默认文字提示
|
||
// allowClear: true,//允许清空
|
||
escapeMarkup: function (markup) {
|
||
return markup;
|
||
}, // 自定义格式化防止xss注入
|
||
language: "zh-CN",
|
||
minimumInputLength: 0,
|
||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||
multiple: true,
|
||
templateResult: function formatRepo(repo) {
|
||
return repo.text;
|
||
}, // 函数用来渲染结果
|
||
templateSelection: function formatRepoSelection(repo) {
|
||
return repo.text;
|
||
} // 函数用于呈现当前的选择
|
||
});
|
||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||
select_3.val('${bean.jobType}'.split(",")).trigger("change");
|
||
}
|
||
|
||
// 加载附件
|
||
function initFileList() {
|
||
// SAFETY_CHECK_COMPREHENSIVE(9, "综合安全检查","ZH"),
|
||
$.post(ext.contextPath + '/safety/SafetyFiles/fileListShow.do',
|
||
{
|
||
bizId: '${bean.id}',
|
||
functionCode: 6,
|
||
statusCode: 2
|
||
}, function (data) {
|
||
$("#fileList").html(data);
|
||
});
|
||
};
|
||
//加载安全培训
|
||
function inittableList() {
|
||
|
||
$.post(ext.contextPath + '/safety/SafetyEducationBuilder/bindListShow.do', {
|
||
bizId: '${bean.id}',
|
||
}, function (data) {
|
||
$("#tableDiv").html(data);
|
||
});
|
||
};
|
||
|
||
//加载时间轴
|
||
function initFlowList() {
|
||
|
||
$.post(ext.contextPath + '/safety/SafetyFlowTask/showList.do', {
|
||
bizId: '${bean.id}',
|
||
}, function (data) {
|
||
$("#flowDiv").html(data);
|
||
});
|
||
};
|
||
// 作业负责人
|
||
function selectdutyUser() {
|
||
$.post(ext.contextPath + '/user/userForOneSelect.do',
|
||
{formId: "editForm", hiddenId: "dutyUserId", textId: "dutyUserName"},
|
||
function (data) {
|
||
$("#user4SelectDiv").html(data);
|
||
openModal('user4SelectModal');
|
||
});
|
||
};
|
||
|
||
//选择部门
|
||
var showUnit4SelectFun = function () {
|
||
$.post(ext.contextPath + '/user/showUnit4Select_Limited.do', {
|
||
formId: "editForm",
|
||
hiddenId: "competentDeptId",
|
||
textId: "competentDeptName"
|
||
}, function (data) {
|
||
$("#unit4SelectDiv").html(data);
|
||
openModal("unit4SelectModal_Limited");
|
||
});
|
||
};
|
||
|
||
|
||
|
||
// 验证
|
||
$("#editForm").bootstrapValidator({
|
||
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
||
fields: {
|
||
competentAdvice: {
|
||
validators: {
|
||
notEmpty: {
|
||
message: '主管部门意见不能为空。'
|
||
}
|
||
}
|
||
},
|
||
}
|
||
});
|
||
//关联安全培训
|
||
function eductaionShow() {
|
||
$.post(ext.contextPath + '/safety/SafetyJobOutside/educationOutsiderListForJobShow.do?bizId=${bean.id}', {}, function (data) {
|
||
$("#educationDiv").html(data);
|
||
openModal('educationModal');
|
||
});
|
||
}
|
||
//开具工单
|
||
function uploadFile() {
|
||
$("#saveFile").click();
|
||
}
|
||
var fileSelected = function () {
|
||
var formData = new FormData($("#uploadForm")[0]);
|
||
$.ajax({
|
||
url: ext.contextPath + "/safety/SafetyJobOutside/saveFile.do",
|
||
type: 'POST',
|
||
data: formData,
|
||
async: false,
|
||
cache: false,
|
||
contentType: false,
|
||
processData: false,
|
||
dataType: 'json',
|
||
success: function (data) {
|
||
// console.log(data)
|
||
if (data.code == 1) {
|
||
showAlert('s', '工单资料上传成功!');
|
||
initTable()
|
||
} else {
|
||
showAlert('d', '保存失败!' + data.msg);
|
||
}
|
||
},
|
||
error: function (data) {
|
||
}
|
||
});
|
||
};
|
||
|
||
</script>
|
||
<div class="modal fade" id="subModal">
|
||
<div class="modal-dialog" style="width: 79%">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span></button>
|
||
<h4 class="modal-title">项目进行中</h4>
|
||
</div>
|
||
<div id="educationDiv"></div>
|
||
<div class="modal-body">
|
||
<div class="row">
|
||
<div class="col-md-7 col-xs-13">
|
||
<!-- 新增界面formid强制为editForm -->
|
||
<form class="form-horizontal" id="editForm" enctype="multipart/form-data">
|
||
<div id="alertDiv"></div>
|
||
<%-- <input type="hidden" name="id" value="${user.id }" />--%>
|
||
<!-- 界面提醒div强制id为alertdiv -->
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label "> 发起人</label>
|
||
<div class="col-sm-4 ">
|
||
<input type="text" class="form-control bor" id="createUserName" name="createUserName"
|
||
value="${bean.createUserName}" readonly style="background-color: white">
|
||
<input type="hidden" class="form-control" id="createUserId" name="createUserId"
|
||
value="${bean.createUserId}">
|
||
</div>
|
||
|
||
<label class="col-sm-2 control-label">作业编号</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="jobCode" name="jobCode" class="form-control bor"
|
||
value="${bean.jobCode}" readonly style="background-color: white">
|
||
<input type="hidden" id="id" name="id" class="form-control"
|
||
value="${bean.id}">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">作业类型</label>
|
||
<div class="col-sm-10">
|
||
<select class="form-control bor" name="jobType" id="jobType" style="width: 100%" value="${bean.jobType}" disabled="true">
|
||
</select>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label "> 作业地点</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" class="form-control bor" id="jobLocation" name="jobLocation"
|
||
value="${bean.jobLocation}" readonly style="background-color: white">
|
||
</div>
|
||
|
||
<label class="col-sm-2 control-label">作业单位</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="jobCompany" name="jobCompany" class="form-control bor"
|
||
value="${bean.jobCompany}" readonly style="background-color: white">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label ">主管部门</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" id="competentDeptName" name="competentDeptName"
|
||
class="form-control bor" style="background-color: white"
|
||
value="${bean.competentDeptName}" readonly>
|
||
<input type="hidden" id="competentDeptId" name="competentDeptId"
|
||
class="form-control"
|
||
value="${bean.competentDeptId}">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label ">开始时间</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="projectBeginDate" name="projectBeginDate"
|
||
class="form-control bor" readonly style="background-color: white"
|
||
value="${bean.projectBeginDate.substring(0, 10)}">
|
||
</div>
|
||
<label class="col-sm-2 control-label ">结束时间</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="projectEndDate" name="projectEndDate" class="form-control bor"
|
||
value="${bean.projectEndDate.substring(0, 10)}" readonly style="background-color: white">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">作业负责人</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="dutyUserName" name="dutyUserName" class="form-control bor"
|
||
readonly style="background-color: white" value="${bean.dutyUserName}">
|
||
<input type="hidden" id="dutyUserId" name="dutyUserId" class="form-control"
|
||
value="${bean.dutyUserId}">
|
||
</div>
|
||
<label class="col-sm-2 control-label">联系方式</label>
|
||
<div class="col-sm-4">
|
||
<input type="text" id="contact" name="contact" class="form-control bor"
|
||
value="${bean.contact}" readonly style="background-color: white">
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label ">作业内容</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control bor" id="jobContent" name="jobContent"
|
||
value="${bean.jobContent}" readonly style="background-color: white" >
|
||
</div>
|
||
</div>
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label ">主管部门意见</label>
|
||
<div class="col-sm-10">
|
||
<input type="text" class="form-control bor" id="competentAdvice" name="competentAdvice"
|
||
value="${bean.competentAdvice}" readonly style="background-color: white" >
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group">
|
||
<div class="col-sm-10" id="fileList"></div>
|
||
</div>
|
||
<div class="form-group">
|
||
<div class="col-sm-10" id="tableDiv"></div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<div class="col-md-5 col-xs-12" id="flowDiv"></div>
|
||
</div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||
<button type="button" class="btn btn-primary " style="margin-left: 10px" onclick="eductaionShow()">
|
||
关联安全培训
|
||
</button>
|
||
<button type="button" class="btn btn-primary " style="margin-left: 10px" onclick="uploadFile()">
|
||
开具工作单
|
||
</button>
|
||
</div>
|
||
<form style="display: none"
|
||
id="uploadForm" enctype="multipart/form-data">
|
||
<input type="file" id="saveFile" name="saveFile" onchange="fileSelected()"/>
|
||
<input type="hidden" name="bizId" value="${bean.id}"/>
|
||
<input type="hidden" name="functionCode" value="5"/>
|
||
<input type="hidden" name="statusCode" value="2"/>
|
||
</form>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|