mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 19:35:50 +00:00
fix:1.仪表盘显示可见性有我,但不是我负责的任务的bug ,2.审批评论间距样式调整与可评论emoj表情加评论通知 ,3,添加任务判断是否存在交集时间内任务调整 ,4. 审批流程撤回后显示错误修复, 5. 审批添加评论后自动滚动到下方
This commit is contained in:
parent
94f1e764bc
commit
42f805d7cc
@ -190,12 +190,25 @@ class ApproveController extends AbstractController
|
|||||||
$data['userid'] = (string)$user->userid;
|
$data['userid'] = (string)$user->userid;
|
||||||
$data['content'] = Request::input('content'); //内容+图片
|
$data['content'] = Request::input('content'); //内容+图片
|
||||||
|
|
||||||
|
$processInst = $this->getProcessById($data['proc_inst_id']);
|
||||||
|
|
||||||
$ret = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/process/addGlobalComment', json_encode(Base::arrayKeyToCamel($data)));
|
$ret = Ihttp::ihttp_post($this->flow_url.'/api/v1/workflow/process/addGlobalComment', json_encode(Base::arrayKeyToCamel($data)));
|
||||||
$process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true);
|
$process = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true);
|
||||||
if (!$process || $process['status'] != 200) {
|
if (!$process || $process['status'] != 200) {
|
||||||
return Base::retError($process['message'] ?? '添加失败');
|
return Base::retError($process['message'] ?? '添加失败');
|
||||||
}
|
}
|
||||||
//
|
|
||||||
|
// 推送通知
|
||||||
|
$botUser = User::botGetOrCreate('approval-alert');
|
||||||
|
foreach ( $processInst['userids'] as $id) {
|
||||||
|
if($id != $user->userid){
|
||||||
|
$dialog = WebSocketDialog::checkUserDialog($botUser, $id);
|
||||||
|
$processInst['comment_user_id'] = $user->userid;
|
||||||
|
$processInst['comment_content'] = json_decode($data['content'],true)['content'];
|
||||||
|
$this->approveMsg('approve_comment_notifier', $dialog, $botUser, $processInst, $processInst);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$res = Base::arrayKeyToUnderline($process['data']);
|
$res = Base::arrayKeyToUnderline($process['data']);
|
||||||
return Base::retSuccess('success', $res);
|
return Base::retSuccess('success', $res);
|
||||||
}
|
}
|
||||||
@ -958,6 +971,8 @@ class ApproveController extends AbstractController
|
|||||||
'type' => $process['var']['type'],
|
'type' => $process['var']['type'],
|
||||||
'start_time' => $process['var']['start_time'],
|
'start_time' => $process['var']['start_time'],
|
||||||
'end_time' => $process['var']['end_time'],
|
'end_time' => $process['var']['end_time'],
|
||||||
|
'comment_nickname' => $process['comment_user_id'] ? User::userid2nickname($process['comment_user_id']) : '',
|
||||||
|
'comment_content' => $process['comment_content'] ?? ''
|
||||||
];
|
];
|
||||||
$text = view('push.bot', ['type' => $type, 'action' => $action, 'is_finished' => $process['is_finished'], 'data' => (object)$data])->render();
|
$text = view('push.bot', ['type' => $type, 'action' => $action, 'is_finished' => $process['is_finished'], 'data' => (object)$data])->render();
|
||||||
$text = preg_replace("/^\x20+/", "", $text);
|
$text = preg_replace("/^\x20+/", "", $text);
|
||||||
@ -1011,6 +1026,7 @@ class ApproveController extends AbstractController
|
|||||||
}
|
}
|
||||||
//
|
//
|
||||||
$res = Base::arrayKeyToUnderline($process['data']);
|
$res = Base::arrayKeyToUnderline($process['data']);
|
||||||
|
$res['userids'] = [];
|
||||||
foreach ($res['node_infos'] as &$val) {
|
foreach ($res['node_infos'] as &$val) {
|
||||||
if (isset($val['node_user_list'])) {
|
if (isset($val['node_user_list'])) {
|
||||||
$node = $val['node_user_list'];
|
$node = $val['node_user_list'];
|
||||||
@ -1020,10 +1036,12 @@ class ApproveController extends AbstractController
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$val['node_user_list'][$k]['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname);
|
$val['node_user_list'][$k]['userimg'] = User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname);
|
||||||
|
$res['userids'][] = $item['target_id'];
|
||||||
}
|
}
|
||||||
}else if($val['aprover_id']){
|
}else if($val['aprover_id']){
|
||||||
$info = User::whereUserid($val['aprover_id'])->first();
|
$info = User::whereUserid($val['aprover_id'])->first();
|
||||||
$val['userimg'] = $info ? User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname) : '';
|
$val['userimg'] = $info ? User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname) : '';
|
||||||
|
$res['userids'][] = $val['aprover_id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 全局评论
|
// 全局评论
|
||||||
@ -1039,6 +1057,10 @@ class ApproveController extends AbstractController
|
|||||||
}
|
}
|
||||||
$info = User::whereUserid($res['start_user_id'])->first();
|
$info = User::whereUserid($res['start_user_id'])->first();
|
||||||
$res['userimg'] = $info ? User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname) : '';
|
$res['userimg'] = $info ? User::getAvatar($info->userid, $info->userimg, $info->email, $info->nickname) : '';
|
||||||
|
//
|
||||||
|
$res['userids'][] = $info->userid;
|
||||||
|
$res['userids'] = array_unique($res['userids']);
|
||||||
|
//
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1079,8 +1079,8 @@ class ProjectController extends AbstractController
|
|||||||
$timerange = explode(',', $timerange);
|
$timerange = explode(',', $timerange);
|
||||||
}
|
}
|
||||||
if (Base::isDateOrTime($timerange[0]) && Base::isDateOrTime($timerange[1])) {
|
if (Base::isDateOrTime($timerange[0]) && Base::isDateOrTime($timerange[1])) {
|
||||||
$query->where('project_tasks.start_at', '>=', Carbon::parse($timerange[0])->startOfDay());
|
$query->where('project_tasks.start_at', '<=', Carbon::parse($timerange[1])->endOfDay());
|
||||||
$query->where('project_tasks.end_at', '<=', Carbon::parse($timerange[1])->endOfDay());
|
$query->where('project_tasks.end_at', '>=', Carbon::parse($timerange[0])->startOfDay());
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->when(!empty($taskid), function ($query) use ($taskid) {
|
->when(!empty($taskid), function ($query) use ($taskid) {
|
||||||
|
|||||||
@ -150,7 +150,7 @@ services:
|
|||||||
|
|
||||||
approve:
|
approve:
|
||||||
container_name: "dootask-approve-${APP_ID}"
|
container_name: "dootask-approve-${APP_ID}"
|
||||||
image: "hitosea2020/go-approve:latest"
|
image: "hitosea2020/go-approve:0.1.1"
|
||||||
environment:
|
environment:
|
||||||
TZ: "Asia/Shanghai"
|
TZ: "Asia/Shanghai"
|
||||||
MYSQL_HOST: "${DB_HOST}"
|
MYSQL_HOST: "${DB_HOST}"
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="approve-details" :style="{'z-index':modalTransferIndex}">
|
<div class="approve-details" :style="{'z-index':modalTransferIndex}">
|
||||||
<div class="approve-details-box">
|
<div class="approve-details-box" ref="approveDetailsBox">
|
||||||
<h2 class="approve-details-title">
|
<h2 class="approve-details-title">
|
||||||
<span>{{$L(datas.proc_def_name)}}</span>
|
<span>{{$L(datas.proc_def_name)}}</span>
|
||||||
<Tag v-if="datas.state == 0" color="cyan">{{$L('待审批')}}</Tag>
|
<Tag v-if="datas.state == 0" color="cyan">{{$L('待审批')}}</Tag>
|
||||||
@ -292,7 +292,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取详情
|
// 获取详情
|
||||||
getInfo(){
|
getInfo(isScrollToBottom = false) {
|
||||||
this.$store.dispatch("call", {
|
this.$store.dispatch("call", {
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: 'approve/process/detail',
|
url: 'approve/process/detail',
|
||||||
@ -308,8 +308,9 @@ export default {
|
|||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
})
|
})
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(() => {
|
||||||
this.datas = data
|
this.datas = data
|
||||||
|
isScrollToBottom && this.scrollToBottom();
|
||||||
})
|
})
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
$A.modalError(msg);
|
$A.modalError(msg);
|
||||||
@ -401,9 +402,12 @@ export default {
|
|||||||
}).then(({msg}) => {
|
}).then(({msg}) => {
|
||||||
$A.messageSuccess("添加成功");
|
$A.messageSuccess("添加成功");
|
||||||
if(this.$route.name=='manage-approve-details' || this.$route.name=='manage-messenger'){
|
if(this.$route.name=='manage-approve-details' || this.$route.name=='manage-messenger'){
|
||||||
this.getInfo()
|
this.getInfo(true)
|
||||||
}else{
|
}else{
|
||||||
this.$emit('approve')
|
this.$emit('approve')
|
||||||
|
setTimeout(() => {
|
||||||
|
this.scrollToBottom()
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
this.commentShow = false;
|
this.commentShow = false;
|
||||||
}).catch(({msg}) => {
|
}).catch(({msg}) => {
|
||||||
@ -412,6 +416,14 @@ export default {
|
|||||||
this.loadIng--;
|
this.loadIng--;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 滚动到容器底部
|
||||||
|
scrollToBottom() {
|
||||||
|
const container = this.$refs.approveDetailsBox
|
||||||
|
container.scrollTo({
|
||||||
|
top: container.scrollHeight + 1000,
|
||||||
|
behavior: 'smooth'
|
||||||
|
});
|
||||||
|
},
|
||||||
// 获取内容
|
// 获取内容
|
||||||
getContent(content){
|
getContent(content){
|
||||||
try {
|
try {
|
||||||
@ -420,7 +432,7 @@ export default {
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取内容
|
// 获取图片
|
||||||
getPictures(content){
|
getPictures(content){
|
||||||
try {
|
try {
|
||||||
return JSON.parse(content).pictures || []
|
return JSON.parse(content).pictures || []
|
||||||
|
|||||||
@ -8,7 +8,6 @@
|
|||||||
<h1>{{$L('审批中心')}}</h1>
|
<h1>{{$L('审批中心')}}</h1>
|
||||||
</div>
|
</div>
|
||||||
<Button type="primary" @click="addApply">{{$L("添加申请")}}</Button>
|
<Button type="primary" @click="addApply">{{$L("添加申请")}}</Button>
|
||||||
<!-- <Button v-for="(item,key) in procdefList" :loading="loadIng > 0" :key="key" type="primary" @click="initiate(item)" style="margin-right:10px;">{{$L(item.name)}}</Button> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Tabs :value="tabsValue" @on-click="tabsClick" style="margin: 0 20px;height: 100%;" size="small">
|
<Tabs :value="tabsValue" @on-click="tabsClick" style="margin: 0 20px;height: 100%;" size="small">
|
||||||
|
|||||||
@ -156,7 +156,7 @@ export default {
|
|||||||
if (!task.end_at) {
|
if (!task.end_at) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return task.owner;
|
return task.owner == 1;
|
||||||
}
|
}
|
||||||
let array = cacheTasks.filter(task => filterTask(task));
|
let array = cacheTasks.filter(task => filterTask(task));
|
||||||
if (taskCompleteTemps.length > 0) {
|
if (taskCompleteTemps.length > 0) {
|
||||||
|
|||||||
@ -1413,7 +1413,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return task.owner;
|
return task.owner == 1;
|
||||||
},
|
},
|
||||||
|
|
||||||
helpFilter(task, chackCompleted = true) {
|
helpFilter(task, chackCompleted = true) {
|
||||||
|
|||||||
4
resources/assets/js/store/getters.js
vendored
4
resources/assets/js/store/getters.js
vendored
@ -124,7 +124,7 @@ export default {
|
|||||||
if (task.complete_at && chackCompleted === true) {
|
if (task.complete_at && chackCompleted === true) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return task.owner;
|
return task.owner == 1;
|
||||||
}
|
}
|
||||||
let array = state.cacheTasks.filter(task => filterTask(task));
|
let array = state.cacheTasks.filter(task => filterTask(task));
|
||||||
let tmpCount = 0;
|
let tmpCount = 0;
|
||||||
@ -174,7 +174,7 @@ export default {
|
|||||||
if (task.complete_at && chackCompleted === true) {
|
if (task.complete_at && chackCompleted === true) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return task.assist && !task.owner;
|
return task.assist && task.owner === 0;
|
||||||
}
|
}
|
||||||
let array = state.cacheTasks.filter(task => filterTask(task));
|
let array = state.cacheTasks.filter(task => filterTask(task));
|
||||||
if (state.taskCompleteTemps.length > 0) {
|
if (state.taskCompleteTemps.length > 0) {
|
||||||
|
|||||||
@ -242,8 +242,7 @@
|
|||||||
|
|
||||||
.approve-record-comment {
|
.approve-record-comment {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin-bottom: 30px;
|
padding-bottom: 0;
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
|||||||
@ -145,6 +145,18 @@
|
|||||||
<Button type="button" class="ivu-btn" style="flex: 1;">查看详情</Button>
|
<Button type="button" class="ivu-btn" style="flex: 1;">查看详情</Button>
|
||||||
@endif
|
@endif
|
||||||
</div></span>
|
</div></span>
|
||||||
|
@elseif ($type === 'approve_comment_notifier')
|
||||||
|
<span class="open-approve-details" data-id="{{$data->id}}">{{$data->comment_nickname}}评论了此审批</b>
|
||||||
|
<div class="cause"><span>申请人:<span style="color:#84c56a">{{'@'}}{{$data->nickname}}</span> {{$data->department}}</span>
|
||||||
|
<b>评论内容</b>
|
||||||
|
<span>{{$data->comment_content}}</span>
|
||||||
|
</div><div class="btn-raw">
|
||||||
|
@if ($is_finished == 1)
|
||||||
|
<Button type="button" class="ivu-btn" style="flex: 1;">已同意</Button>
|
||||||
|
@else
|
||||||
|
<Button type="button" class="ivu-btn" style="flex: 1;">查看详情</Button>
|
||||||
|
@endif
|
||||||
|
</div></span>
|
||||||
@elseif ($type === 'approve_submitter')
|
@elseif ($type === 'approve_submitter')
|
||||||
<span class="open-approve-details" data-id="{{$data->id}}"><b> @if ($action === 'pass')您发起的「{{$data->proc_def_name}}」已通过 @else您发起的「{{$data->proc_def_name}}」被{{$data->nickname}}拒绝 @endif</b>
|
<span class="open-approve-details" data-id="{{$data->id}}"><b> @if ($action === 'pass')您发起的「{{$data->proc_def_name}}」已通过 @else您发起的「{{$data->proc_def_name}}」被{{$data->nickname}}拒绝 @endif</b>
|
||||||
<div class="cause"><span>申请人:<span style="color:#84c56a">{{'@'}}{{$data->start_nickname}}</span> {{$data->department}}</span>
|
<div class="cause"><span>申请人:<span style="color:#84c56a">{{'@'}}{{$data->start_nickname}}</span> {{$data->department}}</span>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user