Commit 13b09625 authored by dcy's avatar dcy

待办流程首页入口

parent 7023b6c6
...@@ -62,3 +62,11 @@ export function getTaskListByProcessInstanceId(processInstanceId) { ...@@ -62,3 +62,11 @@ export function getTaskListByProcessInstanceId(processInstanceId) {
method: 'get', method: 'get',
}) })
} }
export function taskTodoCount(){
return request(
{
url:'/bpm/task/todo-count',
method:'get'
}
)
}
...@@ -7,8 +7,11 @@ ...@@ -7,8 +7,11 @@
<div class="right-menu"> <div class="right-menu">
<template v-if="device!=='mobile'"> <template v-if="device!=='mobile'">
<el-badge :value="matterNum !== 0 ? matterNum : '' " class="right-menu-item badge">
<div @click="$router.push('/bpm/task/todo')" style="font-size: 28px; color: #cccccc;cursor: pointer;" class="el-icon-postcard"></div>
</el-badge>
<el-badge :value="notMessage" class="right-menu-item badge"> <el-badge :value="notMessage !== 0 ? notMessage : '' " class="right-menu-item badge">
<el-image style="width: 22px;height: 20px;cursor: pointer;" :src="unreadMessage" @click="notRead"></el-image> <el-image style="width: 22px;height: 20px;cursor: pointer;" :src="unreadMessage" @click="notRead"></el-image>
</el-badge> </el-badge>
...@@ -81,6 +84,7 @@ export default { ...@@ -81,6 +84,7 @@ export default {
}, },
created() { created() {
this.$store.dispatch('getNotMessage'); this.$store.dispatch('getNotMessage');
this.$store.dispatch('getToDoList');
}, },
components: { components: {
Breadcrumb, Breadcrumb,
...@@ -116,7 +120,11 @@ export default { ...@@ -116,7 +120,11 @@ export default {
}, },
notMessage(){ notMessage(){
return this.$store.state.user.notMessage return this.$store.state.user.notMessage
},
matterNum(){
return this.$store.state.user.matterNum
} }
}, },
methods: { methods: {
toggleSideBar() { toggleSideBar() {
......
import {login, logout, getInfo, socialLogin, socialLogin2} from '@/api/login' import {login, logout, getInfo, socialLogin, socialLogin2} from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth' import { getToken, setToken, removeToken } from '@/utils/auth'
import {getNotReadInternalMessageTotal} from '@/api/system/internalMessage' import {getNotReadInternalMessageTotal,} from '@/api/system/internalMessage'
import {taskTodoCount} from "@/api/bpm/task";
const user = { const user = {
state: { state: {
...@@ -11,6 +12,7 @@ const user = { ...@@ -11,6 +12,7 @@ const user = {
roles: [], roles: [],
permissions: [], permissions: [],
notMessage:0, notMessage:0,
matterNum:0
}, },
mutations: { mutations: {
...@@ -34,6 +36,9 @@ const user = { ...@@ -34,6 +36,9 @@ const user = {
}, },
NOt_MESSAGE:(state, notMessage)=>{ NOt_MESSAGE:(state, notMessage)=>{
state.notMessage = notMessage; state.notMessage = notMessage;
},
GET_MAATER:(state, matterNum) => {
state.matterNum = matterNum;
} }
}, },
...@@ -163,6 +168,17 @@ const user = { ...@@ -163,6 +168,17 @@ const user = {
}) })
}) })
}, },
//获取待办事项
getToDoList({commit}){
return new Promise((resolve,reject) =>{
taskTodoCount().then(r => {
commit('GET_MAATER',r.data)
resolve()
}).catch(err => {
reject(err)
})
})
}
} }
} }
......
...@@ -154,6 +154,11 @@ export default { ...@@ -154,6 +154,11 @@ export default {
specialDiscount, specialDiscount,
warehouseDetails warehouseDetails
}, },
computed:{
matterNum(){
return this.$store.state.user.matterNum
}
},
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -390,11 +395,15 @@ export default { ...@@ -390,11 +395,15 @@ export default {
} }
if (pass) { if (pass) {
approveTask(data).then(response => { approveTask(data).then(response => {
let p = this.matterNum
this.$store.commit('GET_MAATER', --p)
this.$modal.msgSuccess("审批通过成功!"); this.$modal.msgSuccess("审批通过成功!");
this.getDetail(); // 获得最新详情 this.getDetail(); // 获得最新详情
}); });
} else { } else {
rejectTask(data).then(response => { rejectTask(data).then(response => {
let p = this.matterNum
this.$store.commit('GET_MAATER', --p)
this.$modal.msgSuccess("审批不通过成功!"); this.$modal.msgSuccess("审批不通过成功!");
this.getDetail(); // 获得最新详情 this.getDetail(); // 获得最新详情
}); });
...@@ -417,6 +426,8 @@ export default { ...@@ -417,6 +426,8 @@ export default {
} }
updateTaskAssignee(this.updateAssignee.form).then(response => { updateTaskAssignee(this.updateAssignee.form).then(response => {
this.$modal.msgSuccess("转派任务成功!"); this.$modal.msgSuccess("转派任务成功!");
let p = this.matterNum
this.$store.commit('GET_MAATER', --p)
this.updateAssignee.open = false; this.updateAssignee.open = false;
this.getDetail(); // 获得最新详情 this.getDetail(); // 获得最新详情
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment