This commit is contained in:
parent
3f5457bf04
commit
04a716f0e0
@ -10,7 +10,7 @@ export function MyModal(props?: any) {
|
||||
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
props?.onOpen(true);
|
||||
props?.onOpen?.(true);
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
|
||||
@ -1,49 +1,56 @@
|
||||
import { MyBetaModalFormProps, MyProTableProps } from '@/common';
|
||||
import { MyBetaModalFormProps, MyButtons } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProCard, ProTable } from '@ant-design/pro-components';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export default function Info(props: MyBetaModalFormProps) {
|
||||
const [getShow, setDataShow] = useState<any>({});
|
||||
const navigate = useNavigate();
|
||||
|
||||
useEffect(() => {
|
||||
Apis.Bill.HouseBills.SummaryShow({
|
||||
asset_houses_id: props?.item?.id,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
setDataShow(JSON.parse(JSON.stringify(res?.data)));
|
||||
return false;
|
||||
})
|
||||
.catch(() => false);
|
||||
}, [props?.item?.id]);
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
const { item } = props;
|
||||
return (
|
||||
<ProCard>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
asset_houses_id: item?.asset_houses_id,
|
||||
},
|
||||
sort,
|
||||
Apis.Bill.HouseBills.SummaryBillList,
|
||||
)
|
||||
}
|
||||
search={false}
|
||||
options={false}
|
||||
pagination={false}
|
||||
columns={[
|
||||
{
|
||||
title: '账单金额合计',
|
||||
dataIndex: 'payable_amount_sum',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '滞纳金合计',
|
||||
dataIndex: 'late_fee_sum',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '优惠金额合计',
|
||||
dataIndex: 'discount_amount_sum',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '应付合计',
|
||||
dataIndex: 'total_payable_sum',
|
||||
search: false,
|
||||
},
|
||||
]}
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered column={3}>
|
||||
<ProDescriptions.Item label="账单金额">
|
||||
{getShow?.payable_amount_sum || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="滞纳金">
|
||||
{getShow?.late_fee_sum || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="优惠金额">
|
||||
{getShow?.discount_amount_sum || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="应付金额">
|
||||
<Space>
|
||||
{getShow?.total_payable_sum || ''}
|
||||
{getShow?.payable_amount_sum ? (
|
||||
<MyButtons.View
|
||||
title="查看账单明细"
|
||||
size="small"
|
||||
type="link"
|
||||
onClick={() => {
|
||||
navigate(`/bills/summary/show/${props?.item?.id || 0}`);
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
'无账单'
|
||||
)}
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
);
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import SummaryInfo from '../components/SummaryInfo';
|
||||
import OccupantsHistory from '../table/OccupantsHistory';
|
||||
import OccupantsNow from '../table/OccupantsNow';
|
||||
import RegistersList from '../table/RegistersList';
|
||||
import UnpaidBill from '../table/UnpaidBill';
|
||||
|
||||
export default function Show({ title = '房屋档案' }) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
@ -90,18 +89,18 @@ export default function Show({ title = '房屋档案' }) {
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: '欠费账单',
|
||||
key: '4',
|
||||
closable: false,
|
||||
children: <UnpaidBill item={{ ...data, asset_houses_id: id }} />,
|
||||
},
|
||||
// {
|
||||
// label: '欠费账单',
|
||||
// key: '4',
|
||||
// closable: false,
|
||||
// children: <UnpaidBill item={{ ...data, asset_houses_id: id }} />,
|
||||
// },
|
||||
];
|
||||
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
<HouseInfo item={data} reload={loadShow} />
|
||||
<SummaryInfo item={{ ...data, asset_houses_id: id }} reload={loadShow} />
|
||||
{id && <SummaryInfo item={{ ...data, id: id }} reload={loadShow} />}
|
||||
<ProCard style={{ marginTop: 16 }}>
|
||||
<Tabs type="card" items={items} defaultActiveKey="1" size="small" />
|
||||
</ProCard>
|
||||
|
||||
@ -107,7 +107,50 @@ export default function Index({ title = '项目活动' }) {
|
||||
// title={title}
|
||||
/>
|
||||
)}
|
||||
{(!item.end_time || new Date(item.end_time) > new Date()) && (
|
||||
{/* {(!item.end_time || new Date(item.end_time) > new Date()) && (
|
||||
<MyButtons.Default
|
||||
title={
|
||||
item.publish_status ===
|
||||
ActivitiesPublishStatusEnum.Unpublished.value
|
||||
? '发布'
|
||||
: item.publish_status ===
|
||||
ActivitiesPublishStatusEnum.Published.value
|
||||
? '下架'
|
||||
: '重新发布'
|
||||
}
|
||||
type="primary"
|
||||
isConfirm
|
||||
description={
|
||||
item.publish_status ===
|
||||
ActivitiesPublishStatusEnum.Unpublished.value
|
||||
? '确认发布此活动吗?'
|
||||
: item.publish_status ===
|
||||
ActivitiesPublishStatusEnum.Published.value
|
||||
? '确认下架此活动吗?'
|
||||
: '确认重新发布此活动吗?'
|
||||
}
|
||||
onConfirm={() => {
|
||||
let newStatus;
|
||||
if (
|
||||
item.publish_status ===
|
||||
ActivitiesPublishStatusEnum.Unpublished.value
|
||||
) {
|
||||
newStatus = ActivitiesPublishStatusEnum.Published.value;
|
||||
} else if (
|
||||
item.publish_status ===
|
||||
ActivitiesPublishStatusEnum.Published.value
|
||||
) {
|
||||
newStatus = ActivitiesPublishStatusEnum.Unlisted.value;
|
||||
} else {
|
||||
newStatus = ActivitiesPublishStatusEnum.Published.value;
|
||||
}
|
||||
Apis.Activity.Activities.ChangePublishStatus({
|
||||
id: item.id,
|
||||
publish_status: newStatus,
|
||||
}).then(() => action?.reload());
|
||||
}}
|
||||
/>
|
||||
)} */}
|
||||
<MyButtons.Default
|
||||
title={
|
||||
item.publish_status ===
|
||||
@ -150,8 +193,6 @@ export default function Index({ title = '项目活动' }) {
|
||||
}).then(() => action?.reload());
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{item.is_enroll === 1 && (
|
||||
<EnrollsList
|
||||
item={item}
|
||||
|
||||
@ -16,12 +16,12 @@ export default function Create(
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Grid.Grids.AddManager>
|
||||
{...MyModalFormProps.props}
|
||||
title={`设置管理员`}
|
||||
title={`设置楼栋管家`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
trigger={<MyButtons.Default title="管理员" type="link" />}
|
||||
trigger={<MyButtons.Default title="楼栋管家" type="link" />}
|
||||
request={() => Promise.resolve(props.item)}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
@ -49,7 +49,7 @@ export default function Create(
|
||||
}
|
||||
columns={[
|
||||
Selects?.Employees({
|
||||
title: '设置网格员',
|
||||
title: '设置楼栋管家',
|
||||
dataIndex: 'company_employees_id',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||
import { MyBetaModalFormProps } from '@/common';
|
||||
import { MyModal } from '@/components/MyModal';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetHousesOrientationEnum,
|
||||
AssetHousesOwnershipTypeEnum,
|
||||
AssetHousesStatusEnum,
|
||||
AssetHousesUsageEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useState } from 'react';
|
||||
@ -14,12 +8,10 @@ import { useState } from 'react';
|
||||
export default function Info(props: MyBetaModalFormProps) {
|
||||
const [getShow, setDataShow] = useState<any>({});
|
||||
|
||||
// 只在弹窗打开时获取数据
|
||||
|
||||
return (
|
||||
<MyModal
|
||||
title={props.title || '查看'}
|
||||
width="800px"
|
||||
width="600px"
|
||||
onOpen={(e: boolean) => {
|
||||
if (e) {
|
||||
return Apis.Grid.Grids.Show({
|
||||
@ -37,60 +29,25 @@ export default function Info(props: MyBetaModalFormProps) {
|
||||
node={
|
||||
<>
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="房屋全名" span={2}>
|
||||
<Space>
|
||||
<span>【{getShow?.id}】</span>
|
||||
{getShow?.name}
|
||||
</Space>
|
||||
<ProDescriptions bordered column={1}>
|
||||
<ProDescriptions.Item label="板块名称">
|
||||
<Space>{getShow?.name}</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房号">
|
||||
{getShow?.name}
|
||||
|
||||
<ProDescriptions.Item label="楼栋单元">
|
||||
{getShow?.grid_ranges
|
||||
?.map(
|
||||
(item: any) =>
|
||||
item?.asset_building?.name + item?.asset_unit?.name,
|
||||
)
|
||||
.join(';')}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="楼层">
|
||||
{getShow?.floor}
|
||||
|
||||
<ProDescriptions.Item label="创建时间">
|
||||
{getShow?.created_at}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房屋用途">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesUsageEnum}
|
||||
value={getShow?.usage}
|
||||
key="usage"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="产权性质">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesOwnershipTypeEnum}
|
||||
value={getShow?.ownership_type}
|
||||
key="ownership_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="建筑面积">
|
||||
{getShow?.built_area}m²
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="套内面积">
|
||||
{getShow?.inside_area}m²
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="计费面积">
|
||||
{getShow?.chargeable_area}m²
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="房屋状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesStatusEnum}
|
||||
value={getShow?.status}
|
||||
key="status"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="户型">
|
||||
{getShow?.room || ''}房{getShow?.hall || ''}厅
|
||||
{getShow?.bathroom || ''}卫{getShow?.kitchen || ''}厨
|
||||
{getShow?.balcony || ''}阳台
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="朝向">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetHousesOrientationEnum}
|
||||
value={getShow?.orientation}
|
||||
key="orientation"
|
||||
/>
|
||||
<ProDescriptions.Item label="最近修改">
|
||||
{getShow?.updated_at}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
|
||||
@ -44,7 +44,9 @@ export default function Show({ title = '账单详情' }) {
|
||||
key: '1',
|
||||
closable: false,
|
||||
children: (
|
||||
<UnpaidBill item={{ ...data, asset_houses_id: data.asset_houses_id }} />
|
||||
<UnpaidBill
|
||||
item={{ ...data, asset_houses_id: data?.asset_houses_id }}
|
||||
/>
|
||||
),
|
||||
},
|
||||
{
|
||||
@ -52,7 +54,7 @@ export default function Show({ title = '账单详情' }) {
|
||||
key: '2',
|
||||
closable: false,
|
||||
children: (
|
||||
<PaidBill item={{ ...data, asset_houses_id: data.asset_houses_id }} />
|
||||
<PaidBill item={{ ...data, asset_houses_id: data?.asset_houses_id }} />
|
||||
),
|
||||
},
|
||||
{
|
||||
@ -61,7 +63,7 @@ export default function Show({ title = '账单详情' }) {
|
||||
closable: false,
|
||||
children: (
|
||||
<CancelledBill
|
||||
item={{ ...data, asset_houses_id: data.asset_houses_id }}
|
||||
item={{ ...data, asset_houses_id: data?.asset_houses_id }}
|
||||
/>
|
||||
),
|
||||
},
|
||||
|
||||
@ -118,7 +118,11 @@ export default function Index({ title = '账单任务' }) {
|
||||
<Space key={index}>
|
||||
<TaskShow item={item} title="查看" reload={action?.reload} />
|
||||
<MyButtons.Default
|
||||
title="重新执行"
|
||||
title={
|
||||
item.status === HouseChargeTasksStatusEnum.Completed.value
|
||||
? '重新执行'
|
||||
: '执行'
|
||||
}
|
||||
type="link"
|
||||
color="primary"
|
||||
isConfirm
|
||||
|
||||
@ -28,6 +28,7 @@ export default function AssetInfo(props: MyBetaModalFormProps) {
|
||||
Apis.HouseCharage.HouseChargeTaskDetails.List,
|
||||
)
|
||||
}
|
||||
options={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { HouseMeterReadingsOperationTypeEnum } from '@/gen/Enums';
|
||||
import {
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseOccupantsRelationWithOwnerEnum,
|
||||
HouseOccupantsStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
|
||||
export default function Index(props: MyBetaModalFormProps) {
|
||||
@ -19,42 +23,45 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
// search={false}
|
||||
// options={false}
|
||||
columns={[
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: ['asset_house', 'full_name'],
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '操作类型',
|
||||
dataIndex: 'operation_type',
|
||||
valueEnum: HouseMeterReadingsOperationTypeEnum,
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: HouseOccupantsStatusEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '房客关系',
|
||||
dataIndex: 'house_relation',
|
||||
valueEnum: HouseOccupantsHouseRelationEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '与产权人关系',
|
||||
dataIndex: 'relation_with_owner',
|
||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '抄表读数',
|
||||
dataIndex: 'current_reading',
|
||||
title: '入住日期',
|
||||
dataIndex: 'is_live_in',
|
||||
render(_, record) {
|
||||
return `${record?.move_in_date || '未入住'}`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '抄表用量',
|
||||
dataIndex: 'usage_amount',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '抄表时间',
|
||||
dataIndex: 'reading_time',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '抄表人',
|
||||
dataIndex: ['company_employee', 'name'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'remark',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '账单状态',
|
||||
dataIndex: 'bill_status',
|
||||
render: (value) => (value ? '已生成' : '未生成'),
|
||||
title: '退房日期',
|
||||
dataIndex: 'move_out_date',
|
||||
render(_, record) {
|
||||
return `${record?.move_out_date || '-'}`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
|
||||
// MyColumns.Option({
|
||||
// render: (_, item: any, index, action) => (
|
||||
// <Space key={index}>
|
||||
|
||||
@ -14,7 +14,7 @@ export default function Show({ title = '客户档案' }) {
|
||||
// 注册标签页
|
||||
const { addTab } = usePageTabs({
|
||||
tabKey: `customer-detail-${id}`,
|
||||
tabLabel: `${data?.name}档案` || title,
|
||||
tabLabel: `客户:${data?.name}` || title,
|
||||
});
|
||||
|
||||
const loadShow = () => {
|
||||
@ -56,7 +56,12 @@ export default function Show({ title = '客户档案' }) {
|
||||
<MyPageContainer title={title}>
|
||||
<CustomerInfo item={data} reload={loadShow} />
|
||||
<ProCard style={{ marginTop: 16 }}>
|
||||
<Tabs type="card" items={items} defaultActiveKey="1" size="small" />
|
||||
<Tabs
|
||||
type="card"
|
||||
items={data?.id ? items : []}
|
||||
defaultActiveKey="1"
|
||||
size="small"
|
||||
/>
|
||||
</ProCard>
|
||||
</MyPageContainer>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user