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.

297 lines
12 KiB

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
<link rel="stylesheet" href="./iconfont/iconfont.css" />
</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>
</div>
</div>
</div>
<div class="layui-card">
<div class="layui-card-body">
<table id="data-table"></table>
<script type="text/html" id="progress-Templet">
{{# if(d.publish_state === 1){ }}
<button type="button" class="layui-btn layui-bg-blue layui-btn-sm layui-btn-radius" style="padding: 0 20px;">
{{= d.fill_progress }}
</button>
{{# } else { }}
{{= d.fill_progress }}
{{# } }}
</script>
<script type="text/html" id="jobName-Templet">
{{d.job_name}}
{{#if (d.jiezhi == true) { }}
<img src="./imgs/yjz.svg" style="max-width: 50px;margin-top: -9px;margin-left: 10px;">
{{# } }}
</script>
</div>
</div>
<script type="text/html" id="table-toolbar">
<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="createTask">
<i class="layui-icon layui-icon-add-1"></i>
新建任务
</button>
</script>
<script type="text/html" id="table-bar">
{{# if(d.publish_state === 0){ }}
<button type="button" class="layui-btn layui-btn-sm" title="发布" lay-event="publish">
<i class="iconfont icon-fabu"></i>
</button>
{{# if(d.is_clone === 0){ }}
<button type="button" class="layui-btn layui-btn-sm" title="修改" lay-event="update">
<i class="iconfont icon-xiugai"></i>
</button>
{{# } }}
<button type="button" class="layui-btn layui-btn-sm" title="重命名" lay-event="rename">
<i class="iconfont icon-zhongmingming"></i>
</button>
{{# } }}
{{# if(d.publish_state === 1){ }}
<button type="button" class="layui-btn layui-btn-sm" title="延期" lay-event="postpone">
<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>
{{# } }}
<button type="button" class="layui-btn layui-btn-sm" title="导出原始Excel" lay-event="export">
<i class="iconfont icon-daochu"></i>
</button>
{{# if(d.publish_state === 0){ }}
<button type="button" class="layui-btn layui-btn-sm layui-btn-danger" title="删除" lay-event="del">
<i class="iconfont icon-shanchu"></i>
</button>
{{# } }}
</script>
<script src="../../../component/layui/layui.js"></script>
<script src="../../../component/pear/pear.js"></script>
<script>
layui.use(['table', 'form', 'jquery', 'common', 'dtree', 'laytpl'], function () {
var table = layui.table;
var form = layui.form;
var $ = layui.jquery;
var common = layui.common;
var laytpl = layui.laytpl;
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',
url: '/QingLong/collect/getJobList',
where: {
job_name: $("#task_name").val()
},
height: 'full-130',
page: {
limit: 15
, layout: ['count', 'prev', 'page', 'next', 'skip']
, prev: "上一页"
, next: "下一页"
},
cols: [[
{ title: '序号', align: 'center', width: "3%", type: 'numbers' },
{ title: '任务名称', align: 'left', templet: '#jobName-Templet' },
{ title: '发布时间', field: 'publish_time', align: 'center', width: "10%" },
{ title: '截止时间', field: 'deadline_time', align: 'center', width: "10%" },
{ title: '填报格式', field: 'job_type_name', align: 'center', width: "10%" },
{ title: '填报进度', align: 'center', width: "10%", templet: '#progress-Templet' },
{ title: '保存状态', field: 'is_save_name', align: 'center', width: "8%" },
{ title: '发布状态', field: 'publish_state_name', align: 'center', width: "8%" },
{ title: '操作', align: 'left', width: "18%", toolbar: '#table-bar' }
]],
skin: 'line',
toolbar: '#table-toolbar',
defaultToolbar: []
});
}
table.on('tool(data-table)', function (obj) {
if (obj.event === 'publish') {
window.publish(obj);
} 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);
} else if (obj.event === 'postpone') {
window.postpone(obj);
} else if (obj.event === 'del') {
window.del(obj);
}
});
window.publish = function (obj) {
if (obj.data.is_save === 1) {
layer.open({
type: 2,
title: '发布任务',
shade: 0.1,
area: ['860px', '730px'],
content: './publish.html?job_id=' + obj.data.job_id
});
}
else {
layer.msg('该任务尚未保存,请在修改中进行保存!', {
icon: 3,
time: 3000
});
}
}
window.update = function (obj) {
window.location = "./fields_set.html?job_id=" + obj.data.job_id;
}
window.rename = function (obj) {
layer.open({
type: 2,
title: '重命名',
shade: 0.1,
area: ['450px', '230px'],
content: './rename_task.html?job_id=' + obj.data.job_id
});
}
window.postpone = function (obj) {
layer.open({
type: 2,
title: '延长截止时间',
shade: 0.1,
area: ['450px', '400px'],
content: './postpone.html?job_id=' + obj.data.job_id
});
}
window.export = function (obj) {
window.location = "/QingLong/Excel/" + obj.data.upload_excel_filename;
}
window.copy = function (obj) {
layer.open({
type: 2,
title: '复制任务',
shade: 0.1,
area: ['450px', '230px'],
content: './clone_task.html?job_id=' + obj.data.job_id
});
}
window.del = function (obj) {
layer.confirm('确定要删除该任务吗?', {
icon: 3,
title: '提示'
}, function (index) {
layer.close(index);
let loading = layer.load();
$.ajax({
url: "/QingLong/collect/delJob",
data: { job_id: obj.data.job_id },
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
});
}
}
});
});
}
table.on('toolbar(data-table)', function (obj) {
if (obj.event === 'createTask') {
window.createTask();
}
});
window.createTask = function () {
layer.open({
type: 2,
title: '选择填报格式',
shade: 0.1,
area: ['450px', '250px'],
content: './format_select.html'
});
}
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 () {
window.location = "./upload_excel.html";
}
});
</script>
</body>
</html>