fix(approve): 修复审批流程中的用户ID获取问题
优化审批流程中用户ID的获取方式,确保在加载待办列表时使用正确的用户ID。同时添加调试日志和调整toast显示时长。
This commit is contained in:
@@ -128,12 +128,15 @@
|
|||||||
actionForm: {
|
actionForm: {
|
||||||
remark: ''
|
remark: ''
|
||||||
},
|
},
|
||||||
actionSubmitting: false
|
actionSubmitting: false,
|
||||||
|
currentOaUserId: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.loadEmployees();
|
this.fetchUserProfile().then(() => {
|
||||||
this.loadTodoList();
|
this.loadEmployees();
|
||||||
|
this.loadTodoList();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 格式化员工信息展示(不展示各类ID)
|
// 格式化员工信息展示(不展示各类ID)
|
||||||
@@ -149,6 +152,7 @@
|
|||||||
const user = response?.data?.user || {};
|
const user = response?.data?.user || {};
|
||||||
const roles = user.roles?.map(item => item.roleKey) || [];
|
const roles = user.roles?.map(item => item.roleKey) || [];
|
||||||
this.$store.commit('oa/SET_STATE', user);
|
this.$store.commit('oa/SET_STATE', user);
|
||||||
|
this.currentOaUserId = user.userId || '';
|
||||||
this.roleGroup = roles;
|
this.roleGroup = roles;
|
||||||
return user;
|
return user;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -284,18 +288,18 @@
|
|||||||
async loadTodoList() {
|
async loadTodoList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
try {
|
try {
|
||||||
const profileUser = await this.fetchUserProfile();
|
// const profileUser = await this.fetchUserProfile();
|
||||||
const userId = this.resolveCurrentUserId(profileUser);
|
// const userId = this.resolveCurrentUserId(profileUser);
|
||||||
if (!userId) {
|
// if (!userId) {
|
||||||
this.todoList = [];
|
// this.todoList = [];
|
||||||
this.todoCount = 0;
|
// this.todoCount = 0;
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: '当前登录信息未就绪,请稍后重试',
|
// title: '当前登录信息未就绪,请稍后重试',
|
||||||
icon: 'none'
|
// icon: 'none'
|
||||||
});
|
// });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
const res = await listTodoFlowTask(userId);
|
const res = await listTodoFlowTask(this.currentOaUserId);
|
||||||
let list = res.data || [];
|
let list = res.data || [];
|
||||||
// 前端过滤 bizType
|
// 前端过滤 bizType
|
||||||
if (this.query.bizType) {
|
if (this.query.bizType) {
|
||||||
|
|||||||
@@ -206,6 +206,7 @@ export default {
|
|||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: "success",
|
icon: "success",
|
||||||
title: "缓存清除成功",
|
title: "缓存清除成功",
|
||||||
|
duration: 1500
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -59,7 +59,10 @@
|
|||||||
return this.bizTypeComponentMap[this.bizType] || '';
|
return this.bizTypeComponentMap[this.bizType] || '';
|
||||||
},
|
},
|
||||||
canApprove() {
|
canApprove() {
|
||||||
return this.currentTask && this.currentTask.status === 'pending' && (this.currentTask?.assigneeUserName === this.$store.getters.storeOaName || this.currentTask?.assigneeUserId === this.$store.getters.storeOaId)
|
console.log(this.currentTask, this.$store.getters.storeOaName, this.$store.getters.storeOaId)
|
||||||
|
return this.currentTask && this.currentTask.status === 'pending' &&
|
||||||
|
(this.currentTask?.assigneeUserName === this.$store.getters.storeOaName
|
||||||
|
|| this.currentTask?.assigneeUserId === this.$store.getters.storeOaId)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
Reference in New Issue
Block a user