feat(HRM): 为待办和申请页面添加删除驳回记录功能
为待办列表和外出/请假申请页面添加删除按钮,允许用户删除状态为"已驳回"的记录。同时为所有操作按钮添加loading状态防止重复点击。 - 在待办列表(index.vue)中添加删除按钮,处理驳回状态的记录 - 在外出申请(goout.vue)和请假申请(leave.vue)页面添加删除按钮 - 为所有操作按钮添加loading状态 - 新增删除API调用方法
This commit is contained in:
@@ -145,6 +145,15 @@
|
||||
>
|
||||
驳回
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.taskStatus === 'rejected'"
|
||||
size="small"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
:loading="buttonLoading"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -215,7 +224,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listApprovalTask, rejectApprovalTask, resolveApprovalTask } from '@/api/wms/approvalTask'
|
||||
import { listApprovalTask, rejectApprovalTask, resolveApprovalTask, delApprovalTask } from '@/api/wms/approvalTask'
|
||||
import FileList from '@/components/FileList/index.vue'
|
||||
|
||||
|
||||
@@ -324,6 +333,28 @@ export default {
|
||||
this.getTodoList()
|
||||
},
|
||||
|
||||
// 删除按钮操作
|
||||
handleDelete(row) {
|
||||
this.buttonLoading = true
|
||||
// 确认删除
|
||||
this.$confirm('确认删除该待办吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(async () => {
|
||||
this.buttonLoading = true
|
||||
try {
|
||||
await delApprovalTask(row.taskId)
|
||||
this.$message.success('删除成功!')
|
||||
this.getTodoList() // 重新查询列表
|
||||
} catch (err) {
|
||||
this.$message.error('删除失败:' + err.message)
|
||||
} finally {
|
||||
this.buttonLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 查看详情
|
||||
handleDetail(row) {
|
||||
if (row.applyType === 'seal') {
|
||||
|
||||
Reference in New Issue
Block a user