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.
151 lines
5.7 KiB
151 lines
5.7 KiB
<!DOCTYPE html>
|
|
<html lang="cn">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title></title>
|
|
<link rel="stylesheet" href="../../component/pear/css/pear.css" />
|
|
</head>
|
|
|
|
<body class="pear-container">
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
|
|
<div class="layui-inline layui-form" style="margin: 5px 0 5px 0">
|
|
<label class="layui-form-label" style="width: 75px;">任务状态:</label>
|
|
<div class="layui-input-inline">
|
|
<select name="city" lay-verify="" lay-filter="fillStatus" id="fillStatus">
|
|
<option value="">全部</option>
|
|
<option value="0">未填报</option>
|
|
<option value="1">已填报</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-inline" style="margin: 5px 0 5px 0">
|
|
<label class="layui-form-label" style="width: 75px;">任务名称:</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" id="templateName" placeholder="请输入任务名称" class="layui-input"
|
|
style="width: 300px;">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-inline" style="margin-left: 15px">
|
|
<button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="task-query">
|
|
<i class="layui-icon layui-icon-search"></i>
|
|
查询
|
|
</button>
|
|
<button type="reset" class="pear-btn pear-btn-md" lay-submit lay-filter="task-reset">
|
|
<i class="layui-icon layui-icon-refresh"></i>
|
|
重置
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<table id="task-table" lay-filter="task-table"></table>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/html" id="tableOperate">
|
|
{{# if(d.flag === 1){ }}
|
|
<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="fill" title="修改"><i class="layui-icon layui-icon-edit"></i>
|
|
</button>
|
|
{{# } else { }}
|
|
<button class="pear-btn pear-btn-warming pear-btn-sm" lay-event="fill" title="填报"><i class="layui-icon layui-icon-edit"></i>
|
|
</button>
|
|
{{# } }}
|
|
|
|
</script>
|
|
|
|
<script src="../../component/layui/layui.js"></script>
|
|
<script src="../../component/pear/pear.js"></script>
|
|
<script src="../../component/other/js/base64.js"></script>
|
|
|
|
<script>
|
|
layui.use(['table', 'form', 'jquery', 'common'], function () {
|
|
let table = layui.table;
|
|
let form = layui.form;
|
|
let $ = layui.jquery;
|
|
let common = layui.common;
|
|
|
|
let cols = [
|
|
[
|
|
{ field: '', title: '序号', align: 'center', type: 'numbers', width: "5%" }
|
|
, { field: 'task_name', title: '任务名称', align: 'center' }
|
|
, { field: 'create_time', title: '创建时间', align: 'center', width: "15%" }
|
|
, { field: 'end_date', title: '结束时间', align: 'center', width: "15%" }
|
|
, { field: 'flag', title: '状态', align: 'center', width: "10%", templet: getFlagText }
|
|
, { field: '', title: '操作', toolbar: '#tableOperate', align: 'center', width: "10%" }
|
|
]
|
|
]
|
|
|
|
tableRender()
|
|
|
|
function tableRender() {
|
|
table.render({
|
|
elem: '#task-table',
|
|
url: '/Mars/listTaskForSchool',
|
|
where: {
|
|
keyword: $("#templateName").val(),
|
|
flag: $("#fillStatus").val()
|
|
},
|
|
page: {
|
|
limit: 15
|
|
, layout: ['count', 'prev', 'page', 'next', 'skip']
|
|
, prev: "上一页"
|
|
, next: "下一页"
|
|
},
|
|
cols: cols,
|
|
skin: 'line',
|
|
defaultToolbar: []
|
|
});
|
|
}
|
|
|
|
table.on('tool(task-table)', function (data) {
|
|
if (data.event === 'fill') {
|
|
fill(data.data.module_id, data.data.task_id, data.data.flag);
|
|
}
|
|
});
|
|
|
|
form.on('submit(task-query)', function (data) {
|
|
tableRender();
|
|
});
|
|
|
|
form.on('submit(task-reset)', function (data) {
|
|
$("#templateName").val("");
|
|
});
|
|
|
|
form.on('select(fillStatus)', function (data) {
|
|
tableRender();
|
|
});
|
|
|
|
|
|
window.fill = function (moduleId, taskId, flag) {
|
|
layer.open({
|
|
type: 2,
|
|
title: '任务填报',
|
|
shade: 0.1,
|
|
area: ['800px', '610px'],
|
|
content: './taskFillIn.html?module_id=' + moduleId + '&task_id=' + taskId + '&flag=' + flag
|
|
});
|
|
}
|
|
|
|
|
|
window.refresh = function (param) {
|
|
table.reload('task-table');
|
|
}
|
|
|
|
function getFlagText(data) {
|
|
if (data.flag === 1) {
|
|
return "<span style='color:green;'>已填报</span>";
|
|
} else {
|
|
return "<span style='color:red;'>未填报</span>";
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
</body>
|
|
|
|
</html> |