diff --git a/src/api/workflow/businessForm/index.ts b/src/api/workflow/businessForm/index.ts new file mode 100644 index 0000000..b965c8c --- /dev/null +++ b/src/api/workflow/businessForm/index.ts @@ -0,0 +1,63 @@ +import request from '@/utils/request'; +import { AxiosPromise } from 'axios'; +import { BusinessFormVO, BusinessFormForm, BusinessFormQuery } from '@/api/workflow/businessForm/types'; + +/** + * 查询发起流程列表 + * @param query + * @returns {*} + */ + +export const listBusinessForm = (query?: BusinessFormQuery): AxiosPromise => { + return request({ + url: '/workflow/businessForm/list', + method: 'get', + params: query + }); +}; + +/** + * 查询发起流程详细 + * @param id + */ +export const getBusinessForm = (id: string | number): AxiosPromise => { + return request({ + url: '/workflow/businessForm/' + id, + method: 'get' + }); +}; + +/** + * 新增发起流程 + * @param data + */ +export const addBusinessForm = (data: BusinessFormForm) => { + return request({ + url: '/workflow/businessForm', + method: 'post', + data: data + }); +}; + +/** + * 修改发起流程 + * @param data + */ +export const updateBusinessForm = (data: BusinessFormForm) => { + return request({ + url: '/workflow/businessForm', + method: 'put', + data: data + }); +}; + +/** + * 删除发起流程 + * @param id + */ +export const delBusinessForm = (id: string | number | Array) => { + return request({ + url: '/workflow/businessForm/' + id, + method: 'delete' + }); +}; diff --git a/src/api/workflow/businessForm/types.ts b/src/api/workflow/businessForm/types.ts new file mode 100644 index 0000000..41af7f7 --- /dev/null +++ b/src/api/workflow/businessForm/types.ts @@ -0,0 +1,76 @@ +export interface BusinessFormVO { + /** + * 主键 + */ + id: string | number; + + /** + * 申请编码 + */ + applyCode: string; + + /** + * 表单id + */ + formId: string | number; + + /** + * 表单名称 + */ + formName: string; + +} + +export interface BusinessFormForm extends BaseEntity { + /** + * 主键 + */ + id?: string | number; + + /** + * 申请编码 + */ + applyCode?: string; + + /** + * 表单id + */ + formId?: string | number; + + /** + * 表单名称 + */ + formName?: string; + + /** + * 表单内容 + */ + content?: string; + + /** + * 表单值 + */ + contentValue?: string; + +} + +export interface BusinessFormQuery extends PageQuery { + + /** + * 申请编码 + */ + applyCode?: string; + + /** + * 表单名称 + */ + formName?: string; + + /** + * 日期范围参数 + */ + params?: any; +} + + + diff --git a/src/api/workflow/form/index.ts b/src/api/workflow/form/index.ts index 115a78f..973ca67 100644 --- a/src/api/workflow/form/index.ts +++ b/src/api/workflow/form/index.ts @@ -11,6 +11,15 @@ export function listForm(query: FormQuery): AxiosPromise { }); } +// 查询流程表单列表 +export function queryList(query: any): AxiosPromise { + return request({ + url: '/workflow/form/queryList', + method: 'get', + params: query + }); +} + // 查询流程表单详细 export function getForm(formId: string | number): AxiosPromise { return request({ diff --git a/src/api/workflow/form/types.ts b/src/api/workflow/form/types.ts index 5067732..e91e0ce 100644 --- a/src/api/workflow/form/types.ts +++ b/src/api/workflow/form/types.ts @@ -5,6 +5,37 @@ export interface FormVO extends BaseEntity { content: string; status?: string; remark: string; + wfFormDefinitionVo: { + /** + * 主键 + */ + id: string | number; + + /** + * 动态表单id + */ + formId: string | number; + + /** + * 流程定义id + */ + processDefinitionKey: string; + + /** + * 流程定义名称 + */ + processDefinitionName: string; + + /** + * 流程定义id + */ + processDefinitionId: string | number; + + /** + * 流程定义版本 + */ + processDefinitionVersion: number; + }; } export interface FormForm { diff --git a/src/components/Process/submitVerify.vue b/src/components/Process/submitVerify.vue index f766380..dfa84ef 100644 --- a/src/components/Process/submitVerify.vue +++ b/src/components/Process/submitVerify.vue @@ -14,9 +14,11 @@ @@ -31,6 +33,8 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance; //遮罩层 const loading = ref(true); +//按钮 +const buttonLoading = ref(true); //流程状态 const businessStatus = ref(''); //任务id @@ -48,27 +52,30 @@ const form = ref>({ messageType: ['1'] }); //打开弹窗 -const openDialog = (visible?: any,id?: string) => { +const openDialog = (id?: string) => { taskId.value = id form.value.message = undefined; - dialog.visible = visible; + dialog.visible = true; loading.value = true; + buttonLoading.value = true; nextTick(() => { getBusinessStatus(taskId.value).then((response) => { businessStatus.value = response.data; loading.value = false; + buttonLoading.value = false; }); }); }; -onMounted(() => {}); -const emits = defineEmits(['submitCallback']); +onMounted(() => { }); +const emits = defineEmits(['submitCallback', 'cancelCallback']); /** 办理流程 */ const handleCompleteTask = async () => { form.value.taskId = taskId.value; await proxy?.$modal.confirm('是否确认提交?'); loading.value = true + buttonLoading.value = true await completeTask(form.value).finally(() => (loading.value = false)); dialog.visible = false; emits('submitCallback'); @@ -80,12 +87,18 @@ const handleBackProcess = async () => { form.value.taskId = taskId.value; await proxy?.$modal.confirm('是否确认驳回到申请人?'); loading.value = true + buttonLoading.value = true await backProcess(form.value).finally(() => (loading.value = false)); dialog.visible = false; emits('submitCallback'); proxy?.$modal.msgSuccess('操作成功'); }; - +//取消 +const cancel = async () => { + dialog.visible = false + buttonLoading.value = false + emits('cancelCallback'); +} /** * 对外暴露子组件方法 */ diff --git a/src/views/demo/leave/index.vue b/src/views/demo/leave/index.vue index 45abafb..14f2ebb 100644 --- a/src/views/demo/leave/index.vue +++ b/src/views/demo/leave/index.vue @@ -1,6 +1,7 @@