306 lines
14 KiB
Plaintext
306 lines
14 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
|||
|
|
<%@page import="com.sipai.entity.process.LibraryRoutineWork" %>
|
|||
|
|
<% request.setAttribute("Frequency_Type_Day", LibraryRoutineWork.Frequency_Type_Day); %>
|
|||
|
|
<% request.setAttribute("Frequency_Type_Month", LibraryRoutineWork.Frequency_Type_Month); %>
|
|||
|
|
<% request.setAttribute("Frequency_Type_Year", LibraryRoutineWork.Frequency_Type_Year); %>
|
|||
|
|
<% request.setAttribute("Type_Run", LibraryRoutineWork.Type_Run); %>
|
|||
|
|
<% request.setAttribute("Type_Manage", LibraryRoutineWork.Type_Manage); %>
|
|||
|
|
|
|||
|
|
<style type="text/css">
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
|
|||
|
|
function dosave() {
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('receiveUsersName', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('receiveUsersName');
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/process/routineWork/doupdate.do", $("#subForm").serialize(), function (data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
closeModal("subModal");
|
|||
|
|
} else if (data.res == 0) {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.res);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
positionTypeCode: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '岗位类型编号不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
planStartDate: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '计划日期不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
receiveUsersName: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '接收人员不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#planStartDate').datepicker({
|
|||
|
|
language: 'zh-CN',
|
|||
|
|
autoclose: true,
|
|||
|
|
todayHighlight: true,
|
|||
|
|
format: 'yyyy-mm-dd',
|
|||
|
|
}).on('hide', function (e) {
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('planStartDate', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('planStartDate');
|
|||
|
|
});
|
|||
|
|
$('#planStartDate').datepicker('setDate', '${routineWork.planStartDate.substring(0, 10)}');
|
|||
|
|
|
|||
|
|
var showUser4SelectsFun = function () {
|
|||
|
|
var userIds = $("#receiveUserIds").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelect.do', {
|
|||
|
|
formId: "subForm",
|
|||
|
|
hiddenId: "receiveUserIds",
|
|||
|
|
textId: "receiveUsersName",
|
|||
|
|
userIds: userIds
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
function submitFun() {
|
|||
|
|
$('#subForm').data('bootstrapValidator')
|
|||
|
|
.updateStatus('receiveUsersName', 'NOT_VALIDATED', null)
|
|||
|
|
.validateField('receiveUsersName');
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
dosubmit();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function dosubmit() {
|
|||
|
|
$("#status").val('${Status_Start}');
|
|||
|
|
$.post(ext.contextPath + "/process/routineWork/startProcess.do", $("#subForm").serialize(), function (data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
$("#table").bootstrapTable('refresh');
|
|||
|
|
closeModal('subModal');
|
|||
|
|
} else if (data.res == 0) {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
} else if (data.res == 2) {
|
|||
|
|
showAlert('d', '未检测到周期常规工单流程,请先部署周期常规工单流程!');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.res);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$(function (){
|
|||
|
|
getContentForFile();
|
|||
|
|
})
|
|||
|
|
|
|||
|
|
function getContentForFile() {
|
|||
|
|
$("#table_contentFile").bootstrapTable({ // 对应table标签的id
|
|||
|
|
url: ext.contextPath + '/process/routineWork/getListForFile.do', // 获取表格数据的url
|
|||
|
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|||
|
|
striped: true, //表格显示条纹,默认为false
|
|||
|
|
pagination: true, // 在表格底部显示分页组件,默认false
|
|||
|
|
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
|||
|
|
pageSize: 10, // 页面数据条数
|
|||
|
|
pageNumber: 1, // 首页页码
|
|||
|
|
sidePagination: 'client', // 设置为服务器端分页
|
|||
|
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|||
|
|
return {
|
|||
|
|
// rows: params.limit, // 每页要显示的数据条数
|
|||
|
|
// page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
|||
|
|
// sort: params.sort, // 要排序的字段
|
|||
|
|
// order: params.order,
|
|||
|
|
pid: '${routineWork.id}'
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
// sortName: 'id', // 要排序的字段
|
|||
|
|
// sortOrder: 'desc', // 排序规则
|
|||
|
|
columns: [
|
|||
|
|
{
|
|||
|
|
field: 'filename', // 返回json数据中的name
|
|||
|
|
title: '档案名称', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle'
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
field: 'upuser', // 返回json数据中的name
|
|||
|
|
title: '上传人', // 表格表头显示文字
|
|||
|
|
align: 'center', // 左右居中
|
|||
|
|
valign: 'middle'
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
title: "操作",
|
|||
|
|
align: 'center',
|
|||
|
|
valign: 'middle',
|
|||
|
|
width: '80',
|
|||
|
|
formatter: function (value, row, index) {
|
|||
|
|
var buts = '';
|
|||
|
|
buts += '<button class="btn btn-default btn-sm" title="下载" onclick="fileDownload(\'' + row.docId + '\')"><i class="fa fa-download"></i><span class="hidden-md hidden-lg">下载</span></button>';
|
|||
|
|
// buts += '<button class="btn btn-default btn-sm" title="删除" onclick="delRelation(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
|
|||
|
|
buts = '<div class = "btn-group">' + buts + '</div>';
|
|||
|
|
return buts;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
],
|
|||
|
|
onLoadSuccess: function () { //加载成功时执行
|
|||
|
|
adjustBootstrapTableView("table_contentFile");
|
|||
|
|
},
|
|||
|
|
onLoadError: function () { //加载失败时执行
|
|||
|
|
console.info("加载数据失败");
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//下载文件
|
|||
|
|
var fileDownload = function (id) {
|
|||
|
|
window.open(ext.contextPath + "/base/downloadFile.do?key=" + id + "&tbName=tb_doc_file");
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
<div class="modal fade" id="subModal">
|
|||
|
|
<div class="modal-dialog">
|
|||
|
|
<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 class="modal-body">
|
|||
|
|
<!-- 新增界面formid强制为subForm -->
|
|||
|
|
<form class="form-horizontal" id="subForm">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input type="hidden" name="id" id="id" value="${routineWork.id}"/>
|
|||
|
|
<input type="hidden" name="unitId" id="unitId" value="${routineWork.unitId}"/>
|
|||
|
|
<input type="hidden" name="status" id="status" value="${routineWork.status}"/>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">工作类型</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static">${routineWork.libraryRoutineWork.pworkTypeName}</p>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">岗位类型</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static">${routineWork.libraryRoutineWork.ppositionType}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">工作编号</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static">${routineWork.libraryRoutineWork.workCode}</p>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">工作名称</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static">${routineWork.libraryRoutineWork.workName}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">工作内容</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<p class="form-control-static">${routineWork.libraryRoutineWork.workContent}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">评价标准及文件</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<p class="form-control-static">${routineWork.libraryRoutineWork.evaluationCriterion}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">定额工时(小时)</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static">${routineWork.libraryRoutineWork.baseHours}</p>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">定额费用(元)</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static">${routineWork.libraryRoutineWork.baseCost}</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">是否可抢单</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static">${routineWork.libraryRoutineWork.robWorkorder}</p>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">类型</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<p class="form-control-static">
|
|||
|
|
<c:if test="${routineWork.libraryRoutineWork.type == Type_Run}">
|
|||
|
|
运行
|
|||
|
|
</c:if>
|
|||
|
|
<c:if test="${routineWork.libraryRoutineWork.type == Type_Manage}">
|
|||
|
|
行政
|
|||
|
|
</c:if>
|
|||
|
|
</p>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*计划日期</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<div class="input-group date">
|
|||
|
|
<div class="input-group-addon">
|
|||
|
|
<i class="fa fa-calendar"></i>
|
|||
|
|
</div>
|
|||
|
|
<input type="text" class="form-control" id="planStartDate" name="planStartDate"
|
|||
|
|
style="width: 132px;">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">接收人员</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="receiveUsersName" name="receiveUsersName"
|
|||
|
|
placeholder="请选择接收人员" onclick="showUser4SelectsFun();"
|
|||
|
|
value="${routineWork.receiveUsersName}">
|
|||
|
|
<input id="receiveUserIds" name="receiveUserIds" type="hidden"
|
|||
|
|
value="${routineWork.receiveUserIds}"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
<div class="box box-primary">
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">相关资料</h3>
|
|||
|
|
</div>
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<table id="table_contentFile" style="table-layout:fixed;"></table>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="modal-footer">
|
|||
|
|
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
|||
|
|
<button type="button" class="btn btn-primary" onclick="dosave()" >保存</button>
|
|||
|
|
<button type="button" class="btn btn-primary" onclick="submitFun()" >下发</button>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-content -->
|
|||
|
|
</div>
|
|||
|
|
<!-- /.modal-dialog -->
|
|||
|
|
</div>
|