feat: 审批预选人(草稿)

fix: 对于非主表字段不显示响应式布局相关配置项
This commit is contained in:
gaoyunqi
2024-03-01 18:18:27 +08:00
parent ad5c45a281
commit 9ed70d1dde
5 changed files with 83 additions and 45 deletions

View File

@ -418,7 +418,8 @@
</template>
</a-input>
</a-form-item>
<!-- 子表不需要span -->
<!-- 响应式布局只对主表字段生效 -->
<template v-if="!data.isSubFormChild">
<a-form-item v-if="hasKey('responsive')" label="响应式">
<a-switch v-model:checked="data.options.responsive" />
</a-form-item>
@ -437,7 +438,8 @@
<a-form-item v-if="hasKey('labelWidthMode') && data.options.labelWidthMode === 'fix'" label="标签定宽">
<a-input-number v-model:value="data.options.labelFixWidth" :max="200" :min="40" addonAfter="px" />
</a-form-item>
</template>
<!-- 子表不需要span -->
<a-form-item v-if="hasKey('span') && (!data.isSubFormChild || !data.isSingleFormChild)" label="标签宽度">
<a-input-number v-model:value="data.options.span" :max="24" :min="0" addonAfter="/ 24" @change="handleSpanChange" />
</a-form-item>

View File

@ -428,7 +428,6 @@
};
const getComponentsProps = (componentProps, dataIndex, record, index) => {
console.log('getComponentsProps', cacheMap.get(dataIndex), componentProps.disabled);
if (!componentProps) return;
if (isFunction(componentProps)) {
componentProps =

View File

@ -5,6 +5,9 @@
<a-form-item v-if="_action === 'agree'" label="下一节点" name="nextNodeName">
<span>{{ formState.nextNodeName }}</span>
</a-form-item>
<a-form-item v-if="_action === 'agree'" label="审批人">
<a-select v-model:value="formState.assignees" :options="nextAssignees" max-tag-count="responsive" mode="multiple" placeholder="请选择审批人"></a-select>
</a-form-item>
<a-form-item v-if="_action === 'reject'" label="退回至" name="rejectNode">
<a-select v-model:value="rejectNodeId">
<a-select-option v-for="(item, index) in rejectNodeList" :key="index" :value="item.activityId">{{ item.activityName }}</a-select-option>
@ -26,20 +29,23 @@
const isOpen = ref(false);
const rejectNodeList = ref([]);
const rejectNodeId = ref('');
const nextAssigneeName = ref(''); // 不可选审批人
const nextAssignees = ref([]);
let _action = ref('agree');
let _processId = '';
let _taskId = '';
let _nextNodes = [];
let _callback = null;
const formState = reactive({
nextNodeName: '',
opinion: '',
assignees: [],
opinionList: ['同意。', '请领导审批。']
});
function toggleDialog({ isClose, action, callback, processId, taskId } = {}) {
function toggleDialog({ isClose, action, callback, processId, taskId, nextNodes } = {}) {
if (isClose) {
isOpen.value = false;
return;
@ -49,8 +55,27 @@
_callback = callback;
_processId = processId;
_taskId = taskId;
_nextNodes = nextNodes;
formState.opinion = '';
dialogTitle.value = `审批`;
if (nextNodes && nextNodes.length === 1) {
// 下一个节点唯一时(可能有并行节点)
const nNode = nextNodes[0];
formState.nextNodeName = nNode.activityName;
if (nNode.chooseAssign) {
const selected = [];
nextAssignees.value = nNode.userList.map((item) => {
if (item.checked || nNode.userList.length === 1) {
// 只有一个人的时候必须选他
selected.push(item['F_UserId']);
}
return {
value: item['F_UserId'],
label: item['F_RealName']
};
});
}
}
if (action === 'reject') {
loadRejectNodeList();
}

View File

@ -3,7 +3,7 @@
<div class="geg-flow-page">
<div class="top-toolbar">
<a-space :size="10" wrap>
<a-button style="margin-right: 10px">
<a-button style="margin-right: 10px" @click="close">
<slot name="icon">
<close-outlined />
</slot>
@ -46,6 +46,7 @@
:opinionsComponents="data.opinionsComponents"
@get-form-configs="(config) => (formConfigs = config)"
/>
<Title :font-size="18" default-value="流转信息"></Title>
<opinion-dialog ref="opinionDlg" />
</div>
</div>
@ -56,14 +57,18 @@
import { onMounted, reactive, ref, unref } from 'vue';
import FormInformation from '/@/views/secondDev/FormInformation.vue';
import userTaskItem from '/@/views/workflow/task/hooks/userTaskItem';
import { getApprovalProcess, postApproval } from '/@/api/workflow/task';
import { getApprovalProcess, postApproval, postGetNextTaskMaybeArrival } from '/@/api/workflow/task';
import { ApproveCode, ApproveType } from '/@/enums/workflowEnum';
import { CheckCircleOutlined, StopOutlined, CloseOutlined, DownOutlined } from '@ant-design/icons-vue';
import OpinionDialog from '/@/components/SecondDev/OpinionDialog.vue';
import { separator } from '/@bpmn/config/info';
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
import Title from '/@/components/Title/src/Title.vue';
const { data, approveUserData, initProcessData, notificationError, notificationSuccess } = userTaskItem();
const tabStore = useMultipleTabStore();
const router = useRouter();
const currentRoute = router.currentRoute.value;
const rQuery = currentRoute.query;
@ -96,12 +101,19 @@
function onMoreClick() {}
function close() {
tabStore.closeTab(currentRoute, router);
}
async function onApproveClick() {
await submit();
const params = await getApproveParams();
const nextNodes = await postGetNextTaskMaybeArrival(params);
approvalData.approvedType = ApproveType.AGREE;
approvalData.approvedResult = ApproveCode.AGREE;
opinionDlg.value.toggleDialog({
action: 'agree'
action: 'agree',
nextNodes
});
}
@ -203,13 +215,11 @@
return fileFolderIds;
}
async function onFinish(values) {
try {
if (/*validateSuccess.value*/ true) {
async function getApproveParams(){
let formModels = await formInformation.value.getFormModels();
let system = formInformation.value.getSystemType();
let fileFolderIds = getUploadFileFolderIds(formModels);
let params = {
return {
approvedType: approvalData.approvedType,
approvedResult: approvalData.approvedResult, // approvalData.approvedType 审批结果 如果为 4 就需要传buttonCode
approvedContent: approvalData.approvedContent,
@ -218,11 +228,16 @@
taskId: taskId.value,
fileFolderIds,
circulateConfigs: approvalData.circulateConfigs,
stampId: values.stampId,
stampPassword: values.password,
/*stampId: values.stampId,
stampPassword: values.password,*/
isOldSystem: system
};
}
async function onFinish(values) {
try {
if (/*validateSuccess.value*/ true) {
let params = await getApproveParams();
let res = await postApproval(params);
// 下一节点审批人
let taskList = [];

View File

@ -406,9 +406,6 @@
stampPassword: values.password,
isOldSystem: system,
};
let result=await postGetNextTaskMaybeArrival(params);
console.info(result);
//return;
let res = await postApproval(params);
// 下一节点审批人
let taskList: Array<ApproveTask> = [];