diff --git a/pages/hrm/approve/approve.vue b/pages/hrm/approve/approve.vue index c47373e..89d0569 100644 --- a/pages/hrm/approve/approve.vue +++ b/pages/hrm/approve/approve.vue @@ -33,7 +33,7 @@ - + 暂无待审批任务 @@ -128,12 +128,15 @@ actionForm: { remark: '' }, - actionSubmitting: false + actionSubmitting: false, + currentOaUserId: '' } }, onShow() { - this.loadEmployees(); - this.loadTodoList(); + this.fetchUserProfile().then(() => { + this.loadEmployees(); + this.loadTodoList(); + }); }, methods: { // 格式化员工信息展示(不展示各类ID) @@ -149,6 +152,7 @@ const user = response?.data?.user || {}; const roles = user.roles?.map(item => item.roleKey) || []; this.$store.commit('oa/SET_STATE', user); + this.currentOaUserId = user.userId || ''; this.roleGroup = roles; return user; } catch (error) { @@ -284,18 +288,18 @@ async loadTodoList() { this.loading = true; try { - const profileUser = await this.fetchUserProfile(); - const userId = this.resolveCurrentUserId(profileUser); - if (!userId) { - this.todoList = []; - this.todoCount = 0; - uni.showToast({ - title: '当前登录信息未就绪,请稍后重试', - icon: 'none' - }); - return; - } - const res = await listTodoFlowTask(userId); + // const profileUser = await this.fetchUserProfile(); + // const userId = this.resolveCurrentUserId(profileUser); + // if (!userId) { + // this.todoList = []; + // this.todoCount = 0; + // uni.showToast({ + // title: '当前登录信息未就绪,请稍后重试', + // icon: 'none' + // }); + // return; + // } + const res = await listTodoFlowTask(this.currentOaUserId); let list = res.data || []; // 前端过滤 bizType if (this.query.bizType) { diff --git a/pages/profile/index/index.vue b/pages/profile/index/index.vue index 431f070..3c0d977 100644 --- a/pages/profile/index/index.vue +++ b/pages/profile/index/index.vue @@ -206,6 +206,7 @@ export default { uni.showToast({ icon: "success", title: "缓存清除成功", + duration: 1500 }); } }, diff --git a/pages/workbench/hrm/detail/detail.vue b/pages/workbench/hrm/detail/detail.vue index 83f1ce5..3af940b 100644 --- a/pages/workbench/hrm/detail/detail.vue +++ b/pages/workbench/hrm/detail/detail.vue @@ -59,7 +59,10 @@ return this.bizTypeComponentMap[this.bizType] || ''; }, 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: {