feat(flow): 添加流程实例更新功能并禁用撤回操作
添加updateFlowInstance API用于更新流程实例 在所有详情页面禁用撤回功能 修改审批状态从pending到running 在抄送页面添加详情跳转功能
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="草稿" value="draft" />
|
||||
<el-option label="审批中" value="pending" />
|
||||
<el-option label="审批中" value="running" />
|
||||
<el-option label="已通过" value="approved" />
|
||||
<el-option label="已驳回" value="rejected" />
|
||||
</el-select>
|
||||
@@ -82,7 +82,8 @@
|
||||
</el-table-column> -->
|
||||
<el-table-column label="类型/目的" min-width="140">
|
||||
<template slot-scope="scope">
|
||||
{{ getTypeDetail(scope.row) }}
|
||||
<el-input v-model="scope.row.remark" placeholder="请输入类型/目的便于审批或查看" @change="handleRemarkChange(scope.row)"></el-input>
|
||||
<!-- {{ getTypeDetail(scope.row) }} -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="开始时间" prop="startTime" min-width="160">
|
||||
@@ -125,7 +126,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listMyFlowInstance } from '@/api/hrm/flow'
|
||||
import { listMyFlowInstance, updateFlowInstance } from '@/api/hrm/flow'
|
||||
import { getEmployeeByUserId } from '@/api/hrm/employee'
|
||||
|
||||
export default {
|
||||
@@ -185,6 +186,21 @@ export default {
|
||||
const dept = emp.deptName ? ` · ${emp.deptName}` : ''
|
||||
return `${name || '员工'}${no}${dept}`.trim()
|
||||
},
|
||||
handleRemarkChange(row) {
|
||||
updateFlowInstance(row).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.$message({
|
||||
message: '更新成功',
|
||||
type: 'success'
|
||||
})
|
||||
} else {
|
||||
this.$message({
|
||||
message: `更新失败: ${response.msg || '未知错误'}`,
|
||||
type: 'error'
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
formatEmpDisplay(userId) {
|
||||
// The API returns startUserId, which is a user ID, not an empId.
|
||||
// We can display the current user's name if the ID matches.
|
||||
@@ -303,7 +319,7 @@ export default {
|
||||
pageNum: this.historyQuery.pageNum,
|
||||
pageSize: this.historyQuery.pageSize,
|
||||
bizType: this.historyQuery.type || undefined, // 业务类型:leave/travel/seal/reimburse
|
||||
status: this.historyQuery.status || undefined // 状态:draft/pending/approved/rejected
|
||||
status: this.historyQuery.status || undefined // 状态:draft/running/approved/rejected
|
||||
}
|
||||
const res = await listMyFlowInstance(params)
|
||||
if (res.code === 200) {
|
||||
|
||||
@@ -231,6 +231,7 @@ export default {
|
||||
return typeMap[this.detail.status] || 'info'
|
||||
},
|
||||
canWithdraw() {
|
||||
return false;
|
||||
// 只有待审批状态且是当前用户提交的才能撤回
|
||||
return this.detail.status === 'pending' && this.detail.createBy === this.$store.getters.name
|
||||
},
|
||||
|
||||
@@ -242,6 +242,7 @@ export default {
|
||||
return this.detail.status === 'pending' && (this.currentTask?.assigneeUserName === this.$store.getters.name || this.currentTask?.assigneeUserId === this.$store.getters.id)
|
||||
},
|
||||
canWithdraw() {
|
||||
return false;
|
||||
return this.detail.status === 'pending' && this.detail.createBy === this.$store.getters.name
|
||||
}
|
||||
},
|
||||
|
||||
@@ -362,15 +362,16 @@ export default {
|
||||
return empId ? `员工ID:${empId}` : '-'
|
||||
},
|
||||
canApprove() {
|
||||
console.log(this.currentTask, this.$store.getters.id, this.$store.getters.name)
|
||||
// 只有待审批状态且是当前用户待审批的才能审批
|
||||
return this.seal.status === 'pending' && (this.currentTask?.assigneeUserName === this.$store.getters.name || this.currentTask?.assigneeUserId === this.$store.getters.id)
|
||||
return this.seal.status === 'running' && (this.currentTask?.assigneeUserName === this.$store.getters.name || this.currentTask?.assigneeUserId === this.$store.getters.id)
|
||||
},
|
||||
canStamp() {
|
||||
// 审批通过后,且尚未生成回执时,可以盖章
|
||||
return this.seal.status === 'approved' && !this.seal.receiptFileIds && this.targetPdfFile && this.attachmentList.length > 0
|
||||
},
|
||||
canWithdraw() {
|
||||
console.log(this.seal.createBy, this.$store.getters.name)
|
||||
return false;
|
||||
return this.seal.status === 'running' && this.seal.createBy === this.$store.getters.name
|
||||
},
|
||||
},
|
||||
@@ -385,11 +386,11 @@ export default {
|
||||
})
|
||||
},
|
||||
statusText(status) {
|
||||
const map = { pending: '审批中', draft: '草稿', approved: '已通过', rejected: '已驳回', canceled: '已撤销' }
|
||||
const map = { running: '审批中', draft: '草稿', approved: '已通过', rejected: '已驳回', canceled: '已撤销' }
|
||||
return map[status] || status || '-'
|
||||
},
|
||||
statusType(status) {
|
||||
const map = { pending: 'warning', draft: 'info', approved: 'success', rejected: 'danger', canceled: 'info' }
|
||||
const map = { running: 'warning', draft: 'info', approved: 'success', rejected: 'danger', canceled: 'info' }
|
||||
return map[status] || 'info'
|
||||
},
|
||||
formatDate(val) {
|
||||
|
||||
@@ -231,6 +231,7 @@ export default {
|
||||
return this.travel.status === 'pending' && (this.currentTask?.assigneeUserName === this.$store.getters.name || this.currentTask?.assigneeUserId === this.$store.getters.id)
|
||||
},
|
||||
canWithdraw() {
|
||||
return false;
|
||||
return this.travel.status === 'pending' && this.travel.createBy === this.$store.getters.name
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user