Merge pull request 'develop' (#11) from develop into main
Some checks failed
Build and Push Docker Image / build (push) Failing after 2m10s
Some checks failed
Build and Push Docker Image / build (push) Failing after 2m10s
Reviewed-on: https://code.juyouwu.cn/pay/pay-admin/pulls/11
This commit is contained in:
commit
d06c4dbe26
59
src/components/MomentCategories.tsx
Normal file
59
src/components/MomentCategories.tsx
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
import { MyColumnsType } from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { ProColumns, ProFormColumnsType } from '@ant-design/pro-components';
|
||||||
|
|
||||||
|
type ReturnType = ProColumns<any, 'text'> & ProFormColumnsType<any, 'text'>;
|
||||||
|
type PropsType = { required?: boolean } & ReturnType;
|
||||||
|
export const MomentSelect = {
|
||||||
|
MomentCategoriesTree(props?: PropsType): ReturnType {
|
||||||
|
const { ...rest } = props ?? {};
|
||||||
|
return {
|
||||||
|
key: 'parent_id',
|
||||||
|
title: '上级分类',
|
||||||
|
valueType: 'treeSelect',
|
||||||
|
request: async () => {
|
||||||
|
return Apis.Customer.CustomerMomentCategories.SelectTree().then(
|
||||||
|
(res) => res.data,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
fieldProps: {
|
||||||
|
allowClear: true,
|
||||||
|
autoClearSearchValue: true,
|
||||||
|
bordered: true,
|
||||||
|
fieldNames: {
|
||||||
|
label: 'name',
|
||||||
|
value: 'id',
|
||||||
|
},
|
||||||
|
filterTreeNode: true,
|
||||||
|
showSearch: true,
|
||||||
|
treeNodeFilterProp: 'title',
|
||||||
|
treeDefaultExpandAll: true,
|
||||||
|
},
|
||||||
|
...rest,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
MomentCategoriesSelect(props?: PropsType): MyColumnsType {
|
||||||
|
const { ...rest } = props ?? {};
|
||||||
|
return {
|
||||||
|
title: '内容分类',
|
||||||
|
dataIndex: 'moment_categories_ids',
|
||||||
|
valueType: 'cascader',
|
||||||
|
request: async () => {
|
||||||
|
return Apis.Customer.CustomerMomentCategories.SelectTree().then(
|
||||||
|
(res) => res.data,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
hideInTable: true,
|
||||||
|
fieldProps: {
|
||||||
|
showSearch: true,
|
||||||
|
placeholder: '请选择 / 输入名称搜索',
|
||||||
|
fieldNames: {
|
||||||
|
label: 'name',
|
||||||
|
value: 'id',
|
||||||
|
children: 'children',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
...rest,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
};
|
||||||
@ -25,6 +25,7 @@ export function MyModal(props?: any) {
|
|||||||
<MyButtons.View
|
<MyButtons.View
|
||||||
title={props.title || '详情'}
|
title={props.title || '详情'}
|
||||||
type={props.type || 'primary'}
|
type={props.type || 'primary'}
|
||||||
|
size={props.size || 'small'}
|
||||||
onClick={() => setOpen(true)}
|
onClick={() => setOpen(true)}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
77
src/components/TransferProject.tsx
Normal file
77
src/components/TransferProject.tsx
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { Transfer } from 'antd';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
const MyTransferProject = (props: any) => {
|
||||||
|
const [getLoading, setLoading] = useState(false);
|
||||||
|
const [dataSource, setTransferData] = useState<any[]>([]);
|
||||||
|
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
||||||
|
useEffect(() => {
|
||||||
|
Apis.Asset.AssetProjects.Select({})
|
||||||
|
.then((res) => {
|
||||||
|
setLoading(true);
|
||||||
|
const data =
|
||||||
|
res.data?.map((item: any) => ({
|
||||||
|
key: item.value?.toString(),
|
||||||
|
title: item.label,
|
||||||
|
})) || [];
|
||||||
|
setTransferData(data);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
setTransferData([]);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log(props.value, 'props.value');
|
||||||
|
if (props.value?.length) {
|
||||||
|
setTargetKeys(props.value);
|
||||||
|
}
|
||||||
|
}, [props.value]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
getLoading && (
|
||||||
|
<Transfer
|
||||||
|
dataSource={dataSource}
|
||||||
|
targetKeys={targetKeys}
|
||||||
|
onChange={(targetKeys) => {
|
||||||
|
let dataIds: any = [];
|
||||||
|
console.log(targetKeys, 'targetKeys', props.value);
|
||||||
|
targetKeys?.forEach((res: any) => {
|
||||||
|
dataSource?.forEach((k: any) => {
|
||||||
|
if (res === k.key) {
|
||||||
|
dataIds?.push(k?.key);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
setTargetKeys(targetKeys as string[]);
|
||||||
|
props?.onChange?.(dataIds);
|
||||||
|
}}
|
||||||
|
render={(item) => item.title}
|
||||||
|
titles={['可选项目', '已选项目']}
|
||||||
|
showSearch
|
||||||
|
listStyle={{
|
||||||
|
width: 250,
|
||||||
|
height: 300,
|
||||||
|
}}
|
||||||
|
operations={['选择', '移除']}
|
||||||
|
operationStyle={{ marginTop: 20 }}
|
||||||
|
locale={{
|
||||||
|
itemUnit: '项',
|
||||||
|
itemsUnit: '项',
|
||||||
|
searchPlaceholder: '请输入搜索内容',
|
||||||
|
notFoundContent: '列表为空',
|
||||||
|
}}
|
||||||
|
onSelectChange={(sourceSelectedKeys, targetSelectedKeys) => {
|
||||||
|
console.log(
|
||||||
|
sourceSelectedKeys,
|
||||||
|
targetSelectedKeys,
|
||||||
|
'sourceSelectedKeys',
|
||||||
|
);
|
||||||
|
// 处理选择变化,但不触发表单提交
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MyTransferProject;
|
||||||
24
src/gen/ApiTypes.d.ts
vendored
24
src/gen/ApiTypes.d.ts
vendored
@ -475,6 +475,11 @@ declare namespace ApiTypes {
|
|||||||
"asset_houses_id"?: number; // 资产房屋id,[ref:asset_houses]
|
"asset_houses_id"?: number; // 资产房屋id,[ref:asset_houses]
|
||||||
"full_name"?: string; // 模糊搜索:房屋名称
|
"full_name"?: string; // 模糊搜索:房屋名称
|
||||||
"company_name"?: string; // 模糊搜索:公司名称
|
"company_name"?: string; // 模糊搜索:公司名称
|
||||||
|
<<<<<<< HEAD
|
||||||
|
"bill_status"?: string; // 账单状态,[enum:HouseBillsBillStatusEnum]
|
||||||
|
=======
|
||||||
|
"bill_status"?: string[]; // 账单状态,[enum:HouseBillsBillStatusEnum]
|
||||||
|
>>>>>>> 1ee118ed66388333954dd06d50024c67750430d4
|
||||||
};
|
};
|
||||||
type SummaryBillList = {
|
type SummaryBillList = {
|
||||||
"full_name"?: string; // 模糊搜索:房屋名称
|
"full_name"?: string; // 模糊搜索:房屋名称
|
||||||
@ -511,6 +516,9 @@ declare namespace ApiTypes {
|
|||||||
type Show = {
|
type Show = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
};
|
};
|
||||||
|
type SummaryShow = {
|
||||||
|
"asset_houses_id": number; // 资产房屋id,[ref:asset_houses]
|
||||||
|
};
|
||||||
type SoftDelete = {
|
type SoftDelete = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
};
|
};
|
||||||
@ -1334,6 +1342,19 @@ declare namespace ApiTypes {
|
|||||||
"id": number; // id
|
"id": number; // id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
namespace HouseMeterTaskDetails {
|
||||||
|
type List = {
|
||||||
|
"house_meter_task_id"?: number; // 仪表任务id,[ref:house_meter_tasks]
|
||||||
|
"full_name"?: string; // 房屋全称
|
||||||
|
"meter_name"?: string; // 仪表名称
|
||||||
|
};
|
||||||
|
type Show = {
|
||||||
|
"id": number; // id
|
||||||
|
};
|
||||||
|
type Delete = {
|
||||||
|
"id": number; // id
|
||||||
|
};
|
||||||
|
}
|
||||||
namespace HouseMeterTasks {
|
namespace HouseMeterTasks {
|
||||||
type List = {
|
type List = {
|
||||||
"name"?: string; // 模糊搜索:名称
|
"name"?: string; // 模糊搜索:名称
|
||||||
@ -1364,11 +1385,11 @@ declare namespace ApiTypes {
|
|||||||
"name"?: string; // 模糊搜索:名称
|
"name"?: string; // 模糊搜索:名称
|
||||||
"asset_projects_id"?: number; // 项目id,[ref:asset_projects]
|
"asset_projects_id"?: number; // 项目id,[ref:asset_projects]
|
||||||
"project_name"?: string; // 模糊搜索:项目名称
|
"project_name"?: string; // 模糊搜索:项目名称
|
||||||
|
"charge_standards_id"?: number; // 房屋收费标准id,[ref:house_charge_standards]
|
||||||
};
|
};
|
||||||
type Store = {
|
type Store = {
|
||||||
"asset_projects_id": number; // 项目id,[ref:asset_projects]
|
"asset_projects_id": number; // 项目id,[ref:asset_projects]
|
||||||
"charge_standards_id"?: number; // 房屋收费标准id,[ref:house_charge_standards]
|
"charge_standards_id"?: number; // 房屋收费标准id,[ref:house_charge_standards]
|
||||||
"companies_id": number; // 机构id,[ref:companies]
|
|
||||||
"name": string; // 名称
|
"name": string; // 名称
|
||||||
"meter_type": string; // 仪表类型,[enum:HouseMetersMeterTypeEnum]
|
"meter_type": string; // 仪表类型,[enum:HouseMetersMeterTypeEnum]
|
||||||
"usage_type": string; // 使用类型,[enum:HouseMetersUsageTypeEnum]
|
"usage_type": string; // 使用类型,[enum:HouseMetersUsageTypeEnum]
|
||||||
@ -1384,7 +1405,6 @@ declare namespace ApiTypes {
|
|||||||
"id": number; // id
|
"id": number; // id
|
||||||
"asset_projects_id": number; // 项目id,[ref:asset_projects]
|
"asset_projects_id": number; // 项目id,[ref:asset_projects]
|
||||||
"charge_standards_id"?: number; // 房屋收费标准id,[ref:house_charge_standards]
|
"charge_standards_id"?: number; // 房屋收费标准id,[ref:house_charge_standards]
|
||||||
"companies_id": number; // 机构id,[ref:companies]
|
|
||||||
"name": string; // 名称
|
"name": string; // 名称
|
||||||
"meter_type": string; // 仪表类型,[enum:HouseMetersMeterTypeEnum]
|
"meter_type": string; // 仪表类型,[enum:HouseMetersMeterTypeEnum]
|
||||||
"usage_type": string; // 使用类型,[enum:HouseMetersUsageTypeEnum]
|
"usage_type": string; // 使用类型,[enum:HouseMetersUsageTypeEnum]
|
||||||
|
|||||||
@ -266,6 +266,9 @@ export const Apis = {
|
|||||||
Show(data: ApiTypes.Bill.HouseBills.Show): Promise<MyResponseType> {
|
Show(data: ApiTypes.Bill.HouseBills.Show): Promise<MyResponseType> {
|
||||||
return request('admin/bill/house_bills/show', { data });
|
return request('admin/bill/house_bills/show', { data });
|
||||||
},
|
},
|
||||||
|
SummaryShow(data: ApiTypes.Bill.HouseBills.SummaryShow): Promise<MyResponseType> {
|
||||||
|
return request('admin/bill/house_bills/summary_show', { data });
|
||||||
|
},
|
||||||
SoftDelete(data: ApiTypes.Bill.HouseBills.SoftDelete): Promise<MyResponseType> {
|
SoftDelete(data: ApiTypes.Bill.HouseBills.SoftDelete): Promise<MyResponseType> {
|
||||||
return request('admin/bill/house_bills/soft_delete', { data });
|
return request('admin/bill/house_bills/soft_delete', { data });
|
||||||
},
|
},
|
||||||
@ -789,6 +792,17 @@ export const Apis = {
|
|||||||
return request('admin/meter/house_meter_readings/delete', { data });
|
return request('admin/meter/house_meter_readings/delete', { data });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
HouseMeterTaskDetails: {
|
||||||
|
List(data?: ApiTypes.Meter.HouseMeterTaskDetails.List): Promise<MyResponseType> {
|
||||||
|
return request('admin/meter/house_meter_task_details/list', { data });
|
||||||
|
},
|
||||||
|
Show(data: ApiTypes.Meter.HouseMeterTaskDetails.Show): Promise<MyResponseType> {
|
||||||
|
return request('admin/meter/house_meter_task_details/show', { data });
|
||||||
|
},
|
||||||
|
Delete(data: ApiTypes.Meter.HouseMeterTaskDetails.Delete): Promise<MyResponseType> {
|
||||||
|
return request('admin/meter/house_meter_task_details/delete', { data });
|
||||||
|
},
|
||||||
|
},
|
||||||
HouseMeterTasks: {
|
HouseMeterTasks: {
|
||||||
List(data?: ApiTypes.Meter.HouseMeterTasks.List): Promise<MyResponseType> {
|
List(data?: ApiTypes.Meter.HouseMeterTasks.List): Promise<MyResponseType> {
|
||||||
return request('admin/meter/house_meter_tasks/list', { data });
|
return request('admin/meter/house_meter_tasks/list', { data });
|
||||||
|
|||||||
@ -154,7 +154,11 @@ export const BannersTypeEnum= {
|
|||||||
|
|
||||||
// 缓存类型
|
// 缓存类型
|
||||||
export const CacheTypeEnum= {
|
export const CacheTypeEnum= {
|
||||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#0a9319","value":"MobilePhoneVerificationCode"},
|
<<<<<<< HEAD
|
||||||
|
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#262025","value":"MobilePhoneVerificationCode"},
|
||||||
|
=======
|
||||||
|
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#b123bc","value":"MobilePhoneVerificationCode"},
|
||||||
|
>>>>>>> 1ee118ed66388333954dd06d50024c67750430d4
|
||||||
};
|
};
|
||||||
|
|
||||||
// CompaniesMerchantTypeEnum
|
// CompaniesMerchantTypeEnum
|
||||||
@ -176,6 +180,12 @@ export const CompanyAppsModuleEnum= {
|
|||||||
'Customer': {"text":"客户端","color":"#10b981","value":"Customer"},
|
'Customer': {"text":"客户端","color":"#10b981","value":"Customer"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// CompanyAppsWorkTypeEnum
|
||||||
|
export const CompanyAppsWorkTypeEnum= {
|
||||||
|
'WorkWechatApp': {"text":"企微应用","color":"#00c853","value":"WorkWechatApp"},
|
||||||
|
'WorkWechat': {"text":"企微","color":"#0091ea","value":"WorkWechat"},
|
||||||
|
};
|
||||||
|
|
||||||
// CompanyEmployeeBacklogsStatusEnum
|
// CompanyEmployeeBacklogsStatusEnum
|
||||||
export const CompanyEmployeeBacklogsStatusEnum= {
|
export const CompanyEmployeeBacklogsStatusEnum= {
|
||||||
'Pending': {"text":"待办","color":"#FF6600","value":"Pending"},
|
'Pending': {"text":"待办","color":"#FF6600","value":"Pending"},
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import { useNavigate } from '@umijs/max';
|
|||||||
import { Space, Tag } from 'antd';
|
import { Space, Tag } from 'antd';
|
||||||
import Delivery from './modals/Delivery';
|
import Delivery from './modals/Delivery';
|
||||||
|
|
||||||
export default function Index({ title = '房屋档案' }) {
|
export default function Index({ title = '房客关系' }) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
// 注册当前页面为标签页
|
// 注册当前页面为标签页
|
||||||
usePageTabs({
|
usePageTabs({
|
||||||
@ -140,7 +140,7 @@ export default function Index({ title = '房屋档案' }) {
|
|||||||
<Delivery
|
<Delivery
|
||||||
item={item}
|
item={item}
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title="添加产权人"
|
title="添加业主"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
''
|
''
|
||||||
|
|||||||
@ -79,7 +79,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
fieldProps: {
|
fieldProps: {
|
||||||
copyIconProps: false,
|
copyIconProps: false,
|
||||||
creatorButtonProps: {
|
creatorButtonProps: {
|
||||||
creatorButtonText: '添加产权人',
|
creatorButtonText: '添加业主',
|
||||||
},
|
},
|
||||||
itemRender: (
|
itemRender: (
|
||||||
{ listDom, action }: any,
|
{ listDom, action }: any,
|
||||||
|
|||||||
@ -51,7 +51,7 @@ export default function Index({ ...rest }) {
|
|||||||
key="Delivery"
|
key="Delivery"
|
||||||
item={{ ...rest.item, size: 'middle' }}
|
item={{ ...rest.item, size: 'middle' }}
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title="添加产权人"
|
title="添加业主"
|
||||||
/>,
|
/>,
|
||||||
!rest.item?.house_occupants?.length ? (
|
!rest.item?.house_occupants?.length ? (
|
||||||
''
|
''
|
||||||
|
|||||||
@ -82,7 +82,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
fieldProps: {
|
fieldProps: {
|
||||||
copyIconProps: false,
|
copyIconProps: false,
|
||||||
creatorButtonProps: {
|
creatorButtonProps: {
|
||||||
creatorButtonText: '添加产权人',
|
creatorButtonText: '添加业主',
|
||||||
},
|
},
|
||||||
itemRender: (
|
itemRender: (
|
||||||
{ listDom, action }: any,
|
{ listDom, action }: any,
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export default function EnrollsList(props: MyBetaModalFormProps) {
|
|||||||
<MyModal
|
<MyModal
|
||||||
title={props.title || '报名'}
|
title={props.title || '报名'}
|
||||||
type={props.item?.type || 'primary'}
|
type={props.item?.type || 'primary'}
|
||||||
width="900px"
|
width="800px"
|
||||||
node={
|
node={
|
||||||
<ProTable
|
<ProTable
|
||||||
{...MyProTableProps.props}
|
{...MyProTableProps.props}
|
||||||
@ -26,6 +26,7 @@ export default function EnrollsList(props: MyBetaModalFormProps) {
|
|||||||
Apis.Activity.ActivityEnrolls.List,
|
Apis.Activity.ActivityEnrolls.List,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
options={false}
|
||||||
columns={[
|
columns={[
|
||||||
MyColumns.ID(),
|
MyColumns.ID(),
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,128 +0,0 @@
|
|||||||
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/dictionary/modals/HousesShow';
|
|
||||||
import HousesUpdate from '../asset/dictionary/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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -7,7 +7,7 @@ import {
|
|||||||
usePageTabs,
|
usePageTabs,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { HouseBillsTypeEnum } from '@/gen/Enums';
|
import { HouseBillsBillStatusEnum, HouseBillsTypeEnum } from '@/gen/Enums';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import BillCreate from './modals/BillCreate';
|
import BillCreate from './modals/BillCreate';
|
||||||
@ -46,6 +46,11 @@ export default function Index({ title = '账单明细' }) {
|
|||||||
]}
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
MyColumns.ID(),
|
MyColumns.ID(),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'bill_status',
|
||||||
|
valueEnum: HouseBillsBillStatusEnum,
|
||||||
|
}),
|
||||||
MyColumns.EnumTag({
|
MyColumns.EnumTag({
|
||||||
title: '类型',
|
title: '类型',
|
||||||
dataIndex: 'type',
|
dataIndex: 'type',
|
||||||
@ -81,7 +86,11 @@ export default function Index({ title = '账单明细' }) {
|
|||||||
dataIndex: 'late_fee',
|
dataIndex: 'late_fee',
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '应付金额',
|
||||||
|
dataIndex: 'total_payable_amount',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '计费开始日期',
|
title: '计费开始日期',
|
||||||
dataIndex: 'start_date',
|
dataIndex: 'start_date',
|
||||||
|
|||||||
35
src/pages/bills/summary/components/BillInfo.tsx
Normal file
35
src/pages/bills/summary/components/BillInfo.tsx
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import { MyBetaModalFormProps } from '@/common';
|
||||||
|
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
|
||||||
|
export default function info(props: MyBetaModalFormProps) {
|
||||||
|
const { item } = props;
|
||||||
|
|
||||||
|
// 添加调试日志
|
||||||
|
console.log('BillInfo props:', props);
|
||||||
|
console.log('BillInfo 11111111:', item);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Space direction="vertical" style={{ width: '100%' }}>
|
||||||
|
<ProCard title="基本信息">
|
||||||
|
<ProDescriptions bordered>
|
||||||
|
<ProDescriptions.Item label="房屋名称" span={2}>
|
||||||
|
{item?.asset_house?.full_name || '-'}
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="应付金额">
|
||||||
|
{item?.total_payable_sum || '-'}
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="账单金额">
|
||||||
|
{item?.payable_amount_sum || '-'}
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="滞纳金">
|
||||||
|
{item?.late_fee_sum || '-'}
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="优惠金额">
|
||||||
|
{item?.discount_amount_sum || '-'}
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
</ProDescriptions>
|
||||||
|
</ProCard>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
MyButtons,
|
||||||
MyColumns,
|
MyColumns,
|
||||||
MyPageContainer,
|
MyPageContainer,
|
||||||
MyProTableProps,
|
MyProTableProps,
|
||||||
@ -6,10 +7,11 @@ import {
|
|||||||
} from '@/common';
|
} from '@/common';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { useNavigate } from '@umijs/max';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import SummaryShow from './modals/SummaryShow';
|
|
||||||
|
|
||||||
export default function Index({ title = '房屋账单' }) {
|
export default function Index({ title = '房屋账单' }) {
|
||||||
|
const navigate = useNavigate();
|
||||||
// 注册当前页面为标签页
|
// 注册当前页面为标签页
|
||||||
usePageTabs({
|
usePageTabs({
|
||||||
tabKey: 'summary',
|
tabKey: 'summary',
|
||||||
@ -32,18 +34,6 @@ export default function Index({ title = '房屋账单' }) {
|
|||||||
Apis.Bill.HouseBills.SummaryBillList,
|
Apis.Bill.HouseBills.SummaryBillList,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// 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={[
|
columns={[
|
||||||
{
|
{
|
||||||
title: '房屋ID',
|
title: '房屋ID',
|
||||||
@ -81,7 +71,12 @@ export default function Index({ title = '房屋账单' }) {
|
|||||||
MyColumns.Option({
|
MyColumns.Option({
|
||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
<SummaryShow item={item} title="查看" reload={action?.reload} />
|
<MyButtons.View
|
||||||
|
title="查看"
|
||||||
|
onClick={() => {
|
||||||
|
navigate(`/bills/summary/show/${item.asset_houses_id}`);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -1,100 +0,0 @@
|
|||||||
import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common';
|
|
||||||
import { MyModal } from '@/components/MyModal';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import { HouseBillsTypeEnum } from '@/gen/Enums';
|
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
|
||||||
import { Space } from 'antd';
|
|
||||||
import BillUpdate from '../../list/modals/BillUpdate';
|
|
||||||
|
|
||||||
export default function SummaryShow(props: MyBetaModalFormProps) {
|
|
||||||
return (
|
|
||||||
<MyModal
|
|
||||||
title={props.title || '查看'}
|
|
||||||
type={props.item?.type || 'primary'}
|
|
||||||
width="1000px"
|
|
||||||
node={
|
|
||||||
<ProTable
|
|
||||||
{...MyProTableProps.props}
|
|
||||||
request={async (params, sort) =>
|
|
||||||
MyProTableProps.request(
|
|
||||||
{ ...params, asset_houses_id: props?.item?.asset_houses_id },
|
|
||||||
sort,
|
|
||||||
Apis.Bill.HouseBills.List,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
columns={[
|
|
||||||
MyColumns.ID(),
|
|
||||||
MyColumns.EnumTag({
|
|
||||||
title: '类型',
|
|
||||||
dataIndex: 'type',
|
|
||||||
valueEnum: HouseBillsTypeEnum,
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
title: '房屋',
|
|
||||||
dataIndex: ['asset_house', 'full_name'],
|
|
||||||
search: {
|
|
||||||
transform: (value) => {
|
|
||||||
return { full_name: value };
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '账单月份',
|
|
||||||
render: (_, record) => {
|
|
||||||
return `${record.year}-${String(record.month).padStart(
|
|
||||||
2,
|
|
||||||
'0',
|
|
||||||
)}`;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '账单金额',
|
|
||||||
dataIndex: 'amount',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '优惠金额',
|
|
||||||
dataIndex: 'discount_amount',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '滞纳金',
|
|
||||||
dataIndex: 'late_fee',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: '计费开始日期',
|
|
||||||
dataIndex: 'start_date',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '计费结束日期',
|
|
||||||
dataIndex: 'end_date',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
MyColumns.CreatedAt(),
|
|
||||||
MyColumns.Option({
|
|
||||||
render: (_, item: any, index, action) => (
|
|
||||||
<Space key={index}>
|
|
||||||
<BillUpdate
|
|
||||||
item={item}
|
|
||||||
reload={action?.reload}
|
|
||||||
title="编辑"
|
|
||||||
/>
|
|
||||||
{/* <MyButtons.Delete
|
|
||||||
onConfirm={() =>
|
|
||||||
Apis.Bill.HouseBills.Delete({ id: item.id }).then(() =>
|
|
||||||
action?.reload(),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
</Space>
|
|
||||||
),
|
|
||||||
}),
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
83
src/pages/bills/summary/show/$id.tsx
Normal file
83
src/pages/bills/summary/show/$id.tsx
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
import { MyPageContainer, usePageTabs } from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { ProCard } from '@ant-design/pro-components';
|
||||||
|
import { useParams } from '@umijs/max';
|
||||||
|
import { Tabs } from 'antd';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import BillInfo from '../components/BillInfo';
|
||||||
|
import CancelledBill from '../table/CancelledBill';
|
||||||
|
import PaidBill from '../table/PaidBill';
|
||||||
|
import UnpaidBill from '../table/UnpaidBill';
|
||||||
|
|
||||||
|
export default function Show({ title = '账单详情' }) {
|
||||||
|
const { id } = useParams<{ id: string }>();
|
||||||
|
const [data, setShow] = useState<any>({});
|
||||||
|
|
||||||
|
// 注册标签页
|
||||||
|
const { addTab } = usePageTabs({
|
||||||
|
tabKey: `bill-detail-${id}`,
|
||||||
|
tabLabel: `${data?.asset_house?.name}账单` || title,
|
||||||
|
});
|
||||||
|
|
||||||
|
const loadShow = () => {
|
||||||
|
let paramsId: any = { asset_houses_id: id ?? 0 };
|
||||||
|
Apis.Bill.HouseBills.SummaryShow(paramsId).then((res) => {
|
||||||
|
setShow(res?.data);
|
||||||
|
// 更新标签页标题
|
||||||
|
if (res?.data?.asset_house?.name) {
|
||||||
|
addTab({
|
||||||
|
key: `bill-detail-${id}`,
|
||||||
|
label: `${data?.asset_house?.name}档案`,
|
||||||
|
path: `/bills/${id}`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
loadShow();
|
||||||
|
}, [id]);
|
||||||
|
|
||||||
|
let items = [
|
||||||
|
{
|
||||||
|
label: '欠费账单',
|
||||||
|
key: '1',
|
||||||
|
closable: false,
|
||||||
|
children: (
|
||||||
|
<UnpaidBill item={{ ...data, asset_houses_id: data.asset_houses_id }} />
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '已付账单',
|
||||||
|
key: '2',
|
||||||
|
closable: false,
|
||||||
|
children: (
|
||||||
|
<PaidBill item={{ ...data, asset_houses_id: data.asset_houses_id }} />
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '作废账单',
|
||||||
|
key: '3',
|
||||||
|
closable: false,
|
||||||
|
children: (
|
||||||
|
<CancelledBill
|
||||||
|
item={{ ...data, asset_houses_id: data.asset_houses_id }}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MyPageContainer
|
||||||
|
title={title}
|
||||||
|
enableTabs
|
||||||
|
tabKey={`bill-detail-${id}`}
|
||||||
|
tabLabel={data?.asset_house?.name || title}
|
||||||
|
>
|
||||||
|
<BillInfo item={data} reload={loadShow} />
|
||||||
|
<ProCard style={{ marginTop: 16 }}>
|
||||||
|
<Tabs type="card" items={items} defaultActiveKey="1" size="small" />
|
||||||
|
</ProCard>
|
||||||
|
</MyPageContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
76
src/pages/bills/summary/table/CancelledBill.tsx
Normal file
76
src/pages/bills/summary/table/CancelledBill.tsx
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
import { MyColumns, MyProTableProps } from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { HouseBillsBillStatusEnum, HouseBillsTypeEnum } from '@/gen/Enums';
|
||||||
|
import BillUpdate from '@/pages/bills/list/modals/BillUpdate';
|
||||||
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
import { useEffect, useRef } from 'react';
|
||||||
|
|
||||||
|
export default function Index({ ...rest }) {
|
||||||
|
const actionLooks = useRef<any>();
|
||||||
|
useEffect(() => {
|
||||||
|
actionLooks?.current.reloadAndRest();
|
||||||
|
}, [rest.loadmore]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ProTable<Record<any, any>>
|
||||||
|
{...MyProTableProps.props}
|
||||||
|
actionRef={actionLooks}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
{
|
||||||
|
...params,
|
||||||
|
asset_houses_id: rest.item?.asset_houses_id,
|
||||||
|
bill_status: [HouseBillsBillStatusEnum.Cancelled.value],
|
||||||
|
},
|
||||||
|
sort,
|
||||||
|
Apis.Bill.HouseBills.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
search={false}
|
||||||
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'bill_status',
|
||||||
|
valueEnum: HouseBillsBillStatusEnum,
|
||||||
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '类型',
|
||||||
|
dataIndex: 'type',
|
||||||
|
valueEnum: HouseBillsTypeEnum,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
title: '账单月份',
|
||||||
|
render: (_, record) => {
|
||||||
|
return `${record.year}-${String(record.month).padStart(2, '0')}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '应付金额',
|
||||||
|
dataIndex: 'total_payable_amount',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '计费开始日期',
|
||||||
|
dataIndex: 'start_date',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '计费结束日期',
|
||||||
|
dataIndex: 'end_date',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
MyColumns.Option({
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index}>
|
||||||
|
<BillUpdate item={item} reload={action?.reload} title="编辑" />
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
79
src/pages/bills/summary/table/PaidBill.tsx
Normal file
79
src/pages/bills/summary/table/PaidBill.tsx
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
import { MyColumns, MyProTableProps } from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { HouseBillsBillStatusEnum, HouseBillsTypeEnum } from '@/gen/Enums';
|
||||||
|
import BillUpdate from '@/pages/bills/list/modals/BillUpdate';
|
||||||
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
import { useEffect, useRef } from 'react';
|
||||||
|
import BillShow from './modals/BillShow';
|
||||||
|
|
||||||
|
export default function Index({ ...rest }) {
|
||||||
|
const actionLooks = useRef<any>();
|
||||||
|
useEffect(() => {
|
||||||
|
actionLooks?.current.reloadAndRest();
|
||||||
|
}, [rest.loadmore]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ProTable<Record<any, any>>
|
||||||
|
{...MyProTableProps.props}
|
||||||
|
actionRef={actionLooks}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
{
|
||||||
|
...params,
|
||||||
|
asset_houses_id: rest.item?.asset_houses_id,
|
||||||
|
bill_status: [HouseBillsBillStatusEnum.Paid.value],
|
||||||
|
},
|
||||||
|
sort,
|
||||||
|
Apis.Bill.HouseBills.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
search={false}
|
||||||
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'bill_status',
|
||||||
|
valueEnum: HouseBillsBillStatusEnum,
|
||||||
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '类型',
|
||||||
|
dataIndex: 'type',
|
||||||
|
valueEnum: HouseBillsTypeEnum,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
title: '账单月份',
|
||||||
|
render: (_, record) => {
|
||||||
|
return `${record.year}-${String(record.month).padStart(2, '0')}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '应付金额',
|
||||||
|
dataIndex: 'total_payable_amount',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '计费开始日期',
|
||||||
|
dataIndex: 'start_date',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '计费结束日期',
|
||||||
|
dataIndex: 'end_date',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
MyColumns.Option({
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index}>
|
||||||
|
<BillUpdate item={item} reload={action?.reload} title="编辑" />
|
||||||
|
<BillShow item={item} title="查看" reload={action?.reload} />
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
80
src/pages/bills/summary/table/UnpaidBill.tsx
Normal file
80
src/pages/bills/summary/table/UnpaidBill.tsx
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
import { MyColumns, MyProTableProps } from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { HouseBillsBillStatusEnum, HouseBillsTypeEnum } from '@/gen/Enums';
|
||||||
|
import BillUpdate from '@/pages/bills/list/modals/BillUpdate';
|
||||||
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
import { useEffect, useRef } from 'react';
|
||||||
|
|
||||||
|
export default function Index({ ...rest }) {
|
||||||
|
const actionLooks = useRef<any>();
|
||||||
|
useEffect(() => {
|
||||||
|
actionLooks?.current.reloadAndRest();
|
||||||
|
}, [rest.loadmore]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ProTable<Record<any, any>>
|
||||||
|
{...MyProTableProps.props}
|
||||||
|
actionRef={actionLooks}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
{
|
||||||
|
...params,
|
||||||
|
asset_houses_id: rest.item?.asset_houses_id,
|
||||||
|
bill_status: [
|
||||||
|
HouseBillsBillStatusEnum.PendingPayment.value,
|
||||||
|
HouseBillsBillStatusEnum.PartiallyPaid.value,
|
||||||
|
HouseBillsBillStatusEnum.Overdue.value,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
sort,
|
||||||
|
Apis.Bill.HouseBills.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
search={false}
|
||||||
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'bill_status',
|
||||||
|
valueEnum: HouseBillsBillStatusEnum,
|
||||||
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '类型',
|
||||||
|
dataIndex: 'type',
|
||||||
|
valueEnum: HouseBillsTypeEnum,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
title: '账单月份',
|
||||||
|
render: (_, record) => {
|
||||||
|
return `${record.year}-${String(record.month).padStart(2, '0')}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '应付金额',
|
||||||
|
dataIndex: 'total_payable_amount',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '计费开始日期',
|
||||||
|
dataIndex: 'start_date',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '计费结束日期',
|
||||||
|
dataIndex: 'end_date',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
MyColumns.Option({
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index}>
|
||||||
|
<BillUpdate item={item} reload={action?.reload} title="编辑" />
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
71
src/pages/bills/summary/table/modals/BillShow.tsx
Normal file
71
src/pages/bills/summary/table/modals/BillShow.tsx
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||||
|
import { MyModal } from '@/components/MyModal';
|
||||||
|
import { HouseBillsBillStatusEnum, HouseBillsTypeEnum } from '@/gen/Enums';
|
||||||
|
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
|
||||||
|
export default function SummaryShow(props: MyBetaModalFormProps) {
|
||||||
|
return (
|
||||||
|
<MyModal
|
||||||
|
title={props.title || '查看'}
|
||||||
|
type={props.item?.type || 'primary'}
|
||||||
|
width="600px"
|
||||||
|
node={
|
||||||
|
<Space direction="vertical" style={{ width: '100%' }}>
|
||||||
|
<ProCard>
|
||||||
|
<ProDescriptions column={1}>
|
||||||
|
<ProDescriptions.Item label="房屋名称" span={3}>
|
||||||
|
{props?.item?.asset_house?.full_name || '-'}
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="账单金额">
|
||||||
|
<Space>
|
||||||
|
{props?.item?.amount || '-'}
|
||||||
|
<renderTextHelper.Tag
|
||||||
|
Enums={HouseBillsTypeEnum}
|
||||||
|
value={props?.item?.type}
|
||||||
|
key="type"
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="优惠金额">
|
||||||
|
{props?.item?.discount_amount || '-'}
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="滞纳金">
|
||||||
|
{props?.item?.late_fee || '-'}
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="应付金额">
|
||||||
|
<Space>
|
||||||
|
{props?.item?.total_payable_amount || '-'}{' '}
|
||||||
|
<renderTextHelper.Tag
|
||||||
|
Enums={HouseBillsBillStatusEnum}
|
||||||
|
value={props?.item?.bill_status}
|
||||||
|
key="bill_status"
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="账单月份">
|
||||||
|
<Space>
|
||||||
|
<span>
|
||||||
|
{props?.item?.year || '-'}-
|
||||||
|
{String(props?.item?.month).padStart(2, '0')}月
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
( {props?.item?.start_date || '-'} 至{' '}
|
||||||
|
{props?.item?.end_date || '-'})
|
||||||
|
</span>
|
||||||
|
</Space>
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="收款账号">
|
||||||
|
<Space>
|
||||||
|
{props?.item?.receipt_account?.company_name || '-'}
|
||||||
|
{props?.item?.receipt_account?.company_bank || '-'}
|
||||||
|
{props?.item?.receipt_account?.company_account || '-'}
|
||||||
|
</Space>
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
</ProDescriptions>
|
||||||
|
</ProCard>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -140,7 +140,7 @@ export default function Index({ title = '收费标准' }) {
|
|||||||
<MyButtons.View
|
<MyButtons.View
|
||||||
title="查看"
|
title="查看"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate(`/house_charge_standard/show/${item.id}`);
|
navigate(`/charge/standard/show/${item.id}`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ChargeStandardUpdate
|
<ChargeStandardUpdate
|
||||||
|
|||||||
@ -57,14 +57,11 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
},
|
},
|
||||||
MyFormItems.UploadImages({
|
MyFormItems.UploadImages({
|
||||||
key: 'logo',
|
key: 'logo',
|
||||||
title: '品牌logo【尺寸:1024*1024】',
|
title: '品牌logo【 尺寸比例 1:1 】',
|
||||||
tooltip: '只能上传1张图片',
|
tooltip: '只能上传1张图片',
|
||||||
max: 1,
|
max: 1,
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
formItemProps: { required: false },
|
formItemProps: { required: false },
|
||||||
fieldProps: {
|
|
||||||
placeholder: '',
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -69,7 +69,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
title: '选择组织',
|
title: '选择组织',
|
||||||
key: 'organizations_id',
|
key: 'organizations_id',
|
||||||
params: {
|
params: {
|
||||||
companies_id: companies_id || props?.item?.companies_id || 0,
|
companies_id: companies_id || props?.item?.id || 0,
|
||||||
},
|
},
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
@ -109,7 +109,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
Selects?.Positions({
|
Selects?.Positions({
|
||||||
title: '岗位',
|
title: '岗位',
|
||||||
params: {
|
params: {
|
||||||
companies_id: companies_id || props?.item?.companies_id || 0,
|
companies_id: companies_id || props?.item?.id || 0,
|
||||||
},
|
},
|
||||||
key: 'positions_id',
|
key: 'positions_id',
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import { Apis } from '@/gen/Apis';
|
|||||||
import { OrganizationsTypeEnum } from '@/gen/Enums';
|
import { OrganizationsTypeEnum } from '@/gen/Enums';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
|
import NextOrganizationChange from '../../organizations/modals/NextOrganizationChange';
|
||||||
import OrganizationChange from '../../organizations/modals/OrganizationChange';
|
import OrganizationChange from '../../organizations/modals/OrganizationChange';
|
||||||
import OrganizationCreate from '../../organizations/modals/OrganizationCreate';
|
import OrganizationCreate from '../../organizations/modals/OrganizationCreate';
|
||||||
import OrganizationUpdate from '../../organizations/modals/OrganizationUpdate';
|
import OrganizationUpdate from '../../organizations/modals/OrganizationUpdate';
|
||||||
@ -60,14 +61,21 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
|||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
<OrganizationUpdate
|
<OrganizationUpdate
|
||||||
item={{ ...item, companies_id: props?.item?.id }}
|
item={item}
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title="组织"
|
title="组织"
|
||||||
/>
|
/>
|
||||||
<OrganizationChange
|
{item?.type !== OrganizationsTypeEnum.Group.value && (
|
||||||
item={{ ...item, companies_id: props?.item?.id }}
|
<OrganizationChange
|
||||||
|
item={{ ...item, companies_id: props?.item?.companies_id }}
|
||||||
|
reload={action?.reload}
|
||||||
|
title="组织"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<NextOrganizationChange
|
||||||
|
item={{ ...item, companies_id: item?.companies_id }}
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title="组织"
|
title="下级组织"
|
||||||
/>
|
/>
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
onConfirm={() =>
|
onConfirm={() =>
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import { OrganizationsTypeEnum } from '@/gen/Enums';
|
|||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { useNavigate } from '@umijs/max';
|
import { useNavigate } from '@umijs/max';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
|
import NextOrganizationChange from './modals/NextOrganizationChange';
|
||||||
import OrganizationChange from './modals/OrganizationChange';
|
import OrganizationChange from './modals/OrganizationChange';
|
||||||
import OrganizationCreate from './modals/OrganizationCreate';
|
import OrganizationCreate from './modals/OrganizationCreate';
|
||||||
import OrganizationUpdate from './modals/OrganizationUpdate';
|
import OrganizationUpdate from './modals/OrganizationUpdate';
|
||||||
@ -77,14 +78,23 @@ export default function Index({ title = '组织列表' }) {
|
|||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
<OrganizationUpdate
|
<OrganizationUpdate
|
||||||
item={{ ...item, companies_id: item?.id }}
|
item={item}
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title="组织"
|
title="组织"
|
||||||
/>
|
/>
|
||||||
<OrganizationChange
|
|
||||||
item={{ ...item, companies_id: item?.id }}
|
{item?.type !== OrganizationsTypeEnum.Group.value && (
|
||||||
|
<OrganizationChange
|
||||||
|
item={{ ...item, companies_id: item?.companies_id }}
|
||||||
|
reload={action?.reload}
|
||||||
|
title="组织"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<NextOrganizationChange
|
||||||
|
item={{ ...item, companies_id: item?.companies_id }}
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title="组织"
|
title="下级组织"
|
||||||
/>
|
/>
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
onConfirm={() =>
|
onConfirm={() =>
|
||||||
|
|||||||
@ -0,0 +1,71 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyFormItems,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { OrganizationsTypeEnum } from '@/gen/Enums';
|
||||||
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
|
import { Form, message } from 'antd';
|
||||||
|
|
||||||
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<BetaSchemaForm<ApiTypes.Company.Organizations.Store>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`添加${props.title}`}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
width="500px"
|
||||||
|
trigger={<MyButtons.Create title={`添加${props.title}`} size="small" />}
|
||||||
|
key={new Date().getTime()}
|
||||||
|
form={form}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open) {
|
||||||
|
form.resetFields(); // 清空表单数据
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onFinish={async (values: any) =>
|
||||||
|
Apis.Company.Organizations.Store({
|
||||||
|
...values,
|
||||||
|
companies_id: values?.companies_id || props?.item?.companies_id,
|
||||||
|
parent_id: props.item?.id,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success(props.title + '成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false)
|
||||||
|
}
|
||||||
|
columns={[
|
||||||
|
...(props?.item?.id
|
||||||
|
? []
|
||||||
|
: [
|
||||||
|
Selects?.Companies({
|
||||||
|
key: 'companies_id',
|
||||||
|
title: '公司',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'type',
|
||||||
|
title: '组织类型',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueEnum: OrganizationsTypeEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
key: 'name',
|
||||||
|
title: '组织名称',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -11,14 +11,12 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
title={`${props.title}调整`}
|
title={`${props.title}调整`}
|
||||||
form={form}
|
form={form}
|
||||||
trigger={
|
trigger={<MyButtons.Default title="调整" type="primary" size="small" />}
|
||||||
<MyButtons.Default title="组织调整" type="primary" size="small" />
|
|
||||||
}
|
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="500px"
|
width="500px"
|
||||||
onOpenChange={(open: any) => {
|
onOpenChange={(open: any) => {
|
||||||
if (open && props.item) {
|
if (open && props.item) {
|
||||||
form.setFieldsValue(props.item);
|
form.resetFields(); // 清空表单数据
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onFinish={async (values: any) =>
|
onFinish={async (values: any) =>
|
||||||
@ -40,7 +38,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
Selects?.OrganizationsTree({
|
Selects?.OrganizationsTree({
|
||||||
title: '请选择新的上级组织',
|
title: '请选择新的【上级组织】',
|
||||||
key: 'parent_id',
|
key: 'parent_id',
|
||||||
params: { companies_id: props?.item?.companies_id },
|
params: { companies_id: props?.item?.companies_id },
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
onFinish={async (values: any) =>
|
onFinish={async (values: any) =>
|
||||||
Apis.Company.Organizations.Store({
|
Apis.Company.Organizations.Store({
|
||||||
...values,
|
...values,
|
||||||
companies_id: values?.companies_id || props?.item?.id,
|
companies_id: values?.companies_id || props?.item?.companies_id,
|
||||||
parent_id: values?.parent_id?.[values.parent_id.length - 1],
|
parent_id: values?.parent_id?.[values.parent_id.length - 1],
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|||||||
@ -22,6 +22,8 @@ export default function ChargeStandardHasHouse(props: MyBetaModalFormProps) {
|
|||||||
|
|
||||||
// 添加 tableRef 用于操作表格
|
// 添加 tableRef 用于操作表格
|
||||||
const tableRef = useRef<any>();
|
const tableRef = useRef<any>();
|
||||||
|
// 添加 modalRef 用于关闭窗口
|
||||||
|
const modalRef = useRef<any>();
|
||||||
|
|
||||||
const onShowContactPhone = () => {
|
const onShowContactPhone = () => {
|
||||||
if (!selectedHouseId) {
|
if (!selectedHouseId) {
|
||||||
@ -42,6 +44,8 @@ export default function ChargeStandardHasHouse(props: MyBetaModalFormProps) {
|
|||||||
setSelectedRow(null);
|
setSelectedRow(null);
|
||||||
props.reload?.();
|
props.reload?.();
|
||||||
message.success('添加成功!');
|
message.success('添加成功!');
|
||||||
|
// 关闭窗口
|
||||||
|
modalRef.current?.close();
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error('添加失败:', error);
|
console.error('添加失败:', error);
|
||||||
@ -55,6 +59,7 @@ export default function ChargeStandardHasHouse(props: MyBetaModalFormProps) {
|
|||||||
title={props.title || '查看'}
|
title={props.title || '查看'}
|
||||||
type="primary"
|
type="primary"
|
||||||
width="920px"
|
width="920px"
|
||||||
|
myRef={modalRef}
|
||||||
node={
|
node={
|
||||||
<ProTable
|
<ProTable
|
||||||
actionRef={tableRef}
|
actionRef={tableRef}
|
||||||
|
|||||||
69
src/pages/moments/classification/index.tsx
Normal file
69
src/pages/moments/classification/index.tsx
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
import {
|
||||||
|
MyButtons,
|
||||||
|
MyColumns,
|
||||||
|
MyPageContainer,
|
||||||
|
MyProTableProps,
|
||||||
|
usePageTabs,
|
||||||
|
} from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
import Create from './modals/Create';
|
||||||
|
import Update from './modals/Update';
|
||||||
|
|
||||||
|
export default function Index({ title = '朋友圈分类' }) {
|
||||||
|
// 注册当前页面为标签页
|
||||||
|
usePageTabs({
|
||||||
|
tabKey: 'moments-classification',
|
||||||
|
tabLabel: title,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MyPageContainer
|
||||||
|
title={title}
|
||||||
|
enableTabs={true}
|
||||||
|
tabKey="moments-classification"
|
||||||
|
tabLabel={title}
|
||||||
|
>
|
||||||
|
<ProTable
|
||||||
|
{...MyProTableProps.props}
|
||||||
|
expandable={{
|
||||||
|
defaultExpandAllRows: true,
|
||||||
|
}}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
params,
|
||||||
|
sort,
|
||||||
|
Apis.Customer.CustomerMomentCategories.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
toolBarRender={(action) => [
|
||||||
|
<Create key="Create" reload={action?.reload} title={title} />,
|
||||||
|
]}
|
||||||
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
},
|
||||||
|
MyColumns.UpdatedAt(),
|
||||||
|
MyColumns.CreatedAt(),
|
||||||
|
MyColumns.Option({
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index}>
|
||||||
|
<Update item={item} reload={action?.reload} title={title} />
|
||||||
|
<MyButtons.Delete
|
||||||
|
onConfirm={() =>
|
||||||
|
Apis.Customer.CustomerMomentCategories.Delete({
|
||||||
|
id: item.id,
|
||||||
|
}).then(() => action?.reload())
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</MyPageContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
38
src/pages/moments/classification/modals/Create.tsx
Normal file
38
src/pages/moments/classification/modals/Create.tsx
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
import { MomentSelect } from '@/components/MomentCategories';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
|
import { message } from 'antd';
|
||||||
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
return (
|
||||||
|
<BetaSchemaForm<ApiTypes.Customer.CustomerMomentCategories.Store>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`添加${props.title}`}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
width="500px"
|
||||||
|
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||||
|
onFinish={async (values) =>
|
||||||
|
Apis.Customer.CustomerMomentCategories.Store(values)
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success(props.title + '成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false)
|
||||||
|
}
|
||||||
|
columns={[
|
||||||
|
MomentSelect.MomentCategoriesTree(),
|
||||||
|
{
|
||||||
|
key: 'name',
|
||||||
|
title: '分类名称',
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
51
src/pages/moments/classification/modals/Update.tsx
Normal file
51
src/pages/moments/classification/modals/Update.tsx
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
import { MomentSelect } from '@/components/MomentCategories';
|
||||||
|
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.Customer.CustomerMomentCategories.Update>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`编辑${props.title}`}
|
||||||
|
trigger={<MyButtons.Edit />}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
width="500px"
|
||||||
|
form={form}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open && props.item) {
|
||||||
|
form.setFieldsValue({
|
||||||
|
...props.item,
|
||||||
|
roles_id: props.item?.roles?.map((item: any) => item.value),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onFinish={async (values) =>
|
||||||
|
Apis.Customer.CustomerMomentCategories.Update({
|
||||||
|
...values,
|
||||||
|
id: props.item?.id ?? 0,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success(props.title + '成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false)
|
||||||
|
}
|
||||||
|
columns={[
|
||||||
|
MomentSelect.MomentCategoriesTree(),
|
||||||
|
{
|
||||||
|
key: 'name',
|
||||||
|
title: '分类名称',
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
69
src/pages/moments/list/index.tsx
Normal file
69
src/pages/moments/list/index.tsx
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
import {
|
||||||
|
MyButtons,
|
||||||
|
MyColumns,
|
||||||
|
MyPageContainer,
|
||||||
|
MyProTableProps,
|
||||||
|
usePageTabs,
|
||||||
|
} from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
import Create from './modals/Create';
|
||||||
|
import Update from './modals/Update';
|
||||||
|
|
||||||
|
export default function Index({ title = '推送任务' }) {
|
||||||
|
// 注册当前页面为标签页
|
||||||
|
usePageTabs({
|
||||||
|
tabKey: 'moments-list',
|
||||||
|
tabLabel: title,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MyPageContainer
|
||||||
|
title={title}
|
||||||
|
enableTabs={true}
|
||||||
|
tabKey="moments-list"
|
||||||
|
tabLabel={title}
|
||||||
|
>
|
||||||
|
<ProTable
|
||||||
|
{...MyProTableProps.props}
|
||||||
|
expandable={{
|
||||||
|
defaultExpandAllRows: true,
|
||||||
|
}}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
params,
|
||||||
|
sort,
|
||||||
|
Apis.Customer.CustomerMoments.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
toolBarRender={(action) => [
|
||||||
|
<Create key="Create" reload={action?.reload} title={title} />,
|
||||||
|
]}
|
||||||
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
},
|
||||||
|
MyColumns.UpdatedAt(),
|
||||||
|
MyColumns.CreatedAt(),
|
||||||
|
MyColumns.Option({
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index}>
|
||||||
|
<Update item={item} reload={action?.reload} title={title} />
|
||||||
|
<MyButtons.Delete
|
||||||
|
onConfirm={() =>
|
||||||
|
Apis.Customer.CustomerMomentCategories.Delete({
|
||||||
|
id: item.id,
|
||||||
|
}).then(() => action?.reload())
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</MyPageContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
305
src/pages/moments/list/modals/Create.tsx
Normal file
305
src/pages/moments/list/modals/Create.tsx
Normal file
@ -0,0 +1,305 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyFormItems,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
import { MomentSelect } from '@/components/MomentCategories';
|
||||||
|
import { MyModal } from '@/components/MyModal';
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
|
import MyTransferProject from '@/components/TransferProject';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import {
|
||||||
|
CustomerMomentsChannelEnum,
|
||||||
|
CustomerMomentsContentTypeEnum,
|
||||||
|
CustomerMomentsPushTypeEnum,
|
||||||
|
CustomerMomentsRangeTypeEnum,
|
||||||
|
CustomerMomentsTaskEndTypeEnum,
|
||||||
|
} from '@/gen/Enums';
|
||||||
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
|
import { Button, message, Space, Steps } from 'antd';
|
||||||
|
import { useState } from 'react';
|
||||||
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [current, setCurrent] = useState(0);
|
||||||
|
const [formData, setFormData] = useState<any>({});
|
||||||
|
const steps = [
|
||||||
|
{
|
||||||
|
title: '创建任务',
|
||||||
|
columns: [
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'channel',
|
||||||
|
title: '发送渠道',
|
||||||
|
valueEnum: CustomerMomentsChannelEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
Selects?.Companies({
|
||||||
|
key: 'companies_id',
|
||||||
|
title: '公司',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
MomentSelect.MomentCategoriesSelect({
|
||||||
|
title: '内容分类',
|
||||||
|
formItemProps: { ...rulesHelper.array },
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
valueType: 'group',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
columns: [
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'push_type',
|
||||||
|
title: '推送类型',
|
||||||
|
valueEnum: CustomerMomentsPushTypeEnum,
|
||||||
|
required: true,
|
||||||
|
colProps: { span: 8 },
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
name: ['push_type'],
|
||||||
|
valueType: 'dependency',
|
||||||
|
columns: ({ push_type }: any) => {
|
||||||
|
return push_type === 'ScheduledPush'
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
key: 'scheduled_time',
|
||||||
|
title: '定时发送时间',
|
||||||
|
valueType: 'dateTime',
|
||||||
|
colProps: { span: 10 },
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
valueType: 'group',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
columns: [
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'task_end_type',
|
||||||
|
title: '任务结束类型',
|
||||||
|
valueEnum: CustomerMomentsTaskEndTypeEnum,
|
||||||
|
required: true,
|
||||||
|
colProps: { span: 8 },
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
name: ['task_end_type'],
|
||||||
|
valueType: 'dependency',
|
||||||
|
columns: ({ task_end_type }: any) => {
|
||||||
|
return task_end_type === 'AfterNDays'
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
key: 'task_days',
|
||||||
|
title: '任务结束天数',
|
||||||
|
colProps: { span: 10 },
|
||||||
|
valueType: 'number',
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
fieldProps: {
|
||||||
|
suffix: '天结束',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: task_end_type === 'ScheduledEnd'
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
key: 'task_end_time',
|
||||||
|
title: '定时结束',
|
||||||
|
valueType: 'dateTime',
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
colProps: { span: 10 },
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
MyFormItems.EnumSelect({
|
||||||
|
key: 'range_type',
|
||||||
|
title: '范围类型',
|
||||||
|
valueEnum: CustomerMomentsRangeTypeEnum,
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
|
||||||
|
{
|
||||||
|
name: ['range_type'],
|
||||||
|
valueType: 'dependency',
|
||||||
|
columns: ({ range_type }: any) => {
|
||||||
|
return range_type === 'Project'
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
key: 'range_data',
|
||||||
|
title: '选择范围',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.array },
|
||||||
|
renderFormItem: () => <MyTransferProject />,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建内容',
|
||||||
|
columns: [
|
||||||
|
MyFormItems.EnumRadio({
|
||||||
|
key: 'content_type',
|
||||||
|
title: '内容类型',
|
||||||
|
valueEnum: CustomerMomentsContentTypeEnum,
|
||||||
|
required: true,
|
||||||
|
colProps: { span: 24 },
|
||||||
|
}),
|
||||||
|
|
||||||
|
{
|
||||||
|
key: 'skip_url',
|
||||||
|
title: '链接',
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
colProps: { span: 12 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'title',
|
||||||
|
title: '标题',
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
colProps: { span: 12 },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: ['content_type'],
|
||||||
|
valueType: 'dependency',
|
||||||
|
columns: ({ content_type }: any) => {
|
||||||
|
return content_type === 'MiniProgram'
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
key: 'mini_program_app_id',
|
||||||
|
title: '小程序APPID',
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
colProps: { span: 24 },
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'content',
|
||||||
|
title: '内容',
|
||||||
|
valueType: 'textarea',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'desc',
|
||||||
|
title: '描述',
|
||||||
|
valueType: 'textarea',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
},
|
||||||
|
MyFormItems.UploadImages({
|
||||||
|
key: 'cover_image',
|
||||||
|
title: '封面',
|
||||||
|
max: 1,
|
||||||
|
}),
|
||||||
|
MyFormItems.UploadImages({
|
||||||
|
key: 'attachments',
|
||||||
|
title: '附件',
|
||||||
|
uploadType: 'file',
|
||||||
|
max: 100,
|
||||||
|
colProps: { span: 12 },
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const handleNext = async () => {
|
||||||
|
// 这里可以添加表单验证逻辑
|
||||||
|
if (current < steps.length - 1) {
|
||||||
|
setCurrent(current + 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// 处理上一步
|
||||||
|
const handlePrev = () => {
|
||||||
|
if (current > 0) {
|
||||||
|
setCurrent(current - 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MyModal
|
||||||
|
title={`创建${props.title}`}
|
||||||
|
type="primary"
|
||||||
|
size={'middle'}
|
||||||
|
width="800px"
|
||||||
|
node={
|
||||||
|
<Space direction="vertical">
|
||||||
|
<Steps current={current} items={steps} />
|
||||||
|
<BetaSchemaForm<ApiTypes.Customer.CustomerMomentCategories.Store>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`添加${props.title}`}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
width="800px"
|
||||||
|
layoutType="Form"
|
||||||
|
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||||
|
onFinish={async (values) => {
|
||||||
|
setFormData(values);
|
||||||
|
console.log('提交的数据2:', values);
|
||||||
|
if (current < steps.length - 1) {
|
||||||
|
handleNext();
|
||||||
|
} else {
|
||||||
|
let data = { ...formData, ...values };
|
||||||
|
Apis.Customer.CustomerMoments.Store({
|
||||||
|
...data,
|
||||||
|
one_moment_categories_id: formData?.moment_categories_ids[0],
|
||||||
|
two_moment_categories_id: formData?.moment_categories_ids[1],
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success(props.title + '成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
// onFinish={async (values) =>
|
||||||
|
// Apis.Customer.CustomerMomentCategories.Store(values)
|
||||||
|
// .then(() => {
|
||||||
|
// props.reload?.();
|
||||||
|
// message.success(props.title + '成功');
|
||||||
|
// return true;
|
||||||
|
// })
|
||||||
|
// .catch(() => false)
|
||||||
|
// }
|
||||||
|
columns={steps[current].columns}
|
||||||
|
submitter={{
|
||||||
|
render: (props, dom) => {
|
||||||
|
return (
|
||||||
|
<Space
|
||||||
|
style={{ display: 'flex', justifyContent: 'flex-end' }}
|
||||||
|
>
|
||||||
|
{current > 0 && (
|
||||||
|
<Button onClick={handlePrev}>上一步</Button>
|
||||||
|
)}
|
||||||
|
{current < steps.length - 1 ? (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => props.form?.submit?.()}
|
||||||
|
>
|
||||||
|
下一步
|
||||||
|
</Button>
|
||||||
|
) : (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => props.form?.submit?.()}
|
||||||
|
>
|
||||||
|
提交
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
51
src/pages/moments/list/modals/Update.tsx
Normal file
51
src/pages/moments/list/modals/Update.tsx
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
import { MomentSelect } from '@/components/MomentCategories';
|
||||||
|
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.Customer.CustomerMomentCategories.Update>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`编辑${props.title}`}
|
||||||
|
trigger={<MyButtons.Edit />}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
width="500px"
|
||||||
|
form={form}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open && props.item) {
|
||||||
|
form.setFieldsValue({
|
||||||
|
...props.item,
|
||||||
|
roles_id: props.item?.roles?.map((item: any) => item.value),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onFinish={async (values) =>
|
||||||
|
Apis.Customer.CustomerMomentCategories.Update({
|
||||||
|
...values,
|
||||||
|
id: props.item?.id ?? 0,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success(props.title + '成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false)
|
||||||
|
}
|
||||||
|
columns={[
|
||||||
|
MomentSelect.MomentCategoriesTree(),
|
||||||
|
{
|
||||||
|
key: 'name',
|
||||||
|
title: '分类名称',
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user