feat(flow): 添加流程实例更新功能并禁用撤回操作

添加updateFlowInstance API用于更新流程实例
在所有详情页面禁用撤回功能
修改审批状态从pending到running
在抄送页面添加详情跳转功能
This commit is contained in:
砂糖
2026-01-05 14:38:22 +08:00
parent 3a0a076a77
commit b0ee494434
7 changed files with 79 additions and 30 deletions

View File

@@ -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) {