Merge pull request 'fix:更新BUG' (#16) from develop into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 4m53s
All checks were successful
Build and Push Docker Image / build (push) Successful in 4m53s
Reviewed-on: #16
This commit is contained in:
commit
ed66ae077c
18
src/gen/ApiTypes.d.ts
vendored
18
src/gen/ApiTypes.d.ts
vendored
@ -510,6 +510,11 @@ declare namespace ApiTypes {
|
||||
"company_employees_id": number; // 员工id,[ref:company_employees]
|
||||
"type": string; // 类型,[enum:HouseWorkOrdersTypeEnum]
|
||||
};
|
||||
type BatchStore = {
|
||||
"asset_projects_id": number; // 项目id,[ref:asset_projects]
|
||||
"company_employees_id": number; // 员工id,[ref:company_employees]
|
||||
"types": string[]; // 类型数组
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
};
|
||||
@ -925,7 +930,8 @@ declare namespace ApiTypes {
|
||||
"has_overdue"?: boolean; // 是否欠费:true-欠费, false-清欠
|
||||
};
|
||||
type Store = {
|
||||
"asset_houses_id": number; // 资产房屋id,[ref:asset_houses]
|
||||
"asset_houses_id"?: number; // 资产房屋id,[ref:asset_houses](与asset_car_ports_id互斥)
|
||||
"asset_car_ports_id"?: number; // 车位ID,[ref:asset_car_ports](与asset_houses_id互斥)
|
||||
"company_receipt_accounts_id": number; // 公司收款账户id,[ref:company_receipt_accounts]
|
||||
"type": string; // 账单类型,[enum:HouseBillsTypeEnum]
|
||||
"amount": number; // 金额
|
||||
@ -940,6 +946,7 @@ declare namespace ApiTypes {
|
||||
};
|
||||
type Update = {
|
||||
"id": number; // id
|
||||
"asset_car_ports_id"?: number; // 车位ID,[ref:asset_car_ports]
|
||||
"company_receipt_accounts_id": number; // 公司收款账户id,[ref:company_receipt_accounts]
|
||||
"type": string; // 账单类型,[enum:HouseBillsTypeEnum]
|
||||
"amount": number; // 金额
|
||||
@ -3785,6 +3792,15 @@ declare namespace ApiTypes {
|
||||
namespace Statistics {
|
||||
namespace ContractsCount {
|
||||
}
|
||||
namespace HouseBillsCount {
|
||||
type PaidAmountTrend = {
|
||||
"start_date"?: Date; // 开始日期(可选,默认6个月前)
|
||||
"end_date"?: Date; // 结束日期(可选,默认今天)
|
||||
};
|
||||
type ClearCache = {
|
||||
"type"?: string; // 缓存类型
|
||||
};
|
||||
}
|
||||
namespace IndexCount {
|
||||
}
|
||||
}
|
||||
|
||||
@ -270,6 +270,9 @@ export const Apis = {
|
||||
Store(data: ApiTypes.Asset.AssetProjectAdmins.Store): Promise<MyResponseType> {
|
||||
return request('company/asset/asset_project_admins/store', { data });
|
||||
},
|
||||
BatchStore(data: ApiTypes.Asset.AssetProjectAdmins.BatchStore): Promise<MyResponseType> {
|
||||
return request('company/asset/asset_project_admins/batch_store', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Asset.AssetProjectAdmins.Show): Promise<MyResponseType> {
|
||||
return request('company/asset/asset_project_admins/show', { data });
|
||||
},
|
||||
@ -2085,6 +2088,23 @@ export const Apis = {
|
||||
return request('company/statistics/contracts_count/clear_cache', {});
|
||||
},
|
||||
},
|
||||
HouseBillsCount: {
|
||||
OverviewStatistics(): Promise<MyResponseType> {
|
||||
return request('company/statistics/house_bills_count/overview_statistics', {});
|
||||
},
|
||||
ProjectDataByMonth(): Promise<MyResponseType> {
|
||||
return request('company/statistics/house_bills_count/project_data_by_month', {});
|
||||
},
|
||||
PaidAmountTrend(data?: ApiTypes.Statistics.HouseBillsCount.PaidAmountTrend): Promise<MyResponseType> {
|
||||
return request('company/statistics/house_bills_count/paid_amount_trend', { data });
|
||||
},
|
||||
ProjectPaymentRanking(): Promise<MyResponseType> {
|
||||
return request('company/statistics/house_bills_count/project_payment_ranking', {});
|
||||
},
|
||||
ClearCache(data?: ApiTypes.Statistics.HouseBillsCount.ClearCache): Promise<MyResponseType> {
|
||||
return request('company/statistics/house_bills_count/clear_cache', { data });
|
||||
},
|
||||
},
|
||||
IndexCount: {
|
||||
FinancialAnalysis(): Promise<MyResponseType> {
|
||||
return request('company/statistics/index_count/financial_analysis', {});
|
||||
|
||||
@ -333,7 +333,7 @@ export const BillsStatusEnum= {
|
||||
|
||||
// 缓存类型
|
||||
export const CacheTypeEnum= {
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#32265e","value":"MobilePhoneVerificationCode"},
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#f33535","value":"MobilePhoneVerificationCode"},
|
||||
};
|
||||
|
||||
// CompaniesMerchantTypeEnum
|
||||
|
||||
@ -71,7 +71,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
key: 'grid_mark',
|
||||
title: '范围标识',
|
||||
params: {
|
||||
asset_projects_id: projectId,
|
||||
asset_projects_id: projectId || '',
|
||||
},
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
|
||||
@ -7,6 +7,7 @@ import {
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ApprovalTemplateNodesNodeTypeEnum } from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
import { useState } from 'react';
|
||||
@ -22,7 +23,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
trigger={
|
||||
<MyButtons.Default
|
||||
title="申请退款"
|
||||
disabled={props?.item?.bill_status !== 'Paid'}
|
||||
// disabled={props?.item?.bill_status !== 'Paid'}
|
||||
/>
|
||||
}
|
||||
layout="horizontal"
|
||||
@ -161,7 +162,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'node_type',
|
||||
// title: `类型`,
|
||||
// valueEnum: ApprovalTemplateNodesNodeTypeEnum,
|
||||
valueEnum: ApprovalTemplateNodesNodeTypeEnum,
|
||||
colProps: { span: 5 },
|
||||
formItemProps: {
|
||||
...rulesHelper.text,
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
MyTableActions,
|
||||
MyToolBarActions,
|
||||
@ -15,148 +16,159 @@ import Show from './modals/Show';
|
||||
import Update from './modals/Update';
|
||||
import Read from './read/modals/Read';
|
||||
|
||||
export default function Index({ title = '合同借用' }) {
|
||||
export default function Index({ title = '合同档案借用' }) {
|
||||
return (
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Contract.ContractArchiveBorrows.List,
|
||||
)
|
||||
}
|
||||
headerTitle="合同借用列表"
|
||||
toolBarRender={(action) => [
|
||||
<MyToolBarActions
|
||||
key="toolbar"
|
||||
actions={{
|
||||
add: <Create key="Create" reload={action?.reload} title={title} />,
|
||||
read: <Read key="Read" reload={action?.reload} title="合同借阅" />,
|
||||
}}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID({
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '借用状态',
|
||||
dataIndex: 'borrow_status',
|
||||
valueEnum: ContractArchiveBorrowStatusEnum,
|
||||
}),
|
||||
// MyColumns.EnumTag({
|
||||
// title: '归还状态',
|
||||
// dataIndex: 'return_status',
|
||||
// valueEnum: ContractArchiveFileReturnStatusEnum,
|
||||
// }),
|
||||
{
|
||||
title: '档案编号',
|
||||
dataIndex: ['contract_archive', 'code'],
|
||||
render: (_, item: any) => (
|
||||
<CodeInfo
|
||||
item={{ ...item, type: 'link', id: item?.contract_archives_id }}
|
||||
title={item?.contract_archive?.code}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '借用信息',
|
||||
search: false,
|
||||
render: (_, item: any) => {
|
||||
if (!item?.contract_archive_borrow_files) {
|
||||
return '-';
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
{item.contract_archive_borrow_files.map(
|
||||
(res: any, index: number) => (
|
||||
<div key={index} style={{ marginBottom: 4 }}>
|
||||
文件: {res?.contract_archive_file?.name},借用:
|
||||
{res?.contract_archive_file?.borrow_number},遗失:
|
||||
{res?.contract_archive_file?.lost_number},损坏:
|
||||
{
|
||||
res?.contract_archive_file?.contract_archive_file
|
||||
?.lost_number
|
||||
}
|
||||
,损坏: {res?.contract_archive_file?.damaged_number}
|
||||
</div>
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="contract_borrows"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Contract.ContractArchiveBorrows.List,
|
||||
)
|
||||
}
|
||||
headerTitle="合同借用列表"
|
||||
toolBarRender={(action) => [
|
||||
<MyToolBarActions
|
||||
key="toolbar"
|
||||
actions={{
|
||||
add: (
|
||||
<Create key="Create" reload={action?.reload} title={title} />
|
||||
),
|
||||
read: (
|
||||
<Read key="Read" reload={action?.reload} title="合同借阅" />
|
||||
),
|
||||
}}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID({
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '借用状态',
|
||||
dataIndex: 'borrow_status',
|
||||
valueEnum: ContractArchiveBorrowStatusEnum,
|
||||
}),
|
||||
// MyColumns.EnumTag({
|
||||
// title: '归还状态',
|
||||
// dataIndex: 'return_status',
|
||||
// valueEnum: ContractArchiveFileReturnStatusEnum,
|
||||
// }),
|
||||
{
|
||||
title: '档案编号',
|
||||
dataIndex: ['contract_archive', 'code'],
|
||||
render: (_, item: any) => (
|
||||
<CodeInfo
|
||||
item={{ ...item, type: 'link', id: item?.contract_archives_id }}
|
||||
title={item?.contract_archive?.code}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '借用信息',
|
||||
search: false,
|
||||
render: (_, item: any) => {
|
||||
if (!item?.contract_archive_borrow_files) {
|
||||
return '-';
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
{item.contract_archive_borrow_files.map(
|
||||
(res: any, index: number) => (
|
||||
<div key={index} style={{ marginBottom: 4 }}>
|
||||
文件: {res?.contract_archive_file?.name},借用:
|
||||
{res?.contract_archive_file?.borrow_number},遗失:
|
||||
{res?.contract_archive_file?.lost_number},损坏:
|
||||
{
|
||||
res?.contract_archive_file?.contract_archive_file
|
||||
?.lost_number
|
||||
}
|
||||
,损坏: {res?.contract_archive_file?.damaged_number}
|
||||
</div>
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '借用人',
|
||||
dataIndex: 'borrower_name',
|
||||
search: false,
|
||||
render: (_, item: any) => (
|
||||
<EmployeeShow
|
||||
item={{ ...item, type: 'link', id: item?.borrower_id }}
|
||||
title={item?.borrower_name}
|
||||
/>
|
||||
),
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '借用人',
|
||||
dataIndex: 'borrower_name',
|
||||
search: false,
|
||||
render: (_, item: any) => (
|
||||
<EmployeeShow
|
||||
item={{ ...item, type: 'link', id: item?.borrower_id }}
|
||||
title={item?.borrower_name}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
title: '借用日期',
|
||||
dataIndex: 'borrow_date',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '应归还日期',
|
||||
dataIndex: 'expected_return_date',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.Boolean({
|
||||
title: '需要归还',
|
||||
dataIndex: 'is_need_return',
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '登记人',
|
||||
dataIndex: ['registrar', 'name'],
|
||||
search: false,
|
||||
render: (_, item: any) => (
|
||||
<EmployeeShow
|
||||
item={{ ...item, type: 'link', id: item?.operator_id }}
|
||||
title={item?.operator_name}
|
||||
/>
|
||||
),
|
||||
},
|
||||
// MyColumns.CreatedAt(),
|
||||
MyColumns.UpdatedAt(),
|
||||
MyColumns.Option({
|
||||
width: 100,
|
||||
render: (_, item: any, _index, action) => (
|
||||
<MyTableActions
|
||||
actions={{
|
||||
show: (
|
||||
<Show item={item} reload={action?.reload} title={title} />
|
||||
),
|
||||
record: (
|
||||
<MyButtons.Default
|
||||
title="登记"
|
||||
type="primary"
|
||||
disabled={item?.borrow_status !== 'Approved'}
|
||||
isConfirm={true}
|
||||
description={`是否确认借用人已领取?`}
|
||||
onConfirm={() =>
|
||||
Apis.Contract.ContractArchiveBorrows.Borrow({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
),
|
||||
update: (
|
||||
<Update item={item} reload={action?.reload} title={title} />
|
||||
),
|
||||
}}
|
||||
/>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
{
|
||||
title: '借用日期',
|
||||
dataIndex: 'borrow_date',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '应归还日期',
|
||||
dataIndex: 'expected_return_date',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.Boolean({
|
||||
title: '需要归还',
|
||||
dataIndex: 'is_need_return',
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '登记人',
|
||||
dataIndex: ['registrar', 'name'],
|
||||
search: false,
|
||||
render: (_, item: any) => (
|
||||
<EmployeeShow
|
||||
item={{ ...item, type: 'link', id: item?.operator_id }}
|
||||
title={item?.operator_name}
|
||||
/>
|
||||
),
|
||||
},
|
||||
// MyColumns.CreatedAt(),
|
||||
MyColumns.UpdatedAt(),
|
||||
MyColumns.Option({
|
||||
width: 100,
|
||||
render: (_, item: any, _index, action) => (
|
||||
<MyTableActions
|
||||
actions={{
|
||||
show: (
|
||||
<Show item={item} reload={action?.reload} title={title} />
|
||||
),
|
||||
record: (
|
||||
<MyButtons.Default
|
||||
title="登记"
|
||||
type="primary"
|
||||
disabled={item?.borrow_status !== 'Approved'}
|
||||
isConfirm={true}
|
||||
description={`是否确认借用人已领取?`}
|
||||
onConfirm={() =>
|
||||
Apis.Contract.ContractArchiveBorrows.Borrow({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
),
|
||||
update: (
|
||||
<Update item={item} reload={action?.reload} title={title} />
|
||||
),
|
||||
}}
|
||||
/>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
MyTableActions,
|
||||
MyToolBarActions,
|
||||
@ -22,157 +23,168 @@ export default function Index({ title = '突发事件' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Emergency.EmergencyEvents.List,
|
||||
)
|
||||
}
|
||||
headerTitle={`${title}列表`}
|
||||
toolBarRender={(action: any) => [
|
||||
<MyToolBarActions
|
||||
key="toolbar"
|
||||
actions={{
|
||||
create: (
|
||||
<EventCreate key="Create" reload={action?.reload} title={title} />
|
||||
),
|
||||
teams: (
|
||||
<MyButtons.Default
|
||||
key="Teams"
|
||||
size="middle"
|
||||
onClick={() => {
|
||||
navigate('/quality/emergency/teams');
|
||||
}}
|
||||
title="应急小组"
|
||||
/>
|
||||
),
|
||||
categories: (
|
||||
<MyButtons.Default
|
||||
key="Categories"
|
||||
size="middle"
|
||||
onClick={() => {
|
||||
navigate('/quality/emergency/categories');
|
||||
}}
|
||||
title="事件分类"
|
||||
/>
|
||||
),
|
||||
levels: (
|
||||
<MyButtons.Default
|
||||
key="Levels"
|
||||
size="middle"
|
||||
onClick={() => {
|
||||
navigate('/quality/emergency/levels');
|
||||
}}
|
||||
title="级别配置"
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID({
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '所属项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: EmergencyEventsStatusEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '赔偿方',
|
||||
dataIndex: 'compensation_type',
|
||||
valueEnum: EmergencyEventsCompensationTypeEnum,
|
||||
}),
|
||||
{
|
||||
title: '赔偿事项',
|
||||
search: false,
|
||||
render: (_, item: any) => {
|
||||
return (
|
||||
<div>
|
||||
<div>赔偿比例:{item?.compensation_rate}%</div>
|
||||
<div>赔偿金额:{item?.compensation_amount}元</div>
|
||||
<div>已支付赔偿金额:{item?.compensation_paid_amount}元</div>
|
||||
</div>
|
||||
);
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="emergency_events"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Emergency.EmergencyEvents.List,
|
||||
)
|
||||
}
|
||||
headerTitle={`${title}列表`}
|
||||
toolBarRender={(action: any) => [
|
||||
<MyToolBarActions
|
||||
key="toolbar"
|
||||
actions={{
|
||||
create: (
|
||||
<EventCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>
|
||||
),
|
||||
teams: (
|
||||
<MyButtons.Default
|
||||
key="Teams"
|
||||
size="middle"
|
||||
onClick={() => {
|
||||
navigate('/quality/emergency/teams');
|
||||
}}
|
||||
title="应急小组"
|
||||
/>
|
||||
),
|
||||
categories: (
|
||||
<MyButtons.Default
|
||||
key="Categories"
|
||||
size="middle"
|
||||
onClick={() => {
|
||||
navigate('/quality/emergency/categories');
|
||||
}}
|
||||
title="事件分类"
|
||||
/>
|
||||
),
|
||||
levels: (
|
||||
<MyButtons.Default
|
||||
key="Levels"
|
||||
size="middle"
|
||||
onClick={() => {
|
||||
navigate('/quality/emergency/levels');
|
||||
}}
|
||||
title="级别配置"
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID({
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '分类',
|
||||
search: false,
|
||||
render: (_, item: any) => {
|
||||
return `${item?.one_emergency_categories_name} / ${item?.two_emergency_categories_name}`;
|
||||
{
|
||||
title: '所属项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '等级',
|
||||
dataIndex: 'emergency_event_levels_name',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.UpdatedAt(),
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyTableActions
|
||||
actions={{
|
||||
show: (
|
||||
<MyButtons.View
|
||||
key="show"
|
||||
title="查看"
|
||||
to={`/quality/emergency/show/${item.id}`}
|
||||
/>
|
||||
),
|
||||
close: (
|
||||
<EventApplyClose
|
||||
key="close"
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
/>
|
||||
),
|
||||
update: (
|
||||
<EventUpdate
|
||||
key="update"
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>
|
||||
),
|
||||
audit: (
|
||||
<EventReview
|
||||
key="audit"
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
/>
|
||||
),
|
||||
delete: (
|
||||
<MyButtons.Delete
|
||||
key="delete"
|
||||
onConfirm={() =>
|
||||
Apis.Emergency.EmergencyEvents.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
maxVisible={3}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: EmergencyEventsStatusEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '赔偿方',
|
||||
dataIndex: 'compensation_type',
|
||||
valueEnum: EmergencyEventsCompensationTypeEnum,
|
||||
}),
|
||||
{
|
||||
title: '赔偿事项',
|
||||
search: false,
|
||||
render: (_, item: any) => {
|
||||
return (
|
||||
<div>
|
||||
<div>赔偿比例:{item?.compensation_rate}%</div>
|
||||
<div>赔偿金额:{item?.compensation_amount}元</div>
|
||||
<div>已支付赔偿金额:{item?.compensation_paid_amount}元</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '分类',
|
||||
search: false,
|
||||
render: (_, item: any) => {
|
||||
return `${item?.one_emergency_categories_name} / ${item?.two_emergency_categories_name}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '等级',
|
||||
dataIndex: 'emergency_event_levels_name',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.UpdatedAt(),
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyTableActions
|
||||
actions={{
|
||||
show: (
|
||||
<MyButtons.View
|
||||
key="show"
|
||||
title="查看"
|
||||
to={`/quality/emergency/show/${item.id}`}
|
||||
/>
|
||||
),
|
||||
close: (
|
||||
<EventApplyClose
|
||||
key="close"
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
/>
|
||||
),
|
||||
update: (
|
||||
<EventUpdate
|
||||
key="update"
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>
|
||||
),
|
||||
audit: (
|
||||
<EventReview
|
||||
key="audit"
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
/>
|
||||
),
|
||||
delete: (
|
||||
<MyButtons.Delete
|
||||
key="delete"
|
||||
onConfirm={() =>
|
||||
Apis.Emergency.EmergencyEvents.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
maxVisible={3}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
MyTableActions,
|
||||
MyToolBarActions,
|
||||
@ -19,197 +20,204 @@ import DepositPay from './modals/DepositPay';
|
||||
import DepositRefund from './modals/DepositRefund';
|
||||
import MyWorkerCreate from './modals/WorkerCreate';
|
||||
|
||||
export default function Index() {
|
||||
export default function Index({ title = '装修管理' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Renovation.RenovationApplies.List,
|
||||
)
|
||||
}
|
||||
headerTitle="装修申请列表"
|
||||
toolBarRender={(action) => [
|
||||
<MyToolBarActions
|
||||
key="toolbar"
|
||||
actions={{
|
||||
add: (
|
||||
<MyButtons.Default
|
||||
key="Create"
|
||||
size="middle"
|
||||
type="primary"
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => {
|
||||
navigate('/quality/renovation/pages/create');
|
||||
}}
|
||||
title="装修申请"
|
||||
/>
|
||||
),
|
||||
rules: (
|
||||
<MyButtons.Default
|
||||
key="InspectionRules"
|
||||
size="middle"
|
||||
onClick={() => {
|
||||
navigate('/quality/renovation/inspection_rules');
|
||||
}}
|
||||
title="巡检配置"
|
||||
/>
|
||||
),
|
||||
audit: (
|
||||
<MyButtons.Default
|
||||
key="Audit"
|
||||
size="middle"
|
||||
onClick={() => {
|
||||
navigate('/quality/renovation/audit');
|
||||
}}
|
||||
title="资料审核"
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID({ search: false }),
|
||||
Selects?.AssetProjects({
|
||||
title: '选择项目',
|
||||
key: 'id',
|
||||
hidden: true,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '登记状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: RenovationAppliesStatusEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '关联项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '房屋',
|
||||
dataIndex: ['asset_house', 'full_name'],
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return { full_name: value };
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="renovation_applies"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Renovation.RenovationApplies.List,
|
||||
)
|
||||
}
|
||||
headerTitle="装修申请列表"
|
||||
toolBarRender={(action) => [
|
||||
<MyToolBarActions
|
||||
key="toolbar"
|
||||
actions={{
|
||||
add: (
|
||||
<MyButtons.Default
|
||||
key="Create"
|
||||
size="middle"
|
||||
type="primary"
|
||||
icon={<PlusOutlined />}
|
||||
onClick={() => {
|
||||
navigate('/quality/renovation/pages/create');
|
||||
}}
|
||||
title="装修申请"
|
||||
/>
|
||||
),
|
||||
rules: (
|
||||
<MyButtons.Default
|
||||
key="InspectionRules"
|
||||
size="middle"
|
||||
onClick={() => {
|
||||
navigate('/quality/renovation/inspection_rules');
|
||||
}}
|
||||
title="巡检配置"
|
||||
/>
|
||||
),
|
||||
audit: (
|
||||
<MyButtons.Default
|
||||
key="Audit"
|
||||
size="middle"
|
||||
onClick={() => {
|
||||
navigate('/quality/renovation/audit');
|
||||
}}
|
||||
title="资料审核"
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID({ search: false }),
|
||||
Selects?.AssetProjects({
|
||||
title: '选择项目',
|
||||
key: 'id',
|
||||
hidden: true,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '登记状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: RenovationAppliesStatusEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '关联项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '房屋',
|
||||
dataIndex: ['asset_house', 'full_name'],
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return { full_name: value };
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '装修人',
|
||||
dataIndex: 'owner_name',
|
||||
},
|
||||
{
|
||||
title: '装修公司',
|
||||
dataIndex: 'company_name',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '施工负责人',
|
||||
dataIndex: 'construction_principal_name',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '施工状态',
|
||||
dataIndex: 'construction_status',
|
||||
valueEnum: RenovationAppliesConstructionStatusEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '保证金',
|
||||
dataIndex: 'deposit_amount',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '施工时间',
|
||||
search: false,
|
||||
render: (_, item: any) => {
|
||||
return (
|
||||
<div>
|
||||
{item?.construction_start_date || ''} 至
|
||||
{item?.construction_end_date || ''}
|
||||
</div>
|
||||
);
|
||||
{
|
||||
title: '装修人',
|
||||
dataIndex: 'owner_name',
|
||||
},
|
||||
},
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyTableActions
|
||||
actions={{
|
||||
show: (
|
||||
<MyButtons.Default
|
||||
key="Show"
|
||||
size="small"
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
navigate(
|
||||
`/quality/renovation/pages/show?id=${item.id}`,
|
||||
);
|
||||
}}
|
||||
title="查看"
|
||||
/>
|
||||
),
|
||||
worker: (
|
||||
<MyWorkerCreate
|
||||
item={{
|
||||
...item,
|
||||
size: 'small',
|
||||
}}
|
||||
title="装修工人"
|
||||
key="WorkerCreate"
|
||||
/>
|
||||
),
|
||||
update: (
|
||||
<MyButtons.Default
|
||||
key="Update"
|
||||
size="small"
|
||||
type="primary"
|
||||
disabled={item.status !== 'Draft'}
|
||||
onClick={() => {
|
||||
navigate(
|
||||
`/quality/renovation/pages/update?id=${item.id}`,
|
||||
);
|
||||
}}
|
||||
title="编辑"
|
||||
/>
|
||||
),
|
||||
pay: (
|
||||
<DepositPay
|
||||
key="DepositPay"
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
/>
|
||||
),
|
||||
refund: (
|
||||
<DepositRefund
|
||||
key="DepositRefund"
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
/>
|
||||
),
|
||||
delete: (
|
||||
<MyButtons.Delete
|
||||
disabled={item.status !== 'Draft'}
|
||||
onConfirm={() =>
|
||||
Apis.Renovation.RenovationApplies.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
maxVisible={3}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
{
|
||||
title: '装修公司',
|
||||
dataIndex: 'company_name',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '施工负责人',
|
||||
dataIndex: 'construction_principal_name',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '施工状态',
|
||||
dataIndex: 'construction_status',
|
||||
valueEnum: RenovationAppliesConstructionStatusEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '保证金',
|
||||
dataIndex: 'deposit_amount',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '施工时间',
|
||||
search: false,
|
||||
render: (_, item: any) => {
|
||||
return (
|
||||
<div>
|
||||
{item?.construction_start_date || ''} 至
|
||||
{item?.construction_end_date || ''}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyTableActions
|
||||
actions={{
|
||||
show: (
|
||||
<MyButtons.Default
|
||||
key="Show"
|
||||
size="small"
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
navigate(
|
||||
`/quality/renovation/pages/show?id=${item.id}`,
|
||||
);
|
||||
}}
|
||||
title="查看"
|
||||
/>
|
||||
),
|
||||
worker: (
|
||||
<MyWorkerCreate
|
||||
item={{
|
||||
...item,
|
||||
size: 'small',
|
||||
}}
|
||||
title="装修工人"
|
||||
key="WorkerCreate"
|
||||
/>
|
||||
),
|
||||
update: (
|
||||
<MyButtons.Default
|
||||
key="Update"
|
||||
size="small"
|
||||
type="primary"
|
||||
disabled={item.status !== 'Draft'}
|
||||
onClick={() => {
|
||||
navigate(
|
||||
`/quality/renovation/pages/update?id=${item.id}`,
|
||||
);
|
||||
}}
|
||||
title="编辑"
|
||||
/>
|
||||
),
|
||||
pay: (
|
||||
<DepositPay
|
||||
key="DepositPay"
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
/>
|
||||
),
|
||||
refund: (
|
||||
<DepositRefund
|
||||
key="DepositRefund"
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
/>
|
||||
),
|
||||
delete: (
|
||||
<MyButtons.Delete
|
||||
disabled={item.status !== 'Draft'}
|
||||
onConfirm={() =>
|
||||
Apis.Renovation.RenovationApplies.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
maxVisible={3}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
|
||||
@ -28,23 +28,15 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
form.resetFields();
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) => {
|
||||
const { type, ...restValues } = values;
|
||||
const promises = (type || []).map((t: any) =>
|
||||
Apis.Asset.AssetProjectAdmins.Store({
|
||||
...restValues,
|
||||
type: t,
|
||||
}),
|
||||
);
|
||||
|
||||
return Promise.all(promises)
|
||||
onFinish={async (values: any) =>
|
||||
Apis.Asset.AssetProjectAdmins.BatchStore(values)
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
message.success('提交成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false);
|
||||
}}
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.AssetProjects({
|
||||
title: '选择项目',
|
||||
@ -67,7 +59,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumCheckbox({
|
||||
key: 'type',
|
||||
key: 'types',
|
||||
title: '工单类型',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: HouseWorkOrdersTypeEnum,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user