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.

589 lines
25 KiB

2 years ago
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
2 years ago
<link rel="stylesheet" href="../iconfont/iconfont.css" />
2 years ago
<style>
.layui-progress-text {
position: relative;
top: -27px;
line-height: 18px;
font-size: 12px;
color: #5f5f5f;
}
.layui-progress {
position: relative;
height: 11px;
border-radius: 20px;
background-color: #eee;
}
.layui-progress-bar {
position: absolute;
left: 0;
top: 0;
width: 0;
max-width: 100%;
height: 11px;
border-radius: 20px;
text-align: right;
background-color: #16b777;
transition: all .3s;
-webkit-transition: all .3s;
}
2 years ago
.layui-card-body .layui-form {
margin-top: 1px !important;
}
2 years ago
</style>
2 years ago
2 years ago
</head>
<body class="pear-container layui-form">
<div class="layui-card" style="margin-bottom: 10px !important;">
<div class="layui-card-body">
<div class="layui-form-item" style="margin: 10px 0 5px 0 !important;">
<div class="layui-form-item layui-inline">
<label class="layui-form-label" style="width: auto;">任务名称:</label>
<div class="layui-input-inline">
<input type="text" id="task_name" lay-affix="clear" lay-filter="clear" placeholder="请输入任务名称"
class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="user-query">
<i class="layui-icon layui-icon-search"></i>
查询
</button>
</div>
2 years ago
2 years ago
</div>
</div>
</div>
<div class="layui-card">
<div class="layui-card-body">
2 years ago
<table id="data-table"></table>
2 years ago
<script type="text/html" id="fill-progress">
{{# if(d.publish_state === 1){ }}
{{# if(d.total_count > 0){ }}
2 years ago
<span style="cursor: pointer;background-color: #16BAAA;padding: 5px 10px;border-radius: 8px;color: #FFFFFF;font-weight: bolder;" onclick='fill_progress("{{= d.target_type_id }}","{{= d.job_id }}","{{= d.total_count }}","{{= d.finish_count }}","{{= d.job_type }}")'>{{= d.finish_count }} / {{= d.total_count }}</span>
2 years ago
{{# } else { }}
2 years ago
-
2 years ago
{{# } }}
{{# } else { }}
2 years ago
-
2 years ago
{{# } }}
</script>
2 years ago
2 years ago
<script type="text/html" id="forward-progress">
{{# if(d.publish_state === 1){ }}
{{# if(d.forward_count > 0){ }}
2 years ago
<span style="cursor: pointer;background-color: #16BAAA;padding: 5px 10px;border-radius: 8px;color: #FFFFFF;font-weight: bolder;" onclick='forward_progress_xiaji("{{= d.job_id }}","{{= d.forward_count }}","{{= d.forward_finish_count }}","{{= d.job_type }}")'>{{= d.forward_finish_count }} / {{= d.forward_count }}</span>
2 years ago
2 years ago
{{# } else { }}
2 years ago
-
2 years ago
{{# } }}
2 years ago
{{# } else { }}
2 years ago
-
2 years ago
{{# } }}
</script>
2 years ago
2 years ago
<script type="text/html" id="targetType">
{{#if (d.target_type_id == 1) { }}
2 years ago
单位
2 years ago
{{# } else { }}
2 years ago
人员
2 years ago
{{# } }}
</script>
2 years ago
2 years ago
2 years ago
<script type="text/html" id="jobName-Templet">
2 years ago
{{#if (d.job_type == 1) { }}
<img src="../imgs/form.png" title="表单" style="max-width: 16px;margin-top: -4px;">
{{# } else { }}
<img src="../imgs/excel.png" title="EXCEL模板" style="max-width: 16px;margin-top: -4px;">
{{# } }}
2 years ago
{{d.job_name}}
{{#if (d.jiezhi == true) { }}
2 years ago
<img src="../imgs/yjz.svg" style="max-width: 50px;margin-top: -9px;margin-left: 1px;">
2 years ago
{{# } }}
</script>
2 years ago
</div>
</div>
<script type="text/html" id="table-toolbar">
2 years ago
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="createTask">
<i class="layui-icon layui-icon-add-1"></i>
新建任务
</button>
</script>
2 years ago
<script type="text/html" id="table-bar">
2 years ago
{{# if(d.publish_state === 0){ }}
<button type="button" class="layui-btn layui-btn-sm" title="发布" lay-event="publishNextLevel">
<i class="iconfont icon-fabu"></i>
</button>
2 years ago
{{# if(d.is_clone === 0){ }}
<button type="button" class="layui-btn layui-btn-sm" title="修改" lay-event="update">
2 years ago
<i class="iconfont icon-xiugai"></i>
2 years ago
</button>
2 years ago
{{# } }}
2 years ago
{{# } }}
2 years ago
2 years ago
<button type="button" class="layui-btn layui-btn-sm" title="重命名" lay-event="rename">
<i class="iconfont icon-zhongmingming"></i>
</button>
2 years ago
{{# if(d.publish_state === 1){ }}
2 years ago
<button type="button" class="layui-btn layui-btn-sm" title="修改截止日期" lay-event="postpone">
2 years ago
<i class="iconfont icon-delay_completed"></i>
</button>
<button type="button" class="layui-btn layui-btn-sm" title="复制" lay-event="copy">
<i class="iconfont icon-fuzhi"></i>
</button>
2 years ago
2 years ago
<!-- <button type="button" class="layui-btn layui-btn-sm" title="导出表结构" lay-event="exportStruct">
1 year ago
<i class="iconfont icon-shujiegou"></i>
2 years ago
</button> -->
<button type="button" class="layui-btn layui-btn-sm" title="导出汇总表" lay-event="exportHz">
<i class="iconfont icon-cz-hzb"></i>
2 years ago
</button>
2 years ago
{{# } }}
2 years ago
2 years ago
{{# if(d.job_type === 2){ }}
<button type="button" class="layui-btn layui-btn-sm" title="导出原始Excel" lay-event="export">
<i class="iconfont icon-daochu"></i>
</button>
1 year ago
{{# } else { }}
<button type="button" class="layui-btn layui-btn-sm" title="预览" lay-event="preview">
<i class="layui-icon layui-icon-eye"></i>
</button>
2 years ago
{{# } }}
2 years ago
<button type="button" class="layui-btn layui-btn-sm layui-btn-danger" title="删除" lay-event="del">
1 year ago
<i class="iconfont icon-shanchu"></i>
2 years ago
</button>
2 years ago
</script>
2 years ago
<script src="../../../component/layui/layui.js"></script>
<script src="../../../component/pear/pear.js"></script>
2 years ago
<script src="../../../component/pear/base64.js"></script>
2 years ago
<script>
2 years ago
layui.use(['table', 'form', 'jquery', 'common', 'laytpl'], function () {
2 years ago
var table = layui.table;
var form = layui.form;
var $ = layui.jquery;
var common = layui.common;
var laytpl = layui.laytpl;
2 years ago
var element = layui.element;
2 years ago
2 years ago
var publishNextLevel = false;
2 years ago
$.ajax({
url: "/QingLong/collect/canPublishNextLevel",
async: false,
type: 'GET',
success: function (res) {
if (res.success) {
publishNextLevel = res.flag;
} else {
layer.msg("获取数据异常!", {
icon: 2,
time: 1000
});
}
}, error: function (xhr, status, error) {
layer.msg("获取数据异常!", {
icon: 2,
time: 1000
});
}
});
2 years ago
tableRender();
form.on('submit(user-query)', function () {
tableRender();
return false;
});
form.on('input-affix(clear)', function (data) {
tableRender();
});
function tableRender() {
table.render({
elem: '#data-table',
2 years ago
url: '/QingLong/collect/getJobList',
2 years ago
where: {
2 years ago
job_name: $("#task_name").val(),
2 years ago
self_or_next: 2
2 years ago
},
2 years ago
height: 'full-136',
2 years ago
page: {
2 years ago
limit: 12
2 years ago
, layout: ['count', 'prev', 'page', 'next', 'skip']
, prev: "上一页"
, next: "下一页"
},
cols: [[
2 years ago
{ title: '序号', unresize: true, align: 'center', width: "3%", type: 'numbers' },
{ title: '任务名称', unresize: true, align: 'left', templet: '#jobName-Templet' },
2 years ago
{ title: '发布日期', unresize: true, field: 'publish_time', align: 'center', width: "6%" },
{ title: '截止日期', unresize: true, field: 'deadline_time', align: 'center', width: "6%" },
2 years ago
{ title: '填报进度', unresize: true, align: 'center', width: "6%", templet: '#fill-progress' },
{ title: '转发进度', unresize: true, align: 'center', width: "6%", templet: '#forward-progress' },
2 years ago
{ title: '发布对象', unresize: true, align: 'center', width: "8%", templet: '#targetType' },
2 years ago
{ title: '保存状态', unresize: true, field: 'is_save_name', align: 'center', width: "6%" },
{ title: '发布状态', unresize: true, field: 'publish_state_name', align: 'center', width: "6%" },
2 years ago
{ title: '操作', unresize: true, align: 'left', width: "25%", toolbar: '#table-bar' }
2 years ago
]],
skin: 'line',
toolbar: '#table-toolbar',
2 years ago
defaultToolbar: []
// , parseData: function (res) {
// var array = res.data;
// for (var i = 0; i < array.length; i++) {
// if (publishNextLevel) {
// res.data[i].nl = 1;
// } else {
// res.data[i].nl = 0;
// }
// }
// return res;
// }
2 years ago
});
}
table.on('tool(data-table)', function (obj) {
2 years ago
if (obj.event === 'publishNextLevel') {
window.publishNextLevel(obj);
} else if (obj.event === 'publishCurrentOrg') {
window.publishCurrentOrg(obj);
2 years ago
} else if (obj.event === 'update') {
window.update(obj);
} else if (obj.event === 'rename') {
window.rename(obj);
} else if (obj.event === 'export') {
window.export(obj);
} else if (obj.event === 'copy') {
window.copy(obj);
2 years ago
} else if (obj.event === 'postpone') {
window.postpone(obj);
2 years ago
} else if (obj.event === 'del') {
window.del(obj);
2 years ago
} else if (obj.event === 'exportStruct') {
2 years ago
window.exportStruct(obj);
2 years ago
} else if (obj.event === 'exportHz') {
2 years ago
window.exportHz(obj);
1 year ago
} else if (obj.event === 'preview') {
window.preview(obj);
2 years ago
}
});
2 years ago
window.fill_progress = function (target_type_id, job_id, total_count, finish_count, job_type) {
2 years ago
layer.open({
2 years ago
type: 2,
title: '填报进度( <span style="color: #16BAAA;font-weight: bolder;">已填报 ' + finish_count + '</span> / 应填报 ' + total_count + ' ',
shadeClose: true,
shade: false,
maxmin: false,
move: false,
area: ['100%', '100%'],
2 years ago
content: "./task_view.html?job_id=" + job_id + "&job_type=" + job_type + "&target_type_id=" + target_type_id
2 years ago
});
2 years ago
// if (target_type_id == 1) {
// layer.open({
// type: 2,
// title: '填报进度( <span style="color: #16BAAA;font-weight: bolder;">已填报 ' + finish_count + '</span> / 应填报 ' + total_count + ' ',
// shadeClose: true,
// shade: false,
// maxmin: false,
// move: false,
// area: ['100%', '100%'],
// content: "./task_view.html?job_id=" + job_id + "&job_type=" + job_type
// });
// } else {
// var id = "9001"
// parent.layui.admin.closeTab(id);
// parent.layui.admin.addTab(id, "填报进度", "/QingLong/view/tb/org/task_view_bp.html?job_id=" + job_id + "&job_type=" + job_type);
// }
2 years ago
2 years ago
}
2 years ago
window.forward_progress_xiaji = function (job_id, total_count, finish_count, job_type) {
2 years ago
layer.open({
type: 2,
2 years ago
title: '转发进度( <span style="color: #16BAAA;font-weight: bolder;">已提交 ' + finish_count + '</span> / 应提交 ' + total_count + ' ',
2 years ago
shadeClose: true,
shade: false,
maxmin: false,
move: false,
area: ['100%', '100%'],
content: "./task_view_forward.html?job_id=" + job_id + "&job_type=" + job_type
});
// var id = "9001"
// parent.layui.admin.closeTab(id);
// parent.layui.admin.addTab(id, "转发进度", "/QingLong/view/tb/org/task_view_forward.html?job_id=" + job_id + "&job_type=" + job_type);
2 years ago
}
2 years ago
window.publishNextLevel = function (obj) {
2 years ago
if (obj.data.is_save === 1) {
2 years ago
$.ajax({
url: "/QingLong/collect/getCurrentPersonPublishRole",
async: false,
type: 'GET',
success: function (res) {
if (res.success) {
if (res.publish_role_id == 255) {
layer.open({
type: 2,
title: '发布任务',
offset: 'r',
anim: 'slideLeft',
area: ['860px', '100%'],
shade: 0.1,
content: './publish.html?job_id=' + obj.data.job_id
});
} else if (res.publish_role_id == 268) {
layer.open({
type: 2,
title: '发布任务',
offset: 'r',
anim: 'slideLeft',
area: ['860px', '100%'],
shade: 0.1,
content: '../dis/publish.html?job_id=' + obj.data.job_id
});
}
} else {
layer.msg("获取身份异常!", {
icon: 2,
time: 1000
});
}
}, error: function (xhr, status, error) {
layer.msg("获取数据异常!", {
icon: 2,
time: 1000
});
}
2 years ago
});
}
else {
2 years ago
layer.msg('该任务尚未保存,请在修改中进行保存!', {
2 years ago
icon: 3,
time: 3000
});
}
2 years ago
}
2 years ago
window.publishCurrentOrg = function (obj) {
if (obj.data.is_save === 1) {
layer.open({
type: 2,
title: '发布任务',
offset: 'r',
anim: 'slideLeft',
area: ['1000px', '100%'],
shade: 0.1,
2 years ago
content: '../dis/publish_person_bdw.html?job_id=' + obj.data.job_id
2 years ago
});
}
else {
layer.msg('该任务尚未保存,请在修改中进行保存!', {
icon: 3,
time: 3000
});
}
}
2 years ago
window.update = function (obj) {
2 years ago
if (obj.data.job_type == 1) {
window.location = "../form/designer.html?job_id=" + obj.data.job_id;
} else {
window.location = "./fields_set.html?job_id=" + obj.data.job_id;
}
2 years ago
}
window.rename = function (obj) {
2 years ago
layer.open({
type: 2,
title: '重命名',
shade: 0.1,
2 years ago
area: ['450px', '200px'],
content: './rename_task.html?job_id=' + obj.data.job_id + '&job_name=' + Base64.encode(obj.data.job_name)
2 years ago
});
}
2 years ago
2 years ago
window.postpone = function (obj) {
2 years ago
layer.open({
type: 2,
2 years ago
title: '修改截止日期',
2 years ago
shade: 0.1,
area: ['450px', '400px'],
content: './postpone.html?job_id=' + obj.data.job_id
});
2 years ago
}
1 year ago
window.preview = function (obj) {
window.localStorage.setItem('form_json', obj.data.form_json);
layer.open({
type: 2,
title: '预览',
offset: 'r',
anim: 'slideLeft',
area: ['1000px', '100%'],
shade: 0.1,
shadeClose: true,
content: "../form/preview.html"
});
}
2 years ago
window.export = function (obj) {
2 years ago
openDownloadDialog("/QingLong/Excel/" + obj.data.upload_excel_filename, obj.data.job_name + ".xlsx");
2 years ago
}
2 years ago
window.exportHz = function (obj) {
window.location = "/QingLong/collect/getSummaryExcel?job_id=" + obj.data.job_id;
}
2 years ago
window.exportStruct = function (obj) {
2 years ago
window.location = "/QingLong/collect/exportTableStructExcel?job_id=" + obj.data.job_id;
}
2 years ago
window.copy = function (obj) {
2 years ago
layer.open({
type: 2,
title: '复制任务',
shade: 0.1,
2 years ago
area: ['450px', '200px'],
2 years ago
content: './clone_task.html?job_id=' + obj.data.job_id + '&job_name=' + Base64.encode(obj.data.job_name)
2 years ago
});
2 years ago
}
window.del = function (obj) {
2 years ago
layer.confirm('确定要删除该任务吗?', {
2 years ago
icon: 3,
title: '提示'
}, function (index) {
layer.close(index);
let loading = layer.load();
$.ajax({
2 years ago
url: "/QingLong/collect/delJob",
data: { job_id: obj.data.job_id },
2 years ago
type: 'post',
success: function (result) {
layer.close(loading);
if (result.success) {
layer.msg('成功删除!', {
icon: 1,
time: 1000
}, function () {
table.reload('data-table');
});
} else {
layer.msg(result.message, {
icon: 2,
time: 1000
});
}
}
2 years ago
});
2 years ago
});
}
2 years ago
table.on('toolbar(data-table)', function (obj) {
if (obj.event === 'createTask') {
window.createTask();
}
});
window.createTask = function () {
2 years ago
window.localStorage.setItem('self_or_next', 2);
2 years ago
layer.open({
type: 2,
2 years ago
title: '新建任务',
2 years ago
shade: 0.1,
2 years ago
area: ['450px', '300px'],
2 years ago
content: './format_select.html'
});
2 years ago
}
2 years ago
window.refresh = function (param) {
table.reload('data-table');
}
function GetQueryString(name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
window.openExcelCreatePage = function () {
2 years ago
window.location = "./upload_excel.html";
2 years ago
}
2 years ago
window.openFormCreatePage = function () {
2 years ago
window.location = "../form/designer.html";
2 years ago
}
2 years ago
function openDownloadDialog(url, saveName) {
if (window.navigator.msSaveBlob) {
try {
//创建XMLHttpRequest对象
var xhr = new XMLHttpRequest();
//配置请求方式、请求地址以及是否同步
xhr.open('POST', url, true);
//设置请求结果类型为blob
xhr.responseType = 'blob';
//请求成功回调函数
xhr.onload = function (e) {
if (this.status == 200) {//请求成功
//获取blob对象
var blob = this.response;
//获取blob对象地址并把值赋给容器
window.navigator.msSaveBlob(blob, saveName);
}
};
xhr.send();
} catch (e) {
console.log(e);
}
} else {
if (typeof url == 'object' && url instanceof Blob) {
url = URL.createObjectURL(url); // 创建blob地址
}
var aLink = document.createElement('a');
aLink.href = url;
aLink.download = saveName || '';
var event;
if (window.MouseEvent) {
event = new MouseEvent('click');
}
else {
event = document.createEvent('MouseEvents');
event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
}
aLink.dispatchEvent(event);
}
}
2 years ago
});
</script>
</body>
</html>