Commit 5d8f3353 authored by cellee's avatar cellee

Signed-off-by: cellee <893264950@qq.com>

parents 8d09683c 86dffb07
File deleted
......@@ -18,7 +18,6 @@ let readyData: any = {
handleStatus: '',
pageNum: 1,
};
const module = 'CommunityService';
const Card = (props: any) => {
const { dispatch, Data7, location } = props;
......@@ -68,11 +67,11 @@ const Card = (props: any) => {
useEffect(() => {
//前置数据
console.log('前置数据');
readyData = {
pageNum: 1,
...location.query,
pageNum: location.query.pageNum ? parseInt(location.query.pageNum) : 1,
};
//获取数据
setLoading(true);
RA(
......@@ -101,6 +100,9 @@ const Card = (props: any) => {
//页面搜索
const ClickTitleSearch = (comment: any) => {
if (comment.handleStatus instanceof Array) {
comment.handleStatus = comment.handleStatus[0];
}
let tmp = filterObjbyTg(comment, ['handleStatus', 'ownerName', 'communityName']);
tmp['pageNum'] = 1;
history.push(location.pathname + urlEncode(tmp));
......@@ -147,6 +149,7 @@ const Card = (props: any) => {
dataSource={Data7.data.list}
columns={columns}
pagination={{
defaultCurrent: readyData.pageNum,
defaultPageSize: 15,
total: Data7.data.page.totalRow,
showSizeChanger: false,
......
......@@ -8,21 +8,32 @@ import { RA, getCookie } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea';
import * as moment from 'moment';
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 { dispatch, Data, DataSave, DataSaveDetail } = props;
const formRef = useRef(null);
useEffect(() => {
if (DataSaveDetail != null) {
console.log(DataSaveDetail);
}
}, [DataSaveDetail]);
// useEffect(() => {
// if (DataSaveDetail != null) {
// console.log(DataSaveDetail);
// }
// }, [DataSaveDetail]);
useEffect(() => {
if (DataSave != null) {
console.log('初始化页面参数');
console.log(DataSave);
RA(36, { id: DataSave.id }, module, dispatch);
} else {
history.go(-1);
......@@ -30,15 +41,17 @@ const CardDetail = (props: any) => {
}, []);
const onFinish = (values: any) => {
var tmp = {
let tmp = {
communityId: DataSave.communityId,
id: DataSave.id,
ownerId: DataSave.ownerId,
applyStatus: values.applyStatus,
replyContent: values.replyContent,
replyContent:
DataSave.apply_status !== 0 && values.applyStatus === '3'
? DataSave.reply_content
: values.replyContent,
type: '7',
};
console.log(tmp);
RA(34, tmp, module, dispatch);
message.success('Success Operation!');
history.push('/CommercialService/AccessCardApplication');
......@@ -48,7 +61,13 @@ const CardDetail = (props: any) => {
<div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
{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}>
<Col>Community:</Col>
<Col span={3}>{DataSave.community_name}</Col>
......@@ -61,7 +80,8 @@ const CardDetail = (props: any) => {
<Row gutter={8} style={{ marginTop: 16 }}>
<Col>Address:</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>
</Row>
......@@ -80,7 +100,7 @@ const CardDetail = (props: any) => {
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Relationship:</Col>
<Col>{DataSave.apply_relation_owner}</Col>
<Col>{apply_relation_owner[parseInt(DataSave.apply_relation_owner)]}</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reason:</Col>
......@@ -94,11 +114,15 @@ const CardDetail = (props: any) => {
</Row>
<Line></Line>
{DataSave.apply_status === 0 ? (
<Form ref={formRef} name="basic" onFinish={onFinish}>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Examine:</Col>
<Col span={4}>
<Form.Item name="applyStatus">
<Form.Item
name="applyStatus"
rules={[{ required: true, message: 'Please select the reply result!' }]}
>
<Radio.Group>
<Radio.Button value={'1'}>Agree</Radio.Button>
<Radio.Button style={{ marginLeft: 10 }} value={'2'}>
......@@ -112,7 +136,6 @@ const CardDetail = (props: any) => {
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reply:</Col>
<Col>
{' '}
<Form.Item name="replyContent">
<TextArea style={{ width: 300, height: 100, padding: 8 }}></TextArea>
</Form.Item>
......@@ -135,6 +158,61 @@ const CardDetail = (props: any) => {
</Button>
</Form.Item>
</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}
</div>
......
......@@ -161,7 +161,7 @@ const PropertyServices = (props: any) => {
dataSource={Data != null ? Data.data.rows : []}
pagination={{
defaultPageSize: 15,
current: pageNum,
defaultCurrent: pageNum,
total: Data != null ? Data.data.page.totalRow : 0,
showSizeChanger: false,
}}
......
......@@ -24,7 +24,6 @@ const RenovationDetail = (props: any) => {
const [loading, setLoading] = useState(false);
useEffect(() => {
console.log('初始化页面参数');
if (location.query.id) {
setLoading(true);
RA(37, { id: location.query.id }, module, dispatch);
......@@ -36,12 +35,21 @@ const RenovationDetail = (props: any) => {
useEffect(() => {
if (DataSaveDetail) {
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]);
const onFinish = (values: any) => {
console.log(values);
if (
values.decorationStatus === '2' &&
(values.replyView == undefined || values.replyView.trim() === '')
......@@ -60,7 +68,6 @@ const RenovationDetail = (props: any) => {
replyView: values.replyView,
type: '6',
};
// console.log(tmp)
RA(33, tmp, module, dispatch);
message.success('Success Operation!');
......@@ -92,15 +99,7 @@ const RenovationDetail = (props: any) => {
<Row gutter={8} style={{ marginTop: 16 }}>
<Col>Address:</Col>
<Col>
{DataSaveDetail.data.rows.onwerDetail.addressAndpostalCode +
' ' +
DataSaveDetail.data.rows.onwerDetail.buildingNumber +
'#' +
DataSaveDetail.data.rows.onwerDetail.floorNumber +
'-' +
DataSaveDetail.data.rows.onwerDetail.roomNumber}
</Col>
<Col>{DataSave.ownerAddress}</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
......@@ -211,7 +210,7 @@ const RenovationDetail = (props: any) => {
};
function map(state: any) {
const { DataSave, DataSaveDetail } = state[module];
return { DataSave, DataSaveDetail };
const { DataSaveDetail } = state[module];
return { DataSaveDetail };
}
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