feat(wms): 新增用印审批功能

- 在审批API中添加按业务ID查询审批信息的方法
- 配置用印详情页面路由,支持通过业务ID查看用印详情
- 修改待办列表,为用印类型申请隐藏同意驳回按钮
- 在待办列表数据中添加业务ID字段,完善申请类型映射
- 更新审批服务接口和实现类,添加queryByBizId方法
- 重构用印详情页面,集成审批信息加载和权限校验逻辑
- 更新领域模型中的申请类型枚举,添加用印类型支持
- 完善审批任务服务,支持用印申请详情查询和申请人姓名显示
This commit is contained in:
2026-03-19 15:30:28 +08:00
parent 2a4fc70b72
commit 1207072092
13 changed files with 166 additions and 30 deletions

View File

@@ -126,24 +126,26 @@
>
详情
</el-button>
<el-button
v-if="scope.row.taskStatus === 'pending'"
size="small"
icon="el-icon-check"
@click="handleApprove(scope.row)"
:loading="buttonLoading"
>
同意
</el-button>
<el-button
v-if="scope.row.taskStatus === 'pending'"
size="small"
icon="el-icon-close"
@click="handleReject(scope.row)"
:loading="buttonLoading"
>
驳回
</el-button>
<template v-if="scope.row.applyType !== 'seal'">
<el-button
v-if="scope.row.taskStatus === 'pending'"
size="small"
icon="el-icon-check"
@click="handleApprove(scope.row)"
:loading="buttonLoading"
>
同意
</el-button>
<el-button
v-if="scope.row.taskStatus === 'pending'"
size="small"
icon="el-icon-close"
@click="handleReject(scope.row)"
:loading="buttonLoading"
>
驳回
</el-button>
</template>
</template>
</el-table-column>
</el-table>
@@ -274,7 +276,8 @@ export default {
applyType: item.approval.applyType,
approverName: item.approval.approverName,
taskId: item.task.taskId,
...item.detail, // 合并请假/外出的详情字段
bizId: item.approval.applyId,
...item.detail,
}
})
this.total = res.total
@@ -323,7 +326,13 @@ export default {
// 查看详情
handleDetail(row) {
this.currentDetail = { ...row } // 深拷贝避免原数据被修改
if (row.applyType === 'seal') {
this.$router.push({
path: `/wms/seal/sealDetail/${row.bizId}`
})
return
}
this.currentDetail = { ...row }
this.detailDialogVisible = true
},
@@ -427,6 +436,7 @@ export default {
const textMap = {
'leave': '请假',
'out': '外出',
'seal': '用印',
}
return textMap[type] || '未知类型'
},

View File

@@ -5,7 +5,7 @@
<el-card class="form-card" shadow="never">
<div slot="header" class="card-header">
<span>用印申请</span>
</div>
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px" size="small" class="metal-form">
<div class="form-summary">
@@ -223,7 +223,12 @@ export default {
})
},
goDetail(row) {
this.$router.push({ path: '/job/sealDetail', query: { bizId: row.bizId } })
// if (row.applyType === 'seal') {
this.$router.push({
path: `/wms/seal/sealDetail/${row.bizId}`
})
return
// }
},
canPreviewReceipt(row) {
return row.status === 'approved' && row.receiptFileIds

View File

@@ -150,6 +150,7 @@
<script>
import { getSealReq, rejectSealReq, approveSealReq, stampSealJava } from '@/api/wms/seal'
import { getApprovalByBizId } from '@/api/wms/approval'
import { listByIds } from '@/api/system/oss'
import PdfStamper from '@/components/PdfStamper/index.vue'
@@ -168,6 +169,7 @@ export default {
stamping: false,
actionSubmitting: false,
actionRemark: '',
approvalInfo: null,
stampForm: {
pageNo: 1,
stampImageUrl: '',
@@ -191,8 +193,18 @@ export default {
return this.seal.empId ? `员工ID:${this.seal.empId}` : '-'
},
canApprove() {
if (!this.approvalInfo || !this.approvalInfo.task) {
return false
}
const currentUserId = this.$store.getters.id
return this.seal.status === 'running' && String(this.seal.approverId) === String(currentUserId)
const task = this.approvalInfo.task
console.log('canApprove check:', {
currentUserId,
approverId: task.approverId,
status: this.seal.status,
taskStatus: task.taskStatus
})
return this.seal.status === 'running' && task.taskStatus === 'pending' && Number(task.approverId) === Number(currentUserId)
}
},
created() {
@@ -223,12 +235,20 @@ export default {
try {
const res = await getSealReq(bizId)
this.seal = res.data || {}
this.seal.approverId = this.seal.approverId || this.seal.approver_id || this.seal.approverUserId
await this.loadAttachments()
await this.loadApprovalInfo()
} finally {
this.loading = false
}
},
async loadApprovalInfo() {
try {
const res = await getApprovalByBizId(this.currentBizId)
this.approvalInfo = res.data || null
} catch (e) {
this.approvalInfo = null
}
},
async loadAttachments() {
const fileIds = this.seal.applyFileIds
if (!fileIds) {
@@ -353,6 +373,10 @@ export default {
}
},
async reject() {
if (!this.canApprove) {
this.$message.warning('你不是当前审批人')
return
}
this.actionSubmitting = true
try {
await rejectSealReq(this.currentBizId, this.actionRemark)