Commit 78b644a4 authored by maple's avatar maple

[new]物业费详情接口

parent 259fd4a3
......@@ -8,7 +8,18 @@ const TitleBack = (props:any) => {
return (
<>
<div className={styles.item0}><TitleGet title={props.title}/></div>
<div className={styles.item0}><TitleGet title={props.title} /></div>
{
props.sublist!=null
?
(props.sublist).map( (item:any)=>{
return (
<div className={styles.item1}>{item}</div>
)
})
:
<></>
}
<div className={styles.item2}><BackButton/></div>
<div className={styles.clear0}></div>
</>
......
......@@ -3,7 +3,11 @@
float: left;
}
.item1{
float: left;
margin-left: 16px;
line-height: 34px;
}
.item2{
float: right;
}
......
......@@ -7,12 +7,16 @@ export default {
namespace: 'PropertyManagement',
state: {
Data: '',
CurData:'',
},
reducers: {
returnData(state, { Data }) {
return { ...state, Data };
},
returnCurData(state, { CurData }) {
return { ...state, CurData };
},
},
effects: {
......@@ -25,6 +29,10 @@ export default {
let Data = resp.data.rows;
yield put({ type: 'returnData', Data, });
},
*getById({ playload }, { call, put }) {
let CurData = playload;
yield put({ type: 'returnCurData', CurData, });
},
},
......
......@@ -6,6 +6,7 @@
background-color: #ffffff;
padding: 34px;
min-width: 1020px;
overflow-x:auto
}
//边栏1
.box{
......
......@@ -10,7 +10,14 @@ import { render } from 'react-dom';
import { Document } from 'react-pdf/dist/entry.webpack';
const ChargeDetail = () => {
import { stringSplit } from '../../utils/string';
import { timestampToTime2 } from '../../utils/time';
import TitleBack from '../../components/TitleBack/TitleBack';
const ChargeDetail = (props: any) => {
const { CurData } = props;
const { formatMessage } = useIntl();
......@@ -42,21 +49,17 @@ const ChargeDetail = () => {
return (
<div className={styles.base}>
{/* 组件 */}
<div className={styles.box}>
<div className={styles.item1}>Payment Settings</div>
<div className={styles.item2}>Upload Time 2020/7/14/18:09:00</div>
<button className={styles.item3} onClick={goToReturn}>返回</button>
</div>
<TitleBack title="Payment Settings" sublist={['Upload Time '+timestampToTime2(CurData.updateTime.time)]}/>
<div className={styles.box2}>
<div className={styles.item21}>Project</div>
<div className={styles.item22}>Project Name</div>
<div className={styles.item23}>Building No</div>
<div className={styles.item22}>{CurData.billName}</div>
<div className={styles.item23}>{CurData.communityName}</div>
<div className={styles.item234}>#</div>
<div className={styles.item24}>Floor</div>
<div className={styles.item24}>{CurData.floorNumber}</div>
<div className={styles.item245}>——</div>
<div className={styles.item25}>Room Number</div>
<div className={styles.item26}>Owner's Name</div>
<div className={styles.item25}>{CurData.roomNumber}</div>
<div className={styles.item26}>{CurData.tosOwnerName}</div>
</div>
<div className={styles.box4}>
<Pagination simple defaultCurrent={curpage} total={pages*10} onChange={pageChange} />
......@@ -66,7 +69,7 @@ const ChargeDetail = () => {
<><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="/cash/tos-manager/bill/B1-21-1002.pdf?Expires=1911893716&OSSAccessKeyId=LTAI4FxB6SgPMtnJ7UpcATA6&Signature=c72T%2B6BrcHcqXeXdMY%2BuBNZmgCw%3D" workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.228/pdf.worker.js" scale={scale} page={curpage} onDocumentComplete={pdfpages} />
<PDF key="pdfjs" file={stringSplit(CurData.billFileUrl,"m/cash")} workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.228/pdf.worker.js" scale={scale} page={curpage} onDocumentComplete={pdfpages} />
</div>
</div>
</Tooltip></>
......@@ -77,5 +80,10 @@ const ChargeDetail = () => {
);
};
export default ChargeDetail;
function mapStateToProps(state:any) {
const { CurData } = state.PropertyManagement;
return {
CurData
};
}
export default connect(mapStateToProps)(ChargeDetail);
......@@ -5,20 +5,16 @@ import { Input ,Menu,Table,Space} from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
const dataSource = [
{
key: '1',
name: '胡彦斌',
age: 32,
address: '西湖区湖底公园1号',
},
];
import { timestampToTime } from '../../utils/time';
import { values } from 'lodash';
const ChargeManager = (props:any) => {
const { formatMessage } = useIntl();
const { dispatch, location, Data } = props;
const get = (values:any) => {dispatch({type: 'PropertyManagement/get',playload:values})};
const get = (values: any) => { dispatch({ type: 'PropertyManagement/get', playload: values }) };
const getById = (values:any) => {dispatch({type: 'PropertyManagement/getById',playload:values})};
useEffect(() => {
get(null)
}, []);
......@@ -41,8 +37,9 @@ const ChargeManager = (props:any) => {
const pagination={defaultCurrent:1,total: 16}
const goToDetail = () => {
history.push('/PropertyManagementDetail?id=123')
const goToDetail = (values:any) => {
getById(values)
history.push('/PropertyManagementDetail?')
}
const goToAddAccout = () => {
history.push(location.pathname+'/AccoutingDetail')
......@@ -52,11 +49,18 @@ const ChargeManager = (props:any) => {
{ title: project,dataIndex: 'communityName'},
{ title: unit,dataIndex: 'buildingNumber'},
{ title: status,dataIndex: 'enable'},
{ title: submissionTime,dataIndex: 'updateTime'},
{
title: submissionTime,
render: (text: any, record: any) => (
<Space size="middle">
{timestampToTime(record.createTime.time)}
</Space>
),
},
{ title: actions,
render: (text: any, record: any) => (
<Space size="middle">
<a onClick={goToDetail}>Detail</a>
<a onClick={goToDetail.bind(this,record)}>Detail</a>
</Space>
),
},
......
......@@ -8,6 +8,8 @@ import Line from '../../../components/Line/Line';
import BackButton from '../../../components/BackButton/BackButton';
import TitleGet from '../../../components/TitleGet/TitleGet';
import { timestampToTime } from '../../../utils/time';
const Guard = (props:any) => {
const {CurDataFollowDetail} = props;
......@@ -18,7 +20,7 @@ const Guard = (props:any) => {
<div className={styles.item0}><TitleGet title={"Edit Security Guard Account"}/></div>
<div className={styles.item0_1}>Status:Normal</div>
<div className={styles.item0_1}>Registration Date:23-03-2020</div>
<div className={styles.item0_1}>Registration Date:{timestampToTime(CurDataFollowDetail.createTime.time)}</div>
<div className={styles.item2}><BackButton/></div>
<div className={styles.clear0}></div>
......
export const stringSplit=(string:any,rex:any)=>{
var index=string.lastIndexOf(rex);
string=string.substring(index+1,string.length);
return string;
}
\ No newline at end of file
export const timestampToTime=(timestamp:any)=>{
var date = new Date(timestamp);//*1000//getHours getMinutes getSeconds
return date.getDate() + '-'+ (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-'+date.getFullYear();
}
//2020/7/14/18:09:00
export const timestampToTime2=(timestamp:any)=>{
var date = new Date(timestamp);//*1000//getHours getMinutes getSeconds
return date.getFullYear()+'/' + (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + ' '+date.getDate()+' '+date.getHours()+':'+date.getMinutes()+':'+date.getSeconds()
}
\ No newline at end of file
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