Compare commits
2 Commits
44e2c1fd4a
...
1695f017b0
Author | SHA1 | Date | |
---|---|---|---|
1695f017b0 | |||
d96d906392 |
@ -0,0 +1,79 @@
|
||||
import type {
|
||||
ProcurementApplicationVO,
|
||||
ProcurementApplicationForm,
|
||||
ProcurementApplicationQuery,
|
||||
} from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询资产申请列表
|
||||
* @param params
|
||||
* @returns 资产申请列表
|
||||
*/
|
||||
export function procurementApplicationList(
|
||||
params?: ProcurementApplicationQuery,
|
||||
) {
|
||||
return requestClient.get<PageResult<ProcurementApplicationVO>>(
|
||||
'/domain/procurementApplication/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出资产申请列表
|
||||
* @param params
|
||||
* @returns 资产申请列表
|
||||
*/
|
||||
export function procurementApplicationExport(
|
||||
params?: ProcurementApplicationQuery,
|
||||
) {
|
||||
return commonExport('/domain/procurementApplication/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询资产申请详情
|
||||
* @param id id
|
||||
* @returns 资产申请详情
|
||||
*/
|
||||
export function procurementApplicationInfo(id: ID) {
|
||||
return requestClient.get<ProcurementApplicationVO>(
|
||||
`/domain/procurementApplication/${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增资产申请
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function procurementApplicationAdd(data: ProcurementApplicationForm) {
|
||||
return requestClient.postWithMsg<void>(
|
||||
'/domain/procurementApplication',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新资产申请
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function procurementApplicationUpdate(data: ProcurementApplicationForm) {
|
||||
return requestClient.putWithMsg<void>('/domain/procurementApplication', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除资产申请
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function procurementApplicationRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(
|
||||
`/domain/procurementApplication/${id}`,
|
||||
);
|
||||
}
|
197
apps/web-antd/src/api/property/assetManage/procurementApplication/model.d.ts
vendored
Normal file
197
apps/web-antd/src/api/property/assetManage/procurementApplication/model.d.ts
vendored
Normal file
@ -0,0 +1,197 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface ProcurementApplicationVO {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
title: string;
|
||||
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
applicat: number;
|
||||
|
||||
/**
|
||||
* 申请人手机号
|
||||
*/
|
||||
phone: string;
|
||||
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
supplier: number;
|
||||
|
||||
/**
|
||||
* 资产id
|
||||
*/
|
||||
capitalId: string | number;
|
||||
|
||||
/**
|
||||
* 采购方式
|
||||
*/
|
||||
buyType: string;
|
||||
|
||||
/**
|
||||
* 采购单价
|
||||
*/
|
||||
buyUnitPrice: number;
|
||||
|
||||
/**
|
||||
* 采购金额
|
||||
*/
|
||||
buyAmount: number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
applicationTime: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue: string;
|
||||
}
|
||||
|
||||
export interface ProcurementApplicationForm extends BaseEntity {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
applicat?: number;
|
||||
|
||||
/**
|
||||
* 申请人手机号
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
supplier?: number;
|
||||
|
||||
/**
|
||||
* 资产id
|
||||
*/
|
||||
capitalId?: string | number;
|
||||
|
||||
/**
|
||||
* 采购方式
|
||||
*/
|
||||
buyType?: string;
|
||||
|
||||
/**
|
||||
* 采购单价
|
||||
*/
|
||||
buyUnitPrice?: number;
|
||||
|
||||
/**
|
||||
* 采购金额
|
||||
*/
|
||||
buyAmount?: number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
applicationTime?: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
}
|
||||
|
||||
export interface ProcurementApplicationQuery extends PageQuery {
|
||||
/**
|
||||
* 标题
|
||||
*/
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* 申请人id
|
||||
*/
|
||||
applicat?: number;
|
||||
|
||||
/**
|
||||
* 申请人手机号
|
||||
*/
|
||||
phone?: string;
|
||||
|
||||
/**
|
||||
* 供应商id
|
||||
*/
|
||||
supplier?: number;
|
||||
|
||||
/**
|
||||
* 资产id
|
||||
*/
|
||||
capitalId?: string | number;
|
||||
|
||||
/**
|
||||
* 采购方式
|
||||
*/
|
||||
buyType?: string;
|
||||
|
||||
/**
|
||||
* 采购单价
|
||||
*/
|
||||
buyUnitPrice?: number;
|
||||
|
||||
/**
|
||||
* 采购金额
|
||||
*/
|
||||
buyAmount?: number;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state?: string;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
applicationTime?: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
import type { LeaveApplicationVO, LeaveApplicationForm, LeaveApplicationQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询请假申请列表
|
||||
* @param params
|
||||
* @returns 请假申请列表
|
||||
*/
|
||||
export function leaveApplicationList(params?: LeaveApplicationQuery) {
|
||||
return requestClient.get<PageResult<LeaveApplicationVO>>('/property/leaveApplication/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出请假申请列表
|
||||
* @param params
|
||||
* @returns 请假申请列表
|
||||
*/
|
||||
export function leaveApplicationExport(params?: LeaveApplicationQuery) {
|
||||
return commonExport('/property/leaveApplication/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询请假申请详情
|
||||
* @param id id
|
||||
* @returns 请假申请详情
|
||||
*/
|
||||
export function leaveApplicationInfo(id: ID) {
|
||||
return requestClient.get<LeaveApplicationVO>(`/property/leaveApplication/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增请假申请
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function leaveApplicationAdd(data: LeaveApplicationForm) {
|
||||
return requestClient.postWithMsg<void>('/property/leaveApplication', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新请假申请
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function leaveApplicationUpdate(data: LeaveApplicationForm) {
|
||||
return requestClient.putWithMsg<void>('/property/leaveApplication', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除请假申请
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function leaveApplicationRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/leaveApplication/${id}`);
|
||||
}
|
189
apps/web-antd/src/api/property/personalCenter/leaveApplication/model.d.ts
vendored
Normal file
189
apps/web-antd/src/api/property/personalCenter/leaveApplication/model.d.ts
vendored
Normal file
@ -0,0 +1,189 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface LeaveApplicationVO {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 用户ID,关联用户表
|
||||
*/
|
||||
userId: string | number;
|
||||
|
||||
/**
|
||||
* 申请人姓名
|
||||
*/
|
||||
username: string;
|
||||
|
||||
/**
|
||||
* 部门ID,关联部门表
|
||||
*/
|
||||
departmentId: string | number;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
departmentName: string;
|
||||
|
||||
/**
|
||||
* 请假类型
|
||||
*/
|
||||
leaveType: number;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime: string;
|
||||
|
||||
/**
|
||||
* 合计时间,如3天5个小时
|
||||
*/
|
||||
totalDuration: string;
|
||||
|
||||
/**
|
||||
* 请假事由
|
||||
*/
|
||||
reason: string;
|
||||
|
||||
/**
|
||||
* 申请状态(1:'草稿',2:'待审批',3:'已批准',4:'已拒绝':5:'已取消')
|
||||
*/
|
||||
status: number;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue: string;
|
||||
|
||||
}
|
||||
|
||||
export interface LeaveApplicationForm extends BaseEntity {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 用户ID,关联用户表
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 申请人姓名
|
||||
*/
|
||||
username?: string;
|
||||
|
||||
/**
|
||||
* 部门ID,关联部门表
|
||||
*/
|
||||
departmentId?: string | number;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
departmentName?: string;
|
||||
|
||||
/**
|
||||
* 请假类型
|
||||
*/
|
||||
leaveType?: number;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 合计时间,如3天5个小时
|
||||
*/
|
||||
totalDuration?: string;
|
||||
|
||||
/**
|
||||
* 请假事由
|
||||
*/
|
||||
reason?: string;
|
||||
|
||||
/**
|
||||
* 申请状态(1:'草稿',2:'待审批',3:'已批准',4:'已拒绝':5:'已取消')
|
||||
*/
|
||||
status?: number;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface LeaveApplicationQuery extends PageQuery {
|
||||
/**
|
||||
* 用户ID,关联用户表
|
||||
*/
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 申请人姓名
|
||||
*/
|
||||
username?: string;
|
||||
|
||||
/**
|
||||
* 部门ID,关联部门表
|
||||
*/
|
||||
departmentId?: string | number;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
departmentName?: string;
|
||||
|
||||
/**
|
||||
* 请假类型
|
||||
*/
|
||||
leaveType?: number;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
startTime?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 合计时间,如3天5个小时
|
||||
*/
|
||||
totalDuration?: string;
|
||||
|
||||
/**
|
||||
* 请假事由
|
||||
*/
|
||||
reason?: string;
|
||||
|
||||
/**
|
||||
* 申请状态(1:'草稿',2:'待审批',3:'已批准',4:'已拒绝':5:'已取消')
|
||||
*/
|
||||
status?: number;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
import type { WorkflowDefinitionVO, WorkflowDefinitionForm, WorkflowDefinitionQuery } from './model';
|
||||
|
||||
import type { ID, IDS } from '#/api/common';
|
||||
import type { PageResult } from '#/api/common';
|
||||
|
||||
import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询流程定义列表
|
||||
* @param params
|
||||
* @returns 流程定义列表
|
||||
*/
|
||||
export function workflowDefinitionList(params?: WorkflowDefinitionQuery) {
|
||||
return requestClient.get<PageResult<WorkflowDefinitionVO>>('/property/workflowDefinition/list', { params });
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出流程定义列表
|
||||
* @param params
|
||||
* @returns 流程定义列表
|
||||
*/
|
||||
export function workflowDefinitionExport(params?: WorkflowDefinitionQuery) {
|
||||
return commonExport('/property/workflowDefinition/export', params ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询流程定义详情
|
||||
* @param id id
|
||||
* @returns 流程定义详情
|
||||
*/
|
||||
export function workflowDefinitionInfo(id: ID) {
|
||||
return requestClient.get<WorkflowDefinitionVO>(`/property/workflowDefinition/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增流程定义
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function workflowDefinitionAdd(data: WorkflowDefinitionForm) {
|
||||
return requestClient.postWithMsg<void>('/property/workflowDefinition', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新流程定义
|
||||
* @param data
|
||||
* @returns void
|
||||
*/
|
||||
export function workflowDefinitionUpdate(data: WorkflowDefinitionForm) {
|
||||
return requestClient.putWithMsg<void>('/property/workflowDefinition', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除流程定义
|
||||
* @param id id
|
||||
* @returns void
|
||||
*/
|
||||
export function workflowDefinitionRemove(id: ID | IDS) {
|
||||
return requestClient.deleteWithMsg<void>(`/property/workflowDefinition/${id}`);
|
||||
}
|
129
apps/web-antd/src/api/property/personalCenter/workflowDefinition/model.d.ts
vendored
Normal file
129
apps/web-antd/src/api/property/personalCenter/workflowDefinition/model.d.ts
vendored
Normal file
@ -0,0 +1,129 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
|
||||
export interface WorkflowDefinitionVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 流程编号
|
||||
*/
|
||||
code: string;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 流程状态(0:审批不通过,1:审批通过,2:审批中,3已取消)
|
||||
*/
|
||||
status: number;
|
||||
|
||||
/**
|
||||
* 当前审批人
|
||||
*/
|
||||
currentApprover: string;
|
||||
|
||||
/**
|
||||
* 审批建议
|
||||
*/
|
||||
workflowSuggestion: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue: string;
|
||||
|
||||
}
|
||||
|
||||
export interface WorkflowDefinitionForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 流程编号
|
||||
*/
|
||||
code?: string;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* 流程状态(0:审批不通过,1:审批通过,2:审批中,3已取消)
|
||||
*/
|
||||
status?: number;
|
||||
|
||||
/**
|
||||
* 当前审批人
|
||||
*/
|
||||
currentApprover?: string;
|
||||
|
||||
/**
|
||||
* 审批建议
|
||||
*/
|
||||
workflowSuggestion?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface WorkflowDefinitionQuery extends PageQuery {
|
||||
/**
|
||||
* 流程编号
|
||||
*/
|
||||
code?: string;
|
||||
|
||||
/**
|
||||
* 流程名称
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* 流程状态(0:审批不通过,1:审批通过,2:审批中,3已取消)
|
||||
*/
|
||||
status?: number;
|
||||
|
||||
/**
|
||||
* 当前审批人
|
||||
*/
|
||||
currentApprover?: string;
|
||||
|
||||
/**
|
||||
* 审批建议
|
||||
*/
|
||||
workflowSuggestion?: string;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
endTime?: string;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
searchValue?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
@ -0,0 +1,232 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'title',
|
||||
label: '标题',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'applicat',
|
||||
label: '申请人id',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'phone',
|
||||
label: '申请人手机号',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'supplier',
|
||||
label: '供应商id',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'capitalId',
|
||||
label: '资产id',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {},
|
||||
fieldName: 'buyType',
|
||||
label: '采购方式',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'buyUnitPrice',
|
||||
label: '采购单价',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'buyAmount',
|
||||
label: '采购金额',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_ZCSQSHZT 便于维护
|
||||
options: getDictOptions('wy_zcsqshzt'),
|
||||
},
|
||||
fieldName: 'state',
|
||||
label: '状态',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'applicationTime',
|
||||
label: '申请时间',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'searchValue',
|
||||
label: '搜索值',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '标题',
|
||||
field: 'title',
|
||||
},
|
||||
{
|
||||
title: '申请人id',
|
||||
field: 'applicat',
|
||||
},
|
||||
{
|
||||
title: '申请人手机号',
|
||||
field: 'phone',
|
||||
},
|
||||
{
|
||||
title: '供应商id',
|
||||
field: 'supplier',
|
||||
},
|
||||
{
|
||||
title: '资产id',
|
||||
field: 'capitalId',
|
||||
},
|
||||
{
|
||||
title: '采购方式',
|
||||
field: 'buyType',
|
||||
},
|
||||
{
|
||||
title: '采购单价',
|
||||
field: 'buyUnitPrice',
|
||||
},
|
||||
{
|
||||
title: '采购金额',
|
||||
field: 'buyAmount',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_ZCSQSHZT 便于维护
|
||||
return renderDict(row.state, 'wy_zcsqshzt');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
},
|
||||
{
|
||||
title: '申请时间',
|
||||
field: 'applicationTime',
|
||||
},
|
||||
{
|
||||
title: '搜索值',
|
||||
field: 'searchValue',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '标题',
|
||||
fieldName: 'title',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '申请人id',
|
||||
fieldName: 'applicat',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '申请人手机号',
|
||||
fieldName: 'phone',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '供应商id',
|
||||
fieldName: 'supplier',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '资产id',
|
||||
fieldName: 'capitalId',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '采购方式',
|
||||
fieldName: 'buyType',
|
||||
component: 'Select',
|
||||
componentProps: {},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '采购单价',
|
||||
fieldName: 'buyUnitPrice',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '采购金额',
|
||||
fieldName: 'buyAmount',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
fieldName: 'state',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_ZCSQSHZT 便于维护
|
||||
options: getDictOptions('wy_zcsqshzt'),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '申请时间',
|
||||
fieldName: 'applicationTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '搜索值',
|
||||
fieldName: 'searchValue',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
@ -0,0 +1,188 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps,
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
procurementApplicationExport,
|
||||
procurementApplicationList,
|
||||
procurementApplicationRemove,
|
||||
} from '#/api/property/assetManage/procurementApplication';
|
||||
import type { ProcurementApplicationForm } from '#/api/property/assetManage/procurementApplication/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import procurementApplicationModal from './procurementApplication-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
||||
// 不需要直接删除
|
||||
// fieldMappingTime: [
|
||||
// [
|
||||
// 'createTime',
|
||||
// ['params[beginTime]', 'params[endTime]'],
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
// 高亮
|
||||
highlight: true,
|
||||
// 翻页时保留选中状态
|
||||
reserve: true,
|
||||
// 点击行选中
|
||||
// trigger: 'row',
|
||||
},
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// columns: columns(),
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await procurementApplicationList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'domain-procurementApplication-index',
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [ProcurementApplicationModal, modalApi] = useVbenModal({
|
||||
connectedComponent: procurementApplicationModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<ProcurementApplicationForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<ProcurementApplicationForm>) {
|
||||
await procurementApplicationRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<ProcurementApplicationForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await procurementApplicationRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(
|
||||
procurementApplicationExport,
|
||||
'资产申请数据',
|
||||
tableApi.formApi.form.values,
|
||||
{
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="资产申请列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['domain:procurementApplication:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['domain:procurementApplication:remove']"
|
||||
@click="handleMultiDelete"
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['domain:procurementApplication:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['domain:procurementApplication:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['domain:procurementApplication:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<ProcurementApplicationModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
@ -0,0 +1,106 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import {
|
||||
procurementApplicationAdd,
|
||||
procurementApplicationInfo,
|
||||
procurementApplicationUpdate,
|
||||
} from '#/api/property/assetManage/procurementApplication';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||
});
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
},
|
||||
},
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await procurementApplicationInfo(id);
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
await (isUpdate.value
|
||||
? procurementApplicationUpdate(data)
|
||||
: procurementApplicationAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
</BasicModal>
|
||||
</template>
|
@ -0,0 +1,229 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'userId',
|
||||
label: '用户ID,关联用户表',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'username',
|
||||
label: '申请人姓名',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'departmentId',
|
||||
label: '部门ID,关联部门表',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'departmentName',
|
||||
label: '部门名称',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
},
|
||||
fieldName: 'leaveType',
|
||||
label: '请假类型',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'startTime',
|
||||
label: '开始时间',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'endTime',
|
||||
label: '结束时间',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'totalDuration',
|
||||
label: '合计时间,如3天5个小时',
|
||||
},
|
||||
{
|
||||
component: 'Textarea',
|
||||
fieldName: 'reason',
|
||||
label: '请假事由',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_SQZT 便于维护
|
||||
options: getDictOptions('wy_sqzt'),
|
||||
},
|
||||
fieldName: 'status',
|
||||
label: '申请状态',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'searchValue',
|
||||
label: '搜索值',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '用户ID,关联用户表',
|
||||
field: 'userId',
|
||||
},
|
||||
{
|
||||
title: '申请人姓名',
|
||||
field: 'username',
|
||||
},
|
||||
{
|
||||
title: '部门ID,关联部门表',
|
||||
field: 'departmentId',
|
||||
},
|
||||
{
|
||||
title: '部门名称',
|
||||
field: 'departmentName',
|
||||
},
|
||||
{
|
||||
title: '请假类型',
|
||||
field: 'leaveType',
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
field: 'startTime',
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
field: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '合计时间,如3天5个小时',
|
||||
field: 'totalDuration',
|
||||
},
|
||||
{
|
||||
title: '请假事由',
|
||||
field: 'reason',
|
||||
},
|
||||
{
|
||||
title: '申请状态',
|
||||
field: 'status',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_SQZT 便于维护
|
||||
return renderDict(row.status, 'wy_sqzt');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '搜索值',
|
||||
field: 'searchValue',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '用户ID,关联用户表',
|
||||
fieldName: 'userId',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '申请人姓名',
|
||||
fieldName: 'username',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '部门ID,关联部门表',
|
||||
fieldName: 'departmentId',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '部门名称',
|
||||
fieldName: 'departmentName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '请假类型',
|
||||
fieldName: 'leaveType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '开始时间',
|
||||
fieldName: 'startTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '结束时间',
|
||||
fieldName: 'endTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '合计时间,如3天5个小时',
|
||||
fieldName: 'totalDuration',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '请假事由',
|
||||
fieldName: 'reason',
|
||||
component: 'Textarea',
|
||||
},
|
||||
{
|
||||
label: '申请状态',
|
||||
fieldName: 'status',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_SQZT 便于维护
|
||||
options: getDictOptions('wy_sqzt'),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '搜索值',
|
||||
fieldName: 'searchValue',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
@ -0,0 +1,188 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps,
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
leaveApplicationExport,
|
||||
leaveApplicationList,
|
||||
leaveApplicationRemove,
|
||||
} from '#/api/property/personalCenter/leaveApplication';
|
||||
import type { LeaveApplicationForm } from '#/api/property/personalCenter/leaveApplication/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import leaveApplicationModal from './leaveApplication-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
||||
// 不需要直接删除
|
||||
// fieldMappingTime: [
|
||||
// [
|
||||
// 'createTime',
|
||||
// ['params[beginTime]', 'params[endTime]'],
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
// 高亮
|
||||
highlight: true,
|
||||
// 翻页时保留选中状态
|
||||
reserve: true,
|
||||
// 点击行选中
|
||||
// trigger: 'row',
|
||||
},
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// columns: columns(),
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await leaveApplicationList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-leaveApplication-index',
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [LeaveApplicationModal, modalApi] = useVbenModal({
|
||||
connectedComponent: leaveApplicationModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<LeaveApplicationForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<LeaveApplicationForm>) {
|
||||
await leaveApplicationRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<LeaveApplicationForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await leaveApplicationRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(
|
||||
leaveApplicationExport,
|
||||
'请假申请数据',
|
||||
tableApi.formApi.form.values,
|
||||
{
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="请假申请列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['property:leaveApplication:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:leaveApplication:remove']"
|
||||
@click="handleMultiDelete"
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:leaveApplication:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:leaveApplication:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:leaveApplication:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<LeaveApplicationModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
@ -0,0 +1,106 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import {
|
||||
leaveApplicationAdd,
|
||||
leaveApplicationInfo,
|
||||
leaveApplicationUpdate,
|
||||
} from '#/api/property/personalCenter/leaveApplication';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||
});
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
},
|
||||
},
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await leaveApplicationInfo(id);
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
await (isUpdate.value
|
||||
? leaveApplicationUpdate(data)
|
||||
: leaveApplicationAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
</BasicModal>
|
||||
</template>
|
@ -0,0 +1 @@
|
||||
<template>我的消息</template>
|
@ -0,0 +1 @@
|
||||
<template>已办</template>
|
@ -0,0 +1 @@
|
||||
<template>待办</template>
|
@ -0,0 +1,159 @@
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'code',
|
||||
label: '流程编号',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'name',
|
||||
label: '流程名称',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_LCZT 便于维护
|
||||
options: getDictOptions('wy_lczt'),
|
||||
},
|
||||
fieldName: 'status',
|
||||
label: '流程状态(0:审批不通过,1:审批通过,2:审批中,3已取消)',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'currentApprover',
|
||||
label: '当前审批人',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'workflowSuggestion',
|
||||
label: '审批建议',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
fieldName: 'endTime',
|
||||
label: '结束时间',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'searchValue',
|
||||
label: '搜索值',
|
||||
},
|
||||
];
|
||||
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '主键id',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '流程编号',
|
||||
field: 'code',
|
||||
},
|
||||
{
|
||||
title: '流程名称',
|
||||
field: 'name',
|
||||
},
|
||||
{
|
||||
title: '流程状态(0:审批不通过,1:审批通过,2:审批中,3已取消)',
|
||||
field: 'status',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_LCZT 便于维护
|
||||
return renderDict(row.status, 'wy_lczt');
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '当前审批人',
|
||||
field: 'currentApprover',
|
||||
},
|
||||
{
|
||||
title: '审批建议',
|
||||
field: 'workflowSuggestion',
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
field: 'endTime',
|
||||
},
|
||||
{
|
||||
title: '搜索值',
|
||||
field: 'searchValue',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '主键id',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '流程编号',
|
||||
fieldName: 'code',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '流程名称',
|
||||
fieldName: 'name',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '流程状态(0:审批不通过,1:审批通过,2:审批中,3已取消)',
|
||||
fieldName: 'status',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
// 可选从DictEnum中获取 DictEnum.WY_LCZT 便于维护
|
||||
options: getDictOptions('wy_lczt'),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '当前审批人',
|
||||
fieldName: 'currentApprover',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '审批建议',
|
||||
fieldName: 'workflowSuggestion',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '结束时间',
|
||||
fieldName: 'endTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '搜索值',
|
||||
fieldName: 'searchValue',
|
||||
component: 'Input',
|
||||
},
|
||||
];
|
@ -0,0 +1,188 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps,
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
workflowDefinitionExport,
|
||||
workflowDefinitionList,
|
||||
workflowDefinitionRemove,
|
||||
} from '#/api/property/personalCenter/workflowDefinition';
|
||||
import type { WorkflowDefinitionForm } from '#/api/property/personalCenter/workflowDefinition/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import workflowDefinitionModal from './workflowDefinition-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
||||
// 不需要直接删除
|
||||
// fieldMappingTime: [
|
||||
// [
|
||||
// 'createTime',
|
||||
// ['params[beginTime]', 'params[endTime]'],
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
checkboxConfig: {
|
||||
// 高亮
|
||||
highlight: true,
|
||||
// 翻页时保留选中状态
|
||||
reserve: true,
|
||||
// 点击行选中
|
||||
// trigger: 'row',
|
||||
},
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// columns: columns(),
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
return await workflowDefinitionList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
},
|
||||
},
|
||||
rowConfig: {
|
||||
keyField: 'id',
|
||||
},
|
||||
// 表格全局唯一表示 保存列配置需要用到
|
||||
id: 'property-workflowDefinition-index',
|
||||
};
|
||||
|
||||
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
formOptions,
|
||||
gridOptions,
|
||||
});
|
||||
|
||||
const [WorkflowDefinitionModal, modalApi] = useVbenModal({
|
||||
connectedComponent: workflowDefinitionModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<WorkflowDefinitionForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<WorkflowDefinitionForm>) {
|
||||
await workflowDefinitionRemove(row.id);
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<WorkflowDefinitionForm>) => row.id);
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
okType: 'danger',
|
||||
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||
onOk: async () => {
|
||||
await workflowDefinitionRemove(ids);
|
||||
await tableApi.query();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(
|
||||
workflowDefinitionExport,
|
||||
'流程定义数据',
|
||||
tableApi.formApi.form.values,
|
||||
{
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
},
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="流程定义列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['property:workflowDefinition:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:workflowDefinition:remove']"
|
||||
@click="handleMultiDelete"
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:workflowDefinition:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:workflowDefinition:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:workflowDefinition:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<WorkflowDefinitionModal @reload="tableApi.query()" />
|
||||
</Page>
|
||||
</template>
|
@ -0,0 +1,106 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import {
|
||||
workflowDefinitionAdd,
|
||||
workflowDefinitionInfo,
|
||||
workflowDefinitionUpdate,
|
||||
} from '#/api/property/personalCenter/workflowDefinition';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||
});
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
},
|
||||
},
|
||||
schema: modalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
if (isUpdate.value && id) {
|
||||
const record = await workflowDefinitionInfo(id);
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
await (isUpdate.value
|
||||
? workflowDefinitionUpdate(data)
|
||||
: workflowDefinitionAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
</BasicModal>
|
||||
</template>
|
Loading…
Reference in New Issue
Block a user