diff --git a/src/components/custom/file-upload.vue b/src/components/custom/file-upload.vue index b61b2373..62c0b80c 100644 --- a/src/components/custom/file-upload.vue +++ b/src/components/custom/file-upload.vue @@ -37,11 +37,11 @@ const value = defineModel('value', { required: false, defau let fileNum = 0; const fileList = ref([]); -const needRelaodData = defineModel('needRelaodData', { - default: false -}); + +const needRelaodData = ref(false); defineExpose({ - refreshList: needRelaodData + refreshList: needRelaodData, + fileList }); watch( () => fileList.value, diff --git a/src/components/custom/workflow-task-apply-modal.vue b/src/components/custom/workflow-task-apply-modal.vue new file mode 100644 index 00000000..d1cf049f --- /dev/null +++ b/src/components/custom/workflow-task-apply-modal.vue @@ -0,0 +1,103 @@ + + + diff --git a/src/constants/workflow.ts b/src/constants/workflow.ts index 41597fff..67630f6a 100644 --- a/src/constants/workflow.ts +++ b/src/constants/workflow.ts @@ -1,5 +1,24 @@ import { transformRecordToOption } from '@/utils/common'; +export const messageTypeRecord: Record = { + '1': '站内信', + '2': '邮件', + '3': '短信' +}; + +export const messageTypeOptions = transformRecordToOption(messageTypeRecord); + +export const flowCodeTypeRecord: Record = { + leave1: '请假申请-普通', + leave2: '请假申请-排他网关', + leave3: '请假申请-并行网关', + leave4: '请假申请-会签', + leave5: '请假申请-并行会签网关', + leave6: '请假申请-排他并行会签' +}; + +export const flowCodeTypeOptions = transformRecordToOption(flowCodeTypeRecord); + /** leave type */ export const leaveTypeRecord: Record = { '1': '事假', diff --git a/src/service/api/workflow/index.ts b/src/service/api/workflow/index.ts index 5715d87f..ed579949 100644 --- a/src/service/api/workflow/index.ts +++ b/src/service/api/workflow/index.ts @@ -2,3 +2,4 @@ export * from './category'; export * from './leave'; export * from './instance'; export * from './definition'; +export * from './task'; diff --git a/src/service/api/workflow/leave.ts b/src/service/api/workflow/leave.ts index d019ab41..a32f208c 100644 --- a/src/service/api/workflow/leave.ts +++ b/src/service/api/workflow/leave.ts @@ -18,7 +18,7 @@ export function fetchGetLeaveDetail(id: CommonType.IdType) { /** 新增请假申请 */ export function fetchCreateLeave(data: Api.Workflow.LeaveOperateParams) { - return request({ + return request({ url: '/workflow/leave', method: 'post', data @@ -27,7 +27,7 @@ export function fetchCreateLeave(data: Api.Workflow.LeaveOperateParams) { /** 修改请假申请 */ export function fetchUpdateLeave(data: Api.Workflow.LeaveOperateParams) { - return request({ + return request({ url: '/workflow/leave', method: 'put', data diff --git a/src/service/api/workflow/task.ts b/src/service/api/workflow/task.ts new file mode 100644 index 00000000..ad405031 --- /dev/null +++ b/src/service/api/workflow/task.ts @@ -0,0 +1,27 @@ +import { request } from '@/service/request'; + +/** 启动任务 */ +export function fetchStartWorkflow(data: Api.Workflow.StartWorkflowOperateParams) { + return request({ + url: '/workflow/task/startWorkFlow', + method: 'post', + data + }); +} + +/** 获取任务 */ +export function fetchGetTask(taskId: CommonType.IdType) { + return request({ + url: `/workflow/task/getTask/${taskId}`, + method: 'get' + }); +} + +/** 完成任务 */ +export function fetchCompleteTask(data: Api.Workflow.CompleteTaskOperateParams) { + return request({ + url: '/workflow/task/completeTask', + method: 'post', + data + }); +} diff --git a/src/typings/api/workflow.api.d.ts b/src/typings/api/workflow.api.d.ts index e1fd637d..e288bd9e 100644 --- a/src/typings/api/workflow.api.d.ts +++ b/src/typings/api/workflow.api.d.ts @@ -10,6 +10,8 @@ declare namespace Api { * backend api module: "Workflow" */ namespace Workflow { + /** 流程类型 */ + type FlowCodeType = 'leave1' | 'leave2' | 'leave3' | 'leave4' | 'leave5' | 'leave6'; /** 请假状态 */ type LeaveType = '1' | '2' | '3' | '4'; /** leave */ @@ -198,5 +200,127 @@ declare namespace Api { /** 作废原因 */ comment: string; }>; + + /** 启动流程操作参数 */ + type StartWorkflowOperateParams = CommonType.RecordNullable<{ + /** 流程定义ID */ + flowCode: string; + /** 业务ID */ + businessId: CommonType.IdType; + /** 变量 */ + variables: { [key: string]: any }; + }>; + + /** 启动流程结果 */ + type StartWorkflowResult = CommonType.RecordNullable<{ + /** 流程实例ID */ + processInstanceId: CommonType.IdType; + /** 任务ID */ + taskId: CommonType.IdType; + }>; + + /** 抄送人 */ + type FlowCopy = CommonType.RecordNullable<{ + /** 用户ID */ + userId: CommonType.IdType; + /** 用户名称 */ + userName: string; + }>; + /** 按钮权限 */ + type ButtonPermission = CommonType.RecordNullable<{ + /** 唯一编码 */ + code: CommonType.IdType; + /** 选项值 */ + value: string; + /** 是否显示 */ + show: boolean; + }>; + /** 任务详情 */ + type Task = Common.CommonRecord<{ + /** 任务ID */ + id: CommonType.IdType; + /** 租户编号 */ + tenantId: CommonType.IdType; + /** 删除标志 */ + delFlag: number; + /** 流程定义ID */ + definitionId: CommonType.IdType; + /** 流程实例ID */ + instanceId: CommonType.IdType; + /** 业务ID */ + businessId: CommonType.IdType; + /** 节点编码 */ + nodeCode: string; + /** 节点类型 */ + nodeType: WorkflowNodeType; + /** 权限列表 */ + permissionList: string[]; + /** 用户列表 */ + userList: any[]; + /** 审批表单是否自定义 */ + formCustom: Api.Common.YesOrNoStatus; + /** 审批表单路径 */ + formPath: string; + /** 流程状态 */ + flowStatus: string; + /** 流程状态名称 */ + flowStatusName: string; + /** 分类ID */ + category: CommonType.IdType; + /** 分类名称 */ + categoryName: string; + /** 类型 */ + type: string; + /** 审批人 */ + assigneeIds: string; + /** 审批人名称 */ + assigneeNames: string; + /** 审批人 */ + processedBy: string; + /** 审批人名称 */ + processedByName: string; + /** 流程签署比例值 大于0为票签,会签 */ + nodeRatio: string; + /** 创建人名称 */ + createByName: string; + /** 是否为申请人节点 */ + applyNode: string; + /** 按钮列表 */ + buttonList: ButtonPermission[]; + /** 节点名称 */ + nodeName: string; + /** 流程定义名称 */ + flowName: string; + /** 流程定义编码 */ + flowCode: string; + /** 流程版本号 */ + version: string; + }>; + /** 消息类型 */ + type MessageType = '1' | '2' | '3'; + + /** 完成任务操作参数 */ + type CompleteTaskOperateParams = CommonType.RecordNullable<{ + /** 任务ID */ + taskId: CommonType.IdType; + /** 文件ID */ + fileId: CommonType.IdType; + /** 抄送人 */ + flowCopyList: FlowCopy[]; + /** 消息类型 */ + messageType: string[]; + /** 消息 */ + message: string; + /** 通知 */ + notice: string; + /** 任务变量 */ + taskVariables: { [key: string]: any }; + /** 变量 */ + variables: { [key: string]: any }; + /** 审批人 */ + assigneeMap: { [key: string]: string }; + /** 扩展字段 */ + ext: string; + }>; } } diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 2549701d..f55964ad 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -55,6 +55,7 @@ declare module 'vue' { IconUilSearch: typeof import('~icons/uil/search')['default'] JsonPreview: typeof import('./../components/custom/json-preview.vue')['default'] LangSwitch: typeof import('./../components/common/lang-switch.vue')['default'] + LeaveForm: typeof import('../components/custom/workflow-leave-form.vue')['default'] LookForward: typeof import('./../components/custom/look-forward.vue')['default'] MenuToggler: typeof import('./../components/common/menu-toggler.vue')['default'] MenuTree: typeof import('./../components/custom/menu-tree.vue')['default'] @@ -68,6 +69,7 @@ declare module 'vue' { NButton: typeof import('naive-ui')['NButton'] NCard: typeof import('naive-ui')['NCard'] NCheckbox: typeof import('naive-ui')['NCheckbox'] + NCheckboxGroup: typeof import('naive-ui')['NCheckboxGroup'] NCode: typeof import('naive-ui')['NCode'] NCollapse: typeof import('naive-ui')['NCollapse'] NCollapseItem: typeof import('naive-ui')['NCollapseItem'] @@ -147,5 +149,7 @@ declare module 'vue' { UserSelect: typeof import('./../components/custom/user-select.vue')['default'] WaveBg: typeof import('./../components/custom/wave-bg.vue')['default'] WorkflowCategorySelect: typeof import('./../components/custom/workflow-category-select.vue')['default'] + WorkflowLeaveForm: typeof import('./../components/custom/workflow-leave-form.vue')['default'] + WorkflowTaskApplyModal: typeof import('./../components/custom/workflow-task-apply-modal.vue')['default'] } } diff --git a/src/views/workflow/leave/modules/leave-operate-drawer.vue b/src/views/workflow/leave/modules/leave-operate-drawer.vue index 34058f07..71084e4f 100644 --- a/src/views/workflow/leave/modules/leave-operate-drawer.vue +++ b/src/views/workflow/leave/modules/leave-operate-drawer.vue @@ -1,8 +1,9 @@