Compare commits
4 Commits
6c3e5f1e16
...
ac5c56c66b
| Author | SHA1 | Date | |
|---|---|---|---|
| ac5c56c66b | |||
|
|
60b89dd188 | ||
|
|
7545067d68 | ||
|
|
786a48fe99 |
@ -15,8 +15,9 @@ export default defineConfig({
|
||||
proxy: {
|
||||
'/api/': {
|
||||
// target: 'http://yt:8003',
|
||||
target: 'http://10.39.13.80:8001',
|
||||
// target: 'https://test-admin.linyikj.com.cn/',
|
||||
// target: 'http://10.39.13.80:8001',
|
||||
// target: 'http://10.39.13.78:8001/',
|
||||
target: 'https://test-admin.linyikj.com.cn/',
|
||||
// target: 'http://we6f9c65.natappfree.cc',
|
||||
// target: 'https://loanos-test.nchl.net/',
|
||||
changeOrigin: true,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"url": "http://10.39.13.80:8001/api/docs/openapi",
|
||||
"url": "http://10.39.13.78:8001/api/docs/openapi",
|
||||
"module": "Admin"
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { MyResponseType, renderTextHelper } from '@/common';
|
||||
import { ProColumns } from '@ant-design/pro-components';
|
||||
import { Image, Popconfirm, Tag } from 'antd';
|
||||
import { Image, Popconfirm, Switch, Tag } from 'antd';
|
||||
|
||||
type ReturnType = ProColumns<Record<string, any>, 'text'>;
|
||||
|
||||
@ -50,36 +50,23 @@ export const MyColumns = {
|
||||
} & ReturnType): ReturnType {
|
||||
return {
|
||||
title: '启/禁用',
|
||||
render: (_, item, index, action) =>
|
||||
item?.deleted_at ? (
|
||||
<Popconfirm
|
||||
title="启用"
|
||||
description="您确认启用吗?"
|
||||
onConfirm={() => {
|
||||
render: (_, item, index, action) => (
|
||||
<Popconfirm
|
||||
title={item?.deleted_at ? '启用' : '禁用'}
|
||||
description={item?.deleted_at ? '您确认启用吗?' : '您确认禁用吗?'}
|
||||
onConfirm={() => {
|
||||
if (item?.deleted_at) {
|
||||
onRestore?.({ id: item.id }).then(() => action?.reload());
|
||||
}}
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
>
|
||||
<Tag color="gray" style={{ cursor: 'pointer' }}>
|
||||
已禁用
|
||||
</Tag>
|
||||
</Popconfirm>
|
||||
) : (
|
||||
<Popconfirm
|
||||
title="禁用"
|
||||
description="您确认禁用吗?"
|
||||
onConfirm={() => {
|
||||
} else {
|
||||
onSoftDelete?.({ id: item.id }).then(() => action?.reload());
|
||||
}}
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
>
|
||||
<Tag color="green" style={{ cursor: 'pointer' }}>
|
||||
已启用
|
||||
</Tag>
|
||||
</Popconfirm>
|
||||
),
|
||||
}
|
||||
}}
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
>
|
||||
<Switch checked={!item?.deleted_at} size="default" />
|
||||
</Popconfirm>
|
||||
),
|
||||
search: false,
|
||||
...rest,
|
||||
};
|
||||
|
||||
@ -110,7 +110,7 @@ export const Selects = {
|
||||
},
|
||||
};
|
||||
},
|
||||
// 单元下拉框
|
||||
// 网格单元下拉框
|
||||
GridUnits(props?: PropsType): ReturnType {
|
||||
const {
|
||||
title = '单元',
|
||||
@ -126,18 +126,21 @@ export const Selects = {
|
||||
valueType: 'select',
|
||||
hideInTable: hideInTable,
|
||||
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
||||
request: async (params) =>
|
||||
(
|
||||
await Apis.Asset.AssetUnits.GridSelect({
|
||||
keywords: params?.KeyWords,
|
||||
asset_projects_id: params?.asset_projects_id,
|
||||
asset_buildings_id: params?.asset_buildings_id,
|
||||
...params,
|
||||
})
|
||||
).data,
|
||||
request: async (params) => {
|
||||
let res = await Apis.Asset.AssetUnits.GridSelect({
|
||||
keywords: params?.KeyWords,
|
||||
asset_projects_id: params?.asset_projects_id,
|
||||
...params,
|
||||
});
|
||||
res?.data?.map((l: any) => {
|
||||
l.label = l.asset_building.name + l.label;
|
||||
});
|
||||
return res?.data;
|
||||
},
|
||||
...rest,
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
// mode: 'multiple',
|
||||
fieldNames: {
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
@ -355,6 +358,41 @@ export const Selects = {
|
||||
},
|
||||
};
|
||||
},
|
||||
//机构收款账户
|
||||
CompanyAccounts(props?: PropsType): ReturnType {
|
||||
const {
|
||||
title = '收款账户',
|
||||
key = 'receipt_accounts_id',
|
||||
required = false,
|
||||
hideInTable = true,
|
||||
...rest
|
||||
} = props ?? {};
|
||||
|
||||
return {
|
||||
title: title,
|
||||
key: key,
|
||||
valueType: 'select',
|
||||
hideInTable: hideInTable,
|
||||
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
||||
request: async (params) =>
|
||||
(
|
||||
await Apis.Company.CompanyReceiptAccounts.Select({
|
||||
keywords: params?.KeyWords,
|
||||
...params,
|
||||
})
|
||||
).data,
|
||||
...rest,
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
fieldNames: {
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
},
|
||||
...rest?.fieldProps,
|
||||
},
|
||||
};
|
||||
},
|
||||
//项目收款账户
|
||||
ProjectAccounts(props?: PropsType): ReturnType {
|
||||
const {
|
||||
title = '收款账户',
|
||||
|
||||
49
src/gen/ApiTypes.d.ts
vendored
49
src/gen/ApiTypes.d.ts
vendored
@ -71,6 +71,25 @@ declare namespace ApiTypes {
|
||||
type RemoveOwner = {
|
||||
"house_occupants_id": number; // 房客id
|
||||
};
|
||||
type ChangeOccupant = {
|
||||
"house_occupants_id": number; // 房客id
|
||||
"type": string; // 类型,[enum:HouseRegistersTypeEnum
|
||||
"update_info": string[]; // 要修改的信息
|
||||
"update_info.name"?: string; // 客户姓名
|
||||
"update_info.phone"?: string; // 客户手机号
|
||||
"update_info.reserve_phone"?: phone; // 客户备用电话
|
||||
"update_info.card_type"?: string; // 证件类型,[enum:HouseOccupantsCardTypeEnum]
|
||||
"update_info.id_card"?: string; // 客户身份证号
|
||||
"update_info.card_front_image"?: string[]; // 身份证正面图片
|
||||
"update_info.card_back_image"?: string[]; // 身份证反面图片
|
||||
"update_info.address"?: string; // 客户地址
|
||||
"update_info.ownership_info"?: string[]; // 产权信息
|
||||
"house_relation"?: string; // 房客关系,[enum:HouseOccupantsHouseRelationEnum]
|
||||
"residential_relation"?: string; // 居住关系,[enum:HouseOccupantsResidentialRelationEnum]
|
||||
"owners_id"?: number; // 产权人id,[ref:house_occupants]
|
||||
"relation_with_owner"?: string; // 与产权人关系,[enum:HouseOccupantsRelationWithOwnerEnum]
|
||||
"status"?: string; // 状态,[enum:HouseOccupantsStatusEnum]
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
};
|
||||
@ -224,7 +243,7 @@ declare namespace ApiTypes {
|
||||
"charge"?: string; // 收费方式,[enum:AssetProjectsChargeEnum]
|
||||
"takeover_date"?: Date; // 接管日期
|
||||
"closure_date"?: Date; // 封园日期
|
||||
"company_property_brands_id"?: string; // 物业品牌id,[ref:company_property_brands]
|
||||
"company_property_brands_id"?: number; // 物业品牌id,[ref:company_property_brands]
|
||||
};
|
||||
type Update = {
|
||||
"id": number; // id
|
||||
@ -249,7 +268,7 @@ declare namespace ApiTypes {
|
||||
"charge"?: string; // 收费方式,[enum:AssetProjectsChargeEnum]
|
||||
"takeover_date"?: Date; // 接管日期
|
||||
"closure_date"?: Date; // 封园日期
|
||||
"company_property_brands_id"?: string; // 物业品牌id,[ref:company_property_brands]
|
||||
"company_property_brands_id"?: number; // 物业品牌id,[ref:company_property_brands]
|
||||
};
|
||||
type BindCompany = {
|
||||
"projects_id": number; // 项目id
|
||||
@ -518,6 +537,8 @@ declare namespace ApiTypes {
|
||||
namespace ConvenienceServices {
|
||||
type List = {
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
"asset_projects_id"?: number; // 项目ID
|
||||
"project_name"?: string; // 项目名称
|
||||
};
|
||||
type Store = {
|
||||
"asset_projects_id": number; // 项目ID
|
||||
@ -713,8 +734,8 @@ declare namespace ApiTypes {
|
||||
}
|
||||
namespace CompanyProjectReceiptAccounts {
|
||||
type List = {
|
||||
"companies_id": number; // 所属机构id,[ref:companies]
|
||||
"projects_id": number; // 所属项目id,[ref:asset_projects]
|
||||
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||
"projects_id"?: number; // 所属项目id,[ref:asset_projects]
|
||||
};
|
||||
type Store = {
|
||||
"companies_id": number; // 所属机构id,[ref:companies]
|
||||
@ -769,7 +790,7 @@ declare namespace ApiTypes {
|
||||
}
|
||||
namespace CompanyReceiptAccounts {
|
||||
type List = {
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
"company_name"?: string; // 模糊搜索:名称
|
||||
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||
};
|
||||
type Store = {
|
||||
@ -803,6 +824,10 @@ declare namespace ApiTypes {
|
||||
type Delete = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Select = {
|
||||
"company_name"?: string; // 模糊搜索:名称
|
||||
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||
};
|
||||
}
|
||||
namespace Organizations {
|
||||
type List = {
|
||||
@ -870,6 +895,20 @@ declare namespace ApiTypes {
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Customer {
|
||||
namespace CustomerOpinions {
|
||||
type List = {
|
||||
"type"?: string; // 类型,[enum:CustomerOpinionsTypeEnum]
|
||||
"content"?: string; // 模糊搜索:内容
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Delete = {
|
||||
"id": number; // id
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Grid {
|
||||
namespace Grids {
|
||||
type List = {
|
||||
|
||||
@ -45,6 +45,9 @@ export const Apis = {
|
||||
RemoveOwner(data: ApiTypes.Archive.HouseRegisters.RemoveOwner): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_registers/remove_owner', { data });
|
||||
},
|
||||
ChangeOccupant(data: ApiTypes.Archive.HouseRegisters.ChangeOccupant): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_registers/change_occupant', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Archive.HouseRegisters.Show): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_registers/show', { data });
|
||||
},
|
||||
@ -418,7 +421,7 @@ export const Apis = {
|
||||
},
|
||||
},
|
||||
CompanyProjectReceiptAccounts: {
|
||||
List(data: ApiTypes.Company.CompanyProjectReceiptAccounts.List): Promise<MyResponseType> {
|
||||
List(data?: ApiTypes.Company.CompanyProjectReceiptAccounts.List): Promise<MyResponseType> {
|
||||
return request('admin/company/company_project_receipt_accounts/list', { data });
|
||||
},
|
||||
Store(data: ApiTypes.Company.CompanyProjectReceiptAccounts.Store): Promise<MyResponseType> {
|
||||
@ -479,6 +482,9 @@ export const Apis = {
|
||||
Delete(data: ApiTypes.Company.CompanyReceiptAccounts.Delete): Promise<MyResponseType> {
|
||||
return request('admin/company/company_receipt_accounts/delete', { data });
|
||||
},
|
||||
Select(data?: ApiTypes.Company.CompanyReceiptAccounts.Select): Promise<MyResponseType> {
|
||||
return request('admin/company/company_receipt_accounts/select', { data });
|
||||
},
|
||||
},
|
||||
Organizations: {
|
||||
List(data?: ApiTypes.Company.Organizations.List): Promise<MyResponseType> {
|
||||
@ -516,6 +522,19 @@ export const Apis = {
|
||||
},
|
||||
},
|
||||
},
|
||||
Customer: {
|
||||
CustomerOpinions: {
|
||||
List(data?: ApiTypes.Customer.CustomerOpinions.List): Promise<MyResponseType> {
|
||||
return request('admin/customer/customer_opinions/list', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Customer.CustomerOpinions.Show): Promise<MyResponseType> {
|
||||
return request('admin/customer/customer_opinions/show', { data });
|
||||
},
|
||||
Delete(data: ApiTypes.Customer.CustomerOpinions.Delete): Promise<MyResponseType> {
|
||||
return request('admin/customer/customer_opinions/delete', { data });
|
||||
},
|
||||
},
|
||||
},
|
||||
Grid: {
|
||||
Grids: {
|
||||
List(data?: ApiTypes.Grid.Grids.List): Promise<MyResponseType> {
|
||||
|
||||
@ -126,7 +126,7 @@ export const BannersTypeEnum= {
|
||||
|
||||
// 缓存类型
|
||||
export const CacheTypeEnum= {
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#5b3d89","value":"MobilePhoneVerificationCode"},
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#1f86c5","value":"MobilePhoneVerificationCode"},
|
||||
};
|
||||
|
||||
// CompaniesMerchantTypeEnum
|
||||
@ -189,6 +189,12 @@ export const CustomerBacklogsTypeEnum= {
|
||||
'ContractTodo': {"text":"合同待办","color":"#722ed1","value":"ContractTodo"},
|
||||
};
|
||||
|
||||
// CustomerOpinionsTypeEnum
|
||||
export const CustomerOpinionsTypeEnum= {
|
||||
'FeatureException': {"text":"功能异常","color":"#ff0000","value":"FeatureException"},
|
||||
'FeatureSuggestion': {"text":"新功能建议","color":"#00bfff","value":"FeatureSuggestion"},
|
||||
};
|
||||
|
||||
// 账单状态枚举
|
||||
export const HouseBillsBillStatusEnum= {
|
||||
'PendingPayment': {"text":"待支付","color":"#facc15","value":"PendingPayment"},
|
||||
@ -404,6 +410,8 @@ export const HouseRegistersTypeEnum= {
|
||||
'RemoveOccupant': {"text":"移除住户","color":"#fa8c16","value":"RemoveOccupant"},
|
||||
'MoveOut': {"text":"搬离登记","color":"#f50","value":"MoveOut"},
|
||||
'MoveIn': {"text":"搬入登记","color":"#ffc53d","value":"MoveIn"},
|
||||
'UpdateInfo': {"text":"修改信息","color":"#722ed1","value":"UpdateInfo"},
|
||||
'UpdatePhone': {"text":"修改电话","color":"#13c2c2","value":"UpdatePhone"},
|
||||
};
|
||||
|
||||
// HouseRegistersUsagePlanEnum
|
||||
|
||||
@ -1,85 +0,0 @@
|
||||
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 Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Msg.MsgPropertyAnnouncements.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加公告`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
trigger={<MyButtons.Create title={`添加公告`} />}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Msg.MsgPropertyAnnouncements.Store(values)
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('添加公告内容成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'title',
|
||||
title: '公告标题',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'content',
|
||||
title: '公告内容',
|
||||
valueType: 'textarea',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
fieldProps: {
|
||||
autoSize: { minRows: 4, maxRows: 6 },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'publish_at',
|
||||
title: '内容显示的发布日期',
|
||||
valueType: 'date',
|
||||
colProps: { span: 12 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
Selects?.AssetProjects({
|
||||
title: '请选择项目',
|
||||
key: 'asset_projects_id',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
key: 'sort',
|
||||
title: '排序',
|
||||
valueType: 'digit',
|
||||
colProps: { span: 12 },
|
||||
tooltip: '数值越大越靠前',
|
||||
fieldProps: {
|
||||
placeholder: '数值越大越靠前',
|
||||
min: 0,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
initialValue: 0,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
import { MyBetaModalFormProps } from '@/common';
|
||||
import { MyModal } from '@/components/MyModal';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Typography } from 'antd';
|
||||
|
||||
const { Text } = Typography;
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<MyModal
|
||||
title={props.title || '查看'}
|
||||
// width="40vw"
|
||||
width={600}
|
||||
// style={{ maxWidth: '650px' }}
|
||||
node={
|
||||
<ProCard>
|
||||
<ProDescriptions
|
||||
// bordered
|
||||
// column={{ xs: 1, sm: 2, md: 3 }}
|
||||
column={1}
|
||||
size="small"
|
||||
>
|
||||
<ProDescriptions.Item label="公告标题">
|
||||
{props?.item?.title || '-'}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="公告内容">
|
||||
<div
|
||||
style={{
|
||||
whiteSpace: 'pre-wrap',
|
||||
maxHeight: '300px',
|
||||
overflow: 'auto',
|
||||
}}
|
||||
>
|
||||
{props?.item?.content || '-'}
|
||||
</div>
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="发布日期">
|
||||
{props?.item?.publish_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label=" 关联项目">
|
||||
{props?.item?.asset_project?.name || '-'}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="创建时间">
|
||||
{props?.item?.created_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -1,95 +0,0 @@
|
||||
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 Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Msg.MsgPropertyAnnouncements.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑公告内容`}
|
||||
trigger={<MyButtons.Edit />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue(props.item);
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Msg.MsgPropertyAnnouncements.Update({
|
||||
...values,
|
||||
id: props.item?.id ?? 0,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('编辑公告内容成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'title',
|
||||
title: '公告标题',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'content',
|
||||
title: '公告内容',
|
||||
valueType: 'textarea',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
fieldProps: {
|
||||
autoSize: { minRows: 4, maxRows: 6 },
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'publish_at',
|
||||
title: '内容显示的发布日期',
|
||||
valueType: 'date',
|
||||
colProps: { span: 12 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
Selects?.AssetProjects({
|
||||
title: '请选择项目',
|
||||
key: 'asset_projects_id',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
// {
|
||||
// key: 'is_publish',
|
||||
// title: '是否立刻发布',
|
||||
// valueType: 'switch',
|
||||
// colProps: { span: 8 },
|
||||
// },
|
||||
{
|
||||
key: 'sort',
|
||||
title: '排序',
|
||||
valueType: 'digit',
|
||||
colProps: { span: 12 },
|
||||
tooltip: '数值越大越靠前',
|
||||
fieldProps: {
|
||||
placeholder: '数值越大越靠前',
|
||||
min: 0,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
initialValue: 0,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -10,10 +10,12 @@ import { Popconfirm, Space, Tag } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import Delivery from '../modals/Delivery';
|
||||
import AddOccupant from './modals/AddOccupant';
|
||||
import ChangePhone from './modals/ChangePhone';
|
||||
import MoveIn from './modals/MoveIn';
|
||||
import MoveOut from './modals/MoveOut';
|
||||
import OccupantShow from './modals/OccupantShow';
|
||||
import OccupantsUpdate from './modals/OccupantsUpdate';
|
||||
import OwnerUpdate from './modals/OwnerUpdate';
|
||||
import RemoveOwner from './modals/RemoveOwner';
|
||||
import Transfer from './modals/Transfer';
|
||||
|
||||
@ -152,8 +154,16 @@ export default function Index({ ...rest }) {
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<OccupantShow item={item} reload={action?.reload} />
|
||||
<OccupantsUpdate item={item} reload={action?.reload} />
|
||||
{!item?.is_live_in && (
|
||||
{item?.house_relation !==
|
||||
HouseOccupantsHouseRelationEnum.NonOwner.value && (
|
||||
<OwnerUpdate item={item} reload={action?.reload} />
|
||||
)}
|
||||
{item?.house_relation ===
|
||||
HouseOccupantsHouseRelationEnum.NonOwner.value && (
|
||||
<OccupantsUpdate item={item} reload={action?.reload} />
|
||||
)}
|
||||
<ChangePhone item={item} reload={action?.reload} />
|
||||
{!item?.move_in_date && (
|
||||
<MoveIn item={item} reload={action?.reload} title="入住" />
|
||||
)}
|
||||
{item?.move_in_date && (
|
||||
|
||||
59
src/pages/archive/components/modals/ChangePhone.tsx
Normal file
59
src/pages/archive/components/modals/ChangePhone.tsx
Normal file
@ -0,0 +1,59 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { HouseRegistersTypeEnum } from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.ChangeOccupant>
|
||||
{...MyModalFormProps.props}
|
||||
title={`修改电话`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="360px"
|
||||
trigger={<MyButtons.Default title={`改电话`} size="small" type="link" />}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.setFieldsValue(props?.item); // 编辑赋值
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) => {
|
||||
const requestData: any = {
|
||||
house_occupants_id: props?.item?.id,
|
||||
type: HouseRegistersTypeEnum.UpdatePhone.value,
|
||||
house_relation: props?.item?.house_relation,
|
||||
update_info: {
|
||||
phone: values.phone,
|
||||
},
|
||||
};
|
||||
return Apis.Archive.HouseRegisters.ChangeOccupant(requestData)
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('电话修改成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false);
|
||||
}}
|
||||
columns={[
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.phone },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
106
src/pages/archive/components/modals/OwnerUpdate.tsx
Normal file
106
src/pages/archive/components/modals/OwnerUpdate.tsx
Normal file
@ -0,0 +1,106 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseRegistersTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.ChangeOccupant>
|
||||
{...MyModalFormProps.props}
|
||||
title={`修改信息`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
trigger={<MyButtons.Default title={`改信息`} size="small" type="link" />}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.setFieldsValue(props?.item); // 编辑赋值
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) => {
|
||||
const requestData: any = {
|
||||
house_occupants_id: props?.item?.id,
|
||||
type: HouseRegistersTypeEnum.UpdateInfo.value,
|
||||
house_relation: props?.item?.house_relation,
|
||||
update_info: {
|
||||
name: values.name || props?.item,
|
||||
card_type: values.card_type,
|
||||
id_card: values.id_card,
|
||||
card_front_image: values.card_front_image,
|
||||
card_back_image: values.card_back_image,
|
||||
},
|
||||
};
|
||||
return Apis.Archive.HouseRegisters.ChangeOccupant(requestData)
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('信息编辑成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false);
|
||||
}}
|
||||
columns={[
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'card_type',
|
||||
title: '证件类型',
|
||||
colProps: { span: 10 },
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
colProps: { span: 8 },
|
||||
fieldProps: {
|
||||
maxLength: 18,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_front_image',
|
||||
title: '证件正面',
|
||||
// uploadType: 'file',
|
||||
required: true,
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
MyFormItems.UploadImages({
|
||||
key: 'card_back_image',
|
||||
title: '证件反面',
|
||||
// uploadType: 'file',
|
||||
required: true,
|
||||
max: 1,
|
||||
colProps: { span: 6 },
|
||||
}),
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
88
src/pages/asset/accounts/index.tsx
Normal file
88
src/pages/asset/accounts/index.tsx
Normal file
@ -0,0 +1,88 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import AccountsGet from './modals/AccountsGet';
|
||||
|
||||
export default function Index({ title = '项目账户' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'company-project-receipt-accounts',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="company-apps"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Company.CompanyProjectReceiptAccounts.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<AccountsGet key="Select" reload={action?.reload} title={title} />,
|
||||
]}
|
||||
columns={[
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'id',
|
||||
// width: 360,
|
||||
},
|
||||
{
|
||||
title: '收款账号名称',
|
||||
dataIndex: ['receipt_account', 'company_name'],
|
||||
},
|
||||
{
|
||||
title: '开户行',
|
||||
dataIndex: ['receipt_account', 'company_bank'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '收款账号',
|
||||
dataIndex: ['receipt_account', 'company_account'],
|
||||
search: false,
|
||||
},
|
||||
// {
|
||||
// title: '是否默认',
|
||||
// dataIndex: 'is_default',
|
||||
// search: false,
|
||||
// render(_, record) {
|
||||
// return `${record?.is_default ? '是' : '否'} `;
|
||||
// },
|
||||
// },
|
||||
MyColumns.UpdatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Company.CompanyProjectReceiptAccounts.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
67
src/pages/asset/accounts/modals/AccountsGet.tsx
Normal file
67
src/pages/asset/accounts/modals/AccountsGet.tsx
Normal file
@ -0,0 +1,67 @@
|
||||
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 Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Company.CompanyProjectReceiptAccounts.Store>
|
||||
{...MyModalFormProps.props}
|
||||
form={form}
|
||||
title={`${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
trigger={
|
||||
<MyButtons.Create
|
||||
title={`${props.title}`}
|
||||
size={props?.item?.size || 'middle'}
|
||||
/>
|
||||
}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
key={new Date().getTime()}
|
||||
onFinish={async (values) =>
|
||||
Apis.Company.CompanyProjectReceiptAccounts.Store({
|
||||
...values,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '选择机构',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
Selects?.AssetProjects({
|
||||
key: 'projects_id',
|
||||
title: '选择项目',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
Selects?.CompanyAccounts({
|
||||
key: 'receipt_accounts_id',
|
||||
title: '选择收款账户',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -68,7 +68,7 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
<MyButtons.Create
|
||||
title="确定添加"
|
||||
type="primary"
|
||||
key="create2"
|
||||
key="create"
|
||||
onClick={() => onShowContactPhone()}
|
||||
/>
|
||||
);
|
||||
@ -13,12 +13,12 @@ import AnnouncementCreate from './modals/AnnouncementCreate';
|
||||
import AnnouncementShow from './modals/AnnouncementShow';
|
||||
import AnnouncementUpdate from './modals/AnnouncementUpdate';
|
||||
|
||||
export default function Index({ title = '公告管理' }) {
|
||||
export default function Index({ title = '项目公告' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'Msg',
|
||||
tabKey: 'msg-property-announcements',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
@ -26,7 +26,7 @@ export default function Index({ title = '公告管理' }) {
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="banners"
|
||||
tabKey="msg-property-announcements"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
@ -40,16 +40,23 @@ export default function Index({ title = '公告管理' }) {
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<AnnouncementCreate
|
||||
key="Create"
|
||||
key="Select"
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
|
||||
{
|
||||
title: '标题',
|
||||
title: '关联项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: false,
|
||||
render: (_, record) => {
|
||||
return record?.asset_project?.name;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '公告标题',
|
||||
dataIndex: 'title',
|
||||
width: 120, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽)
|
||||
render: (text) => (
|
||||
@ -69,7 +76,7 @@ export default function Index({ title = '公告管理' }) {
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '内容',
|
||||
title: '公告内容',
|
||||
dataIndex: 'content',
|
||||
valueType: 'textarea', // 仅影响表单编辑时的输入类型,不影响表格展示
|
||||
search: false,
|
||||
@ -97,12 +104,10 @@ export default function Index({ title = '公告管理' }) {
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
title: '是否发布小程序',
|
||||
dataIndex: 'is_publish',
|
||||
render: (text) => (text ? '是' : '否'),
|
||||
search: false,
|
||||
render: (_, record) => {
|
||||
return record?.asset_project?.name;
|
||||
},
|
||||
},
|
||||
MyColumns.SoftDelete({
|
||||
title: '启/禁用',
|
||||
@ -116,9 +121,6 @@ export default function Index({ title = '公告管理' }) {
|
||||
dataIndex: 'created_at',
|
||||
valueType: 'date',
|
||||
search: false,
|
||||
// render: (_, record) => {
|
||||
// return record?.created_at?.substring(0, 10);
|
||||
// },
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
@ -127,7 +129,7 @@ export default function Index({ title = '公告管理' }) {
|
||||
<AnnouncementUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
// title={title}
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
@ -4,6 +4,7 @@ import {
|
||||
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';
|
||||
@ -27,7 +28,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
onFinish={async (values) =>
|
||||
Apis.Msg.MsgPropertyAnnouncements.Store({
|
||||
...values,
|
||||
asset_projects_id: props.item?.id,
|
||||
asset_projects_id: values?.asset_projects_id || props.item?.id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -37,6 +38,16 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
...(props?.item?.id
|
||||
? []
|
||||
: [
|
||||
Selects?.AssetProjects({
|
||||
key: 'asset_projects_id',
|
||||
title: '关联项目',
|
||||
colProps: { span: 24 },
|
||||
required: true,
|
||||
}),
|
||||
]),
|
||||
{
|
||||
key: 'title',
|
||||
title: '公告标题',
|
||||
@ -1,154 +0,0 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
console.log(props?.item, 'item');
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`划分范围`}
|
||||
// 基本表单
|
||||
width="700px"
|
||||
layout="horizontal"
|
||||
labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
labelAlign="right"
|
||||
trigger={<MyButtons.Create title={`划分范围`} />}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) => {
|
||||
values?.grid_ranges?.forEach((res: { asset_projects_id: string }) => {
|
||||
res.asset_projects_id = props?.item?.id;
|
||||
});
|
||||
return Apis.Grid.Grids.Store({
|
||||
...values,
|
||||
asset_projects_id: props?.item?.id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('范围划分成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false);
|
||||
}}
|
||||
columns={[
|
||||
Selects?.GetGridMark({
|
||||
key: 'grid_mark',
|
||||
title: '范围标识',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
},
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'grid_ranges',
|
||||
colProps: { span: 24 },
|
||||
initialValue: [''],
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
creatorButtonText: '添加楼栋单元',
|
||||
},
|
||||
itemRender: (
|
||||
{ listDom, action }: any,
|
||||
{ index }: { index: number },
|
||||
) => {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 5 }}
|
||||
title={`选择范围${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
{listDom}
|
||||
</ProCard>
|
||||
);
|
||||
},
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_buildings_id', 'asset_units_id'],
|
||||
columns: ({ asset_buildings_id }) => {
|
||||
return [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
Selects?.AssetBuildings({
|
||||
key: 'asset_buildings_id',
|
||||
title: '选择楼栋',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
},
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
onChange: (value: any) => {
|
||||
// 获取当前表单的所有值
|
||||
const formValues = form.getFieldsValue();
|
||||
const gridRanges = formValues.grid_ranges || [];
|
||||
|
||||
// 清空所有行的asset_units_id,因为楼栋变化会影响所有单元选择
|
||||
const updatedGridRanges = gridRanges.map(
|
||||
(item: any, index: number) => {
|
||||
if (item.asset_buildings_id === value) {
|
||||
return { ...item, asset_units_id: undefined };
|
||||
}
|
||||
return item;
|
||||
},
|
||||
);
|
||||
|
||||
// 更新表单值
|
||||
form.setFieldsValue({
|
||||
grid_ranges: updatedGridRanges,
|
||||
});
|
||||
},
|
||||
},
|
||||
}),
|
||||
...(asset_buildings_id
|
||||
? [
|
||||
Selects?.GridUnits({
|
||||
key: 'asset_units_id',
|
||||
title: '选择单元',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_buildings_id: asset_buildings_id,
|
||||
},
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
},
|
||||
}),
|
||||
]
|
||||
: []),
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
111
src/pages/asset/convenience_services/index.tsx
Normal file
111
src/pages/asset/convenience_services/index.tsx
Normal file
@ -0,0 +1,111 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ConvenienceServicesTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import ServiceCreate from './modals/ServiceCreate';
|
||||
import ServiceUpdate from './modals/ServiceUpdate';
|
||||
|
||||
export default function Index({ title = '便民服务' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'convenience-services',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="convenience-services"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Common.ConvenienceServices.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<ServiceCreate key="Select" reload={action?.reload} title={title} />,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '关联项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return { project_name: value };
|
||||
},
|
||||
},
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: ConvenienceServicesTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '服务名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
|
||||
{
|
||||
title: '联系方式',
|
||||
render(_, record) {
|
||||
const content = record?.content || [];
|
||||
|
||||
// 过滤有效数据
|
||||
const validItems = content.filter(
|
||||
(item: any) => item?.name && item?.phone,
|
||||
);
|
||||
|
||||
return (
|
||||
<div style={{ lineHeight: '1.6' }}>
|
||||
{validItems.length > 0 ? (
|
||||
validItems.map((item: any, index: number) => (
|
||||
// 每个客户信息单独一行
|
||||
<div key={index}>
|
||||
{item.name}: {item.phone}
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<span>暂无客户信息</span>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<ServiceUpdate item={item} reload={action?.reload} />
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Common.ConvenienceServices.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
@ -5,6 +5,7 @@ import {
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ConvenienceServicesTypeEnum } from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
@ -37,7 +38,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
type: values.type,
|
||||
name: service.name,
|
||||
content: service.content,
|
||||
asset_projects_id: props.item?.id,
|
||||
asset_projects_id: values.asset_projects_id || props.item?.id,
|
||||
} as any);
|
||||
}
|
||||
props.reload?.();
|
||||
@ -49,6 +50,16 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
}
|
||||
}}
|
||||
columns={[
|
||||
...(props?.item?.id
|
||||
? []
|
||||
: [
|
||||
Selects?.AssetProjects({
|
||||
key: 'asset_projects_id',
|
||||
title: '关联项目',
|
||||
colProps: { span: 24 },
|
||||
required: true,
|
||||
}),
|
||||
]),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '类型',
|
||||
91
src/pages/asset/grids/index.tsx
Normal file
91
src/pages/asset/grids/index.tsx
Normal file
@ -0,0 +1,91 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import GridCreate from './modals/GridCreate';
|
||||
import GridMannger from './modals/GridMannger';
|
||||
import GridUpdate from './modals/GridUpdate';
|
||||
|
||||
export default function Index({ title = '楼栋范围' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'grids',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="grids"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(params, sort, Apis.Grid.Grids.List)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<GridCreate key="Select" reload={action?.reload} title="楼栋划分" />,
|
||||
]}
|
||||
columns={[
|
||||
{
|
||||
title: '关联项目',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return { project_name: value };
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: 'ID',
|
||||
dataIndex: 'id',
|
||||
},
|
||||
{
|
||||
title: '板块名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '标识',
|
||||
dataIndex: 'grid_mark',
|
||||
},
|
||||
{
|
||||
title: '楼栋管家',
|
||||
dataIndex: ['company_employee', 'name'],
|
||||
render: (_, item: any) =>
|
||||
`${item?.company_employee?.name || ''}-${
|
||||
item?.company_employee?.phone || ''
|
||||
}`,
|
||||
},
|
||||
// MyColumns.CreatedAt(),
|
||||
MyColumns.UpdatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<GridUpdate item={item} reload={action?.reload} />
|
||||
<GridMannger item={item} reload={action?.reload} />
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Grid.Grids.Delete({ id: item.id }).then(() =>
|
||||
action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
216
src/pages/asset/grids/modals/GridCreate copy 2.tsx
Normal file
216
src/pages/asset/grids/modals/GridCreate copy 2.tsx
Normal file
@ -0,0 +1,216 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
import { useState } from 'react';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
const [transferData, setTransferData] = useState<any[]>([]);
|
||||
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
||||
|
||||
// 获取Transfer数据源
|
||||
// useEffect(() => {
|
||||
// const asset_projects_id = props?.item?.id || 0;
|
||||
// if (asset_projects_id) {
|
||||
// Apis.Asset.AssetUnits.GridSelect({ asset_projects_id })
|
||||
// .then((res) => {
|
||||
// const data =
|
||||
// res.data?.map((item: any) => ({
|
||||
// key: item.value?.toString(),
|
||||
// title: item.label,
|
||||
// description: item.label,
|
||||
// })) || [];
|
||||
// setTransferData(data);
|
||||
// })
|
||||
// .catch(() => {
|
||||
// setTransferData([]);
|
||||
// });
|
||||
// }
|
||||
// }, [props?.item?.id]);
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`范围添加`}
|
||||
width="700px"
|
||||
layout="horizontal"
|
||||
labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
labelAlign="right"
|
||||
trigger={
|
||||
<MyButtons.Create
|
||||
title={`${props.title}`}
|
||||
size={props?.item?.size || 'middle'}
|
||||
/>
|
||||
}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
form.setFieldsValue({
|
||||
asset_projects_id: props?.item?.id,
|
||||
});
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) => {
|
||||
(values.asset_projects_id =
|
||||
values?.asset_projects_id || props?.item?.id),
|
||||
values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
||||
res.asset_projects_id = props?.item?.id;
|
||||
});
|
||||
return Apis.Grid.Grids.Store({
|
||||
...values,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('网格添加成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false);
|
||||
}}
|
||||
columns={[
|
||||
...(props?.item?.id
|
||||
? []
|
||||
: [
|
||||
Selects?.AssetProjects({
|
||||
key: 'asset_projects_id',
|
||||
title: '选择项目',
|
||||
colProps: { span: 24 },
|
||||
required: true,
|
||||
}),
|
||||
]),
|
||||
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_projects_id'],
|
||||
columns: ({ asset_projects_id }) => {
|
||||
return [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
Selects?.GetGridMark({
|
||||
key: 'grid_mark',
|
||||
title: '范围标识',
|
||||
params: {
|
||||
asset_projects_id:
|
||||
asset_projects_id || props?.item?.id || 0,
|
||||
},
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
valueType: 'formList',
|
||||
dataIndex: 'grid_ranges',
|
||||
colProps: { span: 24 },
|
||||
initialValue: [''],
|
||||
formItemProps: { ...rulesHelper.array },
|
||||
fieldProps: {
|
||||
copyIconProps: false,
|
||||
creatorButtonProps: {
|
||||
creatorButtonText: '添加楼栋单元',
|
||||
},
|
||||
itemRender: (
|
||||
{ listDom, action }: any,
|
||||
{ index }: { index: number },
|
||||
) => {
|
||||
return (
|
||||
<ProCard
|
||||
bordered
|
||||
style={{ marginBlockEnd: 5 }}
|
||||
title={`选择范围${index + 1}`}
|
||||
extra={action}
|
||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
||||
>
|
||||
{listDom}
|
||||
</ProCard>
|
||||
);
|
||||
},
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_buildings_id', 'asset_units_id'],
|
||||
columns: ({ asset_buildings_id }) => {
|
||||
return [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
Selects?.AssetBuildings({
|
||||
key: 'asset_buildings_id',
|
||||
title: '选择楼栋',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
},
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
onChange: (value: any) => {
|
||||
// 获取当前表单的所有值
|
||||
const formValues = form.getFieldsValue();
|
||||
const gridRanges =
|
||||
formValues.grid_ranges || [];
|
||||
|
||||
// 清空所有行的asset_units_id,因为楼栋变化会影响所有单元选择
|
||||
const updatedGridRanges = gridRanges.map(
|
||||
(item: any, index: number) => {
|
||||
if (
|
||||
item.asset_buildings_id === value
|
||||
) {
|
||||
return {
|
||||
...item,
|
||||
asset_units_id: undefined,
|
||||
};
|
||||
}
|
||||
return item;
|
||||
},
|
||||
);
|
||||
// 更新表单值
|
||||
form.setFieldsValue({
|
||||
grid_ranges: updatedGridRanges,
|
||||
});
|
||||
},
|
||||
},
|
||||
}),
|
||||
...(asset_buildings_id
|
||||
? [
|
||||
Selects?.GridUnits({
|
||||
key: 'asset_units_id',
|
||||
title: '选择单元',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_buildings_id:
|
||||
asset_buildings_id,
|
||||
},
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
},
|
||||
}),
|
||||
]
|
||||
: []),
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
157
src/pages/asset/grids/modals/GridCreate copy.tsx
Normal file
157
src/pages/asset/grids/modals/GridCreate copy.tsx
Normal file
@ -0,0 +1,157 @@
|
||||
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';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
const [transferData, setTransferData] = useState<any[]>([]);
|
||||
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
||||
|
||||
// 获取Transfer数据源
|
||||
useEffect(() => {
|
||||
const asset_projects_id = props?.item?.id || 0;
|
||||
if (asset_projects_id) {
|
||||
Apis.Asset.AssetUnits.GridSelect({ asset_projects_id })
|
||||
.then((res) => {
|
||||
const data =
|
||||
res.data?.map((item: any) => ({
|
||||
key: item.value?.toString(),
|
||||
title: item.label,
|
||||
description: item.label,
|
||||
})) || [];
|
||||
setTransferData(data);
|
||||
})
|
||||
.catch(() => {
|
||||
setTransferData([]);
|
||||
});
|
||||
}
|
||||
}, [props?.item?.id]);
|
||||
|
||||
console.log(props.item, 'pppp');
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`范围添加`}
|
||||
width="700px"
|
||||
layout="horizontal"
|
||||
labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
labelAlign="right"
|
||||
trigger={
|
||||
<MyButtons.Create
|
||||
title={`${props.title}`}
|
||||
size={props?.item?.size || 'middle'}
|
||||
/>
|
||||
}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
form.setFieldsValue({
|
||||
asset_projects_id: props?.item?.id,
|
||||
});
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) => {
|
||||
values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
||||
res.asset_projects_id = props?.item?.id;
|
||||
});
|
||||
return Apis.Grid.Grids.Store({
|
||||
...values,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('网格添加成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false);
|
||||
}}
|
||||
columns={[
|
||||
...(props?.item?.id
|
||||
? []
|
||||
: [
|
||||
Selects?.AssetProjects({
|
||||
key: 'asset_projects_id',
|
||||
title: '选择项目',
|
||||
colProps: { span: 24 },
|
||||
required: true,
|
||||
}),
|
||||
]),
|
||||
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_projects_id'],
|
||||
columns: ({ asset_projects_id }) => {
|
||||
return [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
Selects?.GetGridMark({
|
||||
key: 'grid_mark',
|
||||
title: '范围标识',
|
||||
params: {
|
||||
asset_projects_id:
|
||||
asset_projects_id || props?.item?.id || 0,
|
||||
},
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
Selects?.GridUnits({
|
||||
key: 'grid_units_id',
|
||||
title: '选择单元',
|
||||
params: {
|
||||
asset_projects_id:
|
||||
asset_projects_id || props?.item?.id || 0,
|
||||
},
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
// {
|
||||
// valueType: 'formItem',
|
||||
// dataIndex: 'grid_units_id',
|
||||
// title: '选择单元',
|
||||
// colProps: { span: 24 },
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// renderFormItem: () => (
|
||||
// <Transfer
|
||||
// dataSource={transferData}
|
||||
// targetKeys={targetKeys}
|
||||
// onChange={(nextTargetKeys) => {
|
||||
// setTargetKeys(nextTargetKeys as string[]);
|
||||
// form.setFieldValue('grid_units_id', nextTargetKeys);
|
||||
// }}
|
||||
// render={(item) => item.title}
|
||||
// titles={['可选单元', '已选单元']}
|
||||
// showSearch
|
||||
// listStyle={{
|
||||
// width: 250,
|
||||
// height: 300,
|
||||
// }}
|
||||
// operations={['选择', '移除']}
|
||||
// locale={{
|
||||
// itemUnit: '项',
|
||||
// itemsUnit: '项',
|
||||
// searchPlaceholder: '请输入搜索内容',
|
||||
// notFoundContent: '列表为空',
|
||||
// }}
|
||||
// />
|
||||
// ),
|
||||
// },
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
159
src/pages/asset/grids/modals/GridCreate.tsx
Normal file
159
src/pages/asset/grids/modals/GridCreate.tsx
Normal file
@ -0,0 +1,159 @@
|
||||
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, Transfer } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
const [transferData, setTransferData] = useState<any[]>([]);
|
||||
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
||||
|
||||
// 获取Transfer数据源
|
||||
useEffect(() => {
|
||||
const asset_projects_id = props?.item?.id || 0;
|
||||
if (asset_projects_id) {
|
||||
Apis.Asset.AssetUnits.GridSelect({ asset_projects_id })
|
||||
.then((res) => {
|
||||
const data =
|
||||
res.data?.map((item: any) => ({
|
||||
key: item.value?.toString(),
|
||||
title: item?.asset_building?.name + item.label,
|
||||
})) || [];
|
||||
setTransferData(data);
|
||||
})
|
||||
.catch(() => {
|
||||
setTransferData([]);
|
||||
});
|
||||
}
|
||||
}, [props?.item?.id]);
|
||||
|
||||
console.log(props.item, 'pppp');
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`范围添加`}
|
||||
width="700px"
|
||||
layout="horizontal"
|
||||
labelCol={{ span: 4 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
labelAlign="right"
|
||||
trigger={
|
||||
<MyButtons.Create
|
||||
title={`${props.title}`}
|
||||
size={props?.item?.size || 'middle'}
|
||||
/>
|
||||
}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
form.setFieldsValue({
|
||||
asset_projects_id: props?.item?.id,
|
||||
});
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) => {
|
||||
(values.asset_projects_id =
|
||||
values?.asset_projects_id || props?.item?.id),
|
||||
values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
||||
res.asset_projects_id = props?.item?.id;
|
||||
});
|
||||
return Apis.Grid.Grids.Store({
|
||||
...values,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('网格添加成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false);
|
||||
}}
|
||||
submitter={false}
|
||||
footer={[<MyButtons.Default key="submit" title="添加" />]}
|
||||
columns={[
|
||||
...(props?.item?.id
|
||||
? []
|
||||
: [
|
||||
Selects?.AssetProjects({
|
||||
key: 'asset_projects_id',
|
||||
title: '选择项目',
|
||||
colProps: { span: 24 },
|
||||
required: true,
|
||||
}),
|
||||
]),
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_projects_id'],
|
||||
columns: ({ asset_projects_id }) => {
|
||||
return [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
Selects?.GetGridMark({
|
||||
key: 'grid_mark',
|
||||
title: '范围标识',
|
||||
params: {
|
||||
asset_projects_id:
|
||||
asset_projects_id || props?.item?.id || 0,
|
||||
},
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
|
||||
{
|
||||
valueType: 'formItem',
|
||||
dataIndex: 'grid_units_id',
|
||||
title: '选择单元',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
renderFormItem: () => (
|
||||
<div onClick={(e) => e.stopPropagation()}>
|
||||
<Transfer
|
||||
dataSource={transferData}
|
||||
targetKeys={targetKeys}
|
||||
onChange={(nextTargetKeys) => {
|
||||
setTargetKeys(nextTargetKeys as string[]);
|
||||
form.setFieldValue('grid_units_id', nextTargetKeys);
|
||||
}}
|
||||
render={(item) => item.title}
|
||||
titles={['可选单元', '已选单元']}
|
||||
showSearch
|
||||
listStyle={{
|
||||
width: 250,
|
||||
height: 300,
|
||||
}}
|
||||
operations={['选择', '移除']}
|
||||
operationStyle={{ marginTop: 20 }}
|
||||
locale={{
|
||||
itemUnit: '项',
|
||||
itemsUnit: '项',
|
||||
searchPlaceholder: '请输入搜索内容',
|
||||
notFoundContent: '列表为空',
|
||||
}}
|
||||
onSelectChange={(
|
||||
sourceSelectedKeys,
|
||||
targetSelectedKeys,
|
||||
) => {
|
||||
// 处理选择变化,但不触发表单提交
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
539
src/pages/asset/houses/index.tsx
Normal file
539
src/pages/asset/houses/index.tsx
Normal file
@ -0,0 +1,539 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetHousesOwnershipTypeEnum,
|
||||
AssetHousesUsageEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProCard, ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { message, Space, Typography } from 'antd';
|
||||
import { useCallback, useMemo, useRef, useState } from 'react';
|
||||
import BuildingsCreate from './modals/BuildingsCreate';
|
||||
import AssetBuildingsUpdate from './modals/BuildingsUpdate';
|
||||
import HousesCreate from './modals/HousesCreate';
|
||||
import HousesUpdate from './modals/HousesUpdate';
|
||||
import UnitsCreate from './modals/UnitsCreate';
|
||||
import AssetUnitsUpdate from './modals/UnitsUpdate';
|
||||
|
||||
const { Title } = Typography;
|
||||
interface SelectedAsset {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface SelectedBuilding {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
interface SelectedUnit {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export default function Index({ title = '项目列表' }) {
|
||||
usePageTabs({
|
||||
tabKey: 'asset-buildings',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
const actionAssetRef: any = useRef();
|
||||
const actionBuildingsRef: any = useRef();
|
||||
const actionUnitsRef: any = useRef();
|
||||
const actionHousesRef: any = useRef();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const [selectedAsset, setSelectedAsset] = useState<SelectedAsset | null>(
|
||||
null,
|
||||
);
|
||||
const [selectedBuilding, setSelectedBuilding] =
|
||||
useState<SelectedBuilding | null>(null);
|
||||
const [selectedUnit, setSelectedUnit] = useState<SelectedUnit | null>(null);
|
||||
const [loading, setLoading] = useState({
|
||||
buildings: false,
|
||||
units: false,
|
||||
houses: false,
|
||||
});
|
||||
|
||||
// 选择项目的回调函数
|
||||
const handleAssetSelect = useCallback(
|
||||
(asset: SelectedAsset) => {
|
||||
if (selectedAsset?.id === asset.id) return; // 避免重复选择
|
||||
|
||||
setSelectedAsset(asset);
|
||||
setSelectedBuilding(null); // 重置楼栋选择
|
||||
setSelectedUnit(null); // 重置单元选择
|
||||
|
||||
// 刷新楼栋和单元列表
|
||||
actionBuildingsRef?.current?.reload();
|
||||
actionUnitsRef?.current?.reload();
|
||||
actionHousesRef?.current?.reload();
|
||||
},
|
||||
[selectedAsset?.id],
|
||||
);
|
||||
|
||||
// 选择楼栋的回调函数
|
||||
const handleBuildingSelect = useCallback(
|
||||
(building: SelectedBuilding) => {
|
||||
if (selectedBuilding?.id === building.id) return; // 避免重复选择
|
||||
|
||||
setSelectedBuilding(building);
|
||||
setSelectedUnit(null); // 重置单元选择
|
||||
|
||||
// 刷新单元和房屋列表
|
||||
actionUnitsRef?.current?.reload();
|
||||
actionHousesRef?.current?.reload();
|
||||
},
|
||||
[selectedBuilding?.id],
|
||||
);
|
||||
|
||||
// 选择单元的回调函数
|
||||
const handleUnitSelect = useCallback(
|
||||
(unit: SelectedUnit) => {
|
||||
if (selectedUnit?.id === unit.id) return; // 避免重复选择
|
||||
|
||||
setSelectedUnit(unit);
|
||||
// 刷新房屋列表
|
||||
actionHousesRef?.current?.reload();
|
||||
},
|
||||
[selectedUnit?.id],
|
||||
);
|
||||
|
||||
// 删除操作的通用处理
|
||||
const handleDelete = useCallback(
|
||||
async (deleteApi: any, id: number, reloadAction: any, itemName: string) => {
|
||||
try {
|
||||
await deleteApi({ id });
|
||||
message.success(`${itemName}删除成功`);
|
||||
reloadAction();
|
||||
|
||||
// 如果删除的是当前选中项,清空选择
|
||||
if (itemName === '项目' && selectedAsset?.id === id) {
|
||||
setSelectedAsset(null);
|
||||
setSelectedBuilding(null);
|
||||
setSelectedUnit(null);
|
||||
} else if (itemName === '楼栋' && selectedBuilding?.id === id) {
|
||||
setSelectedBuilding(null);
|
||||
setSelectedUnit(null);
|
||||
} else if (itemName === '单元' && selectedUnit?.id === id) {
|
||||
setSelectedUnit(null);
|
||||
}
|
||||
} catch (error) {
|
||||
message.error(`${itemName}删除失败`);
|
||||
console.error(`删除${itemName}失败:`, error);
|
||||
}
|
||||
},
|
||||
[selectedAsset?.id, selectedBuilding?.id, selectedUnit?.id],
|
||||
);
|
||||
|
||||
// 通用表格配置
|
||||
const getTableConfig = useMemo(
|
||||
() => ({
|
||||
...MyProTableProps.props,
|
||||
search: false as const,
|
||||
size: 'middle' as const,
|
||||
options: false as const,
|
||||
pagination: {
|
||||
pageSize: 10,
|
||||
showSizeChanger: false,
|
||||
},
|
||||
}),
|
||||
[],
|
||||
);
|
||||
|
||||
// 项目表格列配置
|
||||
const projectColumns = useMemo(
|
||||
() => [
|
||||
{
|
||||
title: '项目',
|
||||
dataIndex: 'name',
|
||||
ellipsis: true,
|
||||
search: {
|
||||
transform: (value: string) => ({ name: value }),
|
||||
},
|
||||
},
|
||||
MyColumns.Option({
|
||||
width: 120,
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index} size="small">
|
||||
<MyButtons.View
|
||||
title="配置"
|
||||
onClick={() => {
|
||||
navigate(`/asset/id/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
],
|
||||
[handleDelete],
|
||||
);
|
||||
|
||||
// 楼栋表格列配置
|
||||
const buildingColumns = useMemo(
|
||||
() => [
|
||||
{
|
||||
title: '楼栋',
|
||||
dataIndex: 'name',
|
||||
ellipsis: true,
|
||||
},
|
||||
MyColumns.Option({
|
||||
width: 120,
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index} size="small">
|
||||
<AssetBuildingsUpdate item={item} reload={action?.reload} />
|
||||
{/* <MyButtons.Delete
|
||||
size="small"
|
||||
onConfirm={() =>
|
||||
handleDelete(
|
||||
Apis.Asset.AssetBuildings.Delete,
|
||||
item.id,
|
||||
action?.reload,
|
||||
'楼栋',
|
||||
)
|
||||
}
|
||||
/> */}
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
],
|
||||
[handleDelete],
|
||||
);
|
||||
|
||||
// 单元表格列配置
|
||||
const unitColumns = useMemo(
|
||||
() => [
|
||||
{
|
||||
title: '单元',
|
||||
dataIndex: 'name',
|
||||
ellipsis: true,
|
||||
},
|
||||
MyColumns.Option({
|
||||
width: 120,
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index} size="small">
|
||||
<AssetUnitsUpdate item={item} reload={action?.reload} />
|
||||
{/* <MyButtons.Delete
|
||||
size="small"
|
||||
onConfirm={() =>
|
||||
handleDelete(
|
||||
Apis.Asset.AssetUnits.Delete,
|
||||
item.id,
|
||||
action?.reload,
|
||||
'单元',
|
||||
)
|
||||
}
|
||||
/> */}
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
],
|
||||
[handleDelete],
|
||||
);
|
||||
|
||||
// 房屋表格列配置
|
||||
const houseColumns = useMemo(
|
||||
() => [
|
||||
MyColumns.EnumTag({
|
||||
title: '用途',
|
||||
dataIndex: 'usage',
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
}),
|
||||
{
|
||||
title: '房屋名称',
|
||||
dataIndex: 'full_name',
|
||||
},
|
||||
{
|
||||
title: '楼层',
|
||||
dataIndex: 'floor',
|
||||
render(_, record) {
|
||||
return `${record?.floor}层`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '房号',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '计费面积',
|
||||
dataIndex: 'chargeable_area',
|
||||
render(_, record) {
|
||||
return `${
|
||||
record?.chargeable_area ? record?.chargeable_area + ' m²' : '-'
|
||||
} `;
|
||||
},
|
||||
},
|
||||
|
||||
MyColumns.EnumTag({
|
||||
title: '房屋属性',
|
||||
dataIndex: 'ownership_type',
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
}),
|
||||
MyColumns.Option({
|
||||
width: 120,
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index} size="small">
|
||||
<HousesUpdate item={item} reload={action?.reload} title="编辑" />
|
||||
{/* <MyButtons.Delete
|
||||
size="small"
|
||||
onConfirm={() =>
|
||||
handleDelete(
|
||||
Apis.Asset.AssetHouses.Delete,
|
||||
item.id,
|
||||
action?.reload,
|
||||
'房屋',
|
||||
)
|
||||
}
|
||||
/> */}
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
],
|
||||
[handleDelete],
|
||||
);
|
||||
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
<ProCard
|
||||
// title={
|
||||
// <Alert
|
||||
// message="操作提示:在楼栋下添加单元,在单元下添加房屋!"
|
||||
// type="info"
|
||||
// showIcon
|
||||
// style={{ margin: 0 }}
|
||||
// />
|
||||
// }
|
||||
>
|
||||
<Space align="start" size="large" style={{ width: '100%' }}>
|
||||
<div style={{ flex: 1 }}>
|
||||
<Title level={5} style={{ marginBottom: 16 }}>
|
||||
<Space
|
||||
style={{ display: 'flex', justifyContent: 'space-between' }}
|
||||
>
|
||||
项目信息
|
||||
</Space>
|
||||
</Title>
|
||||
<ProTable
|
||||
{...getTableConfig}
|
||||
// search={{
|
||||
// labelWidth: 'auto',
|
||||
// collapsed: false,
|
||||
// collapseRender: false,
|
||||
// }}
|
||||
actionRef={actionBuildingsRef}
|
||||
rowClassName={(record: any) => {
|
||||
return selectedBuilding?.id === record?.id
|
||||
? 'ant-table-row-selected'
|
||||
: '';
|
||||
}}
|
||||
onRow={(record: any) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
handleAssetSelect(record);
|
||||
},
|
||||
style: {
|
||||
cursor: 'pointer',
|
||||
},
|
||||
};
|
||||
}}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{ ...params },
|
||||
sort,
|
||||
Apis.Asset.AssetProjects.List,
|
||||
)
|
||||
}
|
||||
columns={projectColumns}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* 楼栋列表 */}
|
||||
{selectedAsset ? (
|
||||
<div style={{ flex: 1 }}>
|
||||
<Title level={5} style={{ marginBottom: 16 }}>
|
||||
<Space
|
||||
style={{ display: 'flex', justifyContent: 'space-between' }}
|
||||
>
|
||||
<span>{selectedAsset?.name}</span>
|
||||
<BuildingsCreate
|
||||
key="BuildingsCreate"
|
||||
item={{ ...selectedAsset, size: 'small' }}
|
||||
reload={() => actionBuildingsRef?.current?.reload()}
|
||||
title="楼栋"
|
||||
/>
|
||||
</Space>
|
||||
</Title>
|
||||
<ProTable
|
||||
{...getTableConfig}
|
||||
actionRef={actionBuildingsRef}
|
||||
rowClassName={(record: any) => {
|
||||
return selectedBuilding?.id === record?.id
|
||||
? 'ant-table-row-selected'
|
||||
: '';
|
||||
}}
|
||||
onRow={(record: any) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
handleBuildingSelect(record);
|
||||
},
|
||||
style: {
|
||||
cursor: 'pointer',
|
||||
},
|
||||
};
|
||||
}}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{ ...params, asset_projects_id: selectedAsset?.id },
|
||||
sort,
|
||||
Apis.Asset.AssetBuildings.List,
|
||||
)
|
||||
}
|
||||
columns={buildingColumns}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
// minWidth: 300,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
color: '#999',
|
||||
}}
|
||||
>
|
||||
请先选择项目
|
||||
</div>
|
||||
)}
|
||||
{/* 单元列表 */}
|
||||
{selectedBuilding ? (
|
||||
<div style={{ flex: 1 }}>
|
||||
<Title level={5} style={{ marginBottom: 16 }}>
|
||||
<Space
|
||||
style={{ display: 'flex', justifyContent: 'space-between' }}
|
||||
>
|
||||
<span>{selectedBuilding.name}</span>
|
||||
<UnitsCreate
|
||||
key="UnitsCreate"
|
||||
item={{
|
||||
...selectedBuilding,
|
||||
asset_buildings_id: selectedBuilding?.id,
|
||||
size: 'small',
|
||||
}}
|
||||
reload={() => actionUnitsRef?.current?.reload()}
|
||||
title="单元"
|
||||
/>
|
||||
</Space>
|
||||
</Title>
|
||||
<ProTable
|
||||
{...getTableConfig}
|
||||
actionRef={actionUnitsRef}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
asset_projects_id: selectedAsset?.id,
|
||||
asset_buildings_id: selectedBuilding?.id,
|
||||
},
|
||||
sort,
|
||||
Apis.Asset.AssetUnits.List,
|
||||
)
|
||||
}
|
||||
rowClassName={(record: any) => {
|
||||
return selectedUnit?.id === record?.id
|
||||
? 'ant-table-row-selected'
|
||||
: '';
|
||||
}}
|
||||
onRow={(record: any) => {
|
||||
return {
|
||||
onClick: () => {
|
||||
handleUnitSelect(record);
|
||||
},
|
||||
style: {
|
||||
cursor: 'pointer',
|
||||
},
|
||||
};
|
||||
}}
|
||||
columns={unitColumns}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
// minWidth: 300,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
color: '#999',
|
||||
}}
|
||||
>
|
||||
请先选择楼栋
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 房屋列表 */}
|
||||
{selectedUnit ? (
|
||||
<div style={{ flex: 1 }}>
|
||||
<Title level={5} style={{ marginBottom: 16 }}>
|
||||
<Space
|
||||
style={{ display: 'flex', justifyContent: 'space-between' }}
|
||||
>
|
||||
<span>{selectedUnit.name}</span>
|
||||
<HousesCreate
|
||||
key="HousesCreate"
|
||||
item={{
|
||||
...selectedUnit,
|
||||
asset_projects_id: selectedAsset?.id,
|
||||
asset_buildings_id: selectedBuilding?.id,
|
||||
asset_units_id: selectedUnit?.id,
|
||||
size: 'small',
|
||||
}}
|
||||
reload={() => actionHousesRef?.current?.reload()}
|
||||
title="房屋"
|
||||
/>
|
||||
</Space>
|
||||
</Title>
|
||||
<ProTable
|
||||
{...getTableConfig}
|
||||
actionRef={actionHousesRef}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
{
|
||||
...params,
|
||||
asset_projects_id: selectedAsset?.id,
|
||||
asset_buildings_id: selectedBuilding?.id,
|
||||
asset_units_id: selectedUnit?.id,
|
||||
},
|
||||
sort,
|
||||
Apis.Asset.AssetHouses.List,
|
||||
)
|
||||
}
|
||||
columns={houseColumns}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
// minWidth: 400,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
color: '#999',
|
||||
}}
|
||||
>
|
||||
{selectedBuilding ? '请先选择单元' : '请先选择楼栋'}
|
||||
</div>
|
||||
)}
|
||||
</Space>
|
||||
</ProCard>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
@ -18,7 +18,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
title={`${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
trigger={<MyButtons.Create title={`${props.title}`} />}
|
||||
trigger={
|
||||
<MyButtons.Create
|
||||
title={`${props.title}`}
|
||||
size={props?.item?.size || 'middle'}
|
||||
/>
|
||||
}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
@ -23,7 +23,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
title={`添加${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
trigger={<MyButtons.Create title={`${props.title}`} />}
|
||||
trigger={
|
||||
<MyButtons.Create
|
||||
title={`${props.title}`}
|
||||
size={props?.item?.size || 'mindde'}
|
||||
/>
|
||||
}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
@ -24,7 +24,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
trigger={
|
||||
<MyButtons.Default title={props.title} size="small" type="primary" />
|
||||
<MyButtons.Default title={props.title} size="small" type="link" />
|
||||
}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
@ -21,7 +21,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
title={`添加${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="700px"
|
||||
trigger={<MyButtons.Create title={`${props.title}`} />}
|
||||
trigger={
|
||||
<MyButtons.Create
|
||||
title={`${props.title}`}
|
||||
size={props?.item?.size || 'middle'}
|
||||
/>
|
||||
}
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
@ -3,9 +3,9 @@ import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import AnnouncementCreate from './modals/AnnouncementCreate';
|
||||
import AnnouncementShow from './modals/AnnouncementShow';
|
||||
import AnnouncementUpdate from './modals/AnnouncementUpdate';
|
||||
import AnnouncementCreate from '../../announcement/modals/AnnouncementCreate';
|
||||
import AnnouncementShow from '../../announcement/modals/AnnouncementShow';
|
||||
import AnnouncementUpdate from '../../announcement/modals/AnnouncementUpdate';
|
||||
|
||||
export default function Index({ ...rest }) {
|
||||
const actionLooks = useRef<any>();
|
||||
@ -35,7 +35,6 @@ export default function Index({ ...rest }) {
|
||||
search={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
|
||||
{
|
||||
title: '公告标题',
|
||||
dataIndex: 'title',
|
||||
@ -7,7 +7,7 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import AssetAccountsSelect from './modals/AssetAccountsSelect';
|
||||
import AccountsSelect from '../../accounts/modals/AccountsSelect';
|
||||
|
||||
export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
@ -27,7 +27,7 @@ export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<AssetAccountsSelect
|
||||
<AccountsSelect
|
||||
key="Select"
|
||||
reload={action?.reload}
|
||||
item={props?.item}
|
||||
@ -13,12 +13,12 @@ import {
|
||||
import { ProCard, ProTable } from '@ant-design/pro-components';
|
||||
import { Alert, message, Space, Typography } from 'antd';
|
||||
import { useCallback, useRef, useState } from 'react';
|
||||
import BuildingsCreate from './modals/BuildingsCreate';
|
||||
import AssetBuildingsUpdate from './modals/BuildingsUpdate';
|
||||
import HousesCreate from './modals/HousesCreate';
|
||||
import HousesUpdate from './modals/HousesUpdate';
|
||||
import AssetUnitsCreate from './modals/UnitsCreate';
|
||||
import AssetUnitsUpdate from './modals/UnitsUpdate';
|
||||
import BuildingsCreate from '../../houses/modals/BuildingsCreate';
|
||||
import AssetBuildingsUpdate from '../../houses/modals/BuildingsUpdate';
|
||||
import HousesCreate from '../../houses/modals/HousesCreate';
|
||||
import HousesUpdate from '../../houses/modals/HousesUpdate';
|
||||
import AssetUnitsCreate from '../../houses/modals/UnitsCreate';
|
||||
import AssetUnitsUpdate from '../../houses/modals/UnitsUpdate';
|
||||
|
||||
const { Title } = Typography;
|
||||
|
||||
@ -3,9 +3,9 @@ import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import GridCreate from './modals/GridCreate';
|
||||
import GridMannger from './modals/GridMannger';
|
||||
import GridCreateUpdate from './modals/GridUpdate';
|
||||
import GridCreate from '../../grids/modals/GridCreate';
|
||||
import GridMannger from '../../grids/modals/GridMannger';
|
||||
import GridCreateUpdate from '../../grids/modals/GridUpdate';
|
||||
|
||||
export default function Index({ ...rest }) {
|
||||
const actionLooks = useRef<any>();
|
||||
@ -26,7 +26,12 @@ export default function Index({ ...rest }) {
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<GridCreate key="Create" item={rest.item} reload={action?.reload} />,
|
||||
<GridCreate
|
||||
key="Create"
|
||||
item={rest.item}
|
||||
reload={action?.reload}
|
||||
title="楼栋划分"
|
||||
/>,
|
||||
]}
|
||||
search={false}
|
||||
columns={[
|
||||
@ -29,7 +29,7 @@ export default function AssetInfo(props: MyBetaModalFormProps) {
|
||||
</div>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="绑定机构">
|
||||
<ProDescriptions.Item label="关联机构">
|
||||
<Space size="large">
|
||||
<div>{props?.item?.company?.name}</div>
|
||||
</Space>
|
||||
@ -4,8 +4,8 @@ import { ConvenienceServicesTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import ServiceCreate from './modals/ServiceCreate';
|
||||
import ServiceUpdate from './modals/ServiceUpdate';
|
||||
import ServiceCreate from '../../convenience_services/modals/ServiceCreate';
|
||||
import ServiceUpdate from '../../convenience_services/modals/ServiceUpdate';
|
||||
|
||||
export default function Index({ ...rest }) {
|
||||
const actionLooks = useRef<any>();
|
||||
@ -89,7 +89,7 @@ export default function Index({ title = '项目列表' }) {
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '绑定机构',
|
||||
title: '关联机构',
|
||||
dataIndex: ['company', 'name'],
|
||||
search: {
|
||||
transform: (value) => {
|
||||
@ -116,7 +116,7 @@ export default function Index({ title = '项目列表' }) {
|
||||
<MyButtons.View
|
||||
title="配置"
|
||||
onClick={() => {
|
||||
navigate(`/asset/${item.id}`);
|
||||
navigate(`/asset/list/show/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
@ -4,15 +4,15 @@ import { ProCard } from '@ant-design/pro-components';
|
||||
import { useParams } from '@umijs/max';
|
||||
import { Space, Tabs } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
import Announcement from './components/Announcement';
|
||||
import AssetAccounts from './components/AssetAccounts';
|
||||
import MyAssetBuildings from './components/AssetBuildings';
|
||||
import AssetGrid from './components/AssetGrid';
|
||||
import AssetInfo from './components/AssetInfo';
|
||||
import ChargeStandard from './components/ChargeStandard';
|
||||
import ConvenienceServices from './components/ConvenienceServices';
|
||||
import BindCompany from './components/modals/BindCompany';
|
||||
import AssetUpdate from './modals/AssetUpdate';
|
||||
import Announcement from '../components/Announcement';
|
||||
import AssetAccounts from '../components/AssetAccounts';
|
||||
import MyAssetBuildings from '../components/AssetBuildings';
|
||||
import AssetGrid from '../components/AssetGrid';
|
||||
import AssetInfo from '../components/AssetInfo';
|
||||
import ChargeStandard from '../components/ChargeStandard';
|
||||
import ConvenienceServices from '../components/ConvenienceServices';
|
||||
import BindCompany from '../components/modals/BindCompany';
|
||||
import AssetUpdate from '../modals/AssetUpdate';
|
||||
|
||||
export default function Show({ title }: { title?: string } = {}) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
@ -15,8 +15,8 @@ import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import { useState } from 'react';
|
||||
import HousesShow from '../asset/components/modals/HousesShow';
|
||||
import HousesUpdate from '../asset/components/modals/HousesUpdate';
|
||||
import HousesShow from '../asset/houses/modals/HousesShow';
|
||||
import HousesUpdate from '../asset/houses/modals/HousesUpdate';
|
||||
|
||||
export default function Index({ title = '房屋列表' }) {
|
||||
const [getParams, setParams] = useState({});
|
||||
@ -128,7 +128,7 @@ export default function Index({ title = '房屋列表' }) {
|
||||
// search: false,
|
||||
// }),
|
||||
MyColumns.EnumTag({
|
||||
title: '产权性质',
|
||||
title: '房屋属性',
|
||||
dataIndex: 'ownership_type',
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
search: false,
|
||||
|
||||
128
src/pages/asset_houses_bill/index.tsx
Normal file
128
src/pages/asset_houses_bill/index.tsx
Normal file
@ -0,0 +1,128 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { MyExport } from '@/components/MyExport';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { AssetHousesUsageEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import { useState } from 'react';
|
||||
import HousesShow from '../asset/houses/modals/HousesShow';
|
||||
import HousesUpdate from '../asset/houses/modals/HousesUpdate';
|
||||
|
||||
export default function Index({ title = '房屋列表' }) {
|
||||
const [getParams, setParams] = useState({});
|
||||
|
||||
const navigate = useNavigate();
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'asset-houses',
|
||||
tabLabel: title,
|
||||
});
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) => {
|
||||
setParams(params);
|
||||
return MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Asset.AssetHouses.List,
|
||||
);
|
||||
}}
|
||||
toolBarRender={() => [
|
||||
<MyExport
|
||||
key="export"
|
||||
item={getParams}
|
||||
download={Apis.Asset.AssetHouses}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: ['asset_project', 'name'],
|
||||
search: {
|
||||
transform: (value) => {
|
||||
return { project_name: value };
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '房屋名称',
|
||||
dataIndex: 'full_name',
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '用途',
|
||||
dataIndex: 'usage',
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
}),
|
||||
{
|
||||
title: '楼层',
|
||||
dataIndex: 'floor',
|
||||
render(_, record) {
|
||||
return `${record?.floor}层`;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
|
||||
{
|
||||
title: '建筑面积',
|
||||
dataIndex: 'built_area',
|
||||
render(_, record) {
|
||||
return `${
|
||||
record?.built_area ? record?.built_area + ' m²' : '-'
|
||||
} `;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '套内面积',
|
||||
dataIndex: 'inside_area',
|
||||
render(_, record) {
|
||||
return `${
|
||||
record?.inside_area ? record?.inside_area + ' m²' : '-'
|
||||
} `;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '计费面积',
|
||||
dataIndex: 'chargeable_area',
|
||||
render(_, record) {
|
||||
return `${
|
||||
record?.chargeable_area ? record?.chargeable_area + ' m²' : '-'
|
||||
} `;
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<HousesShow item={item} reload={action?.reload} />
|
||||
<HousesUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="编辑"
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Asset.AssetHouses.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
95
src/pages/company/apps/index.tsx
Normal file
95
src/pages/company/apps/index.tsx
Normal file
@ -0,0 +1,95 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { CompanyAppsAppTypeEnum, CompanyAppsModuleEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import AppCreate from './modals/AppCreate';
|
||||
import AppUpdate from './modals/AppUpdate';
|
||||
|
||||
export default function Index({ title = '应用管理' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'company-apps',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="company-apps"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(params, sort, Apis.Company.CompanyApps.List)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<AppCreate key="Create" reload={action?.reload} title={title} />,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '机构',
|
||||
dataIndex: ['company', 'name'],
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '应用类型',
|
||||
dataIndex: 'app_type',
|
||||
valueEnum: CompanyAppsAppTypeEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '模块',
|
||||
dataIndex: 'module',
|
||||
valueEnum: CompanyAppsModuleEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '应用ID',
|
||||
dataIndex: 'app_id',
|
||||
search: false,
|
||||
ellipsis: true,
|
||||
},
|
||||
// {
|
||||
// title: '应用密钥',
|
||||
// dataIndex: 'app_secret',
|
||||
// search: false,
|
||||
// ellipsis: true,
|
||||
// render: (text) => '***' + String(text).slice(-4),
|
||||
// },
|
||||
|
||||
MyColumns.UpdatedAt(),
|
||||
// MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<AppUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="应用配置"
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Company.CompanyApps.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
@ -5,6 +5,7 @@ import {
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { CompanyAppsAppTypeEnum, CompanyAppsModuleEnum } from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
@ -29,7 +30,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
onFinish={async (values) =>
|
||||
Apis.Company.CompanyApps.Store({
|
||||
...values,
|
||||
companies_id: props?.item?.id,
|
||||
companies_id: values?.companies_id || props?.item?.id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -39,6 +40,16 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
...(props?.item?.id
|
||||
? []
|
||||
: [
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '公司',
|
||||
colProps: { span: 24 },
|
||||
required: true,
|
||||
}),
|
||||
]),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'app_type',
|
||||
title: '应用类型',
|
||||
92
src/pages/company/brand/index.tsx
Normal file
92
src/pages/company/brand/index.tsx
Normal file
@ -0,0 +1,92 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Image, Space } from 'antd';
|
||||
import BrandsCreate from './modals/BrandsCreate';
|
||||
import BrandUpdate from './modals/BrandUpdate';
|
||||
|
||||
export default function Index({ title = '品牌管理' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'company-brands',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="company-brands"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Company.CompanyPropertyBrands.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<BrandsCreate key="Create" reload={action?.reload} title={title} />,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '机构',
|
||||
dataIndex: ['company', 'name'],
|
||||
},
|
||||
{
|
||||
title: '品牌名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: 'logo',
|
||||
search: false,
|
||||
render: (_, item) => {
|
||||
return (
|
||||
<Space>
|
||||
{item?.logo?.[0] && (
|
||||
<Image
|
||||
height={30}
|
||||
src={item?.logo[0]?.url}
|
||||
placeholder="正面"
|
||||
/>
|
||||
)}
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<BrandUpdate
|
||||
item={{ ...item, companies_id: item?.id }}
|
||||
reload={action?.reload}
|
||||
title="品牌"
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Company.CompanyPropertyBrands.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
@ -17,7 +17,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
title={`编辑${props.title}`}
|
||||
trigger={<MyButtons.Edit />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="300px"
|
||||
width="360px"
|
||||
form={form}
|
||||
key={new Date().getTime()}
|
||||
onOpenChange={(open: any) => {
|
||||
@ -5,6 +5,7 @@ import {
|
||||
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';
|
||||
@ -17,7 +18,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加品牌`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="300px"
|
||||
width="360px"
|
||||
trigger={<MyButtons.Create title={`添加品牌`} />}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
@ -28,7 +29,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
onFinish={async (values) =>
|
||||
Apis.Company.CompanyPropertyBrands.Store({
|
||||
...values,
|
||||
companies_id: props?.item?.id,
|
||||
companies_id: values?.companies_id || props?.item?.id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -38,6 +39,16 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
...(props?.item?.id
|
||||
? []
|
||||
: [
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '公司',
|
||||
colProps: { span: 24 },
|
||||
required: true,
|
||||
}),
|
||||
]),
|
||||
{
|
||||
key: 'name',
|
||||
title: '品牌名称',
|
||||
@ -8,8 +8,8 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import EmployeeCreate from '../company/components/modals/EmployeeCreate';
|
||||
import EmployeeUpdate from '../company/components/modals/EmployeeUpdate';
|
||||
import EmployeeCreate from './modals/EmployeeCreate';
|
||||
import EmployeeUpdate from './modals/EmployeeUpdate';
|
||||
|
||||
export default function Index({ title = '员工管理' }) {
|
||||
// 使用多标签页功能
|
||||
@ -24,14 +24,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
form.setFieldsValue({
|
||||
companies_id: props?.item?.id,
|
||||
});
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) =>
|
||||
Apis.Company.CompanyEmployees.Store({
|
||||
...values,
|
||||
companies_id: values?.companies_id || props?.item?.id,
|
||||
organizations_id:
|
||||
values?.organizations_id?.[values.organizations_id.length - 1],
|
||||
})
|
||||
@ -43,12 +41,16 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '所属机构',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
...(props?.item?.id
|
||||
? []
|
||||
: [
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '公司',
|
||||
colProps: { span: 24 },
|
||||
required: true,
|
||||
}),
|
||||
]),
|
||||
Selects?.OrganizationsTree({
|
||||
title: '选择组织',
|
||||
key: 'organizations_id',
|
||||
@ -9,9 +9,9 @@ import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import ComponentsInfo from './components/ComponentsInfo';
|
||||
import CompanyCreate from './modals/CompanyCreate';
|
||||
import CompanyUpdate from './modals/CompanyUpdate';
|
||||
import ComponentsInfo from './table/ComponentsInfo';
|
||||
|
||||
export default function Index({ title = '机构列表' }) {
|
||||
const navigate = useNavigate();
|
||||
@ -77,7 +77,7 @@ export default function Index({ title = '机构列表' }) {
|
||||
title="配置"
|
||||
data-tooltip-position="top"
|
||||
onClick={() => {
|
||||
navigate(`/company/${item.id}`);
|
||||
navigate(`/company/list/show/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
@ -8,9 +8,11 @@ import {
|
||||
import { Address } from '@/components/Address';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { message } from 'antd';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Company.Companies.Store>
|
||||
{...MyModalFormProps.props}
|
||||
@ -18,6 +20,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
trigger={<MyButtons.Create title={`添加机构`} />}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Company.Companies.Store({
|
||||
...values,
|
||||
@ -5,15 +5,15 @@ import { useParams } from '@umijs/max';
|
||||
import { Space, Tabs } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import Assets from './components/Assets';
|
||||
import CompanyApps from './components/CompanyApps';
|
||||
import ComponentsInfo from './components/ComponentsInfo';
|
||||
import Employees from './components/Employees';
|
||||
import Organizations from './components/Organizations';
|
||||
import Positions from './components/Positions';
|
||||
import PropertyBrands from './components/PropertyBrands';
|
||||
import ReceiptAccounts from './components/ReceiptAccounts';
|
||||
import CompanyUpdate from './modals/CompanyUpdate';
|
||||
import CompanyUpdate from '../modals/CompanyUpdate';
|
||||
import CompanyApps from '../table/Apps';
|
||||
import Assets from '../table/Assets';
|
||||
import Brands from '../table/Brands';
|
||||
import ComponentsInfo from '../table/ComponentsInfo';
|
||||
import Employees from '../table/Employees';
|
||||
import Organizations from '../table/Organizations';
|
||||
import Positions from '../table/Positions';
|
||||
import ReceiptAccounts from '../table/ReceiptAccounts';
|
||||
|
||||
export default function Show({ title }: { title?: string } = {}) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
@ -43,12 +43,6 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
}, [id]);
|
||||
|
||||
let items = [
|
||||
{
|
||||
label: '0-品牌配置',
|
||||
key: '0',
|
||||
closable: false,
|
||||
children: <PropertyBrands item={data} />,
|
||||
},
|
||||
{
|
||||
label: '1-项目配置',
|
||||
key: '1',
|
||||
@ -86,6 +80,12 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
closable: false,
|
||||
children: <CompanyApps item={data} />,
|
||||
},
|
||||
{
|
||||
label: '7-品牌配置',
|
||||
key: '7',
|
||||
closable: false,
|
||||
children: <Brands item={data} />,
|
||||
},
|
||||
];
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
@ -104,7 +104,7 @@ export default function Show({ title }: { title?: string } = {}) {
|
||||
}
|
||||
>
|
||||
<div>
|
||||
* 您可在以下页签中对应配置:项目、组织、岗位、员工、账号、应用;
|
||||
* 您可在以下页签中对应配置:项目、组织、岗位、员工、账号、应用、品牌;
|
||||
</div>
|
||||
</ProCard>
|
||||
<ProCard>
|
||||
@ -8,8 +8,8 @@ import { Apis } from '@/gen/Apis';
|
||||
import { CompanyAppsAppTypeEnum, CompanyAppsModuleEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import CompanyAppCreate from './modals/CompanyAppCreate';
|
||||
import CompanyAppUpdate from './modals/CompanyAppUpdate';
|
||||
import AppCreate from '../../apps/modals/AppCreate';
|
||||
import AppUpdate from '../../apps/modals/AppUpdate';
|
||||
|
||||
export default function CompanyApps(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
@ -24,7 +24,7 @@ export default function CompanyApps(props: MyBetaModalFormProps) {
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<CompanyAppCreate
|
||||
<AppCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
item={props?.item}
|
||||
@ -35,7 +35,10 @@ export default function CompanyApps(props: MyBetaModalFormProps) {
|
||||
// options={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
|
||||
{
|
||||
title: '机构',
|
||||
dataIndex: ['company', 'name'],
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '应用类型',
|
||||
dataIndex: 'app_type',
|
||||
@ -66,7 +69,7 @@ export default function CompanyApps(props: MyBetaModalFormProps) {
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<CompanyAppUpdate
|
||||
<AppUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="应用配置"
|
||||
@ -9,7 +9,7 @@ import {
|
||||
AssetProjectsPropertyTypeEnum,
|
||||
AssetProjectsStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import AssetCreate from '@/pages/asset/modals/AssetCreate';
|
||||
import AssetCreate from '@/pages/asset/list/modals/AssetCreate';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
@ -7,8 +7,8 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Image, Space } from 'antd';
|
||||
import PropertyBrandsCreate from './modals/PropertyBrandsCreate';
|
||||
import PropertyBrandUpdate from './modals/PropertyBrandUpdate';
|
||||
import BrandsCreate from '../../brand/modals/BrandsCreate';
|
||||
import PropertyBrandUpdate from '../../brand/modals/BrandUpdate';
|
||||
|
||||
export default function PropertyBrands(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
@ -23,7 +23,7 @@ export default function PropertyBrands(props: MyBetaModalFormProps) {
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<PropertyBrandsCreate
|
||||
<BrandsCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
item={props?.item}
|
||||
@ -7,8 +7,8 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import EmployeeCreate from './modals/EmployeeCreate';
|
||||
import EmployeeUpdate from './modals/EmployeeUpdate';
|
||||
import EmployeeCreate from '../../employees/modals/EmployeeCreate';
|
||||
import EmployeeUpdate from '../../employees/modals/EmployeeUpdate';
|
||||
|
||||
export default function Index(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
@ -8,9 +8,9 @@ import { Apis } from '@/gen/Apis';
|
||||
import { OrganizationsTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import OrganizationChange from './modals/OrganizationChange';
|
||||
import OrganizationCreate from './modals/OrganizationCreate';
|
||||
import OrganizationUpdate from './modals/OrganizationUpdate';
|
||||
import OrganizationChange from '../../organizations/modals/OrganizationChange';
|
||||
import OrganizationCreate from '../../organizations/modals/OrganizationCreate';
|
||||
import OrganizationUpdate from '../../organizations/modals/OrganizationUpdate';
|
||||
|
||||
export default function Organizations(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
@ -7,8 +7,8 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import PositionCreate from './modals/PositionCreate';
|
||||
import PositionUpdate from './modals/PositionUpdate';
|
||||
import PositionCreate from '../../positions/modals/PositionCreate';
|
||||
import PositionUpdate from '../../positions/modals/PositionUpdate';
|
||||
|
||||
export default function Organizations(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
@ -7,8 +7,8 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import ReceiptAccountCreate from './modals/ReceiptAccountCreate';
|
||||
import ReceiptAccountUpdate from './modals/ReceiptAccountUpdate';
|
||||
import ReceiptAccountCreate from '../../receipt_accounts/modals/ReceiptAccountCreate';
|
||||
import ReceiptAccountUpdate from '../../receipt_accounts/modals/ReceiptAccountUpdate';
|
||||
|
||||
export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
103
src/pages/company/organizations/index.tsx
Normal file
103
src/pages/company/organizations/index.tsx
Normal file
@ -0,0 +1,103 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { OrganizationsTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import OrganizationChange from './modals/OrganizationChange';
|
||||
import OrganizationCreate from './modals/OrganizationCreate';
|
||||
import OrganizationUpdate from './modals/OrganizationUpdate';
|
||||
|
||||
export default function Index({ title = '组织列表' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'company-organizations',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="company-organizations"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Company.Organizations.TreeList,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<OrganizationCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
{
|
||||
title: '机构',
|
||||
dataIndex: ['company', 'name'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '组织ID',
|
||||
dataIndex: 'id',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '组织名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '组织类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: OrganizationsTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
|
||||
{
|
||||
title: '上级组织',
|
||||
dataIndex: ['organization_parent', 'name'],
|
||||
search: false,
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<OrganizationUpdate
|
||||
item={{ ...item, companies_id: item?.id }}
|
||||
reload={action?.reload}
|
||||
title="组织"
|
||||
/>
|
||||
<OrganizationChange
|
||||
item={{ ...item, companies_id: item?.id }}
|
||||
reload={action?.reload}
|
||||
title="组织"
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Company.Organizations.Delete({ id: item.id }).then(
|
||||
() => action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
@ -21,6 +21,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
@ -30,7 +31,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
onFinish={async (values: any) =>
|
||||
Apis.Company.Organizations.Store({
|
||||
...values,
|
||||
companies_id: props?.item?.id,
|
||||
companies_id: values?.companies_id || props?.item?.id,
|
||||
parent_id: values?.parent_id?.[values.parent_id.length - 1],
|
||||
})
|
||||
.then(() => {
|
||||
@ -41,6 +42,16 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
...(props?.item?.id
|
||||
? []
|
||||
: [
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '公司',
|
||||
colProps: { span: 24 },
|
||||
required: true,
|
||||
}),
|
||||
]),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'type',
|
||||
title: '组织类型',
|
||||
96
src/pages/company/positions/index.tsx
Normal file
96
src/pages/company/positions/index.tsx
Normal file
@ -0,0 +1,96 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import PositionCreate from './modals/PositionCreate';
|
||||
import PositionUpdate from './modals/PositionUpdate';
|
||||
|
||||
export default function Index({ title = '岗位管理' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'company-positions',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="company-positions"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Company.CompanyPositions.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<PositionCreate key="Create" reload={action?.reload} title={title} />,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '机构',
|
||||
dataIndex: ['company', 'name'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '岗位名称',
|
||||
dataIndex: 'name',
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: '岗位编号',
|
||||
dataIndex: 'code',
|
||||
search: false,
|
||||
width: 200,
|
||||
},
|
||||
// {
|
||||
// title: '岗位排序',
|
||||
// dataIndex: 'sort',
|
||||
// search: false,
|
||||
// },
|
||||
{
|
||||
title: '岗位备注',
|
||||
dataIndex: 'remark',
|
||||
search: false,
|
||||
width: 200,
|
||||
},
|
||||
MyColumns.UpdatedAt(),
|
||||
// MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<PositionUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="岗位"
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Company.CompanyPositions.Delete({ id: item.id }).then(
|
||||
() => action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
@ -4,6 +4,7 @@ import {
|
||||
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';
|
||||
@ -26,7 +27,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
onFinish={async (values) =>
|
||||
Apis.Company.CompanyPositions.Store({
|
||||
...values,
|
||||
companies_id: props?.item?.id,
|
||||
companies_id: values?.companies_id || props?.item?.id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -36,11 +37,16 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
// Selects?.Companies({
|
||||
// title: '机构',
|
||||
// key: 'companies_id',
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// }),
|
||||
...(props?.item?.id
|
||||
? []
|
||||
: [
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '公司',
|
||||
colProps: { span: 24 },
|
||||
required: true,
|
||||
}),
|
||||
]),
|
||||
{
|
||||
key: 'name',
|
||||
title: '岗位名称',
|
||||
91
src/pages/company/receipt_accounts/index.tsx
Normal file
91
src/pages/company/receipt_accounts/index.tsx
Normal file
@ -0,0 +1,91 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import ReceiptAccountCreate from './modals/ReceiptAccountCreate';
|
||||
import ReceiptAccountUpdate from './modals/ReceiptAccountUpdate';
|
||||
|
||||
export default function Index({ title = '账号管理' }) {
|
||||
const navigate = useNavigate();
|
||||
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'company-receipt_accounts',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="company-receipt_accounts"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Company.CompanyReceiptAccounts.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<ReceiptAccountCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '机构',
|
||||
dataIndex: ['company', 'name'],
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '收款账号名称',
|
||||
dataIndex: 'company_name',
|
||||
},
|
||||
{
|
||||
title: '开户行',
|
||||
dataIndex: 'company_bank',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '收款账号',
|
||||
dataIndex: 'company_account',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.UpdatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<ReceiptAccountUpdate
|
||||
item={item}
|
||||
reload={action?.reload}
|
||||
title="收款账号"
|
||||
/>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Company.CompanyReceiptAccounts.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
@ -5,6 +5,7 @@ import {
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { CompanyReceiptAccountsPayChannelEnum } from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
@ -29,7 +30,8 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
onFinish={async (values) =>
|
||||
Apis.Company.CompanyReceiptAccounts.Store({
|
||||
...values,
|
||||
companies_id: props?.item?.id,
|
||||
companies_id: values?.companies_id || props?.item?.id,
|
||||
|
||||
is_default: 0,
|
||||
})
|
||||
.then(() => {
|
||||
@ -40,6 +42,16 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
...(props?.item?.id
|
||||
? []
|
||||
: [
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '公司',
|
||||
colProps: { span: 24 },
|
||||
required: true,
|
||||
}),
|
||||
]),
|
||||
{
|
||||
key: 'company_name',
|
||||
title: '收款账户名称',
|
||||
154
src/pages/customer_opinions/index.tsx
Normal file
154
src/pages/customer_opinions/index.tsx
Normal file
@ -0,0 +1,154 @@
|
||||
import {
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { CustomerOpinionsTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Image } from 'antd';
|
||||
|
||||
export default function Index({ title = '投诉建议' }) {
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'customer_opinions',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="customer_opinions"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.Customer.CustomerOpinions.List,
|
||||
)
|
||||
}
|
||||
// toolBarRender={(action) => [
|
||||
// <MyImportModal
|
||||
// key="ImportHouse"
|
||||
// title="批量导入"
|
||||
// type="danger"
|
||||
// size="middle"
|
||||
// templateApi={Apis.Bill.HouseBills.DownloadTemplate}
|
||||
// importApi={Apis.Bill.HouseBills.Import}
|
||||
// reload={action?.reload}
|
||||
// />,
|
||||
// <BillCreate key="Create" reload={action?.reload} title={title} />,
|
||||
// ]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
// MyColumns.EnumTag({
|
||||
// title: '反馈来源',
|
||||
// dataIndex: 'payment_method',
|
||||
// valueEnum: HouseOrdersPaymentMethodEnum,
|
||||
// }),
|
||||
MyColumns.EnumTag({
|
||||
title: '反馈类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: CustomerOpinionsTypeEnum,
|
||||
}),
|
||||
{
|
||||
title: '反馈内容',
|
||||
dataIndex: 'content',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '反馈内容',
|
||||
dataIndex: 'content',
|
||||
width: 120, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽)
|
||||
render: (text) => (
|
||||
<div
|
||||
style={{
|
||||
width: '100%', // 继承列宽
|
||||
// height: '60px', // 设置固定高度,约显示3行文本
|
||||
overflow: 'hidden', // 超出隐藏
|
||||
textOverflow: 'ellipsis', // 省略号
|
||||
display: '-webkit-box',
|
||||
WebkitBoxOrient: 'vertical',
|
||||
WebkitLineClamp: 1, // 显示3行
|
||||
}}
|
||||
>
|
||||
{text}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '附件',
|
||||
dataIndex: 'images',
|
||||
search: false,
|
||||
render: (_, record) => {
|
||||
if (!Array.isArray(record.images) || record.images.length === 0) {
|
||||
return '无附件';
|
||||
}
|
||||
return (
|
||||
<div style={{ display: 'flex', flexWrap: 'wrap' }}>
|
||||
{record.images.map((item: any, index: number) => {
|
||||
if (item.type && item.type.includes('image')) {
|
||||
return (
|
||||
<Image
|
||||
key={index}
|
||||
width={40}
|
||||
height={30}
|
||||
src={item.url}
|
||||
style={{
|
||||
marginRight: 8,
|
||||
marginBottom: 8,
|
||||
objectFit: 'cover',
|
||||
}}
|
||||
/>
|
||||
);
|
||||
} else if (item.type && item.type.includes('video')) {
|
||||
return (
|
||||
<video
|
||||
key={index}
|
||||
width={40}
|
||||
height={30}
|
||||
controls
|
||||
style={{
|
||||
marginRight: 8,
|
||||
marginBottom: 8,
|
||||
objectFit: 'cover',
|
||||
}}
|
||||
src={item.url}
|
||||
/>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
MyColumns.CreatedAt(),
|
||||
// MyColumns.Option({
|
||||
// render: (_, item: any, index, action) => (
|
||||
// <Space key={index}>
|
||||
// <CustomerOpinionShow
|
||||
// item={item}
|
||||
// title="详情"
|
||||
// reload={action?.reload}
|
||||
// />
|
||||
// <MyButtons.Delete
|
||||
// onConfirm={() =>
|
||||
// Apis.Common.Admins.Delete({ id: item.id }).then(() =>
|
||||
// action?.reload(),
|
||||
// )
|
||||
// }
|
||||
// />
|
||||
// </Space>
|
||||
// ),
|
||||
// }),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
92
src/pages/customer_opinions/modals/CustomerOpinionShow.tsx
Normal file
92
src/pages/customer_opinions/modals/CustomerOpinionShow.tsx
Normal file
@ -0,0 +1,92 @@
|
||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||
import { MyModal } from '@/components/MyModal';
|
||||
import {
|
||||
AssetProjectsChargeEnum,
|
||||
AssetProjectsEntrustTypeEnum,
|
||||
AssetProjectsPropertyTypeEnum,
|
||||
AssetProjectsStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
|
||||
export default function AssetInfo(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<MyModal
|
||||
title={props.title || '查看'}
|
||||
type={props.item?.type || 'primary'}
|
||||
width="920px"
|
||||
node={
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="项目名称" span={2}>
|
||||
<Space size="large">
|
||||
<div>
|
||||
{props?.item?.name}
|
||||
{props?.item?.alias_name
|
||||
? `(${props?.item?.alias_name})`
|
||||
: ''}
|
||||
</div>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="关联机构">
|
||||
<Space size="large">
|
||||
<div>{props?.item?.company?.name}</div>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="项目地址" span={2}>
|
||||
{props?.item?.province || ''}
|
||||
{props?.item?.city || ''}
|
||||
{props?.item?.district || ''}
|
||||
{props?.item?.address || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsPropertyTypeEnum}
|
||||
value={props?.item?.property_type}
|
||||
key="property_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsStatusEnum}
|
||||
value={props?.item?.status}
|
||||
key="status"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="委托类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsEntrustTypeEnum}
|
||||
value={props?.item?.entrust_type}
|
||||
key="entrust_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="收费方式">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsChargeEnum}
|
||||
value={props?.item?.charge}
|
||||
key="charge"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="接管日期">
|
||||
{props?.item?.takeover_date}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="封园日期">
|
||||
{props?.item?.closure_date}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
{/* <ProDescriptions.Item label="创建日期">
|
||||
{props?.item?.created_at}
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="最近修改">
|
||||
{props?.item?.updated_at}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</Space>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -70,18 +70,20 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
{props?.item?.asset_house?.full_name || '-'}
|
||||
</a>
|
||||
</ProDescriptions.Item>
|
||||
{/* <ProDescriptions.Item label="房屋状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={HouseRegistersHouseStatusEnum}
|
||||
value={props?.item?.house_status}
|
||||
/>
|
||||
</ProDescriptions.Item> */}
|
||||
<ProDescriptions.Item label="登记类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={HouseRegistersTypeEnum}
|
||||
value={props?.item?.type}
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="居住关系">
|
||||
<renderTextHelper.Tag
|
||||
Enums={HouseOccupantsResidentialRelationEnum}
|
||||
value={
|
||||
props?.item?.customer_info?.[0].residential_relation
|
||||
}
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="申请时间">
|
||||
{props?.item?.created_at || '-'}
|
||||
</ProDescriptions.Item>
|
||||
@ -100,20 +102,10 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
rowKey={(record, index) => record?.id_card || index}
|
||||
size="small"
|
||||
columns={[
|
||||
MyColumns.EnumTag({
|
||||
title: '居住关系',
|
||||
dataIndex: 'residential_relation',
|
||||
valueEnum: HouseOccupantsResidentialRelationEnum,
|
||||
}),
|
||||
// MyColumns.EnumTag({
|
||||
// title:
|
||||
// props?.item?.status === 'Rented'
|
||||
// ? '与主租人关系'
|
||||
// : '与产权人关系',
|
||||
// // title: '关系说明',
|
||||
// dataIndex: 'relation_with_owner',
|
||||
// valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
// search: false,
|
||||
// title: '居住关系',
|
||||
// dataIndex: 'residential_relation',
|
||||
// valueEnum: HouseOccupantsResidentialRelationEnum,
|
||||
// }),
|
||||
{
|
||||
title: '姓名',
|
||||
@ -159,7 +151,62 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
/>
|
||||
</ProCard>
|
||||
)}
|
||||
|
||||
{(props?.item?.type === 'UpdateInfo' ||
|
||||
props?.item?.type === 'UpdatePhone') && (
|
||||
<ProCard title="更新信息" size="small">
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
toolBarRender={false}
|
||||
pagination={false}
|
||||
dataSource={[props?.item?.update_info]}
|
||||
rowKey={(record, index) => record?.id_card || index}
|
||||
size="small"
|
||||
columns={[
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '证件类型',
|
||||
dataIndex: 'card_type',
|
||||
valueEnum: HouseOccupantsCardTypeEnum,
|
||||
}),
|
||||
{
|
||||
title: '证件号码',
|
||||
dataIndex: 'id_card',
|
||||
},
|
||||
{
|
||||
title: '证件资料',
|
||||
render: (_, item) => {
|
||||
return (
|
||||
<Space>
|
||||
{item?.card_front_image?.[0] && (
|
||||
<Image
|
||||
height={30}
|
||||
src={item?.card_front_image[0]?.url}
|
||||
placeholder="正面"
|
||||
/>
|
||||
)}
|
||||
{item?.card_back_image?.[0] && (
|
||||
<Image
|
||||
height={30}
|
||||
src={item?.card_back_image[0]?.url}
|
||||
placeholder="反面"
|
||||
/>
|
||||
)}
|
||||
</Space>
|
||||
);
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
</ProCard>
|
||||
)}
|
||||
{props?.item?.type === 'AddOwner' &&
|
||||
props?.item?.ownership_info &&
|
||||
props?.item?.ownership_info?.length > 0 && (
|
||||
@ -170,7 +217,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
(res: any, index: number) => (
|
||||
<Image
|
||||
key={`${res?.name}_${index}`}
|
||||
height={60}
|
||||
height={30}
|
||||
src={res?.url || ''}
|
||||
placeholder="产证资料"
|
||||
/>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { MyButtons, MyColumns, MyProTableProps } from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import ChargeStandardHasHouse from '@/pages/asset/components/modals/ChargeStandardHasHouse';
|
||||
import ChargeStandardHasHouse from '@/pages/asset/list/components/modals/ChargeStandardHasHouse';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
@ -15,8 +15,8 @@ import {
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useNavigate } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import ChargeStandardHasHouse from '../asset/components/modals/ChargeStandardHasHouse';
|
||||
import ChargeStandardUpdate from '../asset/components/modals/ChargeStandardUpdate';
|
||||
import ChargeStandardHasHouse from '../asset/list/components/modals/ChargeStandardHasHouse';
|
||||
import ChargeStandardUpdate from '../asset/list/components/modals/ChargeStandardUpdate';
|
||||
import ChargeCreate from './modals/ChargeCreate';
|
||||
|
||||
export default function Index({ title = '收费标准' }) {
|
||||
|
||||
115
src/pages/house_charge_task_details/index.tsx
Normal file
115
src/pages/house_charge_task_details/index.tsx
Normal file
@ -0,0 +1,115 @@
|
||||
import {
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyPageContainer,
|
||||
MyProTableProps,
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseChargeTasksStatusEnum,
|
||||
HouseChargeTasksTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import ChargeTasksCreate from './modals/ChargeTasksCreate';
|
||||
|
||||
export default function Index({ title = '账单任务' }) {
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'charge_tasks',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey="bills"
|
||||
tabLabel={title}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.HouseCharage.HouseChargeTasks.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<ChargeTasksCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
MyColumns.EnumTag({
|
||||
title: '任务状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: HouseChargeTasksStatusEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '创建类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: HouseChargeTasksTypeEnum,
|
||||
}),
|
||||
{
|
||||
title: '收费标准名称',
|
||||
dataIndex: 'charge_standard_name',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '账单月份',
|
||||
render: (_, record) => {
|
||||
return `${record.year}-${String(record.month).padStart(2, '0')}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '计费开始日期',
|
||||
dataIndex: 'start_date',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '计费结束日期',
|
||||
dataIndex: 'end_date',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: 'project_name',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '机构名称',
|
||||
dataIndex: 'company_name',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.SoftDelete({
|
||||
title: '启/禁用',
|
||||
onRestore: Apis.HouseCharage.HouseChargeTasks.Restore,
|
||||
onSoftDelete: Apis.HouseCharage.HouseChargeTasks.SoftDelete,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.UpdatedAt(),
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.HouseCharage.HouseChargeTasks.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
</MyPageContainer>
|
||||
);
|
||||
}
|
||||
109
src/pages/house_charge_task_details/modals/ChargeTasksCreate.tsx
Normal file
109
src/pages/house_charge_task_details/modals/ChargeTasksCreate.tsx
Normal file
@ -0,0 +1,109 @@
|
||||
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 Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.HouseCharage.HouseChargeTasks.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`创建${props.title}`}
|
||||
width="480px"
|
||||
layout="horizontal"
|
||||
labelCol={{ span: 8 }}
|
||||
wrapperCol={{ span: 16 }}
|
||||
labelAlign="left"
|
||||
trigger={<MyButtons.Create title={`创建${props.title}`} />}
|
||||
key={new Date().getTime()}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.HouseCharage.HouseChargeTasks.Store(values)
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '账单任务创建成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.AssetProjects({
|
||||
title: '选择项目',
|
||||
key: 'asset_projects_id',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
}),
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_projects_id'],
|
||||
columns: ({ asset_projects_id }) => {
|
||||
return [
|
||||
Selects?.ChargeStandard({
|
||||
title: '选择收费标准',
|
||||
key: 'house_charge_standards_id',
|
||||
params: {
|
||||
asset_projects_id: asset_projects_id,
|
||||
},
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
},
|
||||
}),
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
key: 'month',
|
||||
title: '选择生成月份',
|
||||
valueType: 'date',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
picker: 'month',
|
||||
format: 'YYYY-MM',
|
||||
valueFormat: 'YYYY-MM',
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'start_date',
|
||||
title: '计费开始日期',
|
||||
valueType: 'date',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'end_date',
|
||||
title: '计费结束日期',
|
||||
valueType: 'date',
|
||||
colProps: { span: 24 },
|
||||
fieldProps: {
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -6,18 +6,14 @@ import {
|
||||
usePageTabs,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseChargeTasksStatusEnum,
|
||||
HouseChargeTasksTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import ChargeTasksCreate from './modals/ChargeTasksCreate';
|
||||
|
||||
export default function Index({ title = '账单任务' }) {
|
||||
export default function Index({ title = '任务结果' }) {
|
||||
// 注册当前页面为标签页
|
||||
usePageTabs({
|
||||
tabKey: 'charge_tasks',
|
||||
tabKey: 'charge_task_details',
|
||||
tabLabel: title,
|
||||
});
|
||||
|
||||
@ -34,33 +30,28 @@ export default function Index({ title = '账单任务' }) {
|
||||
MyProTableProps.request(
|
||||
params,
|
||||
sort,
|
||||
Apis.HouseCharage.HouseChargeTasks.List,
|
||||
Apis.HouseCharage.HouseChargeTaskDetails.List,
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<ChargeTasksCreate
|
||||
key="Create"
|
||||
reload={action?.reload}
|
||||
title={title}
|
||||
/>,
|
||||
]}
|
||||
// toolBarRender={(action) => [
|
||||
// <ChargeTasksCreate
|
||||
// key="Create"
|
||||
// reload={action?.reload}
|
||||
// title={title}
|
||||
// />,
|
||||
// ]}
|
||||
columns={[
|
||||
{
|
||||
title: '任务ID',
|
||||
dataIndex: 'house_charge_tasks_id',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.ID(),
|
||||
MyColumns.EnumTag({
|
||||
title: '任务状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: HouseChargeTasksStatusEnum,
|
||||
valueEnum: HouseChargeTaskDetailsStatusEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '创建类型',
|
||||
dataIndex: 'type',
|
||||
valueEnum: HouseChargeTasksTypeEnum,
|
||||
}),
|
||||
{
|
||||
title: '收费标准名称',
|
||||
dataIndex: 'charge_standard_name',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '账单月份',
|
||||
render: (_, record) => {
|
||||
@ -77,22 +68,6 @@ export default function Index({ title = '账单任务' }) {
|
||||
dataIndex: 'end_date',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: 'project_name',
|
||||
search: false,
|
||||
},
|
||||
{
|
||||
title: '机构名称',
|
||||
dataIndex: 'company_name',
|
||||
search: false,
|
||||
},
|
||||
MyColumns.SoftDelete({
|
||||
title: '启/禁用',
|
||||
onRestore: Apis.HouseCharage.HouseChargeTasks.Restore,
|
||||
onSoftDelete: Apis.HouseCharage.HouseChargeTasks.SoftDelete,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.UpdatedAt(),
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
@ -100,7 +75,7 @@ export default function Index({ title = '账单任务' }) {
|
||||
<Space key={index}>
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.HouseCharage.HouseChargeTasks.Delete({
|
||||
Apis.HouseCharage.HouseChargeTaskDetails.Delete({
|
||||
id: item.id,
|
||||
}).then(() => action?.reload())
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user