Compare commits

..

No commits in common. "b66917f99929fcc80167f2d413d1f05c18f07813" and "50ef72bc802fd17a4a5ec7ef77f0fee4de6666bb" have entirely different histories.

4 changed files with 32 additions and 46 deletions

View File

@ -18,8 +18,8 @@ export default defineConfig({
proxy: { proxy: {
'/api/': { '/api/': {
target: 'http://10.39.13.78:8001/', target: 'http://10.39.13.78:8001/',
// target: 'https://test-admin.linyikj.com.cn/', // target: 'https://gcadmin-test.linyikj.com.cn',
// target: 'https://admin.linyikj.com.cn/', // target: 'http://guocaiservice.com',
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^': '' }, pathRewrite: { '^': '' },
}, },

View File

@ -578,6 +578,7 @@ declare namespace ApiTypes {
"year"?: number; // 账单年份 "year"?: number; // 账单年份
"month"?: number; // 账单月份 "month"?: number; // 账单月份
"type"?: string; // 账单类型,[enum:HouseBillsTypeEnum] "type"?: string; // 账单类型,[enum:HouseBillsTypeEnum]
"has_refunding"?: boolean; // 是否有退款中:false-无,true-有
}; };
type SummaryBillList = { type SummaryBillList = {
"project_name"?: string; // 模糊搜索:项目名称 "project_name"?: string; // 模糊搜索:项目名称
@ -1069,7 +1070,7 @@ declare namespace ApiTypes {
type Select = { type Select = {
"name"?: string; // 模糊搜索:名称 "name"?: string; // 模糊搜索:名称
"project_name"?: string; // 模糊搜索:项目名称 "project_name"?: string; // 模糊搜索:项目名称
"charge_type"?: string[]; // 收费类型,[enum:HouseBillsTypeEnum] "charge_type"?: string; // 收费类型,[enum:HouseBillsTypeEnum]
"asset_projects_id"?: number; // 项目id,[ref:asset_projects] "asset_projects_id"?: number; // 项目id,[ref:asset_projects]
}; };
} }

View File

@ -560,7 +560,7 @@ export const BillsStatusEnum = {
export const CacheTypeEnum = { export const CacheTypeEnum = {
MobilePhoneVerificationCode: { MobilePhoneVerificationCode: {
text: '手机验证码', text: '手机验证码',
color: '#4ef9dd', color: '#d518aa',
value: 'MobilePhoneVerificationCode', value: 'MobilePhoneVerificationCode',
}, },
}; };

View File

@ -4,7 +4,7 @@ import { Apis } from '@/gen/Apis';
import { HomeFilled } from '@ant-design/icons'; import { HomeFilled } from '@ant-design/icons';
import { ProCard } from '@ant-design/pro-components'; import { ProCard } from '@ant-design/pro-components';
import { useNavigate } from '@umijs/max'; import { useNavigate } from '@umijs/max';
import { Empty, Space, Tabs, Tag } from 'antd'; import { Empty, Space, Tag } from 'antd';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import SearchInfo from './components/SearchInfo'; import SearchInfo from './components/SearchInfo';
@ -12,46 +12,42 @@ export default function Index({ title = '房屋账单' }) {
const navigate = useNavigate(); const navigate = useNavigate();
// const [selectedBuilding, setSelectedBuilding] = // const [selectedBuilding, setSelectedBuilding] =
// useState<SelectedBuilding | null>(null); // useState<SelectedBuilding | null>(null);
const [items, setItems] = useState<any>([
{
key: '1',
label: '全部房屋',
},
]);
const [params, setParams] = useState<any>({ page: 1 }); const [params, setParams] = useState<any>({ page: 1 });
const [getSummaryBillListData, setGetSummaryBillListData] = useState<any>({}); const [getSummaryBillListData, setGetSummaryBillListData] = useState<any>({});
const setPageStatistics = (res: any) => {
setItems([
{
key: '1',
label: '全部房屋',
},
{
key: '2',
label: `清欠房屋数(${res?.['清欠房屋数']})`,
},
{
key: '3',
label: `欠费房屋数(${res?.['欠费房屋数']})`,
},
]);
};
const getSummaryBillList = (data: any) => { const getSummaryBillList = (data: any) => {
Apis.Bill.HouseBills.SummaryBillList({ ...params, ...data }).then( Apis.Bill.HouseBills.SummaryBillList({ ...params, ...data }).then((res) => {
(res: any) => { setParams({ ...params, ...data });
setParams({ ...params, ...data }); setGetSummaryBillListData(res);
setPageStatistics(res?.statistics || {}); });
setGetSummaryBillListData(res);
},
);
}; };
useEffect(() => { useEffect(() => {
getSummaryBillList({ page: 1 }); getSummaryBillList({ page: 1 });
}, []); }, []);
// 选择楼栋的回调函数
// const handleBuildingSelect = useCallback((building: SelectedBuilding) => {
// setSelectedBuilding(building);
// // 保存到本地缓存
// localStorage.setItem('selectedBuilding', JSON.stringify(building));
// }, []);
// 从本地缓存恢复选中的楼栋信息
// useEffect(() => {
// const cachedBuilding = localStorage.getItem('selectedBuilding');
// if (cachedBuilding) {
// try {
// const building = JSON.parse(cachedBuilding) as SelectedBuilding;
// setSelectedBuilding(building);
// // 恢复后重新获取账单列表
// getSummaryBillList(building);
// } catch (error) {
// console.error('Failed to parse cached building:', error);
// }
// }
// }, []);
return ( return (
<MyPageContainer <MyPageContainer
title={title} title={title}
@ -81,17 +77,6 @@ export default function Index({ title = '房屋账单' }) {
}} }}
/> />
<ProCard> <ProCard>
<Tabs
defaultActiveKey="1"
items={items}
onChange={(e) => {
console.log(e);
getSummaryBillList({
page: 1,
has_overdue: e === '3' ? true : e === '2' ? false : undefined,
});
}}
/>
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 15 }}> <div style={{ display: 'flex', flexWrap: 'wrap', gap: 15 }}>
{getSummaryBillListData?.data?.length ? null : ( {getSummaryBillListData?.data?.length ? null : (
<div <div