diff --git a/src/views/approval/flow/components/node-card.vue b/src/views/approval/flow/components/node-card.vue
index e10824b..12c989a 100644
--- a/src/views/approval/flow/components/node-card.vue
+++ b/src/views/approval/flow/components/node-card.vue
@@ -57,7 +57,7 @@
-
+
-
+
-
会签组(组内或签,组间会签)
+
{{ groupTitle }}
- 添加会签组
+ {{ groupAddText }}
import { computed, reactive, watch } from 'vue';
import {
+ GROUP_TYPES,
NODE_TYPE_OPTIONS,
ORG_RESOLVERS,
WRITABLE_TYPES,
@@ -228,6 +229,28 @@
const isAttachmentNode = computed(() => form.type !== 'DISPATCH');
+ /* 会签必配组;存档可选配组(多组全部确认才前进),配了组就改用组而不再配单解析器 */
+ const groupEditable = computed(() => GROUP_TYPES.indexOf(form.type) !== -1);
+
+ const hasGroups = computed(() => (form.groups || []).length > 0);
+
+ const showResolver = computed(() => {
+ return (
+ form.type !== 'COUNTERSIGN' &&
+ !(form.type === 'CONFIRM' && hasGroups.value)
+ );
+ });
+
+ const groupTitle = computed(() => {
+ return form.type === 'CONFIRM'
+ ? '确认组(各组都确认后才前进)'
+ : '会签组(组内或签,组间会签)';
+ });
+
+ const groupAddText = computed(() => {
+ return form.type === 'CONFIRM' ? '添加确认组' : '添加会签组';
+ });
+
const isOrgResolver = (resolver?: string) => {
return !!resolver && ORG_RESOLVERS.indexOf(resolver) !== -1;
};
@@ -258,12 +281,18 @@
});
const addGroup = () => {
+ const seq = (form.groups ? form.groups.length : 0) + 1;
const group: ApprovalFlowNodeGroup = {
- key: 'group' + ((form.groups ? form.groups.length : 0) + 1),
- name: '会签组' + ((form.groups ? form.groups.length : 0) + 1),
+ key: 'group' + seq,
+ name: (form.type === 'CONFIRM' ? '确认组' : '会签组') + seq,
resolver: 'orgLeaderByCode'
};
form.groups = [...(form.groups || []), group];
+ /* 存档节点开始用组,就不再保留单解析器(后端按组优先,留着会被忽略) */
+ if (form.type === 'CONFIRM') {
+ form.resolver = undefined;
+ form.orgCode = undefined;
+ }
};
const removeGroup = (index: number) => {
@@ -296,7 +325,7 @@
if (!form.groups || !form.groups.length) {
addGroup();
}
- } else if (form.groups && form.groups.length) {
+ } else if (type !== 'CONFIRM' && form.groups && form.groups.length) {
form.groups = [];
}
}
diff --git a/src/views/approval/flow/constants.ts b/src/views/approval/flow/constants.ts
index 8ca14d5..ecb2bc0 100644
--- a/src/views/approval/flow/constants.ts
+++ b/src/views/approval/flow/constants.ts
@@ -24,6 +24,9 @@ export const ORG_RESOLVERS = ['orgLeaderByCode', 'orgDeputyByCode'];
/** 可配置回填字段的节点类型 */
export const WRITABLE_TYPES = ['APPROVE', 'COUNTERSIGN', 'CONFIRM'];
+/** 可按组配置审批人的节点类型:会签组必填,存档组可选(多组全部确认才前进) */
+export const GROUP_TYPES = ['COUNTERSIGN', 'CONFIRM'];
+
/** 节点类型显示名 */
export function nodeTypeLabel(type?: string) {
const item = NODE_TYPE_LABELS.find((option) => option.value === type);