feat: 员工端二期 7 张单据表单页与通用详情渲染(#46)
This commit is contained in:
@@ -67,6 +67,8 @@ export interface ApprovalPermissions {
|
||||
canArchive: boolean;
|
||||
canDispatch: boolean;
|
||||
canAssign: boolean;
|
||||
/** 当前处理人可回填的字段;非节点处理人为空 */
|
||||
writableFields?: ApprovalWritableField[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,6 +117,10 @@ export interface ApprovalInstance extends ApprovalItem {
|
||||
confirms: ApprovalConfirm[];
|
||||
myTask?: ApprovalMyTask | null;
|
||||
permissions: ApprovalPermissions;
|
||||
/** 单据业务内容:业务字段、明细、会签进度与改值历史 */
|
||||
document?: ApprovalDocument;
|
||||
/** 字段改值历史(最新在后) */
|
||||
fieldChanges?: ApprovalFieldChange[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,6 +151,8 @@ export interface ApprovalCoordinationForm {
|
||||
export interface ApprovalMineParam extends PageParam {
|
||||
status?: string;
|
||||
docType?: string;
|
||||
/** 流程编码,如 settlement(按流程类型筛选) */
|
||||
flowCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -153,6 +161,8 @@ export interface ApprovalMineParam extends PageParam {
|
||||
export interface ApprovalTaskListParam extends PageParam {
|
||||
status?: string;
|
||||
docType?: string;
|
||||
/** 流程编码,如 settlement(按流程类型筛选) */
|
||||
flowCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -185,3 +195,174 @@ export interface ApprovalUser {
|
||||
organizationId?: number;
|
||||
organizationName?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情中的业务字段(后端已格式化好的展示值)
|
||||
*/
|
||||
export interface ApprovalField {
|
||||
key: string;
|
||||
label: string;
|
||||
/** 展示值;空值为 null */
|
||||
value?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 明细列元数据,驱动详情表格与服务端校验
|
||||
*/
|
||||
export interface ApprovalLineColumn {
|
||||
key: string;
|
||||
label: string;
|
||||
/** TEXT / DECIMAL / INT / DATE / BOOL / ENUM */
|
||||
type: string;
|
||||
required: boolean;
|
||||
scale?: number | null;
|
||||
maxLength?: number | null;
|
||||
/** 金额列:由服务端按数量 × 单价重算 */
|
||||
money?: boolean;
|
||||
options?: Array<{ value: string; label: string }> | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 明细汇总:行数与合计金额(金额类单据才有合计)
|
||||
*/
|
||||
export interface ApprovalLineSummary {
|
||||
lineCount: number;
|
||||
amountTotal?: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会签组成员状态
|
||||
*/
|
||||
export interface ApprovalGroupMember {
|
||||
userId?: number;
|
||||
userName?: string;
|
||||
status: string;
|
||||
statusName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 会签进度:按组展示「已签 N/M」
|
||||
*/
|
||||
export interface ApprovalGroupProgress {
|
||||
nodeKey: string;
|
||||
nodeName: string;
|
||||
groupKey: string;
|
||||
groupName: string;
|
||||
groupSeq?: number;
|
||||
signed: number;
|
||||
total: number;
|
||||
members?: ApprovalGroupMember[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 字段改值历史(回填 / 撤回清空等留痕)
|
||||
*/
|
||||
export interface ApprovalFieldChange {
|
||||
id?: number;
|
||||
nodeKey?: string;
|
||||
nodeName?: string;
|
||||
fieldKey: string;
|
||||
fieldLabel?: string;
|
||||
oldValue?: string | null;
|
||||
newValue?: string | null;
|
||||
operatorName?: string;
|
||||
round?: number;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单据业务内容:新页面统一读这里,一期扁平字段仅作兼容
|
||||
*/
|
||||
export interface ApprovalDocument {
|
||||
fields: ApprovalField[];
|
||||
lines: Array<Record<string, any>>;
|
||||
lineColumns?: ApprovalLineColumn[] | null;
|
||||
lineSummary?: ApprovalLineSummary | null;
|
||||
groupProgress?: ApprovalGroupProgress[] | null;
|
||||
fieldChanges?: ApprovalFieldChange[] | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前节点可回填字段
|
||||
*/
|
||||
export interface ApprovalWritableField {
|
||||
field: string;
|
||||
label: string;
|
||||
required: boolean;
|
||||
value?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 明细类单据草稿参数(结算单 / 车辆单 / 体验券 / 设施价格表)
|
||||
*/
|
||||
export interface ApprovalLineDocumentForm {
|
||||
id?: number;
|
||||
lines: Array<Record<string, any>>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 结算单草稿参数
|
||||
*/
|
||||
export interface ApprovalSettlementForm extends ApprovalLineDocumentForm {
|
||||
settlementReason: string;
|
||||
settlementPeriod?: string;
|
||||
counterpartyName: string;
|
||||
contractNo?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 收据申请单草稿参数
|
||||
*/
|
||||
export interface ApprovalReceiptForm {
|
||||
id?: number;
|
||||
amount: number | string;
|
||||
payerName: string;
|
||||
reason: string;
|
||||
receiptNo?: string;
|
||||
applyDate?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆免收费登记表草稿参数
|
||||
*/
|
||||
export interface ApprovalVehicleForm extends ApprovalLineDocumentForm {}
|
||||
|
||||
/**
|
||||
* 场地使用申请表草稿参数
|
||||
*/
|
||||
export interface ApprovalVenueForm {
|
||||
id?: number;
|
||||
applicantName: string;
|
||||
/** ORG 单位 / PERSON 个人 */
|
||||
applicantType: string;
|
||||
/** yyyy-MM-dd HH:mm:ss */
|
||||
useStartTime: string;
|
||||
useEndTime: string;
|
||||
siteId: number;
|
||||
siteName: string;
|
||||
purpose: string;
|
||||
activityFee: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 体验券领用申请单草稿参数
|
||||
*/
|
||||
export interface ApprovalCouponForm extends ApprovalLineDocumentForm {
|
||||
applyReason: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设施价格表草稿参数
|
||||
*/
|
||||
export interface ApprovalFacilityForm extends ApprovalLineDocumentForm {
|
||||
/** yyyy-MM-dd */
|
||||
effectiveDate: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 流程筛选选项(标签取流程定义名称)
|
||||
*/
|
||||
export interface ApprovalFlowOption {
|
||||
value: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api';
|
||||
import type { BookingSite, BookingSiteParam } from './model';
|
||||
import { MODULES_API_URL } from '@/config/setting';
|
||||
|
||||
/**
|
||||
* 查询场馆场地列表(场地主数据,供场地使用申请选择)
|
||||
*/
|
||||
export async function listBookingSite(params?: BookingSiteParam) {
|
||||
const res = await request.get<ApiResult<BookingSite[]>>(
|
||||
MODULES_API_URL + '/booking/booking-site',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 场馆场地(场地主数据)
|
||||
*/
|
||||
export interface BookingSite {
|
||||
id?: number;
|
||||
// 场地名称
|
||||
name?: string;
|
||||
// 封面图
|
||||
thumb?: string;
|
||||
// 每小时价格
|
||||
price?: string;
|
||||
// 营业时间
|
||||
businessTime?: string;
|
||||
// 场馆地址
|
||||
address?: string;
|
||||
// 场馆介绍
|
||||
info?: string;
|
||||
// 场馆电话
|
||||
tel?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 类型:1天,2小时
|
||||
type?: string;
|
||||
// 天数或小时
|
||||
num?: string;
|
||||
// 退款比率
|
||||
proportion?: string;
|
||||
// 退款规则组
|
||||
moneyJson?: string;
|
||||
// 场馆图片
|
||||
files?: string;
|
||||
// 创建时间
|
||||
createTime?: number;
|
||||
// 更新时间
|
||||
updateTime?: number;
|
||||
// 周末活动订场开关:1开,0关
|
||||
weekendOpen?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 场地搜索条件
|
||||
*/
|
||||
export interface BookingSiteParam extends PageParam {
|
||||
id?: number;
|
||||
name?: string;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user