fix:增加审批,退款
This commit is contained in:
parent
1bab84238a
commit
2699402b7a
202
src/gen/ApiTypes.d.ts
vendored
202
src/gen/ApiTypes.d.ts
vendored
@ -63,6 +63,88 @@ declare namespace ApiTypes {
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Approval {
|
||||
namespace ApprovalInstances {
|
||||
type PendingList = {
|
||||
"type"?: string; // 业务类型,[enum:ApprovalTemplatesTypeEnum]
|
||||
"applicant_name"?: string; // 申请人姓名
|
||||
"asset_projects_id"?: number; // 所属项目id
|
||||
"status"?: string; // 状态,[enum:ApprovalRecordsStatusEnum]
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // 审批实例id
|
||||
};
|
||||
type Approve = {
|
||||
"record_id": number; // 审批记录id
|
||||
"status": string; // 审批结果,[enum:ApprovalRecordsStatusEnum]
|
||||
"opinion"?: string; // 审批意见
|
||||
};
|
||||
type Cancel = {
|
||||
"id": number; // 审批实例id
|
||||
};
|
||||
type Transfer = {
|
||||
"record_id": number; // 审批记录id
|
||||
"to_employee_id": number; // 接收人id,[ref:company_employees]
|
||||
"opinion"?: string; // 转交理由
|
||||
};
|
||||
type List = {
|
||||
"type"?: string; // 业务类型,[enum:ApprovalTemplatesTypeEnum]
|
||||
"status"?: string; // 状态,[enum:ApprovalInstancesStatusEnum]
|
||||
"applicant_name"?: string; // 申请人姓名
|
||||
"asset_projects_id"?: number; // 所属项目id
|
||||
};
|
||||
type ProcessedList = {
|
||||
"type"?: string; // 业务类型,[enum:ApprovalTemplatesTypeEnum]
|
||||
"status"?: string; // 审批结果,[enum:ApprovalRecordsStatusEnum]
|
||||
"asset_projects_id"?: number; // 所属项目id
|
||||
};
|
||||
type CcList = {
|
||||
"type"?: string; // 业务类型,[enum:ApprovalTemplatesTypeEnum]
|
||||
"asset_projects_id"?: number; // 所属项目id
|
||||
};
|
||||
}
|
||||
namespace ApprovalTemplates {
|
||||
type List = {
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
"type"?: string; // 业务类型,[enum:ApprovalTemplatesTypeEnum]
|
||||
"is_enabled"?: boolean; // 是否启用
|
||||
"asset_projects_id"?: number; // 所属项目id
|
||||
};
|
||||
type Store = {
|
||||
"name": string; // 模板名称
|
||||
"code": string; // 模板编码
|
||||
"type": string; // 业务类型,[enum:ApprovalTemplatesTypeEnum]
|
||||
"description"?: string; // 模板描述
|
||||
"is_enabled"?: boolean; // 是否启用
|
||||
"asset_projects_id"?: number; // 所属项目id
|
||||
"nodes": string[]; // 审批节点列表
|
||||
};
|
||||
type Update = {
|
||||
"id": number; // id
|
||||
"name": string; // 模板名称
|
||||
"code": string; // 模板编码
|
||||
"type": string; // 业务类型,[enum:ApprovalTemplatesTypeEnum]
|
||||
"description"?: string; // 模板描述
|
||||
"is_enabled"?: boolean; // 是否启用
|
||||
"asset_projects_id"?: number; // 所属项目id
|
||||
"nodes": string[]; // 审批节点列表
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
};
|
||||
type SoftDelete = {
|
||||
"id": number; // id
|
||||
};
|
||||
type ToggleEnabled = {
|
||||
"id": number; // id
|
||||
"is_enabled": boolean; // 是否启用
|
||||
};
|
||||
type Select = {
|
||||
"type"?: string; // 业务类型,[enum:ApprovalTemplatesTypeEnum]
|
||||
"asset_projects_id"?: number; // 所属项目id
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Archive {
|
||||
namespace HouseOccupants {
|
||||
type List = {
|
||||
@ -760,6 +842,17 @@ declare namespace ApiTypes {
|
||||
"organizations_id"?: number; // 所属组织id,[ref:organizations]
|
||||
"keywords"?: string; // 关键词
|
||||
};
|
||||
type Import = {
|
||||
"upload_file": mimes:xlsx,xls; // 上传文件
|
||||
};
|
||||
type Export = {
|
||||
"organizations_id"?: number; // 组织机构ID
|
||||
"organization_name"?: string; // 组织机构名称
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
"phone"?: string; // 模糊搜索:手机号
|
||||
"download_type"?: string; // 下载类型:all-全部,page-当前页
|
||||
"current"?: number; // 当前页偏移量
|
||||
};
|
||||
}
|
||||
namespace CompanyPositions {
|
||||
type List = {
|
||||
@ -946,6 +1039,51 @@ declare namespace ApiTypes {
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace GoodsReleases {
|
||||
namespace GoodsReleases {
|
||||
type List = {
|
||||
"code"?: string; // 放行码
|
||||
"apply_name"?: string; // 申请人姓名
|
||||
"apply_phone"?: string; // 申请人电话
|
||||
"status"?: string; // 状态,[enum:GoodsReleasesStatusEnum]
|
||||
"passed_type"?: string; // 通行类型,[enum:GoodsReleasesPassedTypeEnum]
|
||||
"asset_projects_id"?: number; // 所属项目
|
||||
"asset_houses_id"?: number; // 房屋
|
||||
};
|
||||
type Store = {
|
||||
"asset_houses_id": number; // 访问房屋
|
||||
"apply_name": string; // 申请人姓名
|
||||
"apply_phone": string; // 申请人电话
|
||||
"passed_type": string; // 通行类型,[enum:GoodsReleasesPassedTypeEnum]
|
||||
"goods": string[]; // 放行物品信息
|
||||
"passed_time": Date; // 通行时间
|
||||
"remark"?: string; // 备注
|
||||
};
|
||||
type Update = {
|
||||
"id": number; // id
|
||||
"apply_name"?: string; // 申请人姓名
|
||||
"apply_phone"?: string; // 申请人电话
|
||||
"passed_type"?: string; // 通行类型,[enum:GoodsReleasesPassedTypeEnum]
|
||||
"goods"?: string[]; // 放行物品信息
|
||||
"passed_time"?: Date; // 通行时间
|
||||
"remark"?: string; // 备注
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
};
|
||||
type ApproveByEmployee = {
|
||||
"id": number; // id
|
||||
"status": string; // 审核状态(Approved/Rejected)
|
||||
"reason"?: string; // 驳回原因
|
||||
};
|
||||
type Release = {
|
||||
"id": number; // id
|
||||
};
|
||||
type ScanRelease = {
|
||||
"code": string; // 放行码
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Grid {
|
||||
namespace Grids {
|
||||
type List = {
|
||||
@ -1548,6 +1686,70 @@ declare namespace ApiTypes {
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Refund {
|
||||
namespace Refunds {
|
||||
type List = {
|
||||
"type"?: string; // 退款类型,[enum:RefundsTypeEnum]
|
||||
"business_id"?: number; // 业务ID(配合type使用)
|
||||
"refund_status"?: string; // 退款状态,[enum:RefundsStatusEnum]
|
||||
"applicant_name"?: string; // 申请人姓名
|
||||
"asset_projects_id"?: number; // 项目ID
|
||||
"apply_time"?: string[]; // 申请时间范围
|
||||
"asset_houses_id"?: number; // 房屋ID
|
||||
};
|
||||
type Store = {
|
||||
"type": string; // 退款类型,[enum:RefundsTypeEnum]
|
||||
"business_id"?: number; // 业务ID(根据type对应不同表)
|
||||
"refund_amount": number; // 退款金额(单位元)
|
||||
"company_receipt_accounts_id": number; // 出款账户id
|
||||
"payee_name"?: string; // 收款人姓名
|
||||
"payee_bank"?: string; // 收款银行
|
||||
"payee_account"?: string; // 收款账号
|
||||
"reason"?: string; // 退款原因
|
||||
"asset_projects_id"?: number; // 项目ID
|
||||
"approval_templates_id"?: number; // 审批模板ID
|
||||
"node_approvers"?: string[]; // 各节点审批人员列表
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Complete = {
|
||||
"id": number; // id
|
||||
"serial_number"?: string; // 退款流水号
|
||||
"refund_time"?: Date; // 退款时间
|
||||
"voucher"?: string[]; // 退款凭证
|
||||
};
|
||||
type Cancel = {
|
||||
"id": number; // id
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Visitor {
|
||||
namespace VisitorApplies {
|
||||
type List = {
|
||||
"status"?: string; // 审核状态,[enum:VisitorAppliesStatusEnum]
|
||||
"visit_start_time"?: Date; // 预计到访时间
|
||||
"visitor_name"?: string; // 模糊搜索:访客姓名
|
||||
"visitor_phone"?: string; // 模糊搜索:访客电话
|
||||
"host_phone"?: string; // 模糊搜索:被访人电话
|
||||
"asset_projects_id"?: number; // 项目ID
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // 申请id
|
||||
};
|
||||
type Approve = {
|
||||
"id": number; // 访客申请id
|
||||
};
|
||||
type Reject = {
|
||||
"id": number; // 访客申请id
|
||||
"remark": string; // 驳回原因
|
||||
};
|
||||
type Scan = {
|
||||
"code": string; // 通行码
|
||||
"scan_type": string; // 扫码类型:进入/离开,[enum:VisitorScanTypeEnum]
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace WorkOrder {
|
||||
namespace HouseWorkLogs {
|
||||
type List = {
|
||||
|
||||
129
src/gen/Apis.ts
129
src/gen/Apis.ts
@ -41,6 +41,63 @@ export const Apis = {
|
||||
},
|
||||
},
|
||||
},
|
||||
Approval: {
|
||||
ApprovalInstances: {
|
||||
PendingList(data?: ApiTypes.Approval.ApprovalInstances.PendingList): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_instances/pending_list', { data });
|
||||
},
|
||||
PendingCount(): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_instances/pending_count', {});
|
||||
},
|
||||
MyApplyList(): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_instances/my_apply_list', {});
|
||||
},
|
||||
Show(data: ApiTypes.Approval.ApprovalInstances.Show): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_instances/show', { data });
|
||||
},
|
||||
Approve(data: ApiTypes.Approval.ApprovalInstances.Approve): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_instances/approve', { data });
|
||||
},
|
||||
Cancel(data: ApiTypes.Approval.ApprovalInstances.Cancel): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_instances/cancel', { data });
|
||||
},
|
||||
Transfer(data: ApiTypes.Approval.ApprovalInstances.Transfer): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_instances/transfer', { data });
|
||||
},
|
||||
List(data?: ApiTypes.Approval.ApprovalInstances.List): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_instances/list', { data });
|
||||
},
|
||||
ProcessedList(data?: ApiTypes.Approval.ApprovalInstances.ProcessedList): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_instances/processed_list', { data });
|
||||
},
|
||||
CcList(data?: ApiTypes.Approval.ApprovalInstances.CcList): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_instances/cc_list', { data });
|
||||
},
|
||||
},
|
||||
ApprovalTemplates: {
|
||||
List(data?: ApiTypes.Approval.ApprovalTemplates.List): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_templates/list', { data });
|
||||
},
|
||||
Store(data: ApiTypes.Approval.ApprovalTemplates.Store): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_templates/store', { data });
|
||||
},
|
||||
Update(data: ApiTypes.Approval.ApprovalTemplates.Update): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_templates/update', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Approval.ApprovalTemplates.Show): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_templates/show', { data });
|
||||
},
|
||||
SoftDelete(data: ApiTypes.Approval.ApprovalTemplates.SoftDelete): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_templates/soft_delete', { data });
|
||||
},
|
||||
ToggleEnabled(data: ApiTypes.Approval.ApprovalTemplates.ToggleEnabled): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_templates/toggle_enabled', { data });
|
||||
},
|
||||
Select(data?: ApiTypes.Approval.ApprovalTemplates.Select): Promise<MyResponseType> {
|
||||
return request('company/approval/approval_templates/select', { data });
|
||||
},
|
||||
},
|
||||
},
|
||||
Archive: {
|
||||
HouseOccupants: {
|
||||
List(data?: ApiTypes.Archive.HouseOccupants.List): Promise<MyResponseType> {
|
||||
@ -366,6 +423,15 @@ export const Apis = {
|
||||
Select(data?: ApiTypes.Company.CompanyEmployees.Select): Promise<MyResponseType> {
|
||||
return request('company/company/company_employees/select', { data });
|
||||
},
|
||||
Import(data: ApiTypes.Company.CompanyEmployees.Import): Promise<MyResponseType> {
|
||||
return request('company/company/company_employees/import', { data });
|
||||
},
|
||||
DownloadTemplate(): Promise<MyResponseType> {
|
||||
return request('company/company/company_employees/download_template', {responseType: 'blob',});
|
||||
},
|
||||
Export(data?: ApiTypes.Company.CompanyEmployees.Export): Promise<MyResponseType> {
|
||||
return request('company/company/company_employees/export', { responseType: 'blob',data });
|
||||
},
|
||||
},
|
||||
CompanyPositions: {
|
||||
List(data?: ApiTypes.Company.CompanyPositions.List): Promise<MyResponseType> {
|
||||
@ -500,6 +566,31 @@ export const Apis = {
|
||||
},
|
||||
},
|
||||
},
|
||||
GoodsReleases: {
|
||||
GoodsReleases: {
|
||||
List(data?: ApiTypes.GoodsReleases.GoodsReleases.List): Promise<MyResponseType> {
|
||||
return request('company/goods_releases/goods_releases/list', { data });
|
||||
},
|
||||
Store(data: ApiTypes.GoodsReleases.GoodsReleases.Store): Promise<MyResponseType> {
|
||||
return request('company/goods_releases/goods_releases/store', { data });
|
||||
},
|
||||
Update(data: ApiTypes.GoodsReleases.GoodsReleases.Update): Promise<MyResponseType> {
|
||||
return request('company/goods_releases/goods_releases/update', { data });
|
||||
},
|
||||
Show(data: ApiTypes.GoodsReleases.GoodsReleases.Show): Promise<MyResponseType> {
|
||||
return request('company/goods_releases/goods_releases/show', { data });
|
||||
},
|
||||
ApproveByEmployee(data: ApiTypes.GoodsReleases.GoodsReleases.ApproveByEmployee): Promise<MyResponseType> {
|
||||
return request('company/goods_releases/goods_releases/approve_by_employee', { data });
|
||||
},
|
||||
Release(data: ApiTypes.GoodsReleases.GoodsReleases.Release): Promise<MyResponseType> {
|
||||
return request('company/goods_releases/goods_releases/release', { data });
|
||||
},
|
||||
ScanRelease(data: ApiTypes.GoodsReleases.GoodsReleases.ScanRelease): Promise<MyResponseType> {
|
||||
return request('company/goods_releases/goods_releases/scan_release', { data });
|
||||
},
|
||||
},
|
||||
},
|
||||
Grid: {
|
||||
Grids: {
|
||||
List(data?: ApiTypes.Grid.Grids.List): Promise<MyResponseType> {
|
||||
@ -864,6 +955,44 @@ export const Apis = {
|
||||
},
|
||||
},
|
||||
},
|
||||
Refund: {
|
||||
Refunds: {
|
||||
List(data?: ApiTypes.Refund.Refunds.List): Promise<MyResponseType> {
|
||||
return request('company/refund/refunds/list', { data });
|
||||
},
|
||||
Store(data: ApiTypes.Refund.Refunds.Store): Promise<MyResponseType> {
|
||||
return request('company/refund/refunds/store', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Refund.Refunds.Show): Promise<MyResponseType> {
|
||||
return request('company/refund/refunds/show', { data });
|
||||
},
|
||||
Complete(data: ApiTypes.Refund.Refunds.Complete): Promise<MyResponseType> {
|
||||
return request('company/refund/refunds/complete', { data });
|
||||
},
|
||||
Cancel(data: ApiTypes.Refund.Refunds.Cancel): Promise<MyResponseType> {
|
||||
return request('company/refund/refunds/cancel', { data });
|
||||
},
|
||||
},
|
||||
},
|
||||
Visitor: {
|
||||
VisitorApplies: {
|
||||
List(data?: ApiTypes.Visitor.VisitorApplies.List): Promise<MyResponseType> {
|
||||
return request('company/visitor/visitor_applies/list', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Visitor.VisitorApplies.Show): Promise<MyResponseType> {
|
||||
return request('company/visitor/visitor_applies/show', { data });
|
||||
},
|
||||
Approve(data: ApiTypes.Visitor.VisitorApplies.Approve): Promise<MyResponseType> {
|
||||
return request('company/visitor/visitor_applies/approve', { data });
|
||||
},
|
||||
Reject(data: ApiTypes.Visitor.VisitorApplies.Reject): Promise<MyResponseType> {
|
||||
return request('company/visitor/visitor_applies/reject', { data });
|
||||
},
|
||||
Scan(data: ApiTypes.Visitor.VisitorApplies.Scan): Promise<MyResponseType> {
|
||||
return request('company/visitor/visitor_applies/scan', { data });
|
||||
},
|
||||
},
|
||||
},
|
||||
WorkOrder: {
|
||||
HouseWorkLogs: {
|
||||
List(data: ApiTypes.WorkOrder.HouseWorkLogs.List): Promise<MyResponseType> {
|
||||
|
||||
109
src/gen/Enums.ts
109
src/gen/Enums.ts
@ -26,6 +26,41 @@ export const ActivityEnrollsStatusEnum= {
|
||||
'Cancelled': {"text":"取消","color":"#ff9800","value":"Cancelled"},
|
||||
};
|
||||
|
||||
// 审批实例状态枚举
|
||||
export const ApprovalInstancesStatusEnum= {
|
||||
'Pending': {"text":"待审批","color":"#ff9800","value":"Pending"},
|
||||
'Approved': {"text":"已通过","color":"#4caf50","value":"Approved"},
|
||||
'Rejected': {"text":"已拒绝","color":"#f44336","value":"Rejected"},
|
||||
'Cancelled': {"text":"已取消","color":"#9e9e9e","value":"Cancelled"},
|
||||
};
|
||||
|
||||
// 审批记录状态枚举
|
||||
export const ApprovalRecordsStatusEnum= {
|
||||
'Pending': {"text":"待审批","color":"#ff9800","value":"Pending"},
|
||||
'Approved': {"text":"同意","color":"#4caf50","value":"Approved"},
|
||||
'Rejected': {"text":"拒绝","color":"#f44336","value":"Rejected"},
|
||||
'Transferred': {"text":"转交","color":"#9c27b0","value":"Transferred"},
|
||||
};
|
||||
|
||||
// 审批方式枚举
|
||||
export const ApprovalTemplateNodesApproveTypeEnum= {
|
||||
'And': {"text":"会签","color":"#4caf50","value":"And"},
|
||||
'Or': {"text":"或签","color":"#ff9800","value":"Or"},
|
||||
};
|
||||
|
||||
// 审批节点类型枚举
|
||||
export const ApprovalTemplateNodesNodeTypeEnum= {
|
||||
'Approver': {"text":"审批人","color":"#2196f3","value":"Approver"},
|
||||
'CC': {"text":"抄送人","color":"#9e9e9e","value":"CC"},
|
||||
};
|
||||
|
||||
// 审批业务类型枚举
|
||||
export const ApprovalTemplatesTypeEnum= {
|
||||
'Contract': {"text":"合同","color":"#2196f3","value":"Contract"},
|
||||
'Finance': {"text":"财务","color":"#4caf50","value":"Finance"},
|
||||
'Refund': {"text":"退款","color":"#f44336","value":"Refund"},
|
||||
};
|
||||
|
||||
// 车位产权类型
|
||||
export const AssetCarPortsPropertyTypeEnum= {
|
||||
'Ownership': {"text":"产权车位","color":"#1e90ff","value":"Ownership"},
|
||||
@ -216,7 +251,7 @@ export const BannersTypeEnum= {
|
||||
|
||||
// 缓存类型
|
||||
export const CacheTypeEnum= {
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#6f374e","value":"MobilePhoneVerificationCode"},
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#817c26","value":"MobilePhoneVerificationCode"},
|
||||
};
|
||||
|
||||
// CompaniesMerchantTypeEnum
|
||||
@ -346,6 +381,29 @@ export const CustomerOpinionsTypeEnum= {
|
||||
'FeatureSuggestion': {"text":"新功能建议","color":"#00bfff","value":"FeatureSuggestion"},
|
||||
};
|
||||
|
||||
// 物品放行审核状态
|
||||
export const GoodsReleasesAuditStatusEnum= {
|
||||
'Pending': {"text":"待审核","color":"#faad14","value":"Pending"},
|
||||
'Approved': {"text":"已通过","color":"#52c41a","value":"Approved"},
|
||||
'Rejected': {"text":"已退回","color":"#ff4d4f","value":"Rejected"},
|
||||
};
|
||||
|
||||
// 物品放行通行类型
|
||||
export const GoodsReleasesPassedTypeEnum= {
|
||||
'Moving': {"text":"搬家","color":"#1890ff","value":"Moving"},
|
||||
'Delivery': {"text":"出货","color":"#52c41a","value":"Delivery"},
|
||||
'Other': {"text":"其他","color":"#faad14","value":"Other"},
|
||||
};
|
||||
|
||||
// 物品放行状态
|
||||
export const GoodsReleasesStatusEnum= {
|
||||
'Pending': {"text":"待审核","color":"#faad14","value":"Pending"},
|
||||
'OwnerApproved': {"text":"业主已审","color":"#1890ff","value":"OwnerApproved"},
|
||||
'Approved': {"text":"已通过","color":"#52c41a","value":"Approved"},
|
||||
'Rejected': {"text":"已退回","color":"#ff4d4f","value":"Rejected"},
|
||||
'Released': {"text":"已放行","color":"#722ed1","value":"Released"},
|
||||
};
|
||||
|
||||
// 账单状态枚举
|
||||
export const HouseBillsBillStatusEnum= {
|
||||
'PendingPayment': {"text":"待支付","color":"#facc15","value":"PendingPayment"},
|
||||
@ -733,6 +791,17 @@ export const RefundsStatusEnum= {
|
||||
'Cancelled': {"text":"已取消","color":"#9e9e9e","value":"Cancelled"},
|
||||
};
|
||||
|
||||
// 退款类型枚举
|
||||
export const RefundsTypeEnum= {
|
||||
'HouseBill': {"text":"物业费退款","color":"#2196f3","value":"HouseBill"},
|
||||
'Bill': {"text":"账单退款","color":"#4caf50","value":"Bill"},
|
||||
'ContractBill': {"text":"合同退款","color":"#ff9800","value":"ContractBill"},
|
||||
'RenovationApply': {"text":"退保证金","color":"#86aac3ff","value":"RenovationApply"},
|
||||
'HouseDoorCard': {"text":"门禁退款","color":"#9c27b0","value":"HouseDoorCard"},
|
||||
'HouseWorkOrder': {"text":"工单退款","color":"#00bcd4","value":"HouseWorkOrder"},
|
||||
'Other': {"text":"其他退款","color":"#607d8b","value":"Other"},
|
||||
};
|
||||
|
||||
// 性别
|
||||
export const SexEnum= {
|
||||
'Male': {"text":"男","color":"#0000ff","value":"Male"},
|
||||
@ -753,6 +822,44 @@ export const SysPermissionsTypeEnum= {
|
||||
'Button': {"text":"按钮","color":"#97224f","value":"Button"},
|
||||
};
|
||||
|
||||
// 来访事由
|
||||
export const VisitReasonEnum= {
|
||||
'Visit': {"text":"拜访","color":"#2196f3","value":"Visit"},
|
||||
'Business': {"text":"商务","color":"#3f51b5","value":"Business"},
|
||||
'Interview': {"text":"面试","color":"#9c27b0","value":"Interview"},
|
||||
'Private': {"text":"私人","color":"#e91e63","value":"Private"},
|
||||
'Express': {"text":"快递","color":"#00bcd4","value":"Express"},
|
||||
'Renovation': {"text":"装修","color":"#ff5722","value":"Renovation"},
|
||||
'Other': {"text":"其他","color":"#607d8b","value":"Other"},
|
||||
};
|
||||
|
||||
// 访客申请状态
|
||||
export const VisitorAppliesStatusEnum= {
|
||||
'Pending': {"text":"审核中","color":"#ff9800","value":"Pending"},
|
||||
'Approved': {"text":"已通过","color":"#4caf50","value":"Approved"},
|
||||
'Rejected': {"text":"已驳回","color":"#f44336","value":"Rejected"},
|
||||
'Expired': {"text":"已失效","color":"#9e9e9e","value":"Expired"},
|
||||
};
|
||||
|
||||
// 访客申请类型
|
||||
export const VisitorApplyTypeEnum= {
|
||||
'invite': {"text":"业主邀请","color":"#2196f3","value":"invite"},
|
||||
'register': {"text":"访客登记","color":"#ff9800","value":"register"},
|
||||
};
|
||||
|
||||
// 通行码状态
|
||||
export const VisitorCodeStatusEnum= {
|
||||
'unused': {"text":"未使用","color":"#2196f3","value":"unused"},
|
||||
'used': {"text":"已使用","color":"#4caf50","value":"used"},
|
||||
'expired': {"text":"已过期","color":"#f44336","value":"expired"},
|
||||
};
|
||||
|
||||
// 访客扫码类型
|
||||
export const VisitorScanTypeEnum= {
|
||||
'enter': {"text":"进入","color":"#4caf50","value":"enter"},
|
||||
'exit': {"text":"离开","color":"#f44336","value":"exit"},
|
||||
};
|
||||
|
||||
// WechatAuthsPlatformEnum
|
||||
export const WechatAuthsPlatformEnum= {
|
||||
'MiniProgram': {"text":"微信小程序","color":"#3b82f6","value":"MiniProgram"},
|
||||
|
||||
86
src/pages/approval/approval/index.tsx
Normal file
86
src/pages/approval/approval/index.tsx
Normal file
@ -0,0 +1,86 @@
|
||||
import { MyColumns, MyPageContainer, MyProTableProps } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
ApprovalInstancesStatusEnum,
|
||||
ApprovalTemplatesTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import Audit from '../pending/modals/Audit';
|
||||
|
||||
export default function Index({ title = '待我审批' }) {
|
||||
const navigate = useNavigate();
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="approval_instances"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
status: 'Pending',
|
||||
...params,
|
||||
},
|
||||
sort,
|
||||
Apis.Approval.ApprovalInstances.PendingList,
|
||||
)
|
||||
}
|
||||
headerTitle="待我审批"
|
||||
columns={[
|
||||
MyColumns.ID({ search: false }),
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: ApprovalInstancesStatusEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
dataIndex: ['approval_instance', 'type'],
|
||||
title: '类型',
|
||||
valueEnum: ApprovalTemplatesTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '申请事项',
|
||||
dataIndex: ['approval_instance', 'title'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '关联项目',
|
||||
dataIndex: ['approval_instance', 'asset_project', 'name'],
|
||||
search: false,
|
||||
},
|
||||
|
||||
{
|
||||
title: '申请人',
|
||||
dataIndex: 'approver_name',
|
||||
},
|
||||
|
||||
// {
|
||||
// title: '有效期',
|
||||
// search: false,
|
||||
// render: (_, item: any) => {
|
||||
// return `${dayjs(
|
||||
// item?.approval_instance?.model?.start_time,
|
||||
// ).format('YYYY-MM-DD')}至${dayjs(
|
||||
// item?.approval_instance?.model?.end_time,
|
||||
// ).format('YYYY-MM-DD')}`;
|
||||
// },
|
||||
// },
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<Audit item={item} reload={action?.reload} title={title} />
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
74
src/pages/approval/cc_me/index.tsx
Normal file
74
src/pages/approval/cc_me/index.tsx
Normal file
@ -0,0 +1,74 @@
|
||||
import { MyColumns, MyPageContainer, MyProTableProps } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
ApprovalInstancesStatusEnum,
|
||||
ApprovalTemplatesTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import Show from './modals/Show';
|
||||
export default function Index({ title = '抄送我的' }) {
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="my_apply_list"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Approval.ApprovalInstances.CcList,
|
||||
)
|
||||
}
|
||||
headerTitle={title}
|
||||
columns={[
|
||||
MyColumns.ID({ search: false }),
|
||||
{
|
||||
title: '申请事项',
|
||||
dataIndex: 'title',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '关联项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: ApprovalInstancesStatusEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
dataIndex: 'type',
|
||||
title: '业务类型',
|
||||
valueEnum: ApprovalTemplatesTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
|
||||
// {
|
||||
// title: '项目ID',
|
||||
// dataIndex: 'asset_projects_id',
|
||||
// hidden: true,
|
||||
// },
|
||||
// {
|
||||
// title: '申请人',
|
||||
// dataIndex: 'applicant_name',
|
||||
// search: false,
|
||||
// },
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<Show item={item} reload={action?.reload} title={title} />
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
250
src/pages/approval/cc_me/modals/Show.tsx
Normal file
250
src/pages/approval/cc_me/modals/Show.tsx
Normal file
@ -0,0 +1,250 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyModalFormProps,
|
||||
renderTextHelper,
|
||||
} from '@/common';
|
||||
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { RefundsTypeEnum } from '@/gen/Enums';
|
||||
import BIllInfo from '@/pages/bills/house_bills/modals/BIllInfo';
|
||||
import {
|
||||
BetaSchemaForm,
|
||||
ProCard,
|
||||
ProDescriptions,
|
||||
} from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Form, Space, Steps } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={props.title}
|
||||
trigger={<MyButtons.Default title="查看" type="primary" />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={() => {
|
||||
if (props?.item?.id) {
|
||||
Apis.Approval.ApprovalInstances.Show({
|
||||
id: props.item?.model_id,
|
||||
}).then((res) => {
|
||||
form.setFieldsValue({
|
||||
info_display: res?.data,
|
||||
});
|
||||
});
|
||||
}
|
||||
}}
|
||||
columns={[
|
||||
{
|
||||
// title: '登记信息',
|
||||
dataIndex: 'info_display',
|
||||
valueType: 'text',
|
||||
renderFormItem: (_, config) => (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<div>
|
||||
{/* 退款详情 */}
|
||||
{config?.value?.type === 'Refund' && (
|
||||
<ProCard size="small">
|
||||
<ProDescriptions size="small" column={2}>
|
||||
<ProDescriptions.Item label="申请事项" span={2}>
|
||||
{config?.value?.title || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="账单类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={RefundsTypeEnum}
|
||||
value={config?.value?.model?.type}
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="退款金额">
|
||||
<Space>
|
||||
{config?.value?.model?.refund_amount || '-'}
|
||||
元
|
||||
<BIllInfo
|
||||
item={{
|
||||
id: config?.value?.model?.refundable_id,
|
||||
type: 'link',
|
||||
}}
|
||||
title="查看账单"
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="付款信息" span={2}>
|
||||
{config?.value?.model?.payer_name || '-'}|
|
||||
{config?.value?.model?.payer_bank || '-'}|
|
||||
{config?.value?.model?.payer_account || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收款信息" span={2}>
|
||||
{config?.value?.model?.payee_name || '-'}
|
||||
{config?.value?.model?.payee_bank || '-'}
|
||||
{config?.value?.model?.payee_account || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="申请人" span={2}>
|
||||
{props?.item?.applicant?.name || '-'}:
|
||||
{props?.item?.applicant?.phone || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="申请时间">
|
||||
{props?.item?.created_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
)}
|
||||
{/* 合同详情 */}
|
||||
{config?.value?.type === 'Contract' && (
|
||||
<ProCard size="small">
|
||||
<ProDescriptions size="small" column={2}>
|
||||
<ProDescriptions.Item label="合同名称" span={2}>
|
||||
{config?.value?.model?.name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="合同编号" span={2}>
|
||||
<Space>
|
||||
{config?.value?.model?.code || '-'}
|
||||
<BIllInfo
|
||||
item={{
|
||||
id: config?.value?.model?.refundable_id,
|
||||
type: 'Contract',
|
||||
}}
|
||||
title="查看合同"
|
||||
/>
|
||||
<MyButtons.View
|
||||
title="查看"
|
||||
key="configInfo"
|
||||
onClick={() => {
|
||||
navigate(
|
||||
`/contract/contracts/show/${config?.value?.model?.id}`,
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
{/* <ProDescriptions.Item label="收支类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={ContractTemplatesIncomeExpenseTypeEnum}
|
||||
value={config?.value?.model?.income_expense_type}
|
||||
/>
|
||||
</ProDescriptions.Item> */}
|
||||
{/* <ProDescriptions.Item label="合同性质">
|
||||
<renderTextHelper.Tag
|
||||
Enums={ContractsContractNatureEnum}
|
||||
value={config?.value?.model?.contract_nature}
|
||||
/>
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="合同类型">
|
||||
{config?.value?.model?.contract_type_name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
{/* <ProDescriptions.Item label="结算模式">
|
||||
<renderTextHelper.Tag
|
||||
Enums={ContractsSettlementModeEnum}
|
||||
value={config?.value?.model?.settlement_mode}
|
||||
/>
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="合同金额">
|
||||
{config?.value?.model?.total_amount || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="保证金金额">
|
||||
{config?.value?.model?.deposit_amount || '无'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="签约主体">
|
||||
{config?.value?.model?.sign_subject || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="签约部门">
|
||||
{config?.value?.model?.sign_department || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="关联项目">
|
||||
{config?.value?.model?.project_name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="合同对接人">
|
||||
{config?.value?.model?.contract_liaison || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="合同有效期" span={2}>
|
||||
{config?.value?.model?.start_time?.substring(0, 10)}至
|
||||
{config?.value?.model?.end_time?.substring(0, 10)}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="申请人" span={2}>
|
||||
{props?.item?.applicant?.name || '-'}:
|
||||
{props?.item?.applicant?.phone || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="申请时间" span={2}>
|
||||
{props?.item?.created_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="附件" span={2}>
|
||||
{config?.value?.model?.attachments.map((item: any) => {
|
||||
const handleDownload = async (
|
||||
e: React.MouseEvent,
|
||||
) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
const response = await fetch(item.url);
|
||||
const blob = await response.blob();
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = item.name;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
document.body.removeChild(a);
|
||||
} catch (error) {
|
||||
console.error('下载失败:', error);
|
||||
// 如果下载失败,则在新窗口打开
|
||||
window.open(item.url, '_blank');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div key={item.url}>
|
||||
<a href={item.url} onClick={handleDownload}>
|
||||
{item.name};
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
)}
|
||||
<ProCard>
|
||||
<ProDescriptions>
|
||||
<ProDescriptions.Item label="审核记录">
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<Steps
|
||||
progressDot
|
||||
direction="vertical"
|
||||
current={config?.value?.approval_records.length}
|
||||
items={config?.value?.approval_records.map(
|
||||
(item: any) =>
|
||||
item?.node_type === 'Approver'
|
||||
? {
|
||||
title: `${
|
||||
item.company_employee?.name || '-'
|
||||
}-${item?.company_employee?.phone}`,
|
||||
description: `${
|
||||
item.status === 'Approved'
|
||||
? `通过 - ${item.opinion || '-'} - ${
|
||||
item.created_at || '-'
|
||||
}`
|
||||
: '待审核'
|
||||
}`,
|
||||
}
|
||||
: '',
|
||||
)}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</div>
|
||||
</Space>
|
||||
),
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
99
src/pages/approval/my_apply/index.tsx
Normal file
99
src/pages/approval/my_apply/index.tsx
Normal file
@ -0,0 +1,99 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
ApprovalInstancesStatusEnum,
|
||||
ApprovalTemplatesTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
export default function Index({ title = '我的发起' }) {
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="my_apply_list"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Approval.ApprovalInstances.MyApplyList,
|
||||
)
|
||||
}
|
||||
headerTitle={title}
|
||||
columns={[
|
||||
MyColumns.ID({ search: false }),
|
||||
{
|
||||
title: '申请事项',
|
||||
dataIndex: 'title',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '关联项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: ApprovalInstancesStatusEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
dataIndex: 'type',
|
||||
title: '业务类型',
|
||||
valueEnum: ApprovalTemplatesTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '当前审批人',
|
||||
dataIndex: ['approval_records', 'approver_name'],
|
||||
search: false,
|
||||
render: (_, item: any) =>
|
||||
`${item?.approval_records?.[0]?.company_employee?.name || ''}-${
|
||||
item?.approval_records?.[0]?.company_employee?.phone || ''
|
||||
}`,
|
||||
},
|
||||
// {
|
||||
// title: '项目ID',
|
||||
// dataIndex: 'asset_projects_id',
|
||||
// hidden: true,
|
||||
// },
|
||||
// {
|
||||
// title: '申请人',
|
||||
// dataIndex: 'applicant_name',
|
||||
// search: false,
|
||||
// },
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
{/* <Update item={item} reload={action?.reload} title={title} /> */}
|
||||
<MyButtons.Default
|
||||
title="撤销"
|
||||
isConfirm
|
||||
description="确认撤销该申请吗?"
|
||||
disabled={item.status !== 'Pending'}
|
||||
color="danger"
|
||||
variant="solid"
|
||||
onConfirm={() =>
|
||||
Apis.Approval.ApprovalInstances.Cancel({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
63
src/pages/approval/my_processed/index.tsx
Normal file
63
src/pages/approval/my_processed/index.tsx
Normal file
@ -0,0 +1,63 @@
|
||||
import { MyColumns, MyPageContainer, MyProTableProps } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
ApprovalInstancesStatusEnum,
|
||||
ApprovalTemplatesTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import Show from './modals/Show';
|
||||
export default function Index({ title = '我的发起' }) {
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="my_apply_list"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Approval.ApprovalInstances.ProcessedList,
|
||||
)
|
||||
}
|
||||
headerTitle={title}
|
||||
columns={[
|
||||
MyColumns.ID({ search: false }),
|
||||
{
|
||||
title: '申请事项',
|
||||
dataIndex: 'title',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '关联项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: ApprovalInstancesStatusEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
dataIndex: 'type',
|
||||
title: '业务类型',
|
||||
valueEnum: ApprovalTemplatesTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<Show item={item} reload={action?.reload} title={title} />
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
250
src/pages/approval/my_processed/modals/Show.tsx
Normal file
250
src/pages/approval/my_processed/modals/Show.tsx
Normal file
@ -0,0 +1,250 @@
|
||||
import { MyBetaModalFormProps, MyButtons, MyModalFormProps } from '@/common';
|
||||
|
||||
import { Apis } from '@/gen/Apis';
|
||||
// import {
|
||||
// ContractsContractNatureEnum,
|
||||
// ContractsSettlementModeEnum,
|
||||
// ContractTemplatesIncomeExpenseTypeEnum,
|
||||
// RefundsTypeEnum,
|
||||
// } from '@/gen/Enums';
|
||||
import BIllInfo from '@/pages/bills/house_bills/modals/BIllInfo';
|
||||
import {
|
||||
BetaSchemaForm,
|
||||
ProCard,
|
||||
ProDescriptions,
|
||||
} from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Form, Space, Steps } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={props.title}
|
||||
trigger={<MyButtons.Default title="查看" type="primary" />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={() => {
|
||||
if (props?.item?.id) {
|
||||
Apis.Approval.ApprovalInstances.Show({
|
||||
id: props.item?.model_id,
|
||||
}).then((res) => {
|
||||
form.setFieldsValue({
|
||||
info_display: res?.data,
|
||||
});
|
||||
});
|
||||
}
|
||||
}}
|
||||
columns={[
|
||||
{
|
||||
// title: '登记信息',
|
||||
dataIndex: 'info_display',
|
||||
valueType: 'text',
|
||||
renderFormItem: (_, config) => (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<div>
|
||||
{/* 退款详情 */}
|
||||
{config?.value?.type === 'Refund' && (
|
||||
<ProCard size="small">
|
||||
<ProDescriptions size="small" column={2}>
|
||||
<ProDescriptions.Item label="申请事项" span={2}>
|
||||
{config?.value?.title || '-'}
|
||||
</ProDescriptions.Item>
|
||||
{/* <ProDescriptions.Item label="账单类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={RefundsTypeEnum}
|
||||
value={config?.value?.model?.type}
|
||||
/>
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="退款金额">
|
||||
<Space>
|
||||
{config?.value?.model?.refund_amount || '-'}
|
||||
元
|
||||
<BIllInfo
|
||||
item={{
|
||||
id: config?.value?.model?.refundable_id,
|
||||
type: 'link',
|
||||
}}
|
||||
title="查看账单"
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="付款信息" span={2}>
|
||||
{config?.value?.model?.payer_name || '-'}|
|
||||
{config?.value?.model?.payer_bank || '-'}|
|
||||
{config?.value?.model?.payer_account || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收款信息" span={2}>
|
||||
{config?.value?.model?.payee_name || '-'}
|
||||
{config?.value?.model?.payee_bank || '-'}
|
||||
{config?.value?.model?.payee_account || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="申请人" span={2}>
|
||||
{props?.item?.applicant?.name || '-'}:
|
||||
{props?.item?.applicant?.phone || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="申请时间" span={2}>
|
||||
{props?.item?.created_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
)}
|
||||
{/* 合同详情 */}
|
||||
{config?.value?.type === 'Contract' && (
|
||||
<ProCard size="small">
|
||||
<ProDescriptions size="small" column={2}>
|
||||
<ProDescriptions.Item label="合同名称" span={2}>
|
||||
{config?.value?.model?.name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="合同编号" span={2}>
|
||||
<Space>
|
||||
{config?.value?.model?.code || '-'}
|
||||
<BIllInfo
|
||||
item={{
|
||||
id: config?.value?.model?.refundable_id,
|
||||
type: 'Contract',
|
||||
}}
|
||||
title="查看合同"
|
||||
/>
|
||||
<MyButtons.View
|
||||
title="查看"
|
||||
key="configInfo"
|
||||
onClick={() => {
|
||||
navigate(
|
||||
`/contract/contracts/show/${config?.value?.model?.id}`,
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
{/* <ProDescriptions.Item label="收支类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={ContractTemplatesIncomeExpenseTypeEnum}
|
||||
value={config?.value?.model?.income_expense_type}
|
||||
/>
|
||||
</ProDescriptions.Item> */}
|
||||
{/* <ProDescriptions.Item label="合同性质">
|
||||
<renderTextHelper.Tag
|
||||
Enums={ContractsContractNatureEnum}
|
||||
value={config?.value?.model?.contract_nature}
|
||||
/>
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="合同类型">
|
||||
{config?.value?.model?.contract_type_name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
{/* <ProDescriptions.Item label="结算模式">
|
||||
<renderTextHelper.Tag
|
||||
Enums={ContractsSettlementModeEnum}
|
||||
value={config?.value?.model?.settlement_mode}
|
||||
/>
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="合同金额">
|
||||
{config?.value?.model?.total_amount || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="保证金金额">
|
||||
{config?.value?.model?.deposit_amount || '无'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="签约主体">
|
||||
{config?.value?.model?.sign_subject || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="签约部门">
|
||||
{config?.value?.model?.sign_department || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="关联项目">
|
||||
{config?.value?.model?.project_name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="合同对接人">
|
||||
{config?.value?.model?.contract_liaison || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="合同有效期" span={2}>
|
||||
{config?.value?.model?.start_time?.substring(0, 10)}至
|
||||
{config?.value?.model?.end_time?.substring(0, 10)}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="申请人" span={2}>
|
||||
{props?.item?.applicant?.name || '-'}:
|
||||
{props?.item?.applicant?.phone || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="申请时间" span={2}>
|
||||
{props?.item?.created_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="附件" span={2}>
|
||||
{config?.value?.model?.attachments.map((item: any) => {
|
||||
const handleDownload = async (
|
||||
e: React.MouseEvent,
|
||||
) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
const response = await fetch(item.url);
|
||||
const blob = await response.blob();
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = item.name;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
document.body.removeChild(a);
|
||||
} catch (error) {
|
||||
console.error('下载失败:', error);
|
||||
// 如果下载失败,则在新窗口打开
|
||||
window.open(item.url, '_blank');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div key={item.url}>
|
||||
<a href={item.url} onClick={handleDownload}>
|
||||
{item.name};
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
)}
|
||||
<ProCard>
|
||||
<ProDescriptions>
|
||||
<ProDescriptions.Item label="审核记录">
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<Steps
|
||||
progressDot
|
||||
direction="vertical"
|
||||
current={config?.value?.approval_records?.length}
|
||||
items={config?.value?.approval_records?.map(
|
||||
(item: any) =>
|
||||
item?.node_type === 'Approver'
|
||||
? {
|
||||
title: `${
|
||||
item.company_employee?.name || '-'
|
||||
}-${item?.company_employee?.phone}`,
|
||||
description: `${
|
||||
item.status === 'Approved'
|
||||
? `通过 - ${item.opinion || '-'} - ${
|
||||
item.created_at || '-'
|
||||
}`
|
||||
: '待审核'
|
||||
}`,
|
||||
}
|
||||
: '',
|
||||
)}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</div>
|
||||
</Space>
|
||||
),
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
86
src/pages/approval/pending/index.tsx
Normal file
86
src/pages/approval/pending/index.tsx
Normal file
@ -0,0 +1,86 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
ApprovalInstancesStatusEnum,
|
||||
ApprovalTemplatesTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import Audit from './modals/Audit';
|
||||
import Forwarded from './modals/Forwarded';
|
||||
export default function Index({ title = '我的待办' }) {
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="my_apply_list"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
status: ApprovalInstancesStatusEnum.Pending.value,
|
||||
},
|
||||
sort,
|
||||
Apis.Approval.ApprovalInstances.PendingList,
|
||||
)
|
||||
}
|
||||
headerTitle={title}
|
||||
columns={[
|
||||
MyColumns.ID({ search: false }),
|
||||
{
|
||||
title: '申请事项',
|
||||
dataIndex: ['approval_instance', 'title'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '关联项目',
|
||||
dataIndex: ['approval_instance', 'asset_project', 'name'],
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: ['approval_instance', 'status'],
|
||||
valueEnum: ApprovalInstancesStatusEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
dataIndex: ['approval_instance', 'type'],
|
||||
title: '业务类型',
|
||||
valueEnum: ApprovalTemplatesTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<Audit item={item} reload={action?.reload} title={title} />
|
||||
<Forwarded item={item} reload={action?.reload} title="转办" />
|
||||
<MyButtons.Default
|
||||
title="撤销"
|
||||
isConfirm
|
||||
description="确认撤销该申请吗?"
|
||||
disabled={item.status !== 'Pending'}
|
||||
color="danger"
|
||||
variant="solid"
|
||||
onConfirm={() =>
|
||||
Apis.Approval.ApprovalInstances.Cancel({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
320
src/pages/approval/pending/modals/Audit.tsx
Normal file
320
src/pages/approval/pending/modals/Audit.tsx
Normal file
@ -0,0 +1,320 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
renderTextHelper,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { HouseRegistersStatusEnum, RefundsTypeEnum } from '@/gen/Enums';
|
||||
import BIllInfo from '@/pages/bills/house_bills/modals/BIllInfo';
|
||||
import {
|
||||
BetaSchemaForm,
|
||||
ProCard,
|
||||
ProDescriptions,
|
||||
} from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Form, message, Space, Steps } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 监听status字段变化,动态设置默认审批意见
|
||||
const handleStatusChange = (changedValues: any) => {
|
||||
if (changedValues.status) {
|
||||
if (changedValues.status === HouseRegistersStatusEnum.Approved.value) {
|
||||
form.setFieldsValue({ opinion: '同意' });
|
||||
} else if (
|
||||
changedValues.status === HouseRegistersStatusEnum.Rejected.value
|
||||
) {
|
||||
form.setFieldsValue({ opinion: '不同意' });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={props.title}
|
||||
trigger={<MyButtons.Default title="审核" type="primary" />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={() => {
|
||||
if (props?.item?.id) {
|
||||
Apis.Approval.ApprovalInstances.Show({
|
||||
id: props.item?.approval_instances_id,
|
||||
}).then((res) => {
|
||||
form.setFieldsValue({
|
||||
info_display: res?.data,
|
||||
});
|
||||
});
|
||||
}
|
||||
}}
|
||||
initialValues={{
|
||||
// 默认选择通过,审批意见为同意
|
||||
status: HouseRegistersStatusEnum.Approved.value,
|
||||
opinion: '同意',
|
||||
}}
|
||||
onValuesChange={handleStatusChange}
|
||||
onFinish={async (values: any) =>
|
||||
Apis.Approval.ApprovalInstances.Approve({
|
||||
record_id: props.item?.id ?? 0,
|
||||
...values,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
// title: '登记信息',
|
||||
dataIndex: 'info_display',
|
||||
valueType: 'text',
|
||||
renderFormItem: (_, config) => (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<div>
|
||||
{/* 退款详情 */}
|
||||
{config?.value?.type === 'Refund' && (
|
||||
<ProCard size="small">
|
||||
<ProDescriptions size="small" column={2}>
|
||||
<ProDescriptions.Item label="申请事项" span={2}>
|
||||
{config?.value?.title || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="账单类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={RefundsTypeEnum}
|
||||
value={config?.value?.model?.type}
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="退款金额">
|
||||
<Space>
|
||||
{config?.value?.model?.refund_amount || '-'}
|
||||
元
|
||||
<BIllInfo
|
||||
item={{
|
||||
id: config?.value?.model?.refundable_id,
|
||||
type: 'link',
|
||||
}}
|
||||
title="查看账单"
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="付款信息" span={2}>
|
||||
{config?.value?.model?.payer_name || '-'}|
|
||||
{config?.value?.model?.payer_bank || '-'}|
|
||||
{config?.value?.model?.payer_account || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收款信息" span={2}>
|
||||
{config?.value?.model?.payee_name || '-'}
|
||||
{config?.value?.model?.payee_bank || '-'}
|
||||
{config?.value?.model?.payee_account || '-'}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="申请时间">
|
||||
{props?.item?.created_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
)}
|
||||
{/* 合同详情 */}
|
||||
{config?.value?.type === 'Contract' && (
|
||||
<ProCard size="small">
|
||||
<ProDescriptions size="small" column={2}>
|
||||
<ProDescriptions.Item label="合同名称" span={2}>
|
||||
{config?.value?.model?.name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="合同编号" span={2}>
|
||||
<Space>
|
||||
{config?.value?.model?.code || '-'}
|
||||
<BIllInfo
|
||||
item={{
|
||||
id: config?.value?.model?.refundable_id,
|
||||
type: 'Contract',
|
||||
}}
|
||||
title="查看合同"
|
||||
/>
|
||||
<MyButtons.View
|
||||
title="查看"
|
||||
key="configInfo"
|
||||
onClick={() => {
|
||||
navigate(
|
||||
`/contract/contracts/show/${config?.value?.model?.id}`,
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
{/* <ProDescriptions.Item label="收支类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={ContractTemplatesIncomeExpenseTypeEnum}
|
||||
value={config?.value?.model?.income_expense_type}
|
||||
/>
|
||||
</ProDescriptions.Item> */}
|
||||
{/* <ProDescriptions.Item label="合同性质">
|
||||
<renderTextHelper.Tag
|
||||
Enums={ContractsContractNatureEnum}
|
||||
value={config?.value?.model?.contract_nature}
|
||||
/>
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="合同类型">
|
||||
{config?.value?.model?.contract_type_name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
{/* <ProDescriptions.Item label="结算模式">
|
||||
<renderTextHelper.Tag
|
||||
Enums={ContractsSettlementModeEnum}
|
||||
value={config?.value?.model?.settlement_mode}
|
||||
/>
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="合同金额">
|
||||
{config?.value?.model?.total_amount || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="保证金金额">
|
||||
{config?.value?.model?.deposit_amount || '无'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="签约主体">
|
||||
{config?.value?.model?.sign_subject || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="签约部门">
|
||||
{config?.value?.model?.sign_department || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="关联项目">
|
||||
{config?.value?.model?.project_name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="合同对接人">
|
||||
{config?.value?.model?.contract_liaison || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="合同有效期" span={2}>
|
||||
{config?.value?.model?.start_time?.substring(0, 10)}至
|
||||
{config?.value?.model?.end_time?.substring(0, 10)}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="申请时间" span={2}>
|
||||
{props?.item?.created_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="附件" span={2}>
|
||||
{config?.value?.model?.attachments.map((item: any) => {
|
||||
const handleDownload = async (
|
||||
e: React.MouseEvent,
|
||||
) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
const response = await fetch(item.url);
|
||||
const blob = await response.blob();
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = item.name;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
document.body.removeChild(a);
|
||||
} catch (error) {
|
||||
console.error('下载失败:', error);
|
||||
// 如果下载失败,则在新窗口打开
|
||||
window.open(item.url, '_blank');
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div key={item.url}>
|
||||
<a href={item.url} onClick={handleDownload}>
|
||||
{item.name};
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
)}
|
||||
<ProCard>
|
||||
<ProDescriptions>
|
||||
<ProDescriptions.Item label="审核记录">
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<Steps
|
||||
progressDot
|
||||
direction="vertical"
|
||||
current={config?.value?.approval_records.length}
|
||||
items={config?.value?.approval_records.map(
|
||||
(item: any) =>
|
||||
item?.node_type === 'Approver'
|
||||
? {
|
||||
title: `${
|
||||
item.company_employee?.name || '-'
|
||||
}-${item?.company_employee?.phone}`,
|
||||
description: `${
|
||||
item.status === 'Approved'
|
||||
? `通过 - ${item.opinion || '-'} - ${
|
||||
item.created_at || '-'
|
||||
}`
|
||||
: '待审核'
|
||||
}`,
|
||||
}
|
||||
: '',
|
||||
)}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</div>
|
||||
</Space>
|
||||
),
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
{
|
||||
valueType: 'group',
|
||||
// title: '审核操作',
|
||||
columns: [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'status',
|
||||
title: '审核操作',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(
|
||||
JSON.stringify(HouseRegistersStatusEnum),
|
||||
);
|
||||
delete obj.Pending;
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['status'],
|
||||
columns: ({ status }) => {
|
||||
return status === 'Rejected'
|
||||
? [
|
||||
{
|
||||
title: '审批意见',
|
||||
dataIndex: 'opinion',
|
||||
valueType: 'textarea',
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
title: '审批意见',
|
||||
dataIndex: 'opinion',
|
||||
valueType: 'textarea',
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
59
src/pages/approval/pending/modals/Forwarded.tsx
Normal file
59
src/pages/approval/pending/modals/Forwarded.tsx
Normal file
@ -0,0 +1,59 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Index(props: MyBetaModalFormProps & { item: any }) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Asset.AssetItemInventories.Assign>
|
||||
{...MyModalFormProps.props}
|
||||
title={`转交他人审核`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title || '转办'} type="primary" />
|
||||
}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue({});
|
||||
}
|
||||
}}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onFinish={async (values: any) => {
|
||||
Apis.Approval.ApprovalInstances.Transfer({
|
||||
...values,
|
||||
record_id: props.item.id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('转交成功!');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false);
|
||||
}}
|
||||
columns={[
|
||||
Selects?.Employees({
|
||||
title: '选择新的审核人',
|
||||
key: 'to_employee_id',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
title: '转交理由',
|
||||
valueType: 'textarea',
|
||||
key: 'opinion',
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
83
src/pages/approval/templates/index.tsx
Normal file
83
src/pages/approval/templates/index.tsx
Normal file
@ -0,0 +1,83 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ApprovalTemplatesTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import BatchModifyApprover from './modals/BatchModifyApprover';
|
||||
import Create from './modals/Create';
|
||||
import Update from './modals/Update';
|
||||
|
||||
export default function Index({ title = '审批模板' }) {
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="contract_types"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Approval.ApprovalTemplates.List,
|
||||
)
|
||||
}
|
||||
headerTitle={title}
|
||||
toolBarRender={(action) => [
|
||||
<BatchModifyApprover
|
||||
key="BatchModifyApprover"
|
||||
reload={action?.reload}
|
||||
title="批量修改审批人"
|
||||
/>,
|
||||
<Create key="Create" reload={action?.reload} title={title} />,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID({
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '业务类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: ApprovalTemplatesTypeEnum,
|
||||
}),
|
||||
{
|
||||
title: '模版名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '模版编码',
|
||||
dataIndex: 'code',
|
||||
search: false,
|
||||
},
|
||||
|
||||
MyColumns.ToggleEnabled({
|
||||
onToggleEnabled: Apis.Approval.ApprovalTemplates.ToggleEnabled,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<Update item={item} reload={action?.reload} title={title} />
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Approval.ApprovalTemplates.SoftDelete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
62
src/pages/approval/templates/modals/BatchModifyApprover.tsx
Normal file
62
src/pages/approval/templates/modals/BatchModifyApprover.tsx
Normal file
@ -0,0 +1,62 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Index(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Asset.AssetItemInventories.Assign>
|
||||
{...MyModalFormProps.props}
|
||||
title={`批量修改审批人`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
trigger={
|
||||
<MyButtons.Default
|
||||
title={props.title || '批量修改审批人'}
|
||||
type="primary"
|
||||
size="middle"
|
||||
/>
|
||||
}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields();
|
||||
}
|
||||
}}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onFinish={async (values: any) => {
|
||||
return Apis.Approval.ApprovalTemplates.ReplaceApprover(values)
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('修改成功!');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false);
|
||||
}}
|
||||
columns={[
|
||||
Selects?.Employees({
|
||||
title: '原审批人',
|
||||
key: 'from_employee_id',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
required: true,
|
||||
}),
|
||||
Selects?.Employees({
|
||||
title: '选择新的审批人',
|
||||
key: 'to_employee_id',
|
||||
tooltip: '所有涉及到的审批模版,都修改成当前人',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
required: true,
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
141
src/pages/approval/templates/modals/Create.tsx
Normal file
141
src/pages/approval/templates/modals/Create.tsx
Normal file
@ -0,0 +1,141 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
ApprovalTemplateNodesNodeTypeEnum,
|
||||
ApprovalTemplatesTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Approval.ApprovalTemplates.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="700px"
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
trigger={<MyButtons.Create title={`${props.title}`} />}
|
||||
onFinish={async (values) =>
|
||||
Apis.Approval.ApprovalTemplates.Store({
|
||||
...values,
|
||||
is_enabled: true,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '业务类型',
|
||||
valueEnum: ApprovalTemplatesTypeEnum,
|
||||
required: true,
|
||||
colProps: { span: 24 },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '模板名称',
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
{
|
||||
key: 'code',
|
||||
title: '模板编码',
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'nodes',
|
||||
title: '设置审批节点',
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
// deleteIconProps: false,
|
||||
},
|
||||
formItemProps: {
|
||||
...rulesHelper.array,
|
||||
wrapperCol: { span: 24 },
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
valueType: 'group',
|
||||
colProps: { span: 24 },
|
||||
columns: [
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'node_type',
|
||||
title: `类型`,
|
||||
valueEnum: ApprovalTemplateNodesNodeTypeEnum,
|
||||
colProps: { span: 5 },
|
||||
formItemProps: {
|
||||
...rulesHelper.text,
|
||||
},
|
||||
}),
|
||||
{
|
||||
title: '节点名称',
|
||||
key: 'name',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: {
|
||||
...rulesHelper.text,
|
||||
},
|
||||
},
|
||||
|
||||
// MyFormItems.EnumSelect({
|
||||
// key: 'approve_type',
|
||||
// title: `审批方式`,
|
||||
// valueEnum: ApprovalTemplateNodesApproveTypeEnum,
|
||||
// colProps: { span: 5 },
|
||||
// }),
|
||||
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['node_type'],
|
||||
columns: ({ node_type }) => {
|
||||
return [
|
||||
Selects.Employees({
|
||||
key: 'members',
|
||||
title: `审批人员`,
|
||||
colProps: { span: 13 },
|
||||
fieldProps: {
|
||||
mode: 'multiple',
|
||||
maxCount:
|
||||
node_type ===
|
||||
ApprovalTemplateNodesNodeTypeEnum.Approver.value
|
||||
? 1
|
||||
: 9,
|
||||
},
|
||||
}),
|
||||
];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
key: 'description',
|
||||
colProps: { span: 24 },
|
||||
valueType: 'textarea',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
168
src/pages/approval/templates/modals/Update.tsx
Normal file
168
src/pages/approval/templates/modals/Update.tsx
Normal file
@ -0,0 +1,168 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
ApprovalTemplateNodesNodeTypeEnum,
|
||||
ApprovalTemplatesTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
let showInfo: any = [];
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Approval.ApprovalTemplates.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑${props.title}`}
|
||||
trigger={<MyButtons.Edit />}
|
||||
key={new Date().getTime()}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="700px"
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
Apis.Approval.ApprovalTemplates.Show({
|
||||
id: props.item?.id ?? 0,
|
||||
}).then((res: any) => {
|
||||
showInfo = res?.data?.approval_template_nodes;
|
||||
form.setFieldsValue({
|
||||
...res?.data,
|
||||
nodes: res?.data?.approval_template_nodes?.map((item: any) => ({
|
||||
...item,
|
||||
members: item?.approval_template_node_members?.map(
|
||||
(member: any) => member?.company_employees_id,
|
||||
),
|
||||
})),
|
||||
});
|
||||
});
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Approval.ApprovalTemplates.Update({
|
||||
...values,
|
||||
id: props.item?.id ?? 0,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '编辑成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '业务类型',
|
||||
valueEnum: ApprovalTemplatesTypeEnum,
|
||||
required: true,
|
||||
colProps: { span: 24 },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '名称',
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
{
|
||||
key: 'code',
|
||||
title: '模板编码',
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'nodes',
|
||||
title: '审批节点',
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
// deleteIconProps: false,
|
||||
},
|
||||
formItemProps: {
|
||||
...rulesHelper.array,
|
||||
wrapperCol: { span: 24 },
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
valueType: 'group',
|
||||
colProps: { span: 24 },
|
||||
columns: [
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'node_type',
|
||||
title: `类型`,
|
||||
valueEnum: ApprovalTemplateNodesNodeTypeEnum,
|
||||
colProps: { span: 5 },
|
||||
formItemProps: {
|
||||
...rulesHelper.text,
|
||||
},
|
||||
}),
|
||||
{
|
||||
title: '节点名称',
|
||||
key: 'name',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: {
|
||||
...rulesHelper.text,
|
||||
},
|
||||
},
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['node_type', 'name'],
|
||||
columns: ({ node_type, name }) => {
|
||||
return [
|
||||
Selects.Employees({
|
||||
key: 'members',
|
||||
title: `审批人员`,
|
||||
colProps: { span: 13 },
|
||||
fieldProps: {
|
||||
mode: 'multiple',
|
||||
maxCount:
|
||||
node_type ===
|
||||
ApprovalTemplateNodesNodeTypeEnum.Approver.value
|
||||
? 1
|
||||
: 9,
|
||||
maxTagTextLength: 3,
|
||||
labelRender: (res: any) => {
|
||||
console.log(res, showInfo, name, '222');
|
||||
if (res?.label) {
|
||||
return res?.label;
|
||||
} else {
|
||||
return showInfo?.map((i: any) => {
|
||||
if (i?.name === name) {
|
||||
return i?.approval_template_node_members?.map(
|
||||
(k: any) => {
|
||||
if (
|
||||
k?.company_employees_id === res?.value
|
||||
) {
|
||||
return k?.company_employee?.name || '-';
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
}),
|
||||
];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
key: 'description',
|
||||
colProps: { span: 24 },
|
||||
valueType: 'textarea',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -52,21 +52,17 @@ export default function Index({ title = '账单明细' }) {
|
||||
return { full_name: value };
|
||||
},
|
||||
},
|
||||
render: (_, record) => {
|
||||
return record.asset_houses_id ? (
|
||||
render: (_, res) => {
|
||||
return res.asset_houses_id ? (
|
||||
<MyButtons.View
|
||||
title={record?.asset_house?.full_name || '-'}
|
||||
title={res?.asset_house?.full_name || '-'}
|
||||
type="link"
|
||||
onClick={() => {
|
||||
record.asset_houses_id
|
||||
? navigate(
|
||||
`/bills/summary/show/${record.asset_houses_id}`,
|
||||
)
|
||||
: '';
|
||||
navigate(`/bills/summary/show/${res.asset_houses_id}`);
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
'车位| ' + record.asset_car_port.full_name
|
||||
'车位| ' + res.asset_car_port.full_name
|
||||
);
|
||||
},
|
||||
},
|
||||
@ -139,22 +135,18 @@ export default function Index({ title = '账单明细' }) {
|
||||
title="查看"
|
||||
/>
|
||||
<BillUpdate item={item} reload={action?.reload} title={title} />
|
||||
{item.bill_status ===
|
||||
HouseBillsBillStatusEnum.PartiallyPaid.value ||
|
||||
(item.bill_status === HouseBillsBillStatusEnum.Paid.value && (
|
||||
<BillRefund
|
||||
item={{
|
||||
...item,
|
||||
// 跟据发起的页面传递的type来判断退款类型
|
||||
// type: RefundsTypeEnum.HouseOrder.value,
|
||||
// 审批模板的类型
|
||||
// approval_type: ApprovalTemplatesTypeEnum.Refund.value,
|
||||
total_paid_amount: item.total_paid_amount,
|
||||
}}
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>
|
||||
))}
|
||||
<BillRefund
|
||||
item={{
|
||||
...item,
|
||||
// 跟据发起的页面传递的type来判断退款类型
|
||||
// type: RefundsTypeEnum.HouseOrder.value,
|
||||
// // 审批模板的类型
|
||||
approval_type: 'Refund',
|
||||
total_paid_amount: item.total_paid_amount,
|
||||
}}
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Bill.HouseBills.Delete({ id: item.id }).then(() =>
|
||||
|
||||
@ -9,19 +9,22 @@ import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
import { useRef, useState } from 'react';
|
||||
import { useState } from 'react';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
const modalRef = useRef<any>();
|
||||
const [selectedRow, setSelectedRow] = useState<any>({});
|
||||
const [ApprovalTemplates, setApprovalTemplates] = useState<any>([]);
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Refund.Refunds.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`退款申请单`}
|
||||
trigger={<MyButtons.Default title="申请退款" />}
|
||||
trigger={
|
||||
<MyButtons.Default
|
||||
title="申请退款"
|
||||
disabled={props?.item?.bill_status !== 'Paid'}
|
||||
/>
|
||||
}
|
||||
layout="horizontal"
|
||||
labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 20 }}
|
||||
@ -181,7 +184,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['node_type'],
|
||||
columns: ({ node_type }) => {
|
||||
columns: ({}) => {
|
||||
return [
|
||||
Selects.Employees({
|
||||
key: 'members',
|
||||
|
||||
136
src/pages/charge/refunds/index.tsx
Normal file
136
src/pages/charge/refunds/index.tsx
Normal file
@ -0,0 +1,136 @@
|
||||
import { MyColumns, MyPageContainer, MyProTableProps } from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { RefundsStatusEnum, RefundsTypeEnum } from '@/gen/Enums';
|
||||
import BIllInfo from '@/pages/bills/house_bills/modals/BIllInfo';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Image, Space } from 'antd';
|
||||
import Refund from './modals/Refund';
|
||||
|
||||
export default function Index({ title = '退款列表' }) {
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="house_charge_refund"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
headerTitle={title}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(params, sort, Apis.Refund.Refunds.List)
|
||||
}
|
||||
// toolBarRender={(action) => [
|
||||
// <TaskCreate key="Create" reload={action?.reload} title="账单任务" />,
|
||||
// ]}
|
||||
columns={[
|
||||
MyColumns.ID({ search: false }),
|
||||
Selects?.AssetProjects({
|
||||
title: '选择项目',
|
||||
key: 'asset_projects_id',
|
||||
hidden: true,
|
||||
}),
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: RefundsTypeEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '退款状态',
|
||||
dataIndex: 'refund_status',
|
||||
valueEnum: RefundsStatusEnum,
|
||||
}),
|
||||
{
|
||||
title: '退款申请时间',
|
||||
dataIndex: 'apply_time',
|
||||
valueType: 'dateTimeRange',
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
title: '退款金额',
|
||||
dataIndex: 'refund_amount',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
dataIndex: 'payee_name',
|
||||
title: '收款人',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
dataIndex: 'applicant_name',
|
||||
title: '申请人',
|
||||
hidden: true,
|
||||
},
|
||||
{
|
||||
dataIndex: 'payee_bank',
|
||||
title: '收款银行',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
dataIndex: 'payee_account',
|
||||
title: '收款账号',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '退款原因',
|
||||
dataIndex: 'remark',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '退款信息',
|
||||
search: false,
|
||||
render: (_, item: any) => {
|
||||
return item?.serial_number ? (
|
||||
<Space direction="vertical" size="small">
|
||||
<div>流水号:{item?.serial_number}</div>
|
||||
<div>退款时间:{item?.refund_time}</div>
|
||||
</Space>
|
||||
) : (
|
||||
''
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '退款凭证',
|
||||
search: false,
|
||||
render: (_, item: any) => {
|
||||
return (
|
||||
<Space direction="vertical" size="small">
|
||||
{item?.voucher?.map((res: any, index: number) => {
|
||||
return (
|
||||
<Image
|
||||
src={res?.url}
|
||||
key={`item_${index}`}
|
||||
style={{ width: 50 }}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
},
|
||||
// MyColumns.UpdatedAt(),
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<BIllInfo
|
||||
item={{ ...item, id: item?.refundable_id, type: 'primary' }}
|
||||
reload={action?.reload}
|
||||
title="查看"
|
||||
/>
|
||||
<Refund item={item} title="完成退款" reload={action?.reload} />
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
75
src/pages/charge/refunds/modals/Refund.tsx
Normal file
75
src/pages/charge/refunds/modals/Refund.tsx
Normal file
@ -0,0 +1,75 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Refund(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Refund.Refunds.Complete>
|
||||
{...MyModalFormProps.props}
|
||||
title={props.title}
|
||||
width="500px"
|
||||
wrapperCol={{ span: 24 }}
|
||||
trigger={
|
||||
<MyButtons.Default
|
||||
size="small"
|
||||
type="primary"
|
||||
disabled={props?.item?.refund_status !== 'Approved'}
|
||||
title={props.title}
|
||||
/>
|
||||
}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Refund.Refunds.Complete({
|
||||
...values,
|
||||
id: props.item?.id ?? '',
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('提交成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
title: '退款流水号',
|
||||
colProps: { span: 24 },
|
||||
key: 'serial_number',
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '退款时间',
|
||||
key: 'refund_time',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
valueType: 'dateTime',
|
||||
},
|
||||
MyFormItems.UploadImages({
|
||||
key: 'voucher',
|
||||
title: ' 退款凭证',
|
||||
uploadType: 'file',
|
||||
colProps: { span: 24 },
|
||||
max: 10,
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user