refactor(hrm): 优化流程相关页面显示和功能
移除不必要的流程状态显示和撤回按钮 调整任务列表和抄送页面的列显示和操作逻辑 简化用户信息显示方式,统一使用createBy字段
This commit is contained in:
@@ -54,7 +54,7 @@ public class SysOssController extends BaseController {
|
||||
*
|
||||
* @param ossIds OSS对象ID串
|
||||
*/
|
||||
@SaCheckPermission("system:oss:list")
|
||||
// @SaCheckPermission("system:oss:list")
|
||||
@GetMapping("/listByIds/{ossIds}")
|
||||
public R<List<SysOssVo>> listByIds(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ossIds) {
|
||||
@@ -67,7 +67,7 @@ public class SysOssController extends BaseController {
|
||||
*
|
||||
* @param file 文件
|
||||
*/
|
||||
@SaCheckPermission("system:oss:upload")
|
||||
// @SaCheckPermission("system:oss:upload")
|
||||
@Log(title = "OSS对象存储", businessType = BusinessType.INSERT)
|
||||
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public R<Map<String, String>> upload(@RequestPart("file") MultipartFile file) {
|
||||
@@ -87,7 +87,7 @@ public class SysOssController extends BaseController {
|
||||
*
|
||||
* @param ossId OSS对象ID
|
||||
*/
|
||||
@SaCheckPermission("system:oss:download")
|
||||
// @SaCheckPermission("system:oss:download")
|
||||
@GetMapping("/download/{ossId}")
|
||||
public void download(@PathVariable Long ossId, HttpServletResponse response) throws IOException {
|
||||
iSysOssService.download(ossId,response);
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<span class="card-title">抄送我的</span>
|
||||
<el-button style="margin-left: 10px" size="mini" @click="handleRefresh">刷新</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-tabs v-model="activeTab" @tab-click="handleTabClick">
|
||||
<el-tab-pane>
|
||||
<el-tab-pane label="未读" name="unread">
|
||||
<template #label>
|
||||
<span>
|
||||
未读
|
||||
@@ -30,12 +31,14 @@
|
||||
<el-table-column label="业务" prop="bizTypeName" width="150" />
|
||||
<el-table-column label="内容" prop="bizTitle" min-width="300" show-overflow-tooltip />
|
||||
<el-table-column label="节点" prop="nodeName" width="180" />
|
||||
<el-table-column label="抄送人" prop="createBy" >
|
||||
</el-table-column>
|
||||
<el-table-column label="抄送时间" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
{{ parseTime(scope.row.createTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100" fixed="right">
|
||||
<el-table-column label="操作" width="100" fixed="right" v-if="activeTab === 'unread'">
|
||||
<template #default="scope">
|
||||
<el-link
|
||||
v-if="scope.row.readFlag === 0"
|
||||
@@ -80,9 +83,13 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.refreshCounts()
|
||||
this.getList()
|
||||
},
|
||||
computed: {
|
||||
currentUserId() {
|
||||
return this.$store.getters.id;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
parseTime,
|
||||
tableRowClassName({ row }) {
|
||||
@@ -95,7 +102,7 @@ export default {
|
||||
},
|
||||
getList() {
|
||||
this.loading = true
|
||||
listCc(this.queryParams)
|
||||
listCc({ ...this.queryParams, ccUserId: this.currentUserId })
|
||||
.then((res) => {
|
||||
this.ccList = res.rows || []
|
||||
this.total = res.total || 0
|
||||
@@ -107,19 +114,14 @@ export default {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 单独刷新未读数量(用于 badge)
|
||||
refreshCounts() {
|
||||
listCc({ pageNum: 1, pageSize: 1, readFlag: 0 }).then((res) => {
|
||||
this.badgeUnread = res.total || 0
|
||||
})
|
||||
},
|
||||
handleRead(row) {
|
||||
readCc(row.ccId).then(() => {
|
||||
this.$modal.msgSuccess('已标记已读')
|
||||
// 刷新当前列表 & 未读数量
|
||||
this.refreshCounts()
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
handleRefresh() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,29 +42,29 @@
|
||||
highlight-current-row
|
||||
@row-click="openDetail"
|
||||
>
|
||||
<el-table-column label="状态" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusType(scope.row.status)" size="mini">{{ statusText(scope.row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="mini" type="info">{{ bizTypeText(scope.row.bizType) }}</el-tag>
|
||||
<span class="muted" v-if="scope.row.bizId"> #{{ scope.row.bizId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="节点" min-width="110">
|
||||
<!-- <el-table-column label="节点" min-width="110">
|
||||
<template slot-scope="scope">
|
||||
<span class="pill">{{ scope.row.nodeId }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusType(scope.row.status)" size="mini">{{ statusText(scope.row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="到期" min-width="150">
|
||||
</el-table-column> -->
|
||||
|
||||
<!-- <el-table-column label="到期" min-width="150">
|
||||
<template slot-scope="scope">{{ formatDate(scope.row.expireTime) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" prop="remark" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="160" fixed="right">
|
||||
</el-table-column> -->
|
||||
<el-table-column label="备注" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="160" fixed="right" v-if="mode === 'todo'">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" @click.stop="openDetail(scope.row)">详情</el-button>
|
||||
<el-dropdown v-if="scope.row.status === 'pending'" @command="cmd => openAction(scope.row, cmd)">
|
||||
<span class="el-dropdown-link">
|
||||
快捷办理<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
@@ -105,7 +105,7 @@
|
||||
<div class="ds-right">
|
||||
<div class="ds-item">
|
||||
<div class="k">办理人</div>
|
||||
<div class="v">{{ formatUser(detailTask.assigneeUserId) }}</div>
|
||||
<div class="v">{{ formatUser(detailTask.assigneeUserId, 'userId') }}</div>
|
||||
</div>
|
||||
<div class="ds-item">
|
||||
<div class="k">到期</div>
|
||||
@@ -160,7 +160,7 @@
|
||||
<div class="timeline-row">
|
||||
<div class="t-main">
|
||||
<span class="t-action">{{ actionText(a.action) }}</span>
|
||||
<span class="t-user">· 办理人:{{ formatUser(a.actionUserId) }}</span>
|
||||
<span class="t-user">· 办理人:{{ formatUser(a.createBy, 'createBy') }}</span>
|
||||
</div>
|
||||
<div class="t-remark" v-if="a.remark">{{ a.remark }}</div>
|
||||
</div>
|
||||
@@ -280,7 +280,6 @@
|
||||
<!-- 抄送/转发用户选择组件 -->
|
||||
<UserSingleSelect ref="userSingleSelect" @onSelected="onForwardUserSelected" />
|
||||
<UserMultiSelect ref="userMultiSelect" @onSelected="onCcUsersSelected" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -350,16 +349,17 @@ export default {
|
||||
actionText(action) { const map = { submit: '提交', approve: '通过', reject: '驳回', withdraw: '撤回', cancel: '撤销', stamp: '盖章', transfer: '转发' }; return map[action] || action || '-' },
|
||||
actionTagType(action) { const map = { submit: 'primary', approve: 'success', reject: 'danger', withdraw: 'info', cancel: 'info', stamp: 'primary', transfer: 'warning' }; return map[action] || 'info' },
|
||||
async loadAllUsers() { try { const res = await listUser({ pageNum: 1, pageSize: 1000 }); this.allUsers = res.rows || [] } catch (e) { this.allUsers = [] } },
|
||||
formatUser(userId) { if (!userId) return '-'; const user = this.allUsers.find(u => u.userId === userId); return user ? `${user.nickName || user.userName}` : `ID:${userId}` },
|
||||
formatUser(userId, fieldName) { if (!userId) return '-'; const user = this.allUsers.find(u => u[fieldName] === userId); return user ? `${user.nickName || user.userName}` : `ID:${userId}` },
|
||||
fetchList() {
|
||||
this.loading = true
|
||||
const userId = this.$store?.state?.user?.id
|
||||
const userName = this.$store?.state?.user?.name
|
||||
const params = { ...this.query }
|
||||
let req
|
||||
if (this.mode === 'todo' && userId) {
|
||||
req = listTodoFlowTask(userId)
|
||||
} else if (this.mode === 'mine' && userId) {
|
||||
req = listFlowTask({ ...params, startUserId: userId })
|
||||
} else if (this.mode === 'mine' && userId && userName) {
|
||||
req = listFlowTask({ ...params, createBy: userName })
|
||||
} else {
|
||||
req = listFlowTask(params)
|
||||
}
|
||||
|
||||
@@ -75,17 +75,17 @@
|
||||
<el-tag :type="getTypeTagType(scope.row.bizType)">{{ getTypeText(scope.row.bizType) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请人" min-width="120">
|
||||
<!-- <el-table-column label="申请人" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ formatEmpDisplay(scope.row.startUserId) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="类型/目的" min-width="140">
|
||||
<template slot-scope="scope">
|
||||
{{ getTypeDetail(scope.row) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" prop="startTime" min-width="160">
|
||||
<!-- <el-table-column label="开始时间" prop="startTime" min-width="160">
|
||||
<template slot-scope="scope">{{ formatDate(scope.row.startTime) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" prop="endTime" min-width="160">
|
||||
@@ -93,7 +93,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="时长" min-width="100">
|
||||
<template slot-scope="scope">{{ formatDuration(scope.row) }}</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="状态" prop="status" min-width="110">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="statusType(scope.row.status)">{{ statusText(scope.row.status) }}</el-tag>
|
||||
|
||||
@@ -26,14 +26,14 @@
|
||||
>
|
||||
驳回
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
v-if="canWithdraw"
|
||||
size="mini"
|
||||
:loading="actionLoading"
|
||||
@click="handleWithdraw"
|
||||
>
|
||||
撤回
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
<div class="summary-right">
|
||||
<div class="summary-item">
|
||||
<div class="k">申请人</div>
|
||||
<div class="v">{{ detail.empName || '-' }}<span v-if="detail.empNo" class="text-muted">({{ detail.empNo }})</span></div>
|
||||
<div class="v">{{ detail.createBy || '-' }}<span v-if="detail.empNo" class="text-muted">({{ detail.empNo }})</span></div>
|
||||
</div>
|
||||
<div class="summary-item">
|
||||
<div class="k">请假时长</div>
|
||||
@@ -78,7 +78,7 @@
|
||||
</el-card>
|
||||
|
||||
<!-- 流程状态 -->
|
||||
<div class="block-title">流程状态</div>
|
||||
<!-- <div class="block-title">流程状态</div>
|
||||
<el-card class="inner-card" shadow="never">
|
||||
<div v-if="flowInstance" class="flow-status">
|
||||
<div class="status-item">
|
||||
@@ -99,7 +99,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="empty">暂无流程信息</div>
|
||||
</el-card>
|
||||
</el-card> -->
|
||||
|
||||
<!-- 请假理由说明 -->
|
||||
<div class="block-title">请假理由说明</div>
|
||||
@@ -166,7 +166,7 @@
|
||||
>
|
||||
<el-card>
|
||||
<h4>{{ getActionText(item.action) }}</h4>
|
||||
<p>处理人: {{ item.operatorName || '系统' }}</p>
|
||||
<p>处理人: {{ item.createBy || '系统' }}</p>
|
||||
<p v-if="item.comment">意见: {{ item.comment }}</p>
|
||||
</el-card>
|
||||
</el-timeline-item>
|
||||
@@ -207,6 +207,9 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
currentBizId() {
|
||||
return this.bizId || this.$route?.params?.bizId || this.$route?.query?.bizId || this.$route?.params?.id
|
||||
},
|
||||
statusText() {
|
||||
const statusMap = {
|
||||
'draft': '草稿',
|
||||
@@ -229,17 +232,12 @@ export default {
|
||||
},
|
||||
canWithdraw() {
|
||||
// 只有待审批状态且是当前用户提交的才能撤回
|
||||
return this.detail.status === 'pending' && this.detail.createBy === this.$store.getters.userId
|
||||
return this.detail.status === 'pending' && this.detail.createBy === this.$store.getters.name
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadDetail()
|
||||
},
|
||||
computed: {
|
||||
currentBizId() {
|
||||
return this.bizId || this.$route?.params?.bizId || this.$route?.query?.bizId || this.$route?.params?.id
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async loadDetail() {
|
||||
const bizId = this.currentBizId
|
||||
|
||||
@@ -26,14 +26,14 @@
|
||||
>
|
||||
驳回
|
||||
</el-button>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
v-if="canWithdraw"
|
||||
size="mini"
|
||||
:loading="actionLoading"
|
||||
@click="handleWithdraw"
|
||||
>
|
||||
撤回
|
||||
</el-button>
|
||||
</el-button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 流程状态 -->
|
||||
<div class="block-title">流程状态</div>
|
||||
<!-- <div class="block-title">流程状态</div>
|
||||
<el-card class="inner-card" shadow="never" v-loading="actionLoading">
|
||||
<div v-if="flowInstance" class="flow-status">
|
||||
<div class="status-item">
|
||||
@@ -50,7 +50,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="empty">暂无流程信息</div>
|
||||
</el-card>
|
||||
</el-card> -->
|
||||
|
||||
<div class="block-title">用印信息</div>
|
||||
<el-descriptions :column="2" border size="small" v-loading="loading">
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
</el-card>
|
||||
|
||||
<!-- 流程状态 -->
|
||||
<div class="block-title">流程状态</div>
|
||||
<!-- <div class="block-title">流程状态</div>
|
||||
<el-card class="inner-card" shadow="never" v-loading="actionLoading">
|
||||
<div v-if="flowInstance" class="flow-status">
|
||||
<div class="status-item">
|
||||
@@ -131,7 +131,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="empty">暂无流程信息</div>
|
||||
</el-card>
|
||||
</el-card> -->
|
||||
|
||||
<div class="block-title">流转历史</div>
|
||||
<el-card class="inner-card" shadow="never" v-loading="actionLoading">
|
||||
|
||||
Reference in New Issue
Block a user