1、升级:lauyi升级到2.8.8

2、优化:任务列表搜索条件筛选项目操作优化
3、新增:项目列表新增搜索功能
4、修复:审批节点获取当前部门的审批人id错误修复
5、优化:请假流程的时长修改为,默认日期计算,同时可编辑修改。
This commit is contained in:
HDM58\hdm58 2023-06-20 23:20:18 +08:00
parent 3bdfe60443
commit a4d7bd0f80
11 changed files with 140 additions and 117 deletions

View File

@ -422,10 +422,10 @@ class Index extends BaseController
if($next_step){
//存在下一步审核
if($next_step['flow_type'] == 1){
$param['check_admin_ids'] = get_department_leader($this->uid);
$param['check_admin_ids'] = get_department_leader($detail['admin_id']);
}
else if($next_step['flow_type'] == 2){
$param['check_admin_ids'] = get_department_leader($this->uid,1);
$param['check_admin_ids'] = get_department_leader($detail['admin_id'],1);
}
else{
$param['check_admin_ids'] = $next_step['flow_uids'];
@ -439,7 +439,7 @@ class Index extends BaseController
$param['check_admin_ids'] ='';
}
}
if($param['check_status'] == 1 && $param['check_admin_ids']==''){
if($param['check_status'] == 1 && empty($param['check_admin_ids'])){
return to_assign(1,'找不到下一步的审批人该审批流程设置有问题请联系HR或者管理员');
}
//审核通过数据操作

View File

@ -9,6 +9,7 @@
<link rel="stylesheet" href="{__GOUGU__}/layui/css/layui.css?v={:get_system_config('web','version')}" media="all">
<style type="text/css">
html,body {width: 100%;height: 100%;background: #EAF3FF;}
canvas{display:block;width:100%;height:100%; position: fixed; top: 0;left: 0;}
input:-webkit-autofill {
-webkit-box-shadow: 0 0 0px 1000px white inset;
}
@ -38,6 +39,7 @@
</head>
<body>
<div id="container">
<canvas id="canvas"></canvas>
<div class="login">
<div class="top">
<img src="{__IMG__}/login_logo.png" height="60" width="200">
@ -72,6 +74,8 @@
</div>
<script src="{__GOUGU__}/layui/layui.js?v={:get_system_config('web','version')}"></script>
<script type="text/javascript">
var canvas=document.querySelector("#canvas"),ctx=canvas.getContext("2d");canvas.width=window.innerWidth,canvas.height=window.innerHeight,ctx.lineWidth=.3,ctx.strokeStyle=new Color(150).style;var movePos={x:30*canvas.width/100,y:30*canvas.height/100},dots={nb:250,distance:100,d_radius:150,array:[]};function colorValue(t){return Math.floor(255*Math.random()+t)}function createColorStyle(t,o,i){return"rgba("+t+","+o+","+i+", 0.618)"}function mixComponents(t,o,i,a){return(t*o+i*a)/(o+a)}function averageColorStyles(t,o){var i=t.color,a=o.color,s=mixComponents(i.r,t.radius,a.r,o.radius),n=mixComponents(i.g,t.radius,a.g,o.radius),e=mixComponents(i.b,t.radius,a.b,o.radius);return createColorStyle(Math.floor(s),Math.floor(n),Math.floor(e))}function Color(t){t=t||0,this.r=colorValue(t),this.g=colorValue(t),this.b=colorValue(t),this.style=createColorStyle(this.r,this.g,this.b)}function Dot(){this.x=Math.random()*canvas.width,this.y=Math.random()*canvas.height,this.vx=-.5+Math.random(),this.vy=-.5+Math.random(),this.radius=3*Math.random(),this.color=new Color}function createDots(){for(i=0;i<dots.nb;i++)dots.array.push(new Dot)}function moveDots(){for(i=0;i<dots.nb;i++){var t=dots.array[i];t.y<0||t.y>canvas.height?(t.vx=t.vx,t.vy=-t.vy):(t.x<0||t.x>canvas.width)&&(t.vx=-t.vx,t.vy=t.vy),t.x+=t.vx,t.y+=t.vy}}function connectDots(){for(i=0;i<dots.nb;i++)for(j=0;j<dots.nb;j++)i_dot=dots.array[i],j_dot=dots.array[j],i_dot.x-j_dot.x<dots.distance&&i_dot.y-j_dot.y<dots.distance&&i_dot.x-j_dot.x>-dots.distance&&i_dot.y-j_dot.y>-dots.distance&&i_dot.x-movePos.x<dots.d_radius&&i_dot.y-movePos.y<dots.d_radius&&i_dot.x-movePos.x>-dots.d_radius&&i_dot.y-movePos.y>-dots.d_radius&&(ctx.beginPath(),ctx.strokeStyle=averageColorStyles(i_dot,j_dot),ctx.moveTo(i_dot.x,i_dot.y),ctx.lineTo(j_dot.x,j_dot.y),ctx.stroke(),ctx.closePath())}function drawDots(){for(i=0;i<dots.nb;i++){dots.array[i].draw()}}function runDots(){ctx.clearRect(0,0,canvas.width,canvas.height),moveDots(),connectDots(),drawDots(),requestAnimationFrame(runDots)}Dot.prototype={draw:function(){ctx.beginPath(),ctx.fillStyle=this.color.style,ctx.arc(this.x,this.y,this.radius,0,3*Math.PI,!1),ctx.fill()}};var can=document.querySelector("#canvas");can.addEventListener("mousemove",function(t){movePos.x=t.pageX,movePos.y=t.pageY}),can.addEventListener("mouseleave",function(t){movePos.x=canvas.width/2,movePos.y=canvas.height/2}),createDots(),requestAnimationFrame(runDots);
layui.use(['form'], function() {
var form = layui.form,
$ = layui.$,

View File

@ -9,10 +9,11 @@
<link rel="stylesheet" href="{__GOUGU__}/layui/css/layui.css?v={:get_system_config('web','version')}" media="all">
<style type="text/css">
html,body {width: 100%;height: 100%;background: #EAF3FF;}
canvas{display:block;width:100%;height:100%; position: fixed; top: 0;left: 0;}
input:-webkit-autofill {
-webkit-box-shadow: 0 0 0px 1000px white inset;
}
#container {width: 100%;height: 100%;position: fixed;top: 0;left: 0;z-index: 999;
#container {width: 100%;height: 100%;position: fixed;top: 0;left: 0;z-index: 99;
background: url({__IMG__}/bg.png);
background-size: cover;
}
@ -21,9 +22,8 @@
background-size: cover;
opacity:0.72
}
.login {width: 360px;text-align: center;position: absolute;top: 50%;left: 50%;margin-top: -240px;margin-left: -180px;border-radius: 12px;box-shadow: 0 2px 6px rgba(92, 110, 136, .32);
}
.login .top {width: 360px;height: 117px;background-color: #fbbc05;border-radius: 12px 12px 0 0;line-height: 117px;text-align: center;overflow: hidden;
.login {width: 360px; text-align: center; position: absolute; top: 50%; left: 50%; margin-top: -240px; margin-left: -180px; border-radius: 12px; box-shadow: 0 2px 6px rgba(92, 110, 136, .32);}
.login .top {width: 360px;height: 117px; background-color: #fbbc05; border-radius: 12px 12px 0 0; line-height: 117px; text-align: center; overflow: hidden;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
@ -42,6 +42,7 @@
<body>
<div id="container">
<div class="lock"></div>
<canvas id="canvas"></canvas>
<div class="login">
<div class="top">
<img src="{__IMG__}/login_logo.png" height="60" width="200">
@ -63,6 +64,8 @@
</div>
<script src="{__GOUGU__}/layui/layui.js?v={:get_system_config('web','version')}"></script>
<script type="text/javascript">
var canvas=document.querySelector("#canvas"),ctx=canvas.getContext("2d");canvas.width=window.innerWidth,canvas.height=window.innerHeight,ctx.lineWidth=.3,ctx.strokeStyle=new Color(150).style;var movePos={x:30*canvas.width/100,y:30*canvas.height/100},dots={nb:250,distance:100,d_radius:150,array:[]};function colorValue(t){return Math.floor(255*Math.random()+t)}function createColorStyle(t,o,i){return"rgba("+t+","+o+","+i+", 0.618)"}function mixComponents(t,o,i,a){return(t*o+i*a)/(o+a)}function averageColorStyles(t,o){var i=t.color,a=o.color,s=mixComponents(i.r,t.radius,a.r,o.radius),n=mixComponents(i.g,t.radius,a.g,o.radius),e=mixComponents(i.b,t.radius,a.b,o.radius);return createColorStyle(Math.floor(s),Math.floor(n),Math.floor(e))}function Color(t){t=t||0,this.r=colorValue(t),this.g=colorValue(t),this.b=colorValue(t),this.style=createColorStyle(this.r,this.g,this.b)}function Dot(){this.x=Math.random()*canvas.width,this.y=Math.random()*canvas.height,this.vx=-.5+Math.random(),this.vy=-.5+Math.random(),this.radius=3*Math.random(),this.color=new Color}function createDots(){for(i=0;i<dots.nb;i++)dots.array.push(new Dot)}function moveDots(){for(i=0;i<dots.nb;i++){var t=dots.array[i];t.y<0||t.y>canvas.height?(t.vx=t.vx,t.vy=-t.vy):(t.x<0||t.x>canvas.width)&&(t.vx=-t.vx,t.vy=t.vy),t.x+=t.vx,t.y+=t.vy}}function connectDots(){for(i=0;i<dots.nb;i++)for(j=0;j<dots.nb;j++)i_dot=dots.array[i],j_dot=dots.array[j],i_dot.x-j_dot.x<dots.distance&&i_dot.y-j_dot.y<dots.distance&&i_dot.x-j_dot.x>-dots.distance&&i_dot.y-j_dot.y>-dots.distance&&i_dot.x-movePos.x<dots.d_radius&&i_dot.y-movePos.y<dots.d_radius&&i_dot.x-movePos.x>-dots.d_radius&&i_dot.y-movePos.y>-dots.d_radius&&(ctx.beginPath(),ctx.strokeStyle=averageColorStyles(i_dot,j_dot),ctx.moveTo(i_dot.x,i_dot.y),ctx.lineTo(j_dot.x,j_dot.y),ctx.stroke(),ctx.closePath())}function drawDots(){for(i=0;i<dots.nb;i++){dots.array[i].draw()}}function runDots(){ctx.clearRect(0,0,canvas.width,canvas.height),moveDots(),connectDots(),drawDots(),requestAnimationFrame(runDots)}Dot.prototype={draw:function(){ctx.beginPath(),ctx.fillStyle=this.color.style,ctx.arc(this.x,this.y,this.radius,0,3*Math.PI,!1),ctx.fill()}};var can=document.querySelector("#canvas");can.addEventListener("mousemove",function(t){movePos.x=t.pageX,movePos.y=t.pageY}),can.addEventListener("mouseleave",function(t){movePos.x=canvas.width/2,movePos.y=canvas.height/2}),createDots(),requestAnimationFrame(runDots);
layui.use(['form'], function() {
var form = layui.form,
$ = layui.$,

View File

@ -32,13 +32,12 @@
</td>
<td class="layui-td-gray">结束时间<font>*</font></td>
<td>
<input type="hidden" name="duration" value="">
<input id="end_time" name="end_time" autocomplete="off" class="layui-input select-time" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
</td>
</tr>
<tr>
<td class="layui-td-gray">请假工时</td>
<td id="hours">-</td>
<td><input name="duration" value="" class="layui-input" lay-verify="required|number" placeholder="请完善请假工时" lay-reqText="请完善请假工时"></td>
<td class="layui-td-gray">请假天数</td>
<td id="days">-</td>
</tr>
@ -83,13 +82,12 @@
</td>
<td class="layui-td-gray">结束时间<font>*</font></td>
<td>
<input type="hidden" name="duration" value="">
<input id="end_time" name="end_time" autocomplete="off" class="layui-input select-time" value="{$detail.end_time|date='Y-m-d H:i:s'}" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
</td>
</tr>
<tr>
<td class="layui-td-gray">请假工时</td>
<td id="hours">共{$detail.duration}工时</td>
<td><input name="duration" value="{$detail.duration}" class="layui-input" lay-verify="required|number" placeholder="请完善请假工时" lay-reqText="请完善请假工时"></td>
<td class="layui-td-gray">请假天数</td>
<td id="days">共{$detail.days}天,{$detail.hours}小时</td>
</tr>
@ -167,6 +165,20 @@ function calculateWorkHours() {
return totalHours;
}
function isNumber(str, type) {
var t = type || 0;
var patn = /^[0-9]+$/;
if (t > 0) {
patn = /^\d+(\.\d+)?$/;
}
if (!patn.test(str)){
return false;
}
else{
return true;
}
}
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
@ -193,20 +205,34 @@ const moduleInit = ['tool','employeepicker','oaTool'];
done:function(){
var hours = calculateWorkHours();
if(hours == 0){
$('#hours,#days').html('-');
$('[name="duration"]').val('');
$('#days').html('-');
}
else{
$('#hours').html('共'+hours+'小时');
$('[name="duration"]').val(hours);
var days = 0;
if(hours>=8){
days = parseInt(hours/8);
}
$('#days').html('共'+days+'天,'+(hours%8)+'小时');
}
$('[name="duration"]').val(hours);
$('#days').html('共'+days+'天,'+(hours%8).toFixed(1)+'小时');
}
}
});
});
$('[name="duration"]').on('input',function(){
let hours = $(this).val();
if(isNumber(hours,1) && hours>0){
var days = 0;
if(hours>=8){
days = parseInt(hours/8);
}
$('#days').html('共'+days+'天,'+((hours%8).toFixed(1))+'小时');
}
else{
$('#days').html('-');
}
})
}
</script>
{/block}

View File

@ -19,13 +19,12 @@
</td>
<td class="layui-td-gray">结束时间<font>*</font></td>
<td>
<input type="hidden" name="duration" value="">
<input id="end_time" name="end_time" autocomplete="off" class="layui-input select-time" value="" readonly lay-verify="required" placeholder="请选择时间" lay-reqText="请选择时间">
</td>
</tr>
<tr>
<td class="layui-td-gray">外出时长</td>
<td id="hours">-</td>
<td><input name="duration" value="" class="layui-input" lay-verify="required|number" placeholder="请完善请外出时长" lay-reqText="请完善请外出时长"></td>
<td class="layui-td-gray">外出天数</td>
<td id="days">-</td>
</tr>
@ -63,7 +62,7 @@
</tr>
<tr>
<td class="layui-td-gray">外出时长</td>
<td id="hours">共{$detail.duration}工时</td>
<td><input name="duration" value="{$detail.duration}" class="layui-input" lay-verify="required|number" placeholder="请完善请外出时长" lay-reqText="请完善外出时长"></td>
<td class="layui-td-gray">外出天数</td>
<td id="days">共{$detail.days}天,{$detail.hours}小时</td>
</tr>
@ -141,6 +140,21 @@ function calculateWorkHours() {
return totalHours;
}
function isNumber(str, type) {
var t = type || 0;
var patn = /^[0-9]+$/;
if (t > 0) {
patn = /^\d+(\.\d+)?$/;
}
if (!patn.test(str)){
return false;
}
else{
return true;
}
}
const moduleInit = ['tool','employeepicker','oaTool'];
function gouguInit() {
var form = layui.form,
@ -152,7 +166,7 @@ const moduleInit = ['tool','employeepicker','oaTool'];
btn: 'upFile',
box: 'fileList'
});
if (typeof (flowStep) == "function") {
flowStep();
}
@ -166,20 +180,34 @@ const moduleInit = ['tool','employeepicker','oaTool'];
done:function(){
var hours = calculateWorkHours();
if(hours == 0){
$('#hours,#days').html('-');
$('[name="duration"]').val('');
$('#days').html('-');
}
else{
$('#hours').html('共'+hours+'小时');
$('[name="duration"]').val(hours);
var days = 0;
if(hours>=8){
days = parseInt(hours/8);
}
$('#days').html('共'+days+'天,'+(hours%8)+'小时');
}
$('[name="duration"]').val(hours);
$('#days').html('共'+days+'天,'+(hours%8).toFixed(1)+'小时');
}
}
});
});
$('[name="duration"]').on('input',function(){
let hours = $(this).val();
if(isNumber(hours,1) && hours>0){
var days = 0;
if(hours>=8){
days = parseInt(hours/8);
}
$('#days').html('共'+days+'天,'+((hours%8).toFixed(1))+'小时');
}
else{
$('#days').html('-');
}
})
}
</script>
{/block}

View File

@ -22,15 +22,23 @@ class Index extends BaseController
{
if (request()->isAjax()) {
$param = get_params();
$project_ids = Db::name('ProjectUser')->where(['uid' => $this->uid, 'delete_time' => 0])->column('project_id');
$rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
$auth = isAuth($this->uid,'project_admin');
$where = [];
$where = array();
if (!empty($param['director_uid'])) {
$where[] = ['director_uid', 'in', $param['director_uid']];
}
if (!empty($param['status'])) {
$where[] = ['status', 'in', $param['status']];
}
if (!empty($param['keywords'])) {
$where[] = ['name|content', 'like', '%' . $param['keywords'] . '%'];
}
$where[] = ['delete_time', '=', 0];
$auth = isAuth($this->uid,'project_admin');
if($auth == 0){
$project_ids = Db::name('ProjectUser')->where(['uid' => $this->uid, 'delete_time' => 0])->column('project_id');
$where[] = ['id', 'in', $project_ids];
}
$rows = empty($param['limit']) ? get_config('app.page_size') : $param['limit'];
$list = ProjectList::withoutField('content,md_content')
->where($where)
->order('id desc')

View File

@ -61,9 +61,6 @@ class ProjectTask extends Model
$whereOr =[$map1,$map2,$map3,$map4];
}
}
if (!empty($param['type'])) {
$where[] = ['type', '=', $param['type']];
}
if (!empty($param['flow_status'])) {
$where[] = ['flow_status', '=', $param['flow_status']];
}

View File

@ -2,6 +2,30 @@
<!-- 主体 -->
{block name="body"}
<div 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="status" lay-filter="status">
<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: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="projecttable" lay-filter="projecttable"></table>
</div>
<script type="text/html" id="toolbarDemo">
@ -15,7 +39,7 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','tablePlus'];
const moduleInit = ['tool','tablePlus','employeepicker',];
function gouguInit() {
var table = layui.tablePlus, form = layui.form, tool = layui.tool;
layui.pageTable = table.render({
@ -26,7 +50,7 @@
page: true, //开启分页
limit: 20,
is_excel:true,
height: 'full-24',
height: 'full-82',
url: "/project/index/index", //数据接口
cols: [[
{
@ -57,7 +81,12 @@
]]
});
//监听搜索提交
form.on('submit(webform)', function (data) {
layui.pageTable.reload({ where: data.field });
return false;
});
//触发事件
table.on('toolbar(projecttable)', function(obj){
if(obj.event === 'add'){

View File

@ -39,18 +39,12 @@
</select>
</div>
<div class="layui-input-inline" style="width:200px;">
<select name="project_id" lay-filter="project">
<option value="">所属项目</option>
{volist name="project" id="vo"}
<option value="{$vo.id}">{$vo.name}</option>
{/volist}
</select>
<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="hidden" name="type" />
<input type="text" name="director" placeholder="任务负责人,可多选" readonly class="layui-input picker-more" autocomplete="off" />
<input name="director_uid" style="display: none;" value="" />
<input type="text" name="director" placeholder="负责人,可多选" readonly class="layui-input employeepicker"
autocomplete="off" />
</div>
<div class="layui-input-inline" style="width:200px;">
<input type="text" name="keywords" placeholder="主题/描述内容" class="layui-input" autocomplete="off" />
@ -74,9 +68,9 @@
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool','employeepicker','tablePlus'];
const moduleInit = ['tool','employeepicker','tablePlus','oaTool'];
function gouguInit() {
var table = layui.tablePlus, form = layui.form, tool = layui.tool, employeepicker = layui.employeepicker;
var table = layui.tablePlus, form = layui.form, tool = layui.tool;
layui.taskTable = table.render({
elem: '#task',
@ -87,7 +81,7 @@
url: "/project/task/index", //数据接口
page: true, //开启分页
limit: 20,
height: 'full-88',
height: 'full-82',
cols: [[
{
field: 'id', title: '任务编号', width: 80, align: 'center', fixed: 'left', templet: function (d) {
@ -122,28 +116,6 @@
}
]]
});
//选择人弹窗
$('#taskList').on('click', '.employeepicker', function () {
let that = $(this);
let ids_name = that.attr('name') + '_uid';
var ids = $('[name="' + ids_name + '"]').val(), names = that.val(), id_array = [], name_array = [];
if (ids.length > 0) {
id_array = ids.split(',');
name_array = names.split(',');
}
employeepicker.init({
ids: id_array,
names: name_array,
department_url: "/api/index/get_department_tree",
employee_url: "/api/index/get_employee",
callback: function (ids, names, dids, departments) {
$('[name="' + ids_name + '"]').val(ids);
that.val(names);
tableReload();
}
});
});
//触发事件
table.on('toolbar(task)', function(obj){
@ -152,55 +124,11 @@
return;
}
});
//查看模式
$('#taskList').on('click', '[data-event="show"]', function () {
layer.msg('开源版只支持列表模式');
});
//任务类型
$('#taskTab').on('click', 'li', function () {
$(this).addClass('tab-this').siblings().removeClass('tab-this');
let type = $(this).data('type');
$('#taskForm').find('[name="type"]').val(type);
tableReload();
});
form.on('select(status)', function (data) {
tableReload();
});
form.on('select(priority)', function (data) {
tableReload();
});
form.on('select(cate)', function (data) {
tableReload();
});
form.on('select(project)', function (data) {
tableReload();
});
//监听搜索提交
form.on('submit(webform)', function (data) {
tableReload();
layui.taskTable.reload({ where: data.field });
return false;
});
$('#taskForm').on('click', '[lay-filter="clear"]', function () {
setTimeout(function () {
tableReload();
}, 10)
})
function tableReload() {
let postData = {
flow_status: $('#taskForm').find('[name="flow_status"]').val(),
priority: $('#taskForm').find('[name="priority"]').val(),
cate: $('#taskForm').find('[name="cate"]').val(),
delay: $('#taskForm').find('[name="delay"]').val(),
director_uid: $('#taskForm').find('[name="director_uid"]').val(),
project_id: $('#taskForm').find('[name="project_id"]').val(),
keywords: $('#taskForm').find('[name="keywords"]').val()
}
layui.taskTable.reload({ where: postData });
}
}
</script>
{/block}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long