Commit 29a1e0af authored by Sixiang_Zzb's avatar Sixiang_Zzb

装修申请和住户卡详情请求修改

parent 29994541
......@@ -148,7 +148,7 @@ const TitleSearch = (props: any) => {
<Select style={{ width: 160 }} placeholder={item.name[1]} allowClear={true}>
{item.data.map((word) => {
return (
<Option key={index} value={word[0]}>
<Option key={word[0]} value={word[0]}>
{word[1]}
</Option>
);
......
......@@ -161,14 +161,15 @@ export default {
yield put({ type: 'returnResult', Result });
},
async DataSaveDetailClear({}, { put }: any) {
*DataSaveDetailClear({}, { put }: any) {
console.log('清楚数据');
let DataSaveDetail = null;
await put({ type: 'returnDataSaveDetail', DataSaveDetail });
yield put({ type: 'returnDataSaveDetail', DataSaveDetail });
},
async DataSaveClear({}, { put }: any) {
*DataSaveClear({}, { put }: any) {
let DataSave = null;
await put({ type: 'returnDataSave', DataSave });
yield put({ type: 'returnDataSave', DataSave });
},
},
};
......@@ -94,11 +94,7 @@ const Card = (props: any) => {
message.error('No Permissions!!!', 3);
return;
}
const user = JSON.parse(localStorage.getItem('userInfo') as string);
values['Reply_name'] = user.userModel.tosUserName;
values['Reply_Contact'] = user.userModel.tosUserPhone;
SA(values, module, dispatch);
history.push('./AccessCardApplication/Detail');
history.push('./AccessCardApplication/Detail?id=' + values.id);
};
const goToAdd = () => {
......
......@@ -4,7 +4,7 @@ const { TabPane } = Tabs;
import { connect, history } from 'umi';
import { RA, getCookie } from '@/utils/method';
import { RA, getCookie, DataSaveDetailClear } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea';
......@@ -23,28 +23,48 @@ const apply_status = [
const apply_relation_owner = ['Oneself', 'Family Members', 'Tenant '];
const CardDetail = (props: any) => {
const { dispatch, Data, DataSave, DataSaveDetail } = props;
const { dispatch, DataSaveDetail, location } = props;
const formRef = useRef(null);
const [loading, setLoading] = useState(false);
const [listData, setListData] = useState(null) as any;
const [onwerDetail, setOnwerDetail] = useState(null) as any;
useEffect(() => {
if (!DataSave) {
if (location.query) {
setLoading(true);
// 拿取数据
RA(36, location.query, module, dispatch);
} else {
history.go(-1);
}
return () => {
DataSaveDetailClear(module, dispatch);
};
}, []);
useEffect(() => {
console.log(DataSaveDetail);
if (DataSaveDetail) {
setListData(DataSaveDetail.data.rows.list[0]);
setOnwerDetail(DataSaveDetail.data.rows.onwerDetail);
setLoading(false);
}
}, [DataSaveDetail]);
const onFinish = (values: any) => {
if (values.applyStatus === '2' && !values.replyContent) {
message.error('Replies must be filled in!', 3);
return;
}
let tmp = {
communityId: DataSave.communityId,
id: DataSave.id,
ownerId: DataSave.ownerId,
communityId: listData.communityId,
id: listData.id,
ownerId: listData.ownerId,
applyStatus: values.applyStatus,
replyContent:
DataSave.apply_status !== 0 && values.applyStatus === '3'
? DataSave.reply_content
listData.apply_status !== 0 && values.applyStatus === '3'
? listData.reply_content
: values.replyContent,
type: '7',
};
......@@ -55,62 +75,64 @@ const CardDetail = (props: any) => {
return (
<Spin size="large" spinning={loading}>
<div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
{DataSave != null ? (
{listData !== null && onwerDetail !== null ? (
<>
<TitleBack
sublist={[
'Status : ' + apply_status[DataSave.apply_status][1],
'Time : ' + moment(DataSave.create_time.time).format('DD-MM-YYYY'),
'Status : ' + apply_status[listData.apply_status][1],
'Time : ' + moment(listData.create_time.time).format('DD-MM-YYYY'),
]}
title="Apply Card Detail"
></TitleBack>
<Row gutter={8}>
<Col>Community:</Col>
<Col span={3}>{DataSave.community_name}</Col>
<Col span={3}>{onwerDetail.communityName}</Col>
<Col>Unit:</Col>
<Col>
{DataSave.build_number + ' #' + DataSave.floor_number + '-' + DataSave.room_number}
{onwerDetail.buildingNumber +
' #' +
onwerDetail.floorNumber +
'-' +
onwerDetail.roomNumber}
</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col>Address:</Col>
<Col>
{DataSave.zip_address},{DataSave.zip_code}
</Col>
<Col>{onwerDetail.addressAndpostalCode}</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col>Owner Name:</Col>
<Col span={3}>{DataSave.community_owner}</Col>
<Col span={3}>{onwerDetail.owerName}</Col>
<Col>Phone:</Col>
<Col>{DataSave.community_owner_phone}</Col>
<Col>{onwerDetail.owerPhone}</Col>
</Row>
<Line></Line>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Apply Name:</Col>
<Col span={3}>{DataSave.apply_name}</Col>
<Col span={3}>{listData.apply_name}</Col>
<Col>Phone:</Col>
<Col>{DataSave.apply_name_phone}</Col>
<Col>{listData.apply_name_phone}</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Relationship:</Col>
<Col>{apply_relation_owner[parseInt(DataSave.apply_relation_owner)]}</Col>
<Col>{apply_relation_owner[parseInt(listData.apply_relation_owner)]}</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reason:</Col>
<Col>
<TextArea
disabled
value={DataSave.apply_reason_content}
value={listData.apply_reason_content}
style={{ width: 300, height: 100, padding: 8 }}
></TextArea>
</Col>
</Row>
<Line></Line>
{DataSave.apply_status === 0 ? (
{listData.apply_status === 0 ? (
<Form ref={formRef} name="basic" onFinish={onFinish}>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Examine:</Col>
......@@ -158,14 +180,14 @@ const CardDetail = (props: any) => {
<>
<Row>
<Col span={3}>Replyer:</Col>
<Col span={3}>{DataSave.Reply_name}</Col>
<Col span={3}>{listData.reply_name}</Col>
<Col span={3}>Contact:</Col>
<Col>{DataSave.Reply_Contact}</Col>
<Col>{listData.reply_Contact}</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Examine:</Col>
<Col span={4}>
<Radio.Group value={DataSave.apply_status === 2 ? '2' : '1'}>
<Radio.Group value={listData.apply_status === 2 ? '2' : '1'}>
<Radio.Button value={'1'}>Agree</Radio.Button>
<Radio.Button style={{ marginLeft: 10 }} value={'2'}>
Refuse
......@@ -179,13 +201,13 @@ const CardDetail = (props: any) => {
<Col>
<TextArea
disabled
value={DataSave.reply_content}
value={listData.reply_content}
style={{ width: 300, height: 100, padding: 8 }}
></TextArea>
</Col>
</Row>
{DataSave.apply_status === 1 ? (
{listData.apply_status === 1 ? (
<Form ref={formRef} name="basic" onFinish={onFinish}>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Received:</Col>
......@@ -207,7 +229,7 @@ const CardDetail = (props: any) => {
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Received:</Col>
<Col span={4}>
<Radio.Group value={DataSave.apply_status === 3 ? '3' : ''}>
<Radio.Group value={listData.apply_status === 3 ? '3' : ''}>
<Radio value={'3'}>Receive</Radio>
</Radio.Group>
</Col>
......@@ -223,7 +245,7 @@ const CardDetail = (props: any) => {
};
function map(state: any) {
const { Data, DataSave, DataSaveDetail } = state[module];
return { Data, DataSave, DataSaveDetail };
const { Data, DataSaveDetail } = state[module];
return { Data, DataSaveDetail };
}
export default connect(map)(CardDetail);
import React, { useState, useEffect, useRef } from 'react';
import { Input, Tabs, Table, Space, Button, message } from 'antd';
const { TabPane } = Tabs;
import React, { useState, useEffect } from 'react';
import { Table, Space, message } from 'antd';
import { connect, history } from 'umi';
......@@ -107,7 +106,6 @@ const Renovation = (props: any) => {
message.error('No Permissions!!!', 3);
return;
}
SA(values, module, dispatch);
history.push('./RenovationApplication/Detail?id=' + values.id);
};
......
......@@ -14,22 +14,37 @@ import TitleBack from '@/components/TitleBack/TitleBack';
import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea';
import { timestampToTime } from '@/utils/time';
import { values } from 'lodash';
const module = 'CommunityService';
let DataSave: any = null;
const RenovationDetail = (props: any) => {
const { dispatch, DataSaveDetail, location, DataSave } = props;
const { dispatch, DataSaveDetail, location } = props;
const formRef = useRef(null);
const [loading, setLoading] = useState(false);
const [listData, setListData] = useState(null) as any;
const [onwerDetail, setOnwerDetail] = useState(null) as any;
useEffect(() => {
if (!DataSave) {
// 发起请求拿取数据
if (location.query.id) {
setLoading(true);
RA(37, { ...location.query }, module, dispatch);
} else {
history.go(-1);
}
console.log(DataSave);
return () => {
DataSaveDetailClear(module, dispatch);
};
}, []);
useEffect(() => {
if (DataSaveDetail) {
setListData(DataSaveDetail.data.rows.list[0]);
setOnwerDetail(DataSaveDetail.data.rows.onwerDetail);
setLoading(false);
}
}, [DataSaveDetail]);
const onFinish = (values: any) => {
if (
values.decorationStatus === '2' &&
......@@ -40,9 +55,9 @@ const RenovationDetail = (props: any) => {
}
var tmp = {
communityId: DataSave.communityId,
id: DataSave.id,
ownerId: DataSave.ownerId,
communityId: listData.communityId,
id: listData.id,
ownerId: listData.ownerId,
decorationStatus: values.decorationStatus,
replyName: getCookie('name'),
replyPhone: getCookie('phone'),
......@@ -57,49 +72,48 @@ const RenovationDetail = (props: any) => {
return (
<Spin size="large" spinning={loading}>
<div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
{DataSave != null ? (
{listData !== null && onwerDetail !== null ? (
<>
<TitleBack
sublist={[
'Status : ' + decoration_status[DataSave.decorationStatus][1],
'Time : ' + timestampToTime(DataSave.createTime.time),
'Status : ' + decoration_status[listData.decorationStatus][1],
'Time : ' + timestampToTime(listData.createTime.time),
]}
title={DataSave.decorationStatus === 0 ? 'Renovation Reply' : 'Renovation Detail'}
title={listData.decorationStatus === 0 ? 'Renovation Reply' : 'Renovation Detail'}
></TitleBack>
<Row gutter={8}>
<Col>Community:</Col>
<Col span={3}>{DataSave.communityName}</Col>
<Col span={3}>{onwerDetail.communityName}</Col>
<Col>Unit:</Col>
<Col>
{DataSave.communityBuildDecorate} #{DataSave.communityFloorDecorate}-
{DataSave.communityRoomDecoate}
{onwerDetail.buildingNumber} #{onwerDetail.floorNumber}-{onwerDetail.roomNumber}
</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col>Address:</Col>
<Col>{DataSave.tosCommunityModel.residentialAddress}</Col>
<Col>{onwerDetail.addressAndpostalCode}</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col>Owner Name:</Col>
<Col span={3}>{DataSave.applyforName}</Col>
<Col span={3}>{onwerDetail.owerName}</Col>
<Col>Phone:</Col>
<Col>{DataSave.contactPhone}</Col>
<Col>{onwerDetail.owerPhone}</Col>
</Row>
<Line></Line>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Contract Name:</Col>
<Col span={3}>{DataSave.contactName}</Col>
<Col span={3}>{listData.contactName}</Col>
<Col span={3}>Phone:</Col>
<Col>{DataSave.contactPhone}</Col>
<Col>{listData.contactPhone}</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Time:</Col>
<Col span={3}>{timestampToTime(DataSave.decorationBeginTime)}</Col>
<Col>{timestampToTime(DataSave.decorationEndTime)}</Col>
<Col span={3}>{timestampToTime(listData.decorationBeginTime)}</Col>
<Col>{timestampToTime(listData.decorationEndTime)}</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reason:</Col>
......@@ -107,14 +121,14 @@ const RenovationDetail = (props: any) => {
<TextArea
autoSize
disabled
value={DataSave.decorationContent}
value={listData.decorationContent}
style={{ width: 300, minHeight: 100, padding: 8, resize: 'none' }}
></TextArea>
</Col>
</Row>
<Line></Line>
{DataSave.decorationStatus === '0' ? (
{listData.decorationStatus === '0' ? (
<>
<Form ref={formRef} name="basic" onFinish={onFinish}>
<Row gutter={8} style={{ marginTop: 16 }}>
......@@ -153,15 +167,15 @@ const RenovationDetail = (props: any) => {
<>
<Row>
<Col span={3}>Replyer:</Col>
<Col span={3}>{DataSave.replyName}</Col>
<Col span={3}>{listData.replyName}</Col>
<Col span={3}>Contact: </Col>
<Col>{DataSave.replyPhone}</Col>
<Col>{listData.replyPhone}</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Approval For Application:</Col>
<Col>
<Radio.Group value={DataSave.decorationStatus}>
<Radio.Group value={listData.decorationStatus}>
<Radio.Button value={'1'}>Agree</Radio.Button>{' '}
<Radio.Button style={{ marginLeft: 10 }} value={'2'}>
Reject
......@@ -176,7 +190,7 @@ const RenovationDetail = (props: any) => {
<TextArea
style={{ width: 300, minHeight: 100, padding: 8, resize: 'none' }}
disabled
value={DataSave.replyView}
value={listData.replyView}
></TextArea>
</Col>
</Row>
......@@ -190,7 +204,7 @@ const RenovationDetail = (props: any) => {
};
function map(state: any) {
const { DataSaveDetail, DataSave } = state[module];
return { DataSaveDetail, DataSave };
const { DataSaveDetail } = state[module];
return { DataSaveDetail };
}
export default connect(map)(RenovationDetail);
......@@ -52,21 +52,21 @@ export const setCookie = (key: string, value: string) => {
document.cookie = key + '=' + value + '; ';
};
export const RA = (index: any, values: any, module: string, dispatch: any) => {
export const RA = (index: number, values: object, module: string, dispatch: any) => {
dispatch({
type: module + '/RA',
playload: { index: index, body: values },
});
};
export const SA = (values: any, module: string, dispatch: any) => {
export const SA = (values: object, module: string, dispatch: any) => {
dispatch({ type: module + '/SA', playload: values });
};
export const PAGE = (values: any, module: string, dispatch: any) => {
export const PAGE = (values: object, module: string, dispatch: any) => {
dispatch({ type: module + '/PAGE', playload: values });
};
export const URL = (values: any, module: string, dispatch: any) => {
export const URL = (values: object, module: string, dispatch: any) => {
dispatch({ type: module + '/URL', playload: values });
};
......@@ -76,16 +76,16 @@ export const URLCLEAR = (module: string, dispatch: any) => {
export const DataClear = (module: string, dispatch: any) => {
dispatch({ type: module + '/DataClear' });
};
export const ResultClear = (module: any, dispatch: any) => {
export const ResultClear = (module: string, dispatch: any) => {
dispatch({ type: module + '/ResultClear' });
};
export const DataSaveDetailClear = (module: any, dispatch: any) => {
export const DataSaveDetailClear = (module: string, dispatch: any) => {
dispatch({ type: module + '/DataSaveDetailClear' });
};
export const DataSaveClear = (module: any, dispatch: any) => {
export const DataSaveClear = (module: string, dispatch: any) => {
dispatch({ type: module + '/DataSaveClear' });
};
export const Data4ErrorClear = (module: any, dispatch: any) => {
export const Data4ErrorClear = (module: string, dispatch: any) => {
dispatch({ type: module + '/Data4ErrorClear' });
};
// const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
......
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