You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
220 lines
9.7 KiB
220 lines
9.7 KiB
<!DOCTYPE html>
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
|
<head>
|
|
<th:block th:include="include :: header('请假申请列表')" />
|
|
<th:block th:include="include :: select2-css" />
|
|
</head>
|
|
<body class="gray-bg">
|
|
<div class="container-div">
|
|
<div class="row">
|
|
<div class="col-sm-12 search-collapse">
|
|
<form id="formId">
|
|
<div class="select-list">
|
|
<ul>
|
|
<li>
|
|
<p>请假类型:</p>
|
|
<select name="type" th:with="type=${@dict.getType('biz_leave_type')}">
|
|
<option value="">所有</option>
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
|
</select>
|
|
</li>
|
|
<li>
|
|
<p>标题:</p>
|
|
<input type="text" name="title"/>
|
|
</li>
|
|
<li class="select-time">
|
|
<p>请假时间:</p>
|
|
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
|
|
<span>-</span>
|
|
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
|
|
</li>
|
|
<li>
|
|
<p>流程实例ID:</p>
|
|
<input type="text" name="instanceId"/>
|
|
</li>
|
|
<li>
|
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="btn-group-sm" id="toolbar" role="group">
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="process:leave:add">
|
|
<i class="fa fa-plus"></i> 添加
|
|
</a>
|
|
<!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="process:leave:export">
|
|
<i class="fa fa-download"></i> 导出
|
|
</a>-->
|
|
</div>
|
|
<div class="col-sm-12 select-table table-striped">
|
|
<table id="bootstrap-table"></table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<th:block th:include="include :: footer" />
|
|
<th:block th:include="include :: select2-js" />
|
|
<script th:inline="javascript">
|
|
var editFlag = [[${@permission.hasPermi('process:leave:edit')}]];
|
|
var removeFlag = [[${@permission.hasPermi('process:leave:remove')}]];
|
|
var prefix = ctx + "process/leave";
|
|
var datas = [[${@dict.getType('biz_leave_type')}]];
|
|
var currentUser = [[${currentUser}]];
|
|
|
|
$(function() {
|
|
var options = {
|
|
url: prefix + "/list",
|
|
createUrl: prefix + "/add",
|
|
updateUrl: prefix + "/edit/{id}",
|
|
removeUrl: prefix + "/remove",
|
|
exportUrl: prefix + "/export",
|
|
detailUrl: prefix + "/edit/{id}",
|
|
sortName: "applyTime",
|
|
sortOrder: "desc",
|
|
modalName: "请假业务",
|
|
columns: [{
|
|
checkbox: true
|
|
},
|
|
{
|
|
field : 'id',
|
|
title : '主键ID',
|
|
visible: false
|
|
},
|
|
{
|
|
field : 'type',
|
|
title : '请假类型',
|
|
align : 'center',
|
|
formatter: function(value, row, index) {
|
|
return $.table.selectDictLabel(datas, value);
|
|
}
|
|
},
|
|
{
|
|
field : 'title',
|
|
title : '标题'
|
|
},
|
|
{
|
|
field : 'reason',
|
|
title : '原因'
|
|
},
|
|
{
|
|
field : 'startTime',
|
|
title : '开始时间'
|
|
},
|
|
{
|
|
field : 'endTime',
|
|
title : '结束时间'
|
|
},
|
|
{
|
|
field : 'totalTime',
|
|
title : '请假时长',
|
|
formatter: function(value, row, index) {
|
|
if (!value) return '未知';
|
|
return $.common.formatTotalDateSub(value);
|
|
}
|
|
},
|
|
{
|
|
field : 'instanceId',
|
|
title : '流程实例ID'
|
|
},
|
|
{
|
|
field: 'createBy',
|
|
title: '创建人ID',
|
|
visible: false
|
|
},
|
|
{
|
|
field: 'createUserName',
|
|
title: '创建人'
|
|
},
|
|
{
|
|
field: 'applyUser',
|
|
title: '申请人ID',
|
|
visible: false
|
|
},
|
|
{
|
|
field: 'applyUserName',
|
|
title: '<span style="color: red;">申请人</span>',
|
|
formatter: function(value, row, index) {
|
|
return '<span style="color: red;">' + (value ? value : "-") + '</span>';
|
|
}
|
|
},
|
|
{
|
|
field: 'applyTime',
|
|
title: '申请时间'
|
|
},
|
|
{
|
|
field: 'taskId',
|
|
title: '当前任务ID',
|
|
visible: false
|
|
},
|
|
{
|
|
field: 'taskName',
|
|
title: '当前任务名称',
|
|
align: 'center',
|
|
formatter: function(value, row, index) {
|
|
return '<span class="badge badge-primary">' + value + '</span>';
|
|
}
|
|
},
|
|
{
|
|
title: '操作',
|
|
align: 'center',
|
|
formatter: function(value, row, index) {
|
|
var actions = [];
|
|
if (row.instanceId) {
|
|
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-eye"></i> 表单数据</a> ');
|
|
actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
|
|
actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
|
|
} else {
|
|
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="submitApply(\'' + row.id + '\',\'' + row.createBy + '\')"><i class="fa fa-user"></i> 提交申请</a> ');
|
|
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="editForm(\'' + row.id + '\',\'' + row.createBy + '\')"><i class="fa fa-edit"></i> 编辑</a> ');
|
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="removeForm(\'' + row.id + '\',\'' + row.createBy + '\')"><i class="fa fa-remove"></i> 删除</a>');
|
|
}
|
|
return actions.join('');
|
|
}
|
|
}]
|
|
};
|
|
$.table.init(options);
|
|
});
|
|
|
|
function submitApply(id, createBy) {
|
|
if (createBy !== currentUser.loginName) {
|
|
$.modal.alertWarning("不允许非创建人提交申请!");
|
|
return;
|
|
}
|
|
$.modal.confirm("确认要提交申请吗?", function() {
|
|
var url = prefix + "/submitApply";
|
|
var data = { "id": id };
|
|
$.operate.submit(url, "post", "json", data);
|
|
});
|
|
}
|
|
|
|
function editForm(id, createBy) {
|
|
if (createBy !== currentUser.loginName) {
|
|
$.modal.alertWarning("不允许非创建人编辑表单!");
|
|
return;
|
|
}
|
|
$.operate.edit(id);
|
|
}
|
|
|
|
function removeForm(id, createBy) {
|
|
if (createBy !== currentUser.loginName) {
|
|
$.modal.alertWarning("不允许非创建人删除表单!");
|
|
return;
|
|
}
|
|
$.operate.remove(id);
|
|
}
|
|
|
|
/* 查看审批历史 */
|
|
function showHistoryDialog(instanceId) {
|
|
var url = ctx + 'process/general/historyList/' + instanceId;
|
|
$.modal.open("查看审批历史", url);
|
|
}
|
|
/* 查看流程图 */
|
|
function showProcessImgDialog(instanceId) {
|
|
var url = ctx + 'process/general/processImg/' + instanceId;
|
|
$.modal.open("查看流程图 (标红表示已结束或活动中的流程)", url);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|