commit:同步2.0版本(添加指定审批人功能)

This commit is contained in:
Jerry
2021-10-22 09:50:54 +08:00
parent 3be97f79c0
commit 45de390cc2
321 changed files with 19171 additions and 40 deletions

View File

@@ -101,6 +101,11 @@ const SysFlowTaskOperationType = new DictionaryBase('任务操作类型', [
id: 'multi_abstain',
name: '弃权(会签)',
symbol: 'MULTI_ABSTAIN'
},
{
id: 'set_assignee',
name: '指定审批人',
symbol: 'SET_ASSIGNEE'
}
]);
Vue.prototype.SysFlowTaskOperationType = SysFlowTaskOperationType;

View File

@@ -35,12 +35,15 @@
</template>
</el-upload>
<template v-else>
<template v-for="item in uploadWidgetImpl.fileList">
<img class="table-cell-image" v-if="widgetConfig.isImage" :key="item.url" :src="item.url" />
<a v-else :key="item.url" href="javascript:void(0);" @click="downloadFile(item.url, item.name)">
{{item.name}}
</a>
<template v-if="widgetConfig.isImage">
<el-image v-for="item in uploadWidgetImpl.fileList"
:preview-src-list="(uploadWidgetImpl.fileList || []).map(imgItem => imgItem.url)"
class="table-cell-image" :key="item.url" :src="item.url" fit="fill">
</el-image>
</template>
<a v-else v-for="item in uploadWidgetImpl.fileList" :key="item.url" href="javascript:void(0);" @click="downloadFile(item.url, item.name)">
{{item.name}}
</a>
</template>
</el-form-item>
</el-col>

View File

@@ -136,6 +136,7 @@ export default {
case this.SysFlowTaskOperationType.CO_SIGN:
case this.SysFlowTaskOperationType.MULTI_AGREE:
case this.SysFlowTaskOperationType.MULTI_SIGN:
case this.SysFlowTaskOperationType.SET_ASSIGNEE:
return 'primary';
case this.SysFlowTaskOperationType.SAVE:
return 'success';
@@ -150,6 +151,7 @@ export default {
switch (type) {
case this.SysFlowTaskOperationType.AGREE:
case this.SysFlowTaskOperationType.MULTI_AGREE:
case this.SysFlowTaskOperationType.SET_ASSIGNEE:
return 'success';
case this.SysFlowTaskOperationType.REFUSE:
case this.SysFlowTaskOperationType.PARALLEL_REFUSE:

View File

@@ -74,6 +74,7 @@ export default {
this.$dialog.show('选择用户', TaskUserSelect, {
area: ['1000px', '600px']
}, {
showAssignee: false,
multiple: this.multiSelect
}).then(res => {
let assignee = null;
@@ -88,7 +89,12 @@ export default {
},
computed: {
showAssignSelect () {
return [this.SysFlowTaskOperationType.TRANSFER, this.SysFlowTaskOperationType.CO_SIGN, this.SysFlowTaskOperationType.MULTI_SIGN].indexOf(this.operation.type) !== -1;
return [
this.SysFlowTaskOperationType.TRANSFER,
this.SysFlowTaskOperationType.CO_SIGN,
this.SysFlowTaskOperationType.MULTI_SIGN,
this.SysFlowTaskOperationType.SET_ASSIGNEE
].indexOf(this.operation.type) !== -1;
},
multiSelect () {
return this.operation.type === this.SysFlowTaskOperationType.CO_SIGN || this.operation.type === this.SysFlowTaskOperationType.MULTI_SIGN;

View File

@@ -13,6 +13,9 @@
<el-button type="primary" size="mini" @click="setStartUser">
流程发起人
</el-button>
<el-button v-if="showAssignee" type="primary" size="mini" @click="useAppointedAssignee">
使用指定审批人
</el-button>
<el-button type="primary" size="mini" @click="onSubmit" :disabled="!canCommit">
添加用户
</el-button>
@@ -77,6 +80,11 @@ import { SystemController } from '@/api';
export default {
name: 'TaskUserSelect',
props: {
// 是否显示指定审批人
showAssignee: {
type: Boolean,
default: true
},
// 是否多选
multiple: {
type: Boolean,
@@ -122,6 +130,12 @@ export default {
loginName: '${startUserName}'
});
},
useAppointedAssignee () {
this.onCancel(true, {
/* eslint-disable-next-line */
loginName: '${appointedAssignee}'
});
},
canSelect (row) {
if (Array.isArray(this.usedUserIdList) && this.usedUserIdList.length > 0) {
return this.usedUserIdList.indexOf(row.loginName) === -1;

View File

@@ -136,10 +136,15 @@ export default {
if (this.isOnlineForm) {
this.$refs.workflowForm.getFormData().then(formData => {
formData.taskVariableData = this.$refs.workflowForm.getVariableData(this.variableList);
// 会签操作设置多实例处理人集合
if (operationType === this.SysFlowTaskOperationType.MULTI_SIGN) {
// 会签操作设置多实例处理人集合
if (formData.taskVariableData == null) formData.taskVariableData = {};
formData.taskVariableData.assigneeList = assignee.split(',');
} else if (operationType === this.SysFlowTaskOperationType.SET_ASSIGNEE) {
// 设置下一个任务节点处理人
if (formData.taskVariableData == null) formData.taskVariableData = {};
formData.taskVariableData.appointedAssignee = assignee;
}
resolve(formData);
}).catch(e => {

View File

@@ -50,8 +50,8 @@ export default {
isStart ? resolve() : reject();
return;
}
// 会签或者审批操作
if (!isStart || operation.type === this.SysFlowTaskOperationType.MULTI_SIGN) {
// 会签、指定审批人或者审批操作
if (!isStart || operation.type === this.SysFlowTaskOperationType.MULTI_SIGN || operation.type === this.SysFlowTaskOperationType.SET_ASSIGNEE) {
let title = isStart ? '提交' : (operation.type === this.SysFlowTaskOperationType.CO_SIGN ? '加签' : '审批');
this.$dialog.show(title, TaskCommit, {
area: '500px'