dev_oa/app/project/view/task/index.html
HDM58\hdm58 9ee6fb5afb 1、优化:项目、任务的状态显示;
2、新增:企业员工管理新增离职状态查询;
3、新增:离职档案新增一键资料转移功能,把项目、任务、客户、合同等资料交接到交接人上;
4、新增:任务新增前置任务,如果存在前置任务的,需要把前置任务完成后才能完成当前任务;
5、新增:任务新增子任务功能;
6、修复:新增项目文档成功后,跳转报错的问题;
7、优化:任务进度与任务状态联动,任务完成时,进度默认设置为100%,任务设置进度时,如果任务未开始,状态默认设置为进行中;
8、删除:去除项目选择项目时间周期的联动操作;
9、优化:项目选择弹层操作;
10、修复:修复自定义tab打开时,左侧二级菜单宽度未收回的问题;
11、优化:客户选择弹层添加‘新增客户’的按钮,方便快捷新建客户;
12、优化:工作台项目、任务、知识位置调整优化;

注意:本次数据结构更新代码如下:
ALTER TABLE `oa_personal_quit` ADD COLUMN `connect_id` int(11) NOT NULL DEFAULT 0 COMMENT '资料交接人' AFTER `connect_uids`;
ALTER TABLE `oa_personal_quit` ADD COLUMN `connect_time` int(11) NOT NULL DEFAULT 0 COMMENT '资料交接时间' AFTER `connect_id`;
ALTER TABLE `oa_personal_quit` MODIFY COLUMN `connect_uids` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '参与交接人,多' AFTER `lead_admin_id`;
ALTER TABLE `oa_project_task` ADD COLUMN `pid` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '父任务id' AFTER `title`;
ALTER TABLE `oa_project_task` ADD COLUMN `before_task` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '前置任务id' AFTER `priority`;
ALTER TABLE `oa_project_task` MODIFY COLUMN `type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '任务类型(预留字段)' AFTER `cate`;
2023-10-26 09:16:33 +08:00

183 lines
6.4 KiB
HTML

{extend name="../../base/view/common/base" /}
<!-- 主体 -->
{block name="style"}
<style>
.layui-unselect dl {
max-height: 188px;
}
</style>
{/block}
{block name="body"}
<div id="taskList" class="p-3">
<div class="gg-form-bar border-t border-x">
<form id="taskForm" class="layui-form" lay-filter="barsearchform">
<div class="layui-input-inline" style="width:100px;">
<select name="flow_status" lay-filter="status">
<option value="">任务状态</option>
<option value="1">未开始</option>
<option value="2">进行中</option>
<option value="3">已完成</option>
<option value="4">已拒绝</option>
<option value="5">已关闭</option>
</select>
</div>
<div class="layui-input-inline" style="width:100px;">
<select name="priority" lay-filter="priority">
<option value="">优先级</option>
<option value="1"></option>
<option value="2"></option>
<option value="3"></option>
<option value="4">紧急</option>
</select>
</div>
<div class="layui-input-inline" style="width:100px;">
<select name="cate" lay-filter="cate">
<option value="">工作类型</option>
{volist name="cate" id="vo"}
<option value="{$vo.id}">{$vo.title}</option>
{/volist}
</select>
</div>
<div class="layui-input-inline" style="width:200px;">
<input type="text" name="project_name" placeholder="所属项目" readonly class="layui-input picker-project" autocomplete="off" />
<input name="project_id" style="display: none;" value="" />
</div>
<div class="layui-input-inline" style="width:160px;">
<input type="text" name="director" placeholder="任务负责人,可多选" readonly class="layui-input picker-more" autocomplete="off" />
<input name="director_uid" style="display: none;" value="" />
</div>
<div class="layui-input-inline" style="width:200px;">
<input type="text" name="keywords" placeholder="主题/描述内容" class="layui-input" autocomplete="off" />
</div>
<div class="layui-input-inline" style="width:150px;">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform"><i class="layui-icon layui-icon-search mr-1"></i>搜索</button>
<button type="reset" class="layui-btn layui-btn-reset" lay-filter="reset">清空</button>
</div>
</form>
</div>
<table class="layui-hide" id="task" lay-filter="task"></table>
</div>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm" lay-event="add">+ 新建任务</button>
</div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker','tablePlus','oaTool'];
function gouguInit() {
var table = layui.tablePlus, form = layui.form, tool = layui.tool;
layui.taskTable = table.render({
elem: '#task',
title: '任务列表',
toolbar: '#toolbarDemo',
is_excel:true,
cellMinWidth: 80,
url: "/project/task/index", //数据接口
page: true, //开启分页
limit: 20,
height: 'full-82',
cols: [[
{
field: 'id', title: '任务编号', width: 80, align: 'center', fixed: 'left', templet: function (d) {
return 'T' + d.id;
}
}
, {
field: 'flow_name', title: '状态', align: 'center', width: 90, templet: function (d) {
var html = '<span class="layui-color-' + d.flow_status + '">『' + d.flow_name + '』</span>';
return html;
}
}
, { field: 'cate_name', title: '工作类型', width: 90, align: 'center' }
,{
field: 'title', title: '任务主题',minWidth:240, rowspan: 2, templet: function (d) {
var html = '<span class="layui-badge layui-bg-' + d.priority + '">' + d.priority_name + '</span> <a class="side-a" data-href="/project/task/view/id/' + d.id + '">' + d.title + '</a>';
return html;
}
}
, { field: 'before_task', title: '前置任务编号',align: 'center', width: 100, templet: function (d) {
var html = '-';
if(d.before_task > 0){
html = '<a class="side-a" data-href="/project/task/view/id/' + d.before_task + '">T' + d.before_task + '</a>';
}
return html;
}
}
, { field: 'after_num', title: '后置任务数', align: 'center',width: 90, templet: function (d) {
var html = '-';
if(d.after_num > 0){
html = '<a class="blue" lay-event="more" style="cursor:pointer;">'+d.after_num+'</a>';
if(d.after_num == 1){
html = ' <a class="side-a" data-href="/project/task/view/id/' + d.after_id + '">'+d.after_num+'</a>';
}
}
return html;
}
}
, { field: 'project_name', title: '关联项目', width: 200 }
, { field: 'director_name', title: '负责人', align: 'center', width: 80 }
, { field: 'assist_admin_names', title: '协作人', width: 200 }
, { field: 'plan_hours', title: '预估工时', align: 'center', width: 80 }
, {
field: 'end_time', title: '计划完成日期', width: 150, templet: function (d) {
var html = d.end_time;
if (d.delay > 0) {
html += '<span class="red ml-1" style="font-size:12px;">逾期' + d.delay + '天</span>';
}
return html;
}
}
]]
});
//触发事件
table.on('tool(task)', function(obj){
if(obj.event === 'more'){
layer.open({
title: '后置任务列表',
area: ['666px', '550px'],
type: 1,
content: '<div class="picker-table"><div id="taskTable"></div></div>',
success: function () {
taskTable = table.render({
elem: '#taskTable'
, url: '/project/api/get_task'
, page: true //开启分页
, limit: 10
, where:{'before_task':obj.data.id}
, cols: [[
{ field: 'id', width: 90, title: '编号', align: 'center' }
, {field: 'title', title: '任务主题',minWidth:240, rowspan: 2, templet: function (d) {
var html = '<span class="layui-badge layui-bg-' + d.priority + '">' + d.priority_name + '</span> <a class="side-a" data-href="/project/task/view/id/' + d.id + '">' + d.title + '</a>';
return html;
}}
, { field: 'project_name', width: 200, title: '关联项目' }
]]
});
}
})
return;
}
});
//触发事件
table.on('toolbar(task)', function(obj){
if(obj.event === 'add'){
tool.side('/project/task/add');
return;
}
});
//监听搜索提交
form.on('submit(webform)', function (data) {
layui.taskTable.reload({ where: data.field });
return false;
});
}
</script>
{/block}
<!-- /脚本 -->