diff --git a/src/api/approval/directory/index.ts b/src/api/approval/directory/index.ts new file mode 100644 index 0000000..b7a2e8a --- /dev/null +++ b/src/api/approval/directory/index.ts @@ -0,0 +1,34 @@ +import request from '@/utils/request'; +import type { ApiResult } from '@/api'; +import type { ApprovalOrganization, ApprovalUser } from '../instance/model'; +import { THINK_API_URL } from '@/config/setting'; + +/** + * 启用组织(审批管理下拉) + */ +export async function listApprovalOrganizations() { + const res = await request.get>( + THINK_API_URL + '/approval/directory/organizations' + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 启用用户远程搜索(审批管理下拉) + */ +export async function searchApprovalUsers(params?: { + keywords?: string; + organizationId?: number; +}) { + const res = await request.get>( + THINK_API_URL + '/approval/directory/users', + { params } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/approval/instance/index.ts b/src/api/approval/instance/index.ts new file mode 100644 index 0000000..79ae7e9 --- /dev/null +++ b/src/api/approval/instance/index.ts @@ -0,0 +1,35 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { + ApprovalInstance, + ApprovalItem, + ApprovalQueryParam +} from './model'; +import { THINK_API_URL } from '@/config/setting'; + +/** + * 单据查询分页 + */ +export async function pageInstances(params: ApprovalQueryParam) { + const res = await request.get>>( + THINK_API_URL + '/approval/instance/page', + { params } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 单据详情(只读) + */ +export async function getInstance(id: number) { + const res = await request.get>( + THINK_API_URL + '/approval/instance/' + id + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/approval/instance/model/index.ts b/src/api/approval/instance/model/index.ts new file mode 100644 index 0000000..bae51da --- /dev/null +++ b/src/api/approval/instance/model/index.ts @@ -0,0 +1,172 @@ +import type { PageParam } from '@/api'; + +/** + * 单据查询条件 + */ +export interface ApprovalQueryParam extends PageParam { + // 单据类型 completion/coordination + docType?: string; + // 单号 + bizNo?: string; + // 关键词:单号、名称或标题、实施单位 + keyword?: string; + // 报送部门id + reportOrgId?: number; + // 受理部门id + acceptOrgId?: number; + // 发起人id + reporterId?: number; + // 单据状态 + status?: string; + // 提交时间起 + submitTimeStart?: string; + // 提交时间止 + submitTimeEnd?: string; + // 归档时间起 + archiveTimeStart?: string; + // 归档时间止 + archiveTimeEnd?: string; +} + +/** + * 单据列表行 + */ +export interface ApprovalItem { + id?: number; + bizNo?: string; + docType?: string; + docTypeName?: string; + status?: string; + statusName?: string; + // 名称或标题 + title?: string; + submitTime?: string; + currentNodeName?: string; + reporterId?: number; + reporterName?: string; + reportOrgName?: string; + acceptOrgName?: string; + archiveTime?: string; +} + +/** + * 附件 + */ +export interface ApprovalAttachment { + id?: number; + fileId?: number; + name?: string; + url?: string; + length?: number; + category?: string; + categoryName?: string; + uploaderId?: number; + uploaderName?: string; + createTime?: string; +} + +/** + * 处理记录 + */ +export interface ApprovalRecord { + id?: number; + taskId?: number; + nodeKey?: string; + nodeName?: string; + operatorId?: number; + operatorName?: string; + action?: string; + actionName?: string; + opinion?: string; + round?: number; + createTime?: string; +} + +/** + * 当前轮存档确认 + */ +export interface ApprovalConfirm { + userId?: number; + userName?: string; + status?: string; + statusName?: string; + handleTime?: string; +} + +/** + * 我的待处理任务 + */ +export interface ApprovalMyTask { + id?: number; + nodeKey?: string; + nodeType?: string; + status?: string; +} + +/** + * 单据详情 + */ +export interface ApprovalInstance { + id?: number; + bizNo?: string; + docType?: string; + docTypeName?: string; + flowCode?: string; + status?: string; + statusName?: string; + round?: number; + reporterId?: number; + reporterName?: string; + reportOrgId?: number; + reportOrgName?: string; + acceptOrgId?: number; + acceptOrgName?: string; + currentNodeKey?: string; + currentNodeType?: string; + currentNodeName?: string; + submitTime?: string; + approveTime?: string; + archiveTime?: string; + archivistId?: number; + archivistName?: string; + // 业务完成确认单 + name?: string; + implementOrg?: string; + fee?: number; + serviceContent?: string; + // 内部协调单 + title?: string; + content?: string; + remark?: string; + dispatchTargetId?: number; + dispatchTargetName?: string; + attachments?: ApprovalAttachment[]; + records?: ApprovalRecord[]; + confirms?: ApprovalConfirm[]; + myTask?: ApprovalMyTask | null; + permissions?: Record; +} + +/** + * 审批目录组织 + */ +export interface ApprovalOrganization { + organizationId?: number; + parentId?: number; + organizationName?: string; + organizationFullName?: string; + organizationCode?: string; + leaderId?: number; +} + +/** + * 审批目录用户 + */ +export interface ApprovalUser { + userId?: number; + username?: string; + nickname?: string; + realName?: string; + organizationId?: number; + organizationName?: string; +} diff --git a/src/views/approval/instance/components/detail.vue b/src/views/approval/instance/components/detail.vue new file mode 100644 index 0000000..d8a3da3 --- /dev/null +++ b/src/views/approval/instance/components/detail.vue @@ -0,0 +1,280 @@ + + + + + + diff --git a/src/views/approval/instance/components/search.vue b/src/views/approval/instance/components/search.vue new file mode 100644 index 0000000..17b4fd2 --- /dev/null +++ b/src/views/approval/instance/components/search.vue @@ -0,0 +1,254 @@ + + + + diff --git a/src/views/approval/instance/index.vue b/src/views/approval/instance/index.vue new file mode 100644 index 0000000..b392c7d --- /dev/null +++ b/src/views/approval/instance/index.vue @@ -0,0 +1,188 @@ + + + + + +