Commit 86dffb07 authored by Sixiang_Zzb's avatar Sixiang_Zzb

住户卡模块 详情页面bug修改

parent a2131b8a
File deleted
...@@ -8,23 +8,27 @@ const TitleBack = (props: any) => { ...@@ -8,23 +8,27 @@ const TitleBack = (props: any) => {
// <TitleBack sublist={['Handle Status : '+CurDataDetail.status,'Create Time : '+CurDataDetail.time]} title={headTitle} /> // <TitleBack sublist={['Handle Status : '+CurDataDetail.status,'Create Time : '+CurDataDetail.time]} title={headTitle} />
const backData = (values: any) => { const backData = (values: any) => {
props.titleBack(values) props.titleBack(values);
} };
return ( return (
<> <>
<div className={styles.item0}><TitleGet title={props.title} /></div> <div className={styles.item0}>
{ <TitleGet title={props.title} />
props.sublist != null && props.title == "Edit Owner Infomation" </div>
? {props.sublist != null ? (
(props.sublist).map((item: any, index: any) => { props.sublist.map((item: any, index: any) => {
return ( return (
<div key={index} className={styles.item1}>{item}</div> <div key={index} className={styles.item1}>
) {item}
</div>
);
}) })
: ) : (
<></> <></>
} )}
<div className={styles.item2}><BackButton backFunction={backData} url={props.url} /></div> <div className={styles.item2}>
<BackButton backFunction={backData} url={props.url} />
</div>
<div className={styles.clear0}></div> <div className={styles.clear0}></div>
</> </>
); );
......
...@@ -18,7 +18,6 @@ let readyData: any = { ...@@ -18,7 +18,6 @@ let readyData: any = {
handleStatus: '', handleStatus: '',
pageNum: 1, pageNum: 1,
}; };
const module = 'CommunityService'; const module = 'CommunityService';
const Card = (props: any) => { const Card = (props: any) => {
const { dispatch, Data7, location } = props; const { dispatch, Data7, location } = props;
...@@ -68,11 +67,11 @@ const Card = (props: any) => { ...@@ -68,11 +67,11 @@ const Card = (props: any) => {
useEffect(() => { useEffect(() => {
//前置数据 //前置数据
console.log('前置数据');
readyData = { readyData = {
pageNum: 1,
...location.query, ...location.query,
pageNum: location.query.pageNum ? parseInt(location.query.pageNum) : 1,
}; };
//获取数据 //获取数据
setLoading(true); setLoading(true);
RA( RA(
...@@ -101,6 +100,9 @@ const Card = (props: any) => { ...@@ -101,6 +100,9 @@ const Card = (props: any) => {
//页面搜索 //页面搜索
const ClickTitleSearch = (comment: any) => { const ClickTitleSearch = (comment: any) => {
if (comment.handleStatus instanceof Array) {
comment.handleStatus = comment.handleStatus[0];
}
let tmp = filterObjbyTg(comment, ['handleStatus', 'ownerName', 'communityName']); let tmp = filterObjbyTg(comment, ['handleStatus', 'ownerName', 'communityName']);
tmp['pageNum'] = 1; tmp['pageNum'] = 1;
history.push(location.pathname + urlEncode(tmp)); history.push(location.pathname + urlEncode(tmp));
...@@ -147,6 +149,7 @@ const Card = (props: any) => { ...@@ -147,6 +149,7 @@ const Card = (props: any) => {
dataSource={Data7.data.list} dataSource={Data7.data.list}
columns={columns} columns={columns}
pagination={{ pagination={{
defaultCurrent: readyData.pageNum,
defaultPageSize: 15, defaultPageSize: 15,
total: Data7.data.page.totalRow, total: Data7.data.page.totalRow,
showSizeChanger: false, showSizeChanger: false,
......
...@@ -8,21 +8,32 @@ import { RA, getCookie } from '@/utils/method'; ...@@ -8,21 +8,32 @@ import { RA, getCookie } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack'; import TitleBack from '@/components/TitleBack/TitleBack';
import Line from '@/components/Line/Line'; import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea'; import TextArea from 'antd/lib/input/TextArea';
import * as moment from 'moment';
const module = 'CommunityService'; const module = 'CommunityService';
// const apply_status = [[0, "审核中"], [1, "批准"], [2, "拒绝"], [3, "领取"]]
const apply_status = [
[0, 'Under review'],
[1, 'Approval'],
[2, 'Reject'],
[3, 'Claim'],
];
const apply_relation_owner = ['Oneself', 'Family Members', 'Tenant '];
const CardDetail = (props: any) => { const CardDetail = (props: any) => {
const { dispatch, Data, DataSave, DataSaveDetail } = props; const { dispatch, Data, DataSave, DataSaveDetail } = props;
const formRef = useRef(null); const formRef = useRef(null);
useEffect(() => { // useEffect(() => {
if (DataSaveDetail != null) { // if (DataSaveDetail != null) {
console.log(DataSaveDetail); // console.log(DataSaveDetail);
} // }
}, [DataSaveDetail]); // }, [DataSaveDetail]);
useEffect(() => { useEffect(() => {
if (DataSave != null) { if (DataSave != null) {
console.log('初始化页面参数');
console.log(DataSave);
RA(36, { id: DataSave.id }, module, dispatch); RA(36, { id: DataSave.id }, module, dispatch);
} else { } else {
history.go(-1); history.go(-1);
...@@ -30,15 +41,17 @@ const CardDetail = (props: any) => { ...@@ -30,15 +41,17 @@ const CardDetail = (props: any) => {
}, []); }, []);
const onFinish = (values: any) => { const onFinish = (values: any) => {
var tmp = { let tmp = {
communityId: DataSave.communityId, communityId: DataSave.communityId,
id: DataSave.id, id: DataSave.id,
ownerId: DataSave.ownerId, ownerId: DataSave.ownerId,
applyStatus: values.applyStatus, applyStatus: values.applyStatus,
replyContent: values.replyContent, replyContent:
DataSave.apply_status !== 0 && values.applyStatus === '3'
? DataSave.reply_content
: values.replyContent,
type: '7', type: '7',
}; };
console.log(tmp);
RA(34, tmp, module, dispatch); RA(34, tmp, module, dispatch);
message.success('Success Operation!'); message.success('Success Operation!');
history.push('/CommercialService/AccessCardApplication'); history.push('/CommercialService/AccessCardApplication');
...@@ -48,7 +61,13 @@ const CardDetail = (props: any) => { ...@@ -48,7 +61,13 @@ const CardDetail = (props: any) => {
<div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}> <div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
{DataSave != null ? ( {DataSave != null ? (
<> <>
<TitleBack sublist={['Status : ' + '1', 'Time : ' + '12']} title="Apply Card"></TitleBack> <TitleBack
sublist={[
'Status : ' + apply_status[DataSave.apply_status][1],
'Time : ' + moment(DataSave.create_time.time).format('DD-MM-YYYY'),
]}
title="Apply Card"
></TitleBack>
<Row gutter={8}> <Row gutter={8}>
<Col>Community:</Col> <Col>Community:</Col>
<Col span={3}>{DataSave.community_name}</Col> <Col span={3}>{DataSave.community_name}</Col>
...@@ -61,7 +80,8 @@ const CardDetail = (props: any) => { ...@@ -61,7 +80,8 @@ const CardDetail = (props: any) => {
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col>Address:</Col> <Col>Address:</Col>
<Col> <Col>
{DataSave.build_number}#{DataSave.floor_number}-{DataSave.room_number} {DataSave.zip_address} {DataSave.build_number}#{DataSave.floor_number}-
{DataSave.room_number} {DataSave.zip_code}
</Col> </Col>
</Row> </Row>
...@@ -80,7 +100,7 @@ const CardDetail = (props: any) => { ...@@ -80,7 +100,7 @@ const CardDetail = (props: any) => {
</Row> </Row>
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Relationship:</Col> <Col span={3}>Relationship:</Col>
<Col>{DataSave.apply_relation_owner}</Col> <Col>{apply_relation_owner[parseInt(DataSave.apply_relation_owner)]}</Col>
</Row> </Row>
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reason:</Col> <Col span={3}>Reason:</Col>
...@@ -94,11 +114,15 @@ const CardDetail = (props: any) => { ...@@ -94,11 +114,15 @@ const CardDetail = (props: any) => {
</Row> </Row>
<Line></Line> <Line></Line>
{DataSave.apply_status === 0 ? (
<Form ref={formRef} name="basic" onFinish={onFinish}> <Form ref={formRef} name="basic" onFinish={onFinish}>
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Examine:</Col> <Col span={3}>Examine:</Col>
<Col span={4}> <Col span={4}>
<Form.Item name="applyStatus"> <Form.Item
name="applyStatus"
rules={[{ required: true, message: 'Please select the reply result!' }]}
>
<Radio.Group> <Radio.Group>
<Radio.Button value={'1'}>Agree</Radio.Button> <Radio.Button value={'1'}>Agree</Radio.Button>
<Radio.Button style={{ marginLeft: 10 }} value={'2'}> <Radio.Button style={{ marginLeft: 10 }} value={'2'}>
...@@ -112,7 +136,6 @@ const CardDetail = (props: any) => { ...@@ -112,7 +136,6 @@ const CardDetail = (props: any) => {
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reply:</Col> <Col span={3}>Reply:</Col>
<Col> <Col>
{' '}
<Form.Item name="replyContent"> <Form.Item name="replyContent">
<TextArea style={{ width: 300, height: 100, padding: 8 }}></TextArea> <TextArea style={{ width: 300, height: 100, padding: 8 }}></TextArea>
</Form.Item> </Form.Item>
...@@ -135,6 +158,61 @@ const CardDetail = (props: any) => { ...@@ -135,6 +158,61 @@ const CardDetail = (props: any) => {
</Button> </Button>
</Form.Item> </Form.Item>
</Form> </Form>
) : (
<>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Examine:</Col>
<Col span={4}>
<Radio.Group value={DataSave.apply_status === 2 ? '2' : '1'}>
<Radio.Button value={'1'}>Agree</Radio.Button>
<Radio.Button style={{ marginLeft: 10 }} value={'2'}>
Refuse
</Radio.Button>
</Radio.Group>
</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reply:</Col>
<Col>
<TextArea
disabled
value={DataSave.reply_content}
style={{ width: 300, height: 100, padding: 8 }}
></TextArea>
</Col>
</Row>
{DataSave.apply_status === 1 ? (
<Form ref={formRef} name="basic" onFinish={onFinish}>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Received:</Col>
<Col span={4}>
<Form.Item name="applyStatus">
<Radio.Group>
<Radio value={'3'}>Agree</Radio>
</Radio.Group>
</Form.Item>
</Col>
</Row>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Form>
) : (
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Received:</Col>
<Col span={4}>
<Radio.Group value={DataSave.apply_status === 3 ? '3' : ''}>
<Radio value={'3'}>Agree</Radio>
</Radio.Group>
</Col>
</Row>
)}
</>
)}
</> </>
) : null} ) : null}
</div> </div>
......
...@@ -161,7 +161,7 @@ const PropertyServices = (props: any) => { ...@@ -161,7 +161,7 @@ const PropertyServices = (props: any) => {
dataSource={Data != null ? Data.data.rows : []} dataSource={Data != null ? Data.data.rows : []}
pagination={{ pagination={{
defaultPageSize: 15, defaultPageSize: 15,
current: pageNum, defaultCurrent: pageNum,
total: Data != null ? Data.data.page.totalRow : 0, total: Data != null ? Data.data.page.totalRow : 0,
showSizeChanger: false, showSizeChanger: false,
}} }}
......
...@@ -24,7 +24,6 @@ const RenovationDetail = (props: any) => { ...@@ -24,7 +24,6 @@ const RenovationDetail = (props: any) => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
useEffect(() => { useEffect(() => {
console.log('初始化页面参数');
if (location.query.id) { if (location.query.id) {
setLoading(true); setLoading(true);
RA(37, { id: location.query.id }, module, dispatch); RA(37, { id: location.query.id }, module, dispatch);
...@@ -36,12 +35,21 @@ const RenovationDetail = (props: any) => { ...@@ -36,12 +35,21 @@ const RenovationDetail = (props: any) => {
useEffect(() => { useEffect(() => {
if (DataSaveDetail) { if (DataSaveDetail) {
setLoading(false); setLoading(false);
DataSave = DataSaveDetail.data.rows.list[0]; DataSave = {
...DataSaveDetail.data.rows.list[0],
ownerAddress:
DataSaveDetail.data.rows.onwerDetail.addressAndpostalCode +
' ' +
DataSaveDetail.data.rows.onwerDetail.buildingNumber +
'#' +
DataSaveDetail.data.rows.onwerDetail.floorNumber +
'-' +
DataSaveDetail.data.rows.onwerDetail.roomNumber,
};
} }
}, [DataSaveDetail]); }, [DataSaveDetail]);
const onFinish = (values: any) => { const onFinish = (values: any) => {
console.log(values);
if ( if (
values.decorationStatus === '2' && values.decorationStatus === '2' &&
(values.replyView == undefined || values.replyView.trim() === '') (values.replyView == undefined || values.replyView.trim() === '')
...@@ -60,7 +68,6 @@ const RenovationDetail = (props: any) => { ...@@ -60,7 +68,6 @@ const RenovationDetail = (props: any) => {
replyView: values.replyView, replyView: values.replyView,
type: '6', type: '6',
}; };
// console.log(tmp)
RA(33, tmp, module, dispatch); RA(33, tmp, module, dispatch);
message.success('Success Operation!'); message.success('Success Operation!');
...@@ -92,15 +99,7 @@ const RenovationDetail = (props: any) => { ...@@ -92,15 +99,7 @@ const RenovationDetail = (props: any) => {
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col>Address:</Col> <Col>Address:</Col>
<Col> <Col>{DataSave.ownerAddress}</Col>
{DataSaveDetail.data.rows.onwerDetail.addressAndpostalCode +
' ' +
DataSaveDetail.data.rows.onwerDetail.buildingNumber +
'#' +
DataSaveDetail.data.rows.onwerDetail.floorNumber +
'-' +
DataSaveDetail.data.rows.onwerDetail.roomNumber}
</Col>
</Row> </Row>
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
...@@ -211,7 +210,7 @@ const RenovationDetail = (props: any) => { ...@@ -211,7 +210,7 @@ const RenovationDetail = (props: any) => {
}; };
function map(state: any) { function map(state: any) {
const { DataSave, DataSaveDetail } = state[module]; const { DataSaveDetail } = state[module];
return { DataSave, DataSaveDetail }; return { DataSaveDetail };
} }
export default connect(map)(RenovationDetail); export default connect(map)(RenovationDetail);
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