Commit de18cd4d authored by Sixiang_Zzb's avatar Sixiang_Zzb

物业费管理模块优化处理以及bug修复

parent 20c8de57
import * as service from '../services/PropertyManagementServices';
import { message } from 'antd';
import { routerRedux } from 'dva/router'
export default {
namespace: 'PropertyManagement',
state: {
Data: '',
CurData:'',
Data: null,
CurData: '',
},
reducers: {
returnData(state, { Data }) {
returnData(state: {}, { Data }: any) {
return { ...state, Data };
},
returnCurData(state, { CurData }) {
returnCurData(state: {}, { CurData }: any) {
return { ...state, CurData };
},
},
effects: {
//获取物业费列表
*get({ playload }, { call, put }) {
console.log(playload)
*get({ playload }: any, { call, put }: any) {
console.log(playload);
const resp = yield call(service.get, playload);
console.log(resp)
let Data = resp.data.rows;
yield put({ type: 'returnData', Data, });
console.log(resp);
let Data = resp.data;
yield put({ type: 'returnData', Data });
},
*getById({ playload }, { call, put }) {
*getById({ playload }: any, { call, put }: any) {
let CurData = playload;
yield put({ type: 'returnCurData', CurData, });
yield put({ type: 'returnCurData', CurData });
},
},
};
......@@ -139,3 +139,15 @@
.box4 {
padding-left: 200px;
}
.time1 {
position: absolute;
top: -60px;
left: 200px;
}
.time2 {
position: absolute;
top: -60px;
left: 285px;
}
......@@ -53,6 +53,8 @@ const ChargeDetail = (props: any) => {
/>
<div className={styles.box2}>
<div className={styles.time1}>uploadTime : </div>
<div className={styles.time2}>01-01-2020</div>
<div className={styles.item21}>Project (community)</div>
<div className={styles.item22}>{CurData.communityName}</div>
<div className={styles.item23}>Street name</div>
......@@ -63,17 +65,19 @@ const ChargeDetail = (props: any) => {
<div className={styles.item26}>{CurData.roomNumber}</div>
<div className={styles.item27}>业主姓名</div>
</div>
{/* <>{stringSplit(CurData.billFileUrl, 'm/cash')}</> */}
{/* <div className={styles.box4}>
<>{stringSplit(CurData.billFileUrl, 'm/cash')}</>
<div className={styles.box4}>
<Pagination simple defaultCurrent={curpage} total={pages * 10} onChange={pageChange} />
</div> */}
</div>
<>
<Tooltip title={scale == 1.3 ? '点击放大查看' : '还原视图'}>
<div className={scale == 1.3 ? styles.box3out : null}>
<div className={scale == 1.3 ? styles.box3 : styles.box3of} onClick={lookup}>
<PDF
key="pdfjs"
file={stringSplit(CurData.billFileUrl, 'm/cash')}
file={
'data:application/pdf;base64,' + stringSplit(CurData.billFileUrl, 'm/cash')
}
workerSrc="//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.228/pdf.worker.js"
scale={scale}
page={curpage}
......
......@@ -8,40 +8,28 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { timestampToTime } from '../../utils/time';
import { values } from 'lodash';
import { filterObj, urlEncode } from '@/utils/method';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
let readyData: object = {
tosOwnerName: '',
communityName: '',
pageNum: 1,
};
const ChargeManager = (props: any) => {
const { formatMessage } = useIntl();
const { dispatch, location, Data } = props;
const get = (values: any) => {
dispatch({ type: 'PropertyManagement/get', playload: values });
};
const getById = (values: any) => {
dispatch({ type: 'PropertyManagement/getById', playload: values });
};
useEffect(() => {
get(null);
}, []);
const nameofowner = formatMessage({ id: 'R.charge.input.nameofowner' });
const inputProject = formatMessage({ id: 'R.charge.input.project' });
const { formatMessage } = useIntl();
const username = formatMessage({ id: 'R.charge.username' });
const project = formatMessage({ id: 'R.charge.project' });
const unit = formatMessage({ id: 'R.charge.unit' });
const status = formatMessage({ id: 'R.charge.status' });
const submissionTime = formatMessage({ id: 'R.charge.submissionTime' });
const actions = formatMessage({ id: 'R.charge.actions' });
const search = formatMessage({ id: 'R.charge.search' });
const addaccount = formatMessage({ id: 'R.charge.addaccount' });
const paymentsetting = formatMessage({ id: 'R.charge.paymentsetting' });
const menuListNormal = ['A', 'Accounting company'];
const [display, setDisplay] = useState('A'); //小组件:线框
const pagination = {
defaultCurrent: 15,
total: 16,
};
const [loading, setLoading] = useState(false);
const goToDetail = (values: any) => {
getById(values);
......@@ -50,6 +38,55 @@ const ChargeManager = (props: any) => {
const goToAddAccout = () => {
history.push(location.pathname + '/AccoutingDetail');
};
const getById = (values: any) => {
dispatch({ type: 'PropertyManagement/getById', playload: values });
};
const get = (values: any) => {
dispatch({ type: 'PropertyManagement/get', playload: values });
};
useEffect(() => {
if (location.query) {
readyData = {
...readyData,
...location.query,
};
setLoading(true);
get({
...readyData,
});
}
}, [location]);
useEffect(() => {
if (Data != null) {
console.log(Data);
setLoading(false);
}
}, [Data]);
const TitleSearchContent = (comment: any) => {
history.push(
location.pathname +
urlEncode(
filterObj({
...comment,
pageNum: 1,
}),
),
);
};
const changePage = (values: any) => {
let tmp = {
...location.query,
pageNum: values.current,
};
history.push(location.pathname + urlEncode(filterObj(tmp)));
};
const columns = [
{ title: username, dataIndex: 'tosOwnerName' },
{ title: project, dataIndex: 'communityName' },
......@@ -69,20 +106,25 @@ const ChargeManager = (props: any) => {
),
},
];
const TitleSearchContent = (comment: any) => {
console.log(comment);
const pagination = {
defaultPageSize: 15,
total: Data && Data.page.totalRow,
showSizeChanger: false,
};
return (
<div className={styles.base}>
<TitleSearch
listkey={['tosOwnerName', 'communityName']}
list={['tosOwnerName', 'communityName']}
onSubmit={TitleSearchContent}
defaultValue={{ ...readyData }}
/>
{/* 内容组件 */}
<div className={styles.box2}>
{menuListNormal.map((item, index) => {
{/* {menuListNormal.map((item, index) => {
return (
<button
key={'bt' + index}
......@@ -94,20 +136,22 @@ const ChargeManager = (props: any) => {
{item}
</button>
);
})}
<button className={styles.buttonAdd2} onClick={goToAddAccout}>
})} */}
<button className={styles.buttonAdd} onClick={goToAddAccout}>
+ {addaccount}{' '}
</button>
<button className={styles.buttonAdd}>{paymentsetting}</button>
{/* <button className={styles.buttonAdd}>{paymentsetting}</button> */}
</div>
{/* 列表组件 */}
<Table
style={{ marginTop: 16 }}
rowKey={'id'}
dataSource={Data}
loading={loading}
dataSource={Data != null ? Data.list : []}
columns={columns}
pagination={pagination}
onChange={changePage}
/>
</div>
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment