diff --git a/src/api/approval/attachment/index.ts b/src/api/approval/attachment/index.ts new file mode 100644 index 0000000..d9d1591 --- /dev/null +++ b/src/api/approval/attachment/index.ts @@ -0,0 +1,57 @@ +import request from '@/utils/request'; +import type { ApiResult } from '@/api'; +import type { ApprovalAttachment } from '../model'; +import { TENANT_ID, THINK_API_URL } from '@/config/setting'; + +/** + * 上传附件:走审批域端点,header 带登录态与租户 + */ +export function uploadAttachment( + instanceId: number, + filePath: string, + category: string +): Promise { + return new Promise((resolve, reject) => { + const token = uni.getStorageSync('access_token'); + uni.uploadFile({ + url: + THINK_API_URL + + '/approval/attachment/upload?instanceId=' + + instanceId, + name: 'file', + filePath, + formData: { category }, + header: { + TenantId: TENANT_ID, + ...(token ? { Authorization: token } : {}) + }, + success: res => { + try { + const body = + typeof res.data === 'string' ? JSON.parse(res.data) : res.data; + if (body.code === 0 && body.data) { + resolve(body.data as ApprovalAttachment); + return; + } + reject(new Error(body.message || '上传失败')); + } catch (err) { + reject(new Error('上传失败')); + } + }, + fail: () => reject(new Error('上传失败')) + }); + }); +} + +/** + * 逻辑删除附件 + */ +export async function deleteAttachment(id: number) { + const res = await request.delete>( + THINK_API_URL + '/approval/attachment/' + id + ); + if (res.data.code === 0) { + return true; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/approval/directory/index.ts b/src/api/approval/directory/index.ts new file mode 100644 index 0000000..d3a3266 --- /dev/null +++ b/src/api/approval/directory/index.ts @@ -0,0 +1,17 @@ +import request from '@/utils/request'; +import type { ApiResult } from '@/api'; +import type { ApprovalOrganization } from '../model'; +import { THINK_API_URL } from '@/config/setting'; + +/** + * 启用组织(内部协调单受理部门选择) + */ +export async function getOrganizations() { + 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)); +} diff --git a/src/api/approval/instance/index.ts b/src/api/approval/instance/index.ts new file mode 100644 index 0000000..20975e0 --- /dev/null +++ b/src/api/approval/instance/index.ts @@ -0,0 +1,107 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { + ApprovalCompletionForm, + ApprovalCoordinationForm, + ApprovalInstance, + ApprovalItem, + ApprovalMineParam, + ApprovalTaskListParam +} from '../model'; +import { THINK_API_URL } from '@/config/setting'; + +/** + * 新建或保存业务完成确认单草稿,返回实例id + */ +export async function saveCompletion(data: ApprovalCompletionForm) { + const res = await request.post>( + THINK_API_URL + '/approval/instance/completion', + data + ); + if (res.data.code === 0) { + return res.data.data as number; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 新建或保存内部协调单草稿,返回实例id + */ +export async function saveCoordination(data: ApprovalCoordinationForm) { + const res = await request.post>( + THINK_API_URL + '/approval/instance/coordination', + data + ); + if (res.data.code === 0) { + return res.data.data as number; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 提交或重提 + */ +export async function submitInstance(id: number) { + const res = await request.post>( + THINK_API_URL + '/approval/instance/' + id + '/submit' + ); + if (res.data.code === 0) { + return res.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 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 我发起的 + */ +export async function pageMine(params: ApprovalMineParam) { + const res = await request.get>>( + THINK_API_URL + '/approval/mine/page', + { params } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 我的待办 + */ +export async function pageTodo(params: ApprovalTaskListParam) { + const res = await request.get>>( + THINK_API_URL + '/approval/todo/page', + { params } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 我的已办 + */ +export async function pageDone(params: ApprovalTaskListParam) { + const res = await request.get>>( + THINK_API_URL + '/approval/done/page', + { 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/model/index.ts b/src/api/approval/model/index.ts new file mode 100644 index 0000000..cf1768d --- /dev/null +++ b/src/api/approval/model/index.ts @@ -0,0 +1,187 @@ +import type { PageParam } from '@/api'; + +/** + * 审批附件 + */ +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 ApprovalPermissions { + canEdit: boolean; + canSubmit: boolean; + canWithdraw: boolean; + canApprove: boolean; + canReject: boolean; + canConfirm: boolean; + canArchive: boolean; + canDispatch: boolean; + canAssign: boolean; +} + +/** + * 列表行 + */ +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 ApprovalInstance extends ApprovalItem { + flowCode: string; + round: number; + reportOrgId?: number; + acceptOrgId?: number; + currentNodeKey?: string; + currentNodeType?: string; + approveTime?: string; + archivistId?: number; + archivistName?: string; + name?: string; + implementOrg?: string; + fee?: number; + serviceContent?: string; + content?: string; + remark?: string; + dispatchTargetId?: number; + dispatchTargetName?: string; + attachments: ApprovalAttachment[]; + records: ApprovalRecord[]; + confirms: ApprovalConfirm[]; + myTask?: ApprovalMyTask | null; + permissions: ApprovalPermissions; +} + +/** + * 业务完成确认单草稿参数 + */ +export interface ApprovalCompletionForm { + id?: number; + name: string; + implementOrg: string; + fee: number | string; + serviceContent: string; +} + +/** + * 内部协调单草稿参数 + */ +export interface ApprovalCoordinationForm { + id?: number; + acceptOrgId?: number; + title: string; + content: string; + remark?: string; +} + +/** + * 我发起的查询参数 + */ +export interface ApprovalMineParam extends PageParam { + status?: string; + docType?: string; +} + +/** + * 待办/已办查询参数 + */ +export interface ApprovalTaskListParam extends PageParam { + status?: string; + docType?: string; +} + +/** + * 任务动作参数(通过/驳回) + */ +export interface ApprovalTaskActionParam { + opinion?: string; +} + +/** + * 组织 + */ +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/api/approval/task/index.ts b/src/api/approval/task/index.ts new file mode 100644 index 0000000..462f0d5 --- /dev/null +++ b/src/api/approval/task/index.ts @@ -0,0 +1,111 @@ +import request from '@/utils/request'; +import type { ApiResult } from '@/api'; +import type { ApprovalInstance, ApprovalUser } from '../model'; +import { THINK_API_URL } from '@/config/setting'; + +/** + * 待办数量(个人中心红点) + */ +export async function getTodoCount() { + const res = await request.get>( + THINK_API_URL + '/approval/todo/count' + ); + if (res.data.code === 0 && res.data.data !== undefined) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 通过(意见可选) + */ +export async function approveTask(id: number, opinion?: string) { + const res = await request.post>( + THINK_API_URL + '/approval/task/' + id + '/approve', + { opinion } + ); + if (res.data.code === 0 && res.data.data) { + return res.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 驳回(意见必填) + */ +export async function rejectTask(id: number, opinion: string) { + const res = await request.post>( + THINK_API_URL + '/approval/task/' + id + '/reject', + { opinion } + ); + if (res.data.code === 0 && res.data.data) { + return res.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 存档确认(无意见,只能确认) + */ +export async function confirmTask(id: number) { + const res = await request.post>( + THINK_API_URL + '/approval/task/' + id + '/confirm' + ); + if (res.data.code === 0 && res.data.data) { + return res.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 归档(或签,归档后单据只读) + */ +export async function archiveTask(id: number) { + const res = await request.post>( + THINK_API_URL + '/approval/task/' + id + '/archive' + ); + if (res.data.code === 0 && res.data.data) { + return res.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 派单候选池(仅派单节点、本人待办) + */ +export async function listDispatchCandidates(id: number) { + const res = await request.get>( + THINK_API_URL + '/approval/task/' + id + '/candidates' + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 派单(选定 1 人即完成派单节点) + */ +export async function dispatchTask(id: number, targetUserId: number) { + const res = await request.post>( + THINK_API_URL + '/approval/task/' + id + '/dispatch', + { targetUserId } + ); + if (res.data.code === 0 && res.data.data) { + return res.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 撤回 + */ +export async function withdrawInstance(id: number) { + const res = await request.post>( + THINK_API_URL + '/approval/instance/' + id + '/withdraw' + ); + if (res.data.code === 0 && res.data.data) { + return res.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/booking/userCard/model/index.ts b/src/api/booking/userCard/model/index.ts index e17a36f..f94d7b2 100644 --- a/src/api/booking/userCard/model/index.ts +++ b/src/api/booking/userCard/model/index.ts @@ -82,7 +82,6 @@ export interface UserCard { createTime?: number; // updateTime?: number; - @TableField("IDCard") // 身份证号码 idcard?: string; // 备注 diff --git a/src/api/think/thinkCard/model/index.ts b/src/api/think/thinkCard/model/index.ts index d34c229..eb8fb72 100644 --- a/src/api/think/thinkCard/model/index.ts +++ b/src/api/think/thinkCard/model/index.ts @@ -80,7 +80,6 @@ export interface ThinkCard { createTime?: number; // updateTime?: number; - @TableField("IDCard") // 身份证号码 idcard?: string; // 备注 diff --git a/src/api/think/thinkGatePassreord/model/index.ts b/src/api/think/thinkGatePassreord/model/index.ts index ecc687e..247ddba 100644 --- a/src/api/think/thinkGatePassreord/model/index.ts +++ b/src/api/think/thinkGatePassreord/model/index.ts @@ -32,7 +32,6 @@ export interface ThinkGatePassreord { deleteStatus?: string; // siteId?: number; - @TableField("consume_Money") // 本次消费金额 consumeMoney?: string; } diff --git a/src/api/think/thinkInvoice/model/index.ts b/src/api/think/thinkInvoice/model/index.ts index 6f0ee42..f455691 100644 --- a/src/api/think/thinkInvoice/model/index.ts +++ b/src/api/think/thinkInvoice/model/index.ts @@ -46,7 +46,6 @@ export interface ThinkInvoice { createTime?: number; // updateTime?: number; - @TableField("InvoiceType") // 1.普票,2是专票 invoicetype?: number; // diff --git a/src/packageApproval/pages/detail.vue b/src/packageApproval/pages/detail.vue new file mode 100644 index 0000000..236da37 --- /dev/null +++ b/src/packageApproval/pages/detail.vue @@ -0,0 +1,836 @@ +