Browse Source
feat(workflow): 添加特殊放行功能并移除待办任务页面
feat(workflow): 添加特殊放行功能并移除待办任务页面
- 在流程实例列表中新增特殊放行列显示 - 在审批对话框中添加特殊放行选择选项 - 初始化审批数据时设置默认特殊放行为否 - 审批提交时传递特殊放行参数到后端 - 移除待办任务列表页面及其相关API接口 - 清理相关的任务管理API调用和方法master
3 changed files with 21 additions and 504 deletions
-
29src/api/workFlow/workFlow.js
-
24src/views/modules/workFlow/flowInstanceList.vue
-
472src/views/modules/workFlow/flowTaskList.vue
@ -1,472 +0,0 @@ |
|||||
<template> |
|
||||
<div class="customer-css"> |
|
||||
<!-- Tab切换 - rqrq --> |
|
||||
<el-tabs v-model="activeTab" @tab-click="handleTabClick" class="customer-tab" type="border-card"> |
|
||||
<!-- 待办任务 --> |
|
||||
<el-tab-pane label="待办任务" name="pending"> |
|
||||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;"> |
|
||||
<el-row> |
|
||||
<el-col :span="24"> |
|
||||
<el-form-item label="单据号:"> |
|
||||
<el-input v-model="searchData.applyNo" style="width: 150px"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="单据类型:"> |
|
||||
<el-select v-model="searchData.orderType" style="width: 130px" clearable> |
|
||||
<el-option label="全部" value=""></el-option> |
|
||||
<el-option label="产品资料" value="产品资料"></el-option> |
|
||||
|
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label=" "> |
|
||||
<el-button class="customer-bun-min" type="primary" @click="getPendingList">查询</el-button> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
</el-form> |
|
||||
|
|
||||
<el-table |
|
||||
:height="height" |
|
||||
:data="pendingList" |
|
||||
border |
|
||||
ref="pendingTable" |
|
||||
highlight-current-row |
|
||||
v-loading="pendingLoading" |
|
||||
style="margin-top: 0px; width: 100%;"> |
|
||||
<el-table-column prop="applyNo" label="单据号" min-width="150" header-align="center" align="center"></el-table-column> |
|
||||
<el-table-column prop="orderType" label="单据类型" min-width="100" header-align="center" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span >{{ scope.row.orderType }}</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="flowName" label="流程名称" min-width="150" header-align="center" align="left"></el-table-column> |
|
||||
<el-table-column prop="nodeName" label="当前节点" min-width="120" header-align="center" align="center"></el-table-column> |
|
||||
<el-table-column prop="approveType" label="审批类型" min-width="100" header-align="center" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-if="scope.row.approveType === 'SINGLE'">单人审批</span> |
|
||||
<span v-else-if="scope.row.approveType === 'ALL'">会签</span> |
|
||||
<span v-else-if="scope.row.approveType === 'ANY'">或签</span> |
|
||||
<span v-else>{{ scope.row.approveType }}</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="assigneeName" label="审批人" min-width="100" header-align="center" align="center"></el-table-column> |
|
||||
<el-table-column prop="createdTime" label="接收时间" min-width="150" header-align="center" align="center"></el-table-column> |
|
||||
<el-table-column fixed="right" header-align="center" align="center" width="180" label="操作"> |
|
||||
<template slot-scope="scope"> |
|
||||
<!-- 只有当前用户是审批人才能操作 - rqrq --> |
|
||||
<template v-if="scope.row.assignee === currentUser"> |
|
||||
<el-link style="cursor: pointer; color: #67C23A" @click="approveTask(scope.row)">同意 |</el-link> |
|
||||
<el-link style="cursor: pointer; color: #F56C6C" @click="rejectTask(scope.row)">驳回 |</el-link> |
|
||||
</template> |
|
||||
<el-link style="cursor: pointer" @click="viewHistory(scope.row)">审批记录</el-link> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
|
|
||||
<el-pagination |
|
||||
style="margin-top: 0px" |
|
||||
@size-change="pendingSizeChange" |
|
||||
@current-change="pendingPageChange" |
|
||||
:current-page="pendingPageIndex" |
|
||||
:page-sizes="[20, 50, 100, 200]" |
|
||||
:page-size="pendingPageSize" |
|
||||
:total="pendingTotal" |
|
||||
layout="total, sizes, prev, pager, next, jumper"> |
|
||||
</el-pagination> |
|
||||
</el-tab-pane> |
|
||||
|
|
||||
<!-- 已办任务 --> |
|
||||
<el-tab-pane label="已办任务" name="completed"> |
|
||||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;"> |
|
||||
<el-row> |
|
||||
<el-col :span="24"> |
|
||||
<el-form-item label="单据号:"> |
|
||||
<el-input v-model="completedSearchData.applyNo" style="width: 150px"></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="单据类型:"> |
|
||||
<el-select v-model="completedSearchData.orderType" style="width: 130px" clearable> |
|
||||
<el-option label="全部" value=""></el-option> |
|
||||
<el-option label="产品资料" value="产品资料"></el-option> |
|
||||
|
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="审批结果:"> |
|
||||
<el-select v-model="completedSearchData.status" style="width: 130px" clearable> |
|
||||
<el-option label="全部" value=""></el-option> |
|
||||
<el-option label="已同意" value="APPROVED"></el-option> |
|
||||
<el-option label="已驳回" value="REJECTED"></el-option> |
|
||||
</el-select> |
|
||||
</el-form-item> |
|
||||
<el-form-item label=" "> |
|
||||
<el-button class="customer-bun-min" type="primary" @click="getCompletedList">查询</el-button> |
|
||||
</el-form-item> |
|
||||
</el-col> |
|
||||
</el-row> |
|
||||
</el-form> |
|
||||
|
|
||||
<el-table |
|
||||
:height="height" |
|
||||
:data="completedList" |
|
||||
border |
|
||||
ref="completedTable" |
|
||||
highlight-current-row |
|
||||
v-loading="completedLoading" |
|
||||
style="margin-top: 0px; width: 100%;"> |
|
||||
<el-table-column prop="applyNo" label="单据号" min-width="150" header-align="center" align="center"></el-table-column> |
|
||||
<el-table-column prop="orderType" label="单据类型" min-width="100" header-align="center" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
|
|
||||
<span>{{ scope.row.orderType }}</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="flowName" label="流程名称" min-width="150" header-align="center" align="left"></el-table-column> |
|
||||
<el-table-column prop="nodeName" label="审批节点" min-width="120" header-align="center" align="center"></el-table-column> |
|
||||
<el-table-column prop="assigneeName" label="审批人" min-width="100" header-align="center" align="center"></el-table-column> |
|
||||
<el-table-column prop="statusDesc" label="审批结果" min-width="100" header-align="center" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span :style="{ color: scope.row.status === 'APPROVED' ? '#67C23A' : '#F56C6C' }"> |
|
||||
{{ scope.row.statusDesc }} |
|
||||
</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="comment" label="审批意见" min-width="180" header-align="center" align="left" show-overflow-tooltip></el-table-column> |
|
||||
<el-table-column prop="actionTime" label="审批时间" min-width="150" header-align="center" align="center"></el-table-column> |
|
||||
<el-table-column fixed="right" header-align="center" align="center" width="100" label="操作"> |
|
||||
<template slot-scope="scope"> |
|
||||
<el-link style="cursor: pointer" @click="viewHistory(scope.row)">审批记录</el-link> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
|
|
||||
<el-pagination |
|
||||
style="margin-top: 0px" |
|
||||
@size-change="completedSizeChange" |
|
||||
@current-change="completedPageChange" |
|
||||
:current-page="completedPageIndex" |
|
||||
:page-sizes="[20, 50, 100, 200]" |
|
||||
:page-size="completedPageSize" |
|
||||
:total="completedTotal" |
|
||||
layout="total, sizes, prev, pager, next, jumper"> |
|
||||
</el-pagination> |
|
||||
</el-tab-pane> |
|
||||
</el-tabs> |
|
||||
|
|
||||
<!-- 审批对话框 --> |
|
||||
<el-dialog |
|
||||
:title="approvalTitle" |
|
||||
:visible.sync="approvalDialogVisible" |
|
||||
width="500px" |
|
||||
:close-on-click-modal="false" |
|
||||
v-drag> |
|
||||
<el-form :model="approvalData" label-position="top"> |
|
||||
<el-form-item label="单据号"> |
|
||||
<el-input v-model="approvalData.applyNo" disabled></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="当前节点"> |
|
||||
<el-input v-model="approvalData.nodeName" disabled></el-input> |
|
||||
</el-form-item> |
|
||||
<el-form-item label="审批意见" :required="approvalAction === 'reject'"> |
|
||||
<el-input type="textarea" v-model="approvalData.comment" :rows="3" placeholder="请输入审批意见"></el-input> |
|
||||
</el-form-item> |
|
||||
</el-form> |
|
||||
<span slot="footer" class="dialog-footer"> |
|
||||
<el-button type="primary" @click="submitApproval" :loading="approvalLoading">{{ approvalLoading ? '提交中...' : '确定' }}</el-button> |
|
||||
<el-button type="info" @click="openFlowPreview">流程预览</el-button> |
|
||||
<el-button @click="approvalDialogVisible = false" :disabled="approvalLoading">取消</el-button> |
|
||||
</span> |
|
||||
</el-dialog> |
|
||||
|
|
||||
<!-- 流程预览对话框 - rqrq --> |
|
||||
<el-dialog |
|
||||
title="流程预览" |
|
||||
:visible.sync="previewDialogVisible" |
|
||||
width="700px" |
|
||||
:close-on-click-modal="false" |
|
||||
append-to-body |
|
||||
v-drag> |
|
||||
<div style="margin-bottom: 15px;"> |
|
||||
<span style="font-weight: bold;">流程名称:</span>{{ previewData.flowName }} |
|
||||
<span style="margin-left: 20px; font-weight: bold;">流程编码:</span>{{ previewData.flowCode }} |
|
||||
<span style="margin-left: 20px; font-weight: bold;">版本:</span>{{ previewData.flowVersion }} |
|
||||
</div> |
|
||||
<el-table :data="previewData.nodeList" border style="width: 100%;"> |
|
||||
<el-table-column prop="nodeOrder" label="顺序" width="60" header-align="center" align="center"> |
|
||||
<template slot-scope="scope">{{ scope.$index + 1 }}</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="nodeCode" label="节点编码" min-width="100" header-align="center" align="center"></el-table-column> |
|
||||
<el-table-column prop="nodeName" label="节点名称" min-width="120" header-align="center" align="center"></el-table-column> |
|
||||
<el-table-column prop="nodeType" label="节点类型" min-width="80" header-align="center" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-if="scope.row.nodeType === 'START'" style="color: #67C23A">开始</span> |
|
||||
<span v-else-if="scope.row.nodeType === 'END'" style="color: #F56C6C">结束</span> |
|
||||
<span v-else style="color: #409EFF">审批</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="approveType" label="审批类型" min-width="100" header-align="center" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span v-if="scope.row.approveType === 'SINGLE'">单人审批</span> |
|
||||
<span v-else-if="scope.row.approveType === 'ALL'">会签</span> |
|
||||
<span v-else-if="scope.row.approveType === 'ANY'">或签</span> |
|
||||
<span v-else>-</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="departmentName" label="审批部门" min-width="120" header-align="center" align="center"> |
|
||||
<template slot-scope="scope">{{ scope.row.departmentName || '-' }}</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="approverNames" label="审批人" min-width="150" header-align="center" align="left"> |
|
||||
<template slot-scope="scope">{{ scope.row.approverNames || '-' }}</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<span slot="footer" class="dialog-footer"> |
|
||||
<el-button type="primary" @click="previewDialogVisible = false">关闭</el-button> |
|
||||
</span> |
|
||||
</el-dialog> |
|
||||
|
|
||||
<!-- 审批记录对话框 --> |
|
||||
<el-dialog |
|
||||
title="审批记录" |
|
||||
:visible.sync="historyDialogVisible" |
|
||||
width="800px" |
|
||||
:close-on-click-modal="false" |
|
||||
v-drag> |
|
||||
<el-table :data="historyList" border style="width: 100%;"> |
|
||||
<el-table-column prop="nodeName" label="节点" min-width="100" header-align="center" align="center"></el-table-column> |
|
||||
<el-table-column prop="assigneeName" label="审批人" min-width="100" header-align="center" align="center"></el-table-column> |
|
||||
<el-table-column prop="statusDesc" label="结果" min-width="80" header-align="center" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
<span :style="{ color: scope.row.status === 'APPROVED' ? '#67C23A' : (scope.row.status === 'REJECTED' ? '#F56C6C' : '#909399') }"> |
|
||||
{{ scope.row.statusDesc }} |
|
||||
</span> |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
<el-table-column prop="comment" label="审批意见" min-width="180" header-align="center" align="left" show-overflow-tooltip></el-table-column> |
|
||||
<el-table-column prop="actionTime" label="审批时间" min-width="150" header-align="center" align="center"> |
|
||||
<template slot-scope="scope"> |
|
||||
{{ scope.row.actionTime || '-' }} |
|
||||
</template> |
|
||||
</el-table-column> |
|
||||
</el-table> |
|
||||
<span slot="footer" class="dialog-footer"> |
|
||||
<el-button type="primary" @click="historyDialogVisible = false">关闭</el-button> |
|
||||
</span> |
|
||||
</el-dialog> |
|
||||
</div> |
|
||||
</template> |
|
||||
|
|
||||
<script> |
|
||||
import { |
|
||||
searchPendingTaskList, |
|
||||
searchCompletedTaskList, |
|
||||
approveTask, |
|
||||
rejectTask, |
|
||||
getApprovalHistory, |
|
||||
getFlowPreview |
|
||||
} from '@/api/workFlow/workFlow.js' |
|
||||
|
|
||||
export default { |
|
||||
data() { |
|
||||
return { |
|
||||
height: 400, |
|
||||
activeTab: 'pending', |
|
||||
// 待办任务 |
|
||||
pendingLoading: false, |
|
||||
pendingList: [], |
|
||||
pendingPageIndex: 1, |
|
||||
pendingPageSize: 20, |
|
||||
pendingTotal: 0, |
|
||||
searchData: { |
|
||||
site: this.$store.state.user.site, |
|
||||
applyNo: '', |
|
||||
orderType: '' |
|
||||
}, |
|
||||
// 已办任务 |
|
||||
completedLoading: false, |
|
||||
completedList: [], |
|
||||
completedPageIndex: 1, |
|
||||
completedPageSize: 20, |
|
||||
completedTotal: 0, |
|
||||
completedSearchData: { |
|
||||
site: this.$store.state.user.site, |
|
||||
applyNo: '', |
|
||||
orderType: '', |
|
||||
status: '' |
|
||||
}, |
|
||||
// 审批对话框 |
|
||||
approvalDialogVisible: false, |
|
||||
approvalTitle: '审批', |
|
||||
approvalAction: '', |
|
||||
approvalLoading: false, |
|
||||
approvalData: { |
|
||||
id: null, |
|
||||
applyNo: '', |
|
||||
nodeName: '', |
|
||||
comment: '', |
|
||||
flowCode: '', |
|
||||
flowVersion: null, |
|
||||
site: '' |
|
||||
}, |
|
||||
// 审批记录 |
|
||||
historyDialogVisible: false, |
|
||||
historyList: [], |
|
||||
// 当前登录用户 - rqrq |
|
||||
currentUser: this.$store.state.user.username, |
|
||||
// 流程预览 - rqrq |
|
||||
previewDialogVisible: false, |
|
||||
previewData: { |
|
||||
flowCode: '', |
|
||||
flowName: '', |
|
||||
flowVersion: '', |
|
||||
nodeList: [] |
|
||||
} |
|
||||
} |
|
||||
}, |
|
||||
mounted() { |
|
||||
this.$nextTick(() => { |
|
||||
this.height = (window.innerHeight - 300) |
|
||||
} ) |
|
||||
this.getPendingList() |
|
||||
}, |
|
||||
methods: { |
|
||||
handleTabClick(tab) { |
|
||||
if (tab.name === 'pending') { |
|
||||
this.getPendingList() |
|
||||
} else { |
|
||||
this.getCompletedList() |
|
||||
} |
|
||||
}, |
|
||||
// 待办任务 |
|
||||
getPendingList() { |
|
||||
this.pendingLoading = true |
|
||||
const params = { |
|
||||
...this.searchData, |
|
||||
limit: this.pendingPageSize, |
|
||||
page: this.pendingPageIndex |
|
||||
} |
|
||||
searchPendingTaskList(params).then(({ data }) => { |
|
||||
if (data && data.code === 0) { |
|
||||
this.pendingList = data.page.list |
|
||||
this.pendingTotal = data.page.totalCount |
|
||||
} |
|
||||
this.pendingLoading = false |
|
||||
}) |
|
||||
}, |
|
||||
pendingSizeChange(val) { |
|
||||
this.pendingPageSize = val |
|
||||
this.pendingPageIndex = 1 |
|
||||
this.getPendingList() |
|
||||
}, |
|
||||
pendingPageChange(val) { |
|
||||
this.pendingPageIndex = val |
|
||||
this.getPendingList() |
|
||||
}, |
|
||||
// 已办任务 |
|
||||
getCompletedList() { |
|
||||
this.completedLoading = true |
|
||||
const params = { |
|
||||
...this.completedSearchData, |
|
||||
limit: this.completedPageSize, |
|
||||
page: this.completedPageIndex |
|
||||
} |
|
||||
searchCompletedTaskList(params).then(({ data }) => { |
|
||||
if (data && data.code === 0) { |
|
||||
this.completedList = data.page.list |
|
||||
this.completedTotal = data.page.totalCount |
|
||||
} |
|
||||
this.completedLoading = false |
|
||||
}) |
|
||||
}, |
|
||||
completedSizeChange(val) { |
|
||||
this.completedPageSize = val |
|
||||
this.completedPageIndex = 1 |
|
||||
this.getCompletedList() |
|
||||
}, |
|
||||
completedPageChange(val) { |
|
||||
this.completedPageIndex = val |
|
||||
this.getCompletedList() |
|
||||
}, |
|
||||
// 审批通过 |
|
||||
approveTask(row) { |
|
||||
this.approvalTitle = '审批通过' |
|
||||
this.approvalAction = 'approve' |
|
||||
this.approvalData = { |
|
||||
id: row.id, |
|
||||
applyNo: row.applyNo, |
|
||||
nodeName: row.nodeName, |
|
||||
comment: '', |
|
||||
flowCode: row.flowCode, |
|
||||
flowVersion: row.flowVersion, |
|
||||
site: row.site |
|
||||
} |
|
||||
this.approvalDialogVisible = true |
|
||||
}, |
|
||||
// 审批驳回 |
|
||||
rejectTask(row) { |
|
||||
this.approvalTitle = '审批驳回' |
|
||||
this.approvalAction = 'reject' |
|
||||
this.approvalData = { |
|
||||
id: row.id, |
|
||||
applyNo: row.applyNo, |
|
||||
nodeName: row.nodeName, |
|
||||
comment: '', |
|
||||
flowCode: row.flowCode, |
|
||||
flowVersion: row.flowVersion, |
|
||||
site: row.site |
|
||||
} |
|
||||
this.approvalDialogVisible = true |
|
||||
}, |
|
||||
// 提交审批 |
|
||||
submitApproval() { |
|
||||
if (this.approvalAction === 'reject' && !this.approvalData.comment) { |
|
||||
this.$message.warning('驳回时必须填写审批意见') |
|
||||
return |
|
||||
} |
|
||||
this.approvalLoading = true |
|
||||
const action = this.approvalAction === 'approve' ? approveTask : rejectTask |
|
||||
action(this.approvalData).then(({ data }) => { |
|
||||
if (data && data.code === 0) { |
|
||||
this.$message.success(this.approvalAction === 'approve' ? '审批通过成功' : '驳回成功') |
|
||||
this.approvalDialogVisible = false |
|
||||
this.getPendingList() |
|
||||
} else { |
|
||||
this.$message.error(data.msg || '操作失败') |
|
||||
} |
|
||||
}).finally(() => { |
|
||||
this.approvalLoading = false |
|
||||
}) |
|
||||
}, |
|
||||
// 查看审批记录 |
|
||||
viewHistory(row) { |
|
||||
getApprovalHistory({ |
|
||||
applyNo: row.applyNo, |
|
||||
site: row.site, |
|
||||
orderType: row.orderType |
|
||||
}).then(({ data }) => { |
|
||||
if (data && data.code === 0) { |
|
||||
this.historyList = data.rows |
|
||||
this.historyDialogVisible = true |
|
||||
} |
|
||||
}) |
|
||||
}, |
|
||||
// 流程预览 - rqrq |
|
||||
openFlowPreview() { |
|
||||
getFlowPreview({ |
|
||||
flowCode: this.approvalData.flowCode, |
|
||||
flowVersion: this.approvalData.flowVersion, |
|
||||
site: this.approvalData.site |
|
||||
}).then(({ data }) => { |
|
||||
if (data && data.code === 0) { |
|
||||
this.previewData = data.row |
|
||||
this.previewDialogVisible = true |
|
||||
} else { |
|
||||
this.$message.error(data.msg || '获取流程信息失败') |
|
||||
} |
|
||||
}) |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
</script> |
|
||||
|
|
||||
<style scoped> |
|
||||
/deep/ .el-tabs__content { |
|
||||
padding: 10px; |
|
||||
} |
|
||||
</style> |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue