276 lines
13 KiB
HTML
276 lines
13 KiB
HTML
<!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('党务列表')" />
|
||
</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>
|
||
<label>考核类型:</label>
|
||
<input type="text" name="type"/>
|
||
</li>
|
||
<li>
|
||
<label>部门:</label>
|
||
<select name="deptId" id="deptId">
|
||
</select>
|
||
<!-- <input type="text" name="deptId"/>-->
|
||
</li>
|
||
<li>
|
||
<label>审批人:</label>
|
||
<select name="reviewed" id="reviewed">
|
||
</select>
|
||
<!-- <input type="text" name="reviewed"/>-->
|
||
</li>
|
||
<li>
|
||
<label>提交时间:</label>
|
||
<input type="text" class="time-input" placeholder="提交时间" name="finishDate"/>
|
||
</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="base:affairs:add">-->
|
||
<!-- <i class="fa fa-plus"></i> 添加-->
|
||
<!-- </a>-->
|
||
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="base:affairs:edit">-->
|
||
<!-- <i class="fa fa-edit"></i> 修改-->
|
||
<!-- </a>-->
|
||
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="base:affairs:remove">-->
|
||
<!-- <i class="fa fa-remove"></i> 删除-->
|
||
<!-- </a>-->
|
||
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="base:affairs: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" />
|
||
<script th:inline="javascript">
|
||
var editFlag = [[${@permission.hasPermi('base:affairs:edit')}]];
|
||
var removeFlag = [[${@permission.hasPermi('base:affairs:remove')}]];
|
||
var prefix = ctx + "base/affairs";
|
||
|
||
$(document).ready(function () {
|
||
$.ajax({
|
||
type: "post",
|
||
url: ctx + "base/personnel/personnelList",
|
||
data: {
|
||
},
|
||
success: function(data) {
|
||
var opt = '<option value="">请选择</option>';
|
||
data.data.forEach(d=>{
|
||
opt += '<option value="'+d.id+'">'+d.name+'</option>';
|
||
})
|
||
$("#reviewed")[0].innerHTML=opt;
|
||
}
|
||
});
|
||
|
||
$.ajax({
|
||
type: "post",
|
||
url: ctx + "base/personnel/deptList",
|
||
data: {
|
||
},
|
||
success: function(data) {
|
||
var opt = '<option value="">请选择</option>';
|
||
data.data.forEach(d=>{
|
||
opt += '<option value="'+d.deptId+'">'+d.deptName+'</option>';
|
||
})
|
||
$("#deptId")[0].innerHTML=opt;
|
||
}
|
||
});
|
||
})
|
||
|
||
$(function() {
|
||
var options = {
|
||
url: prefix + "/warnList",
|
||
createUrl: prefix + "/add",
|
||
updateUrl: prefix + "/edit/{id}",
|
||
removeUrl: prefix + "/remove",
|
||
exportUrl: prefix + "/export",
|
||
modalName: "指标",
|
||
columns: [{
|
||
checkbox: true
|
||
},
|
||
{
|
||
field: 'id',
|
||
title: '自增ID',
|
||
visible: false
|
||
},
|
||
{
|
||
field: 'header',
|
||
title: '提交人'
|
||
},
|
||
{
|
||
field: 'type',
|
||
title: '考核类型'
|
||
},
|
||
{
|
||
field: 'target',
|
||
title: '指标'
|
||
},
|
||
{
|
||
field: 'commitTime',
|
||
title: '提交时间',
|
||
formatter: function(value, row, index) {
|
||
if (row.status === '2'){
|
||
return row.updateTime
|
||
}
|
||
}
|
||
},
|
||
{
|
||
field: 'finishDate',
|
||
title: '截止时间'
|
||
},
|
||
{
|
||
field: 'deptName',
|
||
title: '部门'
|
||
},
|
||
{
|
||
field: 'reviewer',
|
||
title: '审批人'
|
||
},
|
||
{
|
||
field: 'status',
|
||
title: '审批状态',
|
||
formatter: function(value, row, index) {
|
||
var actions = [];
|
||
if (row.status === '1'){
|
||
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)">待提交</a> ');
|
||
}else if (row.status === '2'){
|
||
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)">待审核</a> ');
|
||
}else if (row.status === '3'){
|
||
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)">已驳回</a> ');
|
||
}else if (row.status === '4'){
|
||
actions.push('<a class="btn btn-default btn-xs" href="javascript:void(0)">已完成</a> ');
|
||
}
|
||
return actions.join('');
|
||
}
|
||
},
|
||
{
|
||
title: '操作',
|
||
align: 'center',
|
||
formatter: function(value, row, index) {
|
||
var actions = [];
|
||
if (row.status === '1'){
|
||
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.upload(\'' + row.id + '\')"><i class="fa fa-edit"></i>上传附件</a> ');
|
||
}else if (row.status === '2'){
|
||
actions.push('<a data-id="'+row.id+'" data-header="'+row.header+'" data-score="'+row.score+'" data-updatetime="'+row.updateTime+'" data-shotname="'+row.shotName+'" data-deptname="'+row.deptName+'" data-reviewer="'+row.reviewer+'" data-detailed="'+row.detailed+'" data-demand="'+row.demand+'" data-type="'+row.type+'" data-nowscore="'+row.nowScore+'" class="shenhe btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)">审批</a> ');
|
||
}else if (row.status === '3'){
|
||
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)">已驳回</a> ');
|
||
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.upload(\'' + row.id + '\')"><i class="fa fa-edit"></i>重新上传附件</a> ');
|
||
}
|
||
if (row.files && row.status !=='3'){
|
||
actions.push('<a data-files="'+row.files+'" data-type="1" class="viewFiles0828 btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-picture-o"></i>查看图片</a> ');
|
||
actions.push('<a data-files="'+row.files+'" data-type="2" class="viewFiles0828 btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)"><i class="fa fa-download"></i>下载附件</a> ');
|
||
}
|
||
return actions.join('');
|
||
}
|
||
}]
|
||
};
|
||
$.table.init(options);
|
||
$("#bootstrap-table").on('click','.shenhe',function () {
|
||
let _id = $(this)[0].dataset.id;
|
||
let header = $(this)[0].dataset.header;
|
||
let score = $(this)[0].dataset.score;
|
||
let nowScore = $(this)[0].dataset.nowscore;
|
||
let deptName = $(this)[0].dataset.deptname;
|
||
let shotName = $(this)[0].dataset.shotname;
|
||
let reviewer = $(this)[0].dataset.reviewer;
|
||
let updatetime = $(this)[0].dataset.updatetime;
|
||
let type = $(this)[0].dataset.type;
|
||
let demand = $(this)[0].dataset.demand;
|
||
let detailed = $(this)[0].dataset.detailed;
|
||
layer.open({
|
||
title:'审批',
|
||
area:['40%','50%'],
|
||
type:2,
|
||
content:'/base/affairs/reviewed',
|
||
success(res,index){
|
||
//传值
|
||
parent.a_upload_id = _id;
|
||
parent.a_header = header;
|
||
parent.a_nowScore = nowScore;
|
||
parent.a_score = score;
|
||
parent.a_deptName = deptName;
|
||
parent.a_shotName = shotName;
|
||
parent.a_reviewer = reviewer;
|
||
parent.a_updatetime = updatetime;
|
||
parent.a_upload_index = index;
|
||
parent.a_upload_type = "1";
|
||
parent.a_type = type;
|
||
parent.a_demand = demand;
|
||
parent.a_detailed = detailed;
|
||
},
|
||
end(){
|
||
$.table.search()
|
||
}
|
||
})
|
||
})
|
||
|
||
$("#bootstrap-table").on("click",".viewFiles0828",function () {
|
||
let _files = $(this)[0].dataset.files.split(',');
|
||
let _type = $(this)[0].dataset.type;
|
||
let _dataImg = [];
|
||
let _downData = [];
|
||
_files.forEach((item,index) => {
|
||
if(item.indexOf(".jpg")>-1 || item.indexOf(".png")>-1){
|
||
_dataImg.push({
|
||
"alt": "",
|
||
"pid": index, //图片id
|
||
"src": window.location.origin+item, //原图地址
|
||
"thumb": window.location.origin+item //缩略图地址
|
||
})
|
||
}else if(item.indexOf(".docx")> -1 || item.indexOf(".doc") > -1 || item.indexOf(".xlsx") > -1 || item.indexOf(".xls") > -1 || item.indexOf(".pdf") > -1){
|
||
_downData.push(item);
|
||
}
|
||
})
|
||
if(_type === '1'){ //查看图片
|
||
let json = {
|
||
"title": "查看图片", //相册标题
|
||
"id": 123, //相册id
|
||
"start": 0, //初始显示的图片序号,默认0
|
||
"data": _dataImg
|
||
};
|
||
layer.photos({
|
||
photos: json,
|
||
closeBtn: 0, //右上角按钮,可通过配置1和2来展示,如果不显示,则closeBtn: 0
|
||
anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机(请注意,3.0之前的版本用shift参数)
|
||
});
|
||
}else{ //下载附件
|
||
if(_downData.length === 0){
|
||
$.modal.msgError('暂无文件!')
|
||
return false;
|
||
}
|
||
_downData.forEach(item => {
|
||
let _lastNum = item.lastIndexOf('/')+1;
|
||
let _title = item.substr(_lastNum,item.length-1);
|
||
const a = document.createElement('a');
|
||
a.style.display = 'none';
|
||
a.download = _title;
|
||
a.href = window.location.origin+item;
|
||
document.body.appendChild(a);
|
||
a.click();
|
||
document.body.removeChild(a);
|
||
})
|
||
}
|
||
});
|
||
});
|
||
|
||
|
||
</script>
|
||
</body>
|
||
</html> |