chore: 流程申请支持上传文件
This commit is contained in:
parent
a320bc3778
commit
4439533b09
@ -1,6 +1,8 @@
|
|||||||
<!-- 流程发起(启动)的弹窗 -->
|
<!-- 流程发起(启动)的弹窗 -->
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { CompleteTaskReqData } from '#/api/workflow/task/model';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
@ -56,6 +58,29 @@ const [BasicForm, formApi] = useVbenForm({
|
|||||||
label: '通知方式',
|
label: '通知方式',
|
||||||
defaultValue: ['1'],
|
defaultValue: ['1'],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
fieldName: 'attachment',
|
||||||
|
component: 'FileUpload',
|
||||||
|
componentProps: {
|
||||||
|
resultField: 'ossId',
|
||||||
|
maxNumber: 10,
|
||||||
|
maxSize: 20,
|
||||||
|
accept: [
|
||||||
|
'png',
|
||||||
|
'jpg',
|
||||||
|
'jpeg',
|
||||||
|
'doc',
|
||||||
|
'docx',
|
||||||
|
'xlsx',
|
||||||
|
'xls',
|
||||||
|
'ppt',
|
||||||
|
'pdf',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
defaultValue: [],
|
||||||
|
label: '附件上传',
|
||||||
|
formItemClass: 'items-baseline',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'flowCopyList',
|
fieldName: 'flowCopyList',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
@ -70,7 +95,9 @@ const [BasicForm, formApi] = useVbenForm({
|
|||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
try {
|
try {
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
const { messageType, flowCopyList } = cloneDeep(await formApi.getValues());
|
const { messageType, flowCopyList, attachment } = cloneDeep(
|
||||||
|
await formApi.getValues(),
|
||||||
|
);
|
||||||
const { taskId, taskVariables, variables } =
|
const { taskId, taskVariables, variables } =
|
||||||
modalApi.getData() as ModalProps;
|
modalApi.getData() as ModalProps;
|
||||||
// 需要转换数据 抄送人员
|
// 需要转换数据 抄送人员
|
||||||
@ -78,14 +105,15 @@ async function handleSubmit() {
|
|||||||
userId: item.userId,
|
userId: item.userId,
|
||||||
userName: item.nickName,
|
userName: item.nickName,
|
||||||
}));
|
}));
|
||||||
const data = {
|
const requestData = {
|
||||||
|
fileId: attachment.join(','),
|
||||||
messageType,
|
messageType,
|
||||||
flowCopyList: flowCCList,
|
flowCopyList: flowCCList,
|
||||||
taskId,
|
taskId,
|
||||||
taskVariables,
|
taskVariables,
|
||||||
variables,
|
variables,
|
||||||
};
|
} as CompleteTaskReqData;
|
||||||
await completeTask(data);
|
await completeTask(requestData);
|
||||||
modalApi.close();
|
modalApi.close();
|
||||||
emit('complete');
|
emit('complete');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user