diff --git a/app/Http/Controllers/Api/ApproveController.php b/app/Http/Controllers/Api/ApproveController.php index 12ee28334..7c67c3da2 100755 --- a/app/Http/Controllers/Api/ApproveController.php +++ b/app/Http/Controllers/Api/ApproveController.php @@ -360,6 +360,7 @@ class ApproveController extends AbstractController { $user = User::auth(); $data['userid'] = (string)$user->userid; + $data['username'] = Request::input('username'); $data['procName'] = Request::input('proc_def_name'); $data['sort'] = Request::input('sort'); $data['pageIndex'] = intval(Request::input('page')); @@ -402,6 +403,7 @@ class ApproveController extends AbstractController { $user = User::auth(); $data['userid'] = (string)$user->userid; + $data['username'] = Request::input('username'); $data['procName'] = Request::input('proc_def_name'); //分类 $data['state'] = intval(Request::input('state')); //状态 $data['pageIndex'] = intval(Request::input('page')); @@ -561,6 +563,7 @@ class ApproveController extends AbstractController { $user = User::auth(); $data['userid'] = (string)$user->userid; + $data['username'] = Request::input('username'); $data['procName'] = Request::input('proc_def_name'); $data['sort'] = Request::input('sort'); $data['pageIndex'] = intval(Request::input('page')); @@ -641,6 +644,7 @@ class ApproveController extends AbstractController { $user = User::auth(); $data['userid'] = (string)$user->userid; + $data['username'] = Request::input('username'); $data['procName'] = Request::input('proc_def_name'); $data['sort'] = Request::input('sort'); $data['pageIndex'] = intval(Request::input('page')); diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index a88459e54..134eea2f7 100755 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -633,6 +633,12 @@ class UsersController extends AbstractController $basic = UserDelete::userid2basic($id); } if ($basic) { + // 用户审批状态 + $approval_status = Base::getUserApprovalStatus($basic->userid); + if ($approval_status != ''){ + $basic->approval_status = $approval_status; + } + // $retArray[] = $basic; } } diff --git a/app/Module/Base.php b/app/Module/Base.php index 569c958c6..051e2edb0 100755 --- a/app/Module/Base.php +++ b/app/Module/Base.php @@ -2936,4 +2936,22 @@ class Base } return $newArray; } + + /** + * 获取用户审批状态 + * + * @param [type] $userid + * @return string + */ + public static function getUserApprovalStatus($userid) { + $data['userid'] = $userid; + $url = env('FLOW_URL') ?: 'http://approve'; + $ret = Ihttp::ihttp_get($url.'/api/v1/workflow/process/getUserApprovalStatus?'.http_build_query($data)); + $procdef = json_decode($ret['ret'] == 1 ? $ret['data'] : '{}', true); + if (isset($procdef['status']) && $procdef['status'] == 200) { + return isset($procdef['data']["proc_def_name"]) ? $procdef['data']["proc_def_name"] : ''; + } else { + return ''; + } + } } diff --git a/resources/assets/js/pages/manage/approve/index.vue b/resources/assets/js/pages/manage/approve/index.vue index ec12869bc..c497fcd32 100644 --- a/resources/assets/js/pages/manage/approve/index.vue +++ b/resources/assets/js/pages/manage/approve/index.vue @@ -36,9 +36,8 @@ -
- -
+ +
@@ -66,9 +65,8 @@ -
- -
+ +
{{$L('暂无数据')}}
@@ -95,9 +93,8 @@ -
- -
+ + @@ -127,9 +124,8 @@ -
- -
+ +
{{$L('暂无数据')}}
@@ -267,6 +263,7 @@ export default { tabsValue: "", // approvalType: "all", + approvalName: "", approvalList: [ { value: "all", label: this.$L("全部审批") }, ], @@ -440,6 +437,7 @@ export default { this.tabsValue = val || this.tabsValue if(val){ this.approvalType = this.searchState = "all" + this.approvalName = "" } // this.detailsShow = false; @@ -531,6 +529,7 @@ export default { page: type == 'scroll' ? this.unreadPage : 1, page_size: type == 'scroll' ? this.pageSize : this.unreadPage * this.pageSize, proc_def_name: this.approvalType == 'all' ? '' : this.approvalType, + username: this.approvalName, } }).then(({data}) => { let activeId = 0; @@ -572,6 +571,7 @@ export default { page: type == 'scroll' ? this.donePage : 1, page_size: type == 'scroll' ? this.pageSize : this.donePage * this.pageSize, proc_def_name: this.approvalType == 'all' ? '' : this.approvalType, + username: this.approvalName, } }).then(({data}) => { let activeId = 0; @@ -613,6 +613,7 @@ export default { page: type == 'scroll' ? this.notifyPage : 1, page_size: type == 'scroll' ? this.pageSize : this.notifyPage * this.pageSize, proc_def_name: this.approvalType == 'all' ? '' : this.approvalType, + username: this.approvalName, } }).then(({data}) => { let activeId = 0; @@ -654,7 +655,8 @@ export default { page: type == 'scroll' ? this.initiatedPage : 1, page_size: type == 'scroll' ? this.pageSize : this.initiatedPage * this.pageSize, proc_def_name: this.approvalType == 'all' ? '' : this.approvalType, - state: this.searchState == 'all' ? '' : this.searchState + state: this.searchState == 'all' ? '' : this.searchState, + username: this.approvalName, } }).then(({data}) => { let activeId = 0; diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 8e9ee2cd2..a81a292f5 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -44,6 +44,7 @@

{{dialogData.name}}

({{peopleNum}}) {{$L('机器人')}} + {{$L(cacheUserBasic.find(item => item.userid === dialogData.dialog_user.userid)?.approval_status)}} {{$L('全员')}} {{$L('部门')}}
@@ -661,6 +662,7 @@ export default { mounted() { this.msgSubscribe = Store.subscribe('dialogMsgChange', this.onMsgChange); + console.log('dialogMsgChange', this.cacheUserBasic) }, beforeDestroy() { @@ -1443,7 +1445,7 @@ export default { onSearchMsgId() { if (this.dialogSearchMsgId > 0 && this.openId === this.dialogId) { this.onPositionId(this.dialogSearchMsgId) - this.$store.state.dialogSearchMsgId = 0 + this.$store.state.dialogSearchMsgId = 0 } },