Commit de18cd4d authored by Sixiang_Zzb's avatar Sixiang_Zzb

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

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