流程配置:存档节点按组编辑(ADR 0015)

收据申请单、设施价格表的存档节点是「报送人 + 部门负责人」分组确认,页面
只在会签节点显示分组,这两条流程打开时分组看不见、单解析器为空,而隐藏的
groups 仍随表单提交,保存必然被后端拦下。

- 分组区块对会签、存档都显示,文案分开:会签组(组内或签,组间会签)/
  确认组(各组都确认后才前进)
- 存档节点配了组就隐藏单解析器,添加组时清空已填的解析器
- 节点类型切换只清「不支持分组」类型的组,存档节点保留分组
This commit is contained in:
2026-11-01 19:39:31 +08:00
parent 07141566a3
commit 0f4085c2be
2 changed files with 39 additions and 7 deletions
@@ -57,7 +57,7 @@
<a-select v-model:value="form.type" :options="NODE_TYPE_OPTIONS" />
</a-form-item>
</a-col>
<a-col v-if="form.type !== 'COUNTERSIGN'" :md="8" :sm="24">
<a-col v-if="showResolver" :md="8" :sm="24">
<a-form-item label="审批人解析器">
<a-select
v-model:value="form.resolver"
@@ -88,11 +88,11 @@
</a-col>
</a-row>
<div v-if="form.type === 'COUNTERSIGN'" class="node-section">
<div v-if="groupEditable" class="node-section">
<div class="node-section-title">
<span>会签组(组内或签,组间会签)</span>
<span>{{ groupTitle }}</span>
<a-button type="link" size="small" @click="addGroup">
添加会签组
{{ groupAddText }}
</a-button>
</div>
<a-row
@@ -185,6 +185,7 @@
<script lang="ts" setup>
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 = [];
}
}
+3
View File
@@ -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);