feat(审批): 添加撤回审批功能并优化审批状态显示

- 在approval.js中添加withdrawApproval API方法
- 在leave.vue和goout.vue中启用撤回按钮并调用新API
- 在todo/index.vue中优化审批状态显示逻辑
This commit is contained in:
砂糖
2026-03-11 16:03:14 +08:00
parent 30a06d297b
commit f561b4eb0b
4 changed files with 62 additions and 32 deletions

View File

@@ -63,13 +63,13 @@
<el-button style="float: right;" icon="el-icon-refresh" @click="getList">刷新</el-button>
</template>
<el-table v-loading="loading" :data="leaveRequestList">
<!-- <el-table-column prop="approvalStatus" label="审批状态" align="center">
<el-table-column prop="approvalStatus" label="审批状态" align="center">
<template slot-scope="scope">
<el-tag :type="getStatusTagType(scope.row.approvalStatus)">
{{ getStatusText(scope.row.approvalStatus) }}
</el-tag>
</template>
</el-table-column> -->
</el-table-column>
<el-table-column label="外出类型" align="center" prop="outType">
<template slot-scope="scope">
<dict-tag :options="dict.type.hrm_out_type" :value="scope.row.outType" />
@@ -104,8 +104,8 @@
@click="handlePrint(scope.row)">打印</el-button>
<el-button icon="el-icon-edit" size="mini" @click="handleEdit(scope.row)"
v-if="scope.row.approvalStatus === '待审批'">修改</el-button>
<!-- <el-button icon="el-icon-delete" size="mini" @click="handleWithdraw(scope.row)"
v-if="scope.row.approvalStatus === '待审批'">撤回</el-button> -->
<el-button icon="el-icon-delete" size="mini" @click="handleWithdraw(scope.row)"
v-if="scope.row.approvalStatus === '待审批'">撤回</el-button>
</template>
</el-table-column>
</el-table>
@@ -121,7 +121,7 @@
<script>
import { getOutRequest, addOutRequest, updateOutRequest } from "@/api/wms/outRequest";
import { listApproval, updateApproval } from "@/api/wms/approval"
import { listApproval, updateApproval, withdrawApproval } from "@/api/wms/approval"
import { listDept } from "@/api/wms/dept"
import FileUpload from '@/components/FileUpload'
import EmployeeSelector from '@/components/EmployeeSelector'
@@ -324,10 +324,8 @@ export default {
handleWithdraw(row) {
this.$modal.confirm('是否确认撤回外出申请编号为"' + row.applyId + '"的数据项?').then(() => {
this.loading = true;
return updateApproval({
approvalId: row.approvalId,
approvalStatus: '已撤销'
});
// 撤销审批
return withdrawApproval(row.approvalId)
}).then(() => {
this.loading = false;
this.getList();