Commit 60981b65 authored by cellee's avatar cellee

拉取代码合并

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parents 0cf1c156 1d108a9c
...@@ -3,37 +3,39 @@ import { connect } from 'umi'; ...@@ -3,37 +3,39 @@ import { connect } from 'umi';
import SearchOptions from './SearchOptions'; import SearchOptions from './SearchOptions';
import SearchOptionsTow from './SearchOptionsTow'; import SearchOptionsTow from './SearchOptionsTow';
const SearchOptionsCommnity = (props: any) => { const SearchOptionsCommnity = (props: any) => {
const { dispatch, CommunityList, opname, defaultName } = props; const { dispatch, CommunityList, opname, defaultName } = props;
const tosCommunityget = (values: any) => { dispatch({ type: 'Init/tosCommunityget', playload: values }) }; const tosCommunityget = (values: any) => {
dispatch({ type: 'Init/tosCommunityget', playload: values });
};
useEffect(() => { useEffect(() => {
if (CommunityList == null) { if (CommunityList == null) {
tosCommunityget(null) tosCommunityget(null);
} }
}, []); }, []);
const extendName = (values: any) => { const extendName = (values: any) => {
// console.log(values) // console.log(values)
opname(values) opname(values);
} };
return ( return (
<>{CommunityList != null ? <>
{CommunityList != null ? (
// <SearchOptions // <SearchOptions
// titleSearch={titleSearch} // titleSearch={titleSearch}s
// disabled={disabled} // disabled={disabled}
// placeholder={placeholder} // placeholder={placeholder}
// defaultValue={props.defaultValue!=null?props.defaultValue:value} // defaultValue={props.defaultValue!=null?props.defaultValue:value}
// list={CommunityList} // list={CommunityList}
// onSubmit={extendName} /> // onSubmit={extendName} />
<SearchOptionsTow list={CommunityList} extendName={extendName} def={defaultName}></SearchOptionsTow> <SearchOptionsTow
: null list={CommunityList}
} extendName={extendName}
def={defaultName}
></SearchOptionsTow>
) : null}
</> </>
); );
}; };
......
import React from 'react' import React from 'react';
import { Select } from 'antd'; import { Select } from 'antd';
const { Option } = Select; const { Option } = Select;
const SearchOptionsTow = (porps: any) => { const SearchOptionsTow = (porps: any) => {
const { list, extendName, def } = porps; const { list, extendName, def } = porps;
const options = list.map((d: any, index: number) => <Option value={d} key={index}>{d}</Option>); const options = list.map((d: any, index: number) => (
<Option value={d} key={index}>
{d}
</Option>
));
function onChange(value: any) { function onChange(value: any) {
// console.log(`selected ${value}`); // console.log(`selected ${value}`);
extendName(value) extendName(value);
} }
return ( return (
<div> <div>
<Select <Select
...@@ -24,7 +26,7 @@ const SearchOptionsTow = (porps: any) => { ...@@ -24,7 +26,7 @@ const SearchOptionsTow = (porps: any) => {
{options} {options}
</Select> </Select>
</div> </div>
) );
} };
export default SearchOptionsTow export default SearchOptionsTow;
...@@ -2,7 +2,7 @@ import * as service from '@/services/tos'; ...@@ -2,7 +2,7 @@ import * as service from '@/services/tos';
import { message } from 'antd'; import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi'; import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router' import { routerRedux } from 'dva/router';
import { timestampToTime, timestampToTime4 } from '@/utils/time'; import { timestampToTime, timestampToTime4 } from '@/utils/time';
import { picFromate, Fromate } from '@/utils/method'; import { picFromate, Fromate } from '@/utils/method';
...@@ -11,168 +11,164 @@ export default { ...@@ -11,168 +11,164 @@ export default {
namespace: 'CommunityService', namespace: 'CommunityService',
state: { state: {
Data: null, Data: null,
DataSave:null, DataSave: null,
CurData: null, CurData: null,
CurDataDetail: null, CurDataDetail: null,
Data7: null, Data7: null,
Data8: null, Data8: null,
Result: null, Result: null,
DataSaveDetail:null, DataSaveDetail: null,
}, },
reducers: { reducers: {
returnPage(state, { Data }) { returnPage(state: object, { Data }: any) {
return { ...state, Data }; return { ...state, Data };
}, },
returnDataSave(state, { DataSave }) { returnDataSave(state: object, { DataSave }: any) {
return { ...state, DataSave } return { ...state, DataSave };
}, },
returnCurData(state, { CurData }) { returnCurData(state: object, { CurData }: any) {
return { ...state, CurData }; return { ...state, CurData };
}, },
returnCurDataDetail(state, { CurDataDetail }) { returnCurDataDetail(state: object, { CurDataDetail }: any) {
return { ...state, CurDataDetail }; return { ...state, CurDataDetail };
}, },
returnPage7(state, { Data7 }) { returnPage7(state: object, { Data7 }: any) {
return { ...state, Data7 }; return { ...state, Data7 };
}, },
returnPage8(state, { Data8 }) { returnPage8(state: object, { Data8 }: any) {
return { ...state, Data8 }; return { ...state, Data8 };
}, },
returnResult(state, { Result }) { returnResult(state: object, { Result }: any) {
return { ...state, Result }; return { ...state, Result };
}, },
returnDataSaveDetail(state, { DataSaveDetail }) { returnDataSaveDetail(state: object, { DataSaveDetail }: any) {
return { ...state, DataSaveDetail }; return { ...state, DataSaveDetail };
}, },
}, },
effects: { effects: {
//预订设施查询 //预订设施查询
*RA({ playload }, { call, put }) { *RA({ playload }: any, { call, put }: any) {
switch (playload.index) { switch (playload.index) {
case 40: { case 40:
var Data = null {
yield put({ type: 'returnPage', Data}); var Data = null;
} break; yield put({ type: 'returnPage', Data });
}
break;
} }
const resp = yield call(service.RA, playload); const resp = yield call(service.RA, playload);
console.log(resp) console.log(resp);
if (resp.code == 500||resp.error_code!="0000") { if (resp.code == 500 || resp.error_code != '0000') {
// window.location.href = '/500'; // window.location.href = '/500';
} }
if (resp.error_code != "0000") { if (resp.error_code != '0000') {
console.log("请求错误码:" + "(" + playload.index + ")" + resp.error_code) console.log('请求错误码:' + '(' + playload.index + ')' + resp.error_code);
console.log(playload) console.log(playload);
} else { } else {
switch (playload.index) { switch (playload.index) {
case 21: case 21:
{ {
var tmp = resp.data.rows[0].tosOwerModel; var tmp = resp.data.rows[0].tosOwerModel;
var tmp2 = resp.data.rows[0]; var tmp2 = resp.data.rows[0];
console.log(resp.data.rows[0].replyImgUrl) console.log(resp.data.rows[0].replyImgUrl);
console.log(Fromate(resp.data.rows[0].replyImgUrl,[["url",null]])) console.log(Fromate(resp.data.rows[0].replyImgUrl, [['url', null]]));
var CurDataDetail = { var CurDataDetail = {
community: tmp.communityName, community: tmp.communityName,
address: tmp.addressAndpostalCode, address: tmp.addressAndpostalCode,
home: tmp.buildingNumber + "#" + tmp.floorNumber + "-" + tmp.roomNumber, home: tmp.buildingNumber + '#' + tmp.floorNumber + '-' + tmp.roomNumber,
name: tmp.owerName, name: tmp.owerName,
phone: tmp.accountLogin!=null?tmp.accountLogin:tmp.owerPhone, phone: tmp.accountLogin != null ? tmp.accountLogin : tmp.owerPhone,
email: tmp.owerEmail, email: tmp.owerEmail,
content: resp.data.rows[0].serviceContent, content: resp.data.rows[0].serviceContent,
replyContent: resp.data.rows[0].replyContent, replyContent: resp.data.rows[0].replyContent,
replyImgUrl: Fromate(resp.data.rows[0].replyImgUrl,[["url",null]]), replyImgUrl: Fromate(resp.data.rows[0].replyImgUrl, [['url', null]]),
status: tmp2.handleStatus, status: tmp2.handleStatus,
pictrues: picFromate(tmp2.imgUrl), pictrues: picFromate(tmp2.imgUrl),
time: timestampToTime4(tmp2.createTime.time) time: timestampToTime4(tmp2.createTime.time),
}; };
yield put({ type: 'returnCurDataDetail', CurDataDetail, }); yield put({ type: 'returnCurDataDetail', CurDataDetail });
} break; }
break;
case 33: case 33:
case 22: { case 22:
message.success("Success Operation!", 3) {
history.go(-1) message.success('Success Operation!', 3);
history.go(-1);
// history.push("/CommercialService/CommunityMaintenance") // history.push("/CommercialService/CommunityMaintenance")
} break; }
case 23: { break;
case 23:
{
let Data8 = resp; let Data8 = resp;
yield put({ type: 'returnPage8', Data8, }); yield put({ type: 'returnPage8', Data8 });
} break; }
case 31: { break;
case 31:
{
let Data7 = resp; let Data7 = resp;
yield put({ type: 'returnPage7', Data7 }) yield put({ type: 'returnPage7', Data7 });
} break; }
case 35: { break;
case 35:
{
let Result = resp; let Result = resp;
yield put({ type: 'returnResult', Result }) yield put({ type: 'returnResult', Result });
} break; }
break;
case 37: case 37:
case 36: { {
let DataSaveDetail = resp;
yield put({ type: 'returnDataSaveDetail', DataSaveDetail });
}
break;
case 36:
{
let DataSaveDetail = resp; let DataSaveDetail = resp;
yield put({ type: 'returnDataSaveDetail', DataSaveDetail, }); yield put({ type: 'returnDataSaveDetail', DataSaveDetail });
} break; }
case 40: { break;
case 40:
{
let Data = resp; let Data = resp;
yield put({ type: 'returnPage', Data, }); yield put({ type: 'returnPage', Data });
} break; }
break;
} }
} }
}, },
// *TosCommunityServiceGetDetail({ playload }, { call, put }) { *SA({ playload }: any, { call, put }: any) {
// const resp = yield call(service.TosCommunityServiceGetDetail, playload);
// console.log(resp)
// if (resp.error_code !=0 ) {
// window.location.href = '/500';
// } else {
// var tmp = resp.data.rows[0].tosOwerModel;
// var tmp2 = resp.data.rows[0];
// console.log(tmp2.imgUrl)
// // TODO:还差图片
// var CurDataDetail = {
// community: tmp.communityName,
// address: tmp.addressAndpostalCode,
// home: tmp.buildingNumber+"#"+tmp.floorNumber+"-"+tmp.roomNumber,
// name: tmp.owerName,
// phone: tmp.owerPhone,
// email: tmp.owerEmail,
// content: resp.data.rows[0].serviceContent,
// status: tmp2.handleStatus,
// time:timestampToTime(tmp2.createTime.time)
// };
// yield put({ type: 'returnCurDataDetail', CurDataDetail, });
// }
// },
*SA({ playload }, { call, put }) {
var DataSave = playload; var DataSave = playload;
yield put({ type: 'returnDataSave', DataSave, }); yield put({ type: 'returnDataSave', DataSave });
}, },
*setCurData({ playload }, { call, put }) { *setCurData({ playload }: any, { call, put }: any) {
var CurData = playload; var CurData = playload;
yield put({ type: 'returnCurData', CurData, }); yield put({ type: 'returnCurData', CurData });
}, },
*setCurDataDetail({ playload }, { call, put }) { *setCurDataDetail({ playload }: any, { call, put }: any) {
var CurDataDetail=null var CurDataDetail = null;
yield put({ type: 'returnCurDataDetail', CurDataDetail, }); yield put({ type: 'returnCurDataDetail', CurDataDetail });
}, },
*ResultClear({}, { put }: any) {
*ResultClear({ }, { put }) { var Result = null;
var Result = null console.log('清除');
console.log("清除") yield put({ type: 'returnResult', Result });
yield put({type: 'returnResult', Result} )
}, },
async DataSaveDetailClear({}, { put }: any) {
let DataSaveDetail = null;
await put({ type: 'returnDataSaveDetail', DataSaveDetail });
}, },
async DataSaveClear({}, { put }: any) {
let DataSave = null;
await put({ type: 'returnDataSave', DataSave });
},
},
}; };
...@@ -12,101 +12,137 @@ import TitleSearch from '../../components/TitleSearch/TitleSearch'; ...@@ -12,101 +12,137 @@ import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method'; import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
const module = 'CommunityService';
const module = "CommunityService"
const Card = (props: any) => { const Card = (props: any) => {
const { dispatch, Data7 } = props; const { dispatch, Data7 } = props;
const [readyData, setReadyData] = useState(null) const [readyData, setReadyData] = useState(null);
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false);
// const apply_status = [[0, "审核中"], [1, "批准"], [2, "拒绝"], [3, "领取"]] // const apply_status = [[0, "审核中"], [1, "批准"], [2, "拒绝"], [3, "领取"]]
const apply_status = [[0, "Under review"], [1, "Approval"], [2, "Reject"], [3, "Claim"]] const apply_status = [
[0, 'Under review'],
[1, 'Approval'],
[2, 'Reject'],
[3, 'Claim'],
];
const columns = objectColumns([ const columns = objectColumns([
["所在小区", "community_name"], ['Community Name', 'community_name'],
["所在单元", null, (text: any, record: any) => (<Space size="middle">{record.build_number + "#" + record.floor_number + "-" + record.room_number}</Space>)], [
["用户名", "community_owner"], 'Unit',
["申请时间", null, (text: any, record: any) => (<Space size="middle">{timestampToTime(record.create_time.time)}</Space>)], null,
["申请状态", "apply_status", (text: any, record: any) => (<Space size="middle">{apply_status[parseInt(text)][1]}</Space>)], (text: any, record: any) => (
["Actions", null, (text: any, record: any) => (<Space size="middle"> <a onClick={goToDetail.bind(this, record)}>Detail</a></Space>)], <Space size="middle">
]) {record.build_number + '#' + record.floor_number + '-' + record.room_number}
</Space>
),
],
['Community Owner', 'community_owner'],
[
'Apply Time',
null,
(text: any, record: any) => (
<Space size="middle">{timestampToTime(record.create_time.time)}</Space>
),
],
[
'Apply Status',
'apply_status',
(text: any, record: any) => <Space size="middle">{apply_status[parseInt(text)][1]}</Space>,
],
[
'Actions',
null,
(text: any, record: any) => (
<Space size="middle">
{' '}
<a onClick={goToDetail.bind(this, record)}>Detail</a>
</Space>
),
],
]);
useEffect(() => { useEffect(() => {
if (Data7 != null) { setLoading(false) } if (Data7 != null) {
setLoading(false);
}
}, [Data7]); }, [Data7]);
useEffect(() => { useEffect(() => {
//前置数据 //前置数据
console.log("前置数据"); console.log('前置数据');
let tmp: any = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName", "current"]) let tmp: any = filterObjbyTg(location.query, [
tmp.handleStatus = apply_status[parseInt(tmp.handleStatus)] //特殊处理 'handleStatus',
setReadyData(tmp) 'ownerName',
'communityName',
'current',
]);
tmp.handleStatus = apply_status[parseInt(tmp.handleStatus)]; //特殊处理
setReadyData(tmp);
//获取数据 //获取数据
setLoading(true) setLoading(true);
RA(31, { serviceType: "7", id: "" }, module, dispatch) RA(31, { serviceType: '7', id: '' }, module, dispatch);
}, []) }, []);
useEffect(() => { useEffect(() => {
if (Data7 != null) { if (Data7 != null) {
console.log("首页信息") console.log('首页信息');
console.log(Data7) console.log(Data7);
} }
}, [Data7]) }, [Data7]);
const goToDetail = (values: any, e: any) => { const goToDetail = (values: any, e: any) => {
SA(values, module, dispatch) SA(values, module, dispatch);
history.push('./AccessCardApplication/Detail') history.push('./AccessCardApplication/Detail');
} };
const goToAdd = (values: any, e: any) => { const goToAdd = (values: any, e: any) => {
history.push('./AccessCardApplication/Add') history.push('./AccessCardApplication/Add');
} };
//页面搜索 //页面搜索
const ClickTitleSearch = (comment: any) => { const ClickTitleSearch = (comment: any) => {
let tmp = filterObjbyTg(comment, ["handleStatus", "ownerName", "communityName"]) let tmp = filterObjbyTg(comment, ['handleStatus', 'ownerName', 'communityName']);
tmp["current"] = 1 tmp['current'] = 1;
console.log(tmp) console.log(tmp);
history.push(location.pathname + urlEncode(tmp)) history.push(location.pathname + urlEncode(tmp));
} };
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
{Data7 != null ? (
{
Data7 != null ?
<> <>
<TitleSearch <TitleSearch
communitySelect={true} communitySelect={true}
listkey={['ownerName']} listkey={['ownerName']}
list={['Owner Name']} list={['Owner Name']}
status={[{ name: ["handleStatus", "Status"], data: apply_status }]} status={[{ name: ['handleStatus', 'Status'], data: apply_status }]}
defaultValue={readyData} defaultValue={readyData}
onSubmit={ClickTitleSearch} onSubmit={ClickTitleSearch}
/> />
<div style={{ height: 80, position: "relative" }}> <div style={{ height: 80, position: 'relative' }}>
<div style={{ position: "absolute", right: 0 }}> <div style={{ position: 'absolute', right: 0 }}>
<Button type="primary" onClick={goToAdd}>Apply Card</Button> <Button type="primary" onClick={goToAdd}>
Apply Card
</Button>
</div> </div>
</div> </div>
<Table loading={loading} rowKey="id" style={{ marginTop: 16 }} <Table
loading={loading}
rowKey="id"
style={{ marginTop: 16 }}
dataSource={Data7.data.rows} dataSource={Data7.data.rows}
columns={columns} columns={columns}
pagination={{ defaultCurrent: 1, total: Data7.total }} /> pagination={{ defaultCurrent: 1, total: Data7.total }}
/>
</> </>
: null ) : null}
}
</div> </div>
); );
}; };
function map(state: any) { function map(state: any) {
const { Data7 } = state[module] const { Data7 } = state[module];
return { Data7 } return { Data7 };
} }
export default connect(map)(Card); export default connect(map)(Card);
...@@ -4,7 +4,6 @@ const { TabPane } = Tabs; ...@@ -4,7 +4,6 @@ const { TabPane } = Tabs;
import { connect, history } from 'umi'; import { connect, history } from 'umi';
import { RA, ResultClear } from '@/utils/method'; import { RA, ResultClear } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack'; import TitleBack from '@/components/TitleBack/TitleBack';
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity';
...@@ -12,94 +11,121 @@ import Line from '@/components/Line/Line'; ...@@ -12,94 +11,121 @@ import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea'; import TextArea from 'antd/lib/input/TextArea';
import Relationship from '@/components/Relationship/Relationship'; import Relationship from '@/components/Relationship/Relationship';
import { useForm } from 'antd/es/form/util'; import { useForm } from 'antd/es/form/util';
const module = "CommunityService" const module = 'CommunityService';
const CardAdd = (props: any) => { const CardAdd = (props: any) => {
const { dispatch, Result, communityInfo } = props;
const { dispatch, Result } = props;
// const formRef = useRef(null) // const formRef = useRef(null)
const [form] = Form.useForm(); const [form] = Form.useForm();
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false);
useEffect(() => { useEffect(() => {
console.log(Result)
if (Result != null) { if (Result != null) {
console.log("初始化页面参数") if ((Result.error_code = '0000')) {
console.log(Result) message.success('Operation Success!');
setLoading(false);
if (Result.error_code = "0000") { ResultClear(module, dispatch);
message.success("Operation Success!") history.go(-1);
setLoading(false)
ResultClear(module, dispatch)
} else { } else {
message.error("Operation Fail!") message.error('Operation Fail!');
ResultClear(module, dispatch) setLoading(false);
history.go(-1) ResultClear(module, dispatch);
}
} }
}, [Result])
useEffect(() => {
var param =
{
"communityName": "A4",
"buildNumber": "01",
"floorNumber": "02",
"roomNumber": "369",
"zipCode": "510000",
"communityOwner": "jack-小雄",
"communityOwnerPhone": "18813757878",
"communityOwnerEmail": "sale2huahuico.com",
"applyName": "小李子",
"applyNamePhone": "13436989568",
"applyNameEmail": "xiaoli@huahuico.com",
"applyRelationOwner": "2",
"applyReasonContent": "租房",
"description": "test"
} }
form.setFieldsValue(param) }, [Result]);
}, [])
const onFinish = (values: any) => { const onFinish = (values: any) => {
console.log(values) setLoading(true);
setLoading(true)
RA(35, values, module, dispatch); RA(35, values, module, dispatch);
};
} const extendName = (values: any) => {
RA(32, { communityName: values }, 'User', dispatch);
};
// 选择小区名字并赋值 useEffect(() => {
const opname = (value: any) => { if (communityInfo != null) {
form.setFieldsValue({ form.setFieldsValue({
'communityName': value zipCode:
}) communityInfo.data.rows[0].residentialAddress +
' SINGAPORE' +
communityInfo.data.rows[0].residentialZipCode,
});
} }
}, [communityInfo]);
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
<TitleBack title={'Apply Card'}></TitleBack>
<TitleBack title={"Apply Card"}></TitleBack>
<Form form={form} name="basic" onFinish={onFinish}> <Form form={form} name="basic" onFinish={onFinish}>
<Spin spinning={loading}> <Spin spinning={loading}>
<Form.Item labelCol={{ span: 3 }} label="Community" style={{ marginBottom: 0 }}> <Form.Item labelCol={{ span: 3 }} label="Community" style={{ marginBottom: 0 }}>
<Input.Group compact> <Input.Group compact>
<Form.Item name="communityName" style={{ marginRight: 20 }} ><SearchOptionsCommnity opname={opname} /></Form.Item> <Form.Item name="communityName" style={{ marginRight: 20 }}>
<Form.Item name="buildNumber" style={{ marginRight: 16 }} ><Input style={{ width: 80 }} placeholder={"Building"} /></Form.Item> <SearchOptionsCommnity opname={extendName} />
</Form.Item>
<Form.Item
name="buildNumber"
style={{ marginRight: 16 }}
rules={[{ required: true }]}
>
<Input style={{ width: 80 }} placeholder={'Building'} />
</Form.Item>
<div style={{ lineHeight: 2, marginRight: 16 }}>#</div> <div style={{ lineHeight: 2, marginRight: 16 }}>#</div>
<Form.Item name="floorNumber" style={{ marginRight: 16 }} ><Input style={{ width: 80 }} placeholder={"Floor"} /></Form.Item> <Form.Item
name="floorNumber"
style={{ marginRight: 16 }}
rules={[{ required: true }]}
>
<Input style={{ width: 80 }} placeholder={'Floor'} />
</Form.Item>
<div style={{ lineHeight: 2, marginRight: 16 }}>-</div> <div style={{ lineHeight: 2, marginRight: 16 }}>-</div>
<Form.Item name="roomNumber" ><Input style={{ width: 120 }} placeholder={"Room"} /></Form.Item> <Form.Item name="roomNumber" rules={[{ required: true }]}>
<Input style={{ width: 120 }} placeholder={'Room'} />
</Form.Item>
</Input.Group> </Input.Group>
</Form.Item> </Form.Item>
<Form.Item name="zipCode" wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}>
<Input
style={{ width: 580 }}
placeholder={'Display the address and postcode automatically according to the'}
disabled
></Input>
</Form.Item>
<Form.Item name="zipCode" wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}><Input style={{ width: 400 }}></Input></Form.Item> <Form.Item
labelCol={{ span: 3 }}
<Form.Item labelCol={{ span: 3 }} label="Owner Name" style={{ marginBottom: -40 }}> label="Owner Name"
style={{ marginBottom: -40 }}
rules={[{ required: true }]}
>
<Input.Group compact> <Input.Group compact>
<Form.Item name="communityOwner" style={{ marginRight: 20 }} ><Input placeholder={"Name"} /></Form.Item> <Form.Item
<Form.Item style={{ marginRight: 20 }} label={"Contact Information"} ><Input hidden={true} /></Form.Item> name="communityOwner"
<Form.Item name="communityOwnerPhone" style={{ marginRight: 20 }}><Input placeholder={"Phone number"} /></Form.Item> style={{ marginRight: 20 }}
<Form.Item name="communityOwnerEmail" ><Input placeholder={"Email"} /></Form.Item> rules={[{ required: true }]}
>
<Input placeholder={'Name'} />
</Form.Item>
<Form.Item
style={{ marginRight: 20 }}
label={'Contact Information'}
rules={[{ required: true }]}
>
<Input hidden={true} />
</Form.Item>
<Form.Item
name="communityOwnerPhone"
style={{ marginRight: 20 }}
rules={[{ required: true }]}
>
<Input placeholder={'Phone number'} />
</Form.Item>
<Form.Item name="communityOwnerEmail" rules={[{ required: true }]}>
<Input placeholder={'Email'} />
</Form.Item>
</Input.Group> </Input.Group>
</Form.Item> </Form.Item>
...@@ -107,30 +133,51 @@ const CardAdd = (props: any) => { ...@@ -107,30 +133,51 @@ const CardAdd = (props: any) => {
<Form.Item labelCol={{ span: 3 }} label="Applicant" style={{ marginBottom: -40 }}> <Form.Item labelCol={{ span: 3 }} label="Applicant" style={{ marginBottom: -40 }}>
<Input.Group compact> <Input.Group compact>
<Form.Item name="applyName" style={{ marginRight: 20 }} ><Input placeholder={"Name"} /></Form.Item> <Form.Item name="applyName" style={{ marginRight: 20 }} rules={[{ required: true }]}>
<Form.Item style={{ marginRight: 20 }} label={"Contact Information"} ><Input placeholder={"Phone number"} hidden={true} /></Form.Item> <Input placeholder={'Name'} />
<Form.Item name="applyNamePhone" style={{ marginRight: 20 }}><Input placeholder={"Phone number"} /></Form.Item> </Form.Item>
<Form.Item name="applyNameEmail" ><Input placeholder={"Email"} /></Form.Item> <Form.Item
style={{ marginRight: 20 }}
label={'Contact Information'}
rules={[{ required: true }]}
>
<Input placeholder={'Phone number'} hidden={true} />
</Form.Item>
<Form.Item
name="applyNamePhone"
style={{ marginRight: 20 }}
rules={[{ required: true }]}
>
<Input placeholder={'Phone number'} />
</Form.Item>
<Form.Item name="applyNameEmail" rules={[{ required: true }]}>
<Input placeholder={'Email'} />
</Form.Item>
</Input.Group> </Input.Group>
</Form.Item> </Form.Item>
{/* label={"Contact Information"} */} {/* label={"Contact Information"} */}
<Form.Item labelCol={{ span: 3 }} name="applyRelationOwner" label={"Relationship"} ><Relationship /></Form.Item> <Form.Item labelCol={{ span: 3 }} name="applyRelationOwner" label={'Relationship'}>
<Form.Item labelCol={{ span: 3 }} name="applyReasonContent" label={"Reason"}><TextArea style={{ width: 400 }}></TextArea></Form.Item> <Relationship />
</Form.Item>
<Form.Item labelCol={{ span: 3 }} name="applyReasonContent" label={'Reason'}>
<TextArea style={{ width: 400 }}></TextArea>
</Form.Item>
<Line></Line> <Line></Line>
<Form.Item wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}><Button type="primary" htmlType="submit">Submit</Button></Form.Item> <Form.Item wrapperCol={{ ...Layout.wrapperCol, offset: 3 }}>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Spin> </Spin>
</Form> </Form>
</div> </div>
); );
}; };
function map(state: any) { function map(state: any) {
const { Result } = state[module] const { Result } = state[module];
return { Result } const { communityInfo } = state.User;
return { Result, communityInfo };
} }
export default connect(map)(CardAdd); export default connect(map)(CardAdd);
...@@ -14,180 +14,215 @@ import { getCookie } from '@/utils/method'; ...@@ -14,180 +14,215 @@ import { getCookie } from '@/utils/method';
import { timestampToTime } from '@/utils/time'; import { timestampToTime } from '@/utils/time';
import { validateMessages } from '@/utils/params'; import { validateMessages } from '@/utils/params';
const treatStatus = ["Pending", "Processed"] const treatStatus = ['Pending', 'Processed'];
const Detail = (props: any) => { const Detail = (props: any) => {
const [editorFlag, setEditorFlag] = useState(true); const [editorFlag, setEditorFlag] = useState(true);
const { dispatch, location, CurDataDetail } = props; const { dispatch, location, CurDataDetail } = props;
const fromRef = useRef(null) const fromRef = useRef(null);
const RA = (index: any, values: any) => { dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } }) }; const RA = (index: any, values: any) => {
dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } });
};
const [curString, setCurString] = useState({ readyState: false }) const [curString, setCurString] = useState({ readyState: false });
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false);
const [headTitle, setHeadTitle] = useState(""); const [headTitle, setHeadTitle] = useState('');
const headTitles = [ const headTitles = [
"Reply To Community maintenance", 'Reply To Community maintenance',
"Reply To Shelf life Service", 'Reply To Shelf life Service',
"Reply To Owner Complaints", 'Reply To Owner Complaints',
"Reply To Report Online", 'Reply To Report Online',
"Reply To Problem Feedback"] 'Reply To Problem Feedback',
];
useEffect(() => { useEffect(() => {
if ((location.pathname).indexOf("/Edit") > -1) { if (location.pathname.indexOf('/Edit') > -1) {
setEditorFlag(true) setEditorFlag(true);
} else { } else {
setEditorFlag(false) setEditorFlag(false);
} }
RA(21, { RA(21, {
serviceType: location.query.serviceType, serviceType: location.query.serviceType,
id: location.query.id id: location.query.id,
}) });
setHeadTitle(headTitles[parseInt(location.query.serviceType) - 1]) setHeadTitle(headTitles[parseInt(location.query.serviceType) - 1]);
setLoading(true) setLoading(true);
}, [location.pathname]); }, [location.pathname]);
useEffect(() => { useEffect(() => {
setCurString({ readyState: true });
console.log('页面准备好了');
}, []);
useEffect(() => {
console.log(CurDataDetail);
if (CurDataDetail != null && curString.readyState == true) { if (CurDataDetail != null && curString.readyState == true) {
console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@") console.log('@@@@@@@@@@@@@@@@@@@@@@@@@@@@');
console.log(CurDataDetail) console.log(CurDataDetail);
if (!editorFlag) { if (!editorFlag) {
var tmp = { replyContent: CurDataDetail.replyContent, file: CurDataDetail.replyImgUrl } var tmp = { replyContent: CurDataDetail.replyContent, file: CurDataDetail.replyImgUrl };
fromRef.current.setFieldsValue(tmp) fromRef.current.setFieldsValue(tmp);
} }
setLoading(false) setLoading(false);
} }
}, [CurDataDetail]) }, [CurDataDetail]);
useEffect(() => {
setCurString({ readyState: true })
console.log("页面准备好了")
}, [])
const onFinish = (values: any) => { const onFinish = (values: any) => {
console.log(values) console.log(values);
var val = values; var val = values;
val.handleName = getCookie("name") val.handleName = getCookie('name');
val.handleContacts = getCookie("phone") val.handleContacts = getCookie('phone');
val.type = "" + location.query.serviceType val.type = '' + location.query.serviceType;
val.id = location.query.id val.id = location.query.id;
val.userId = location.query.user_id val.userId = location.query.user_id;
val.communityId = location.query.community_id val.communityId = location.query.community_id;
val.handleStatus = "1" val.handleStatus = '1';
// val.file=fileList // val.file=fileList
console.log('Success:', val) console.log('Success:', val);
RA(22, val); RA(22, val);
setLoading(true) setLoading(true);
}; };
const titleProps = { const titleProps = {
sublist: CurDataDetail != null ? ['Status : ' + treatStatus[CurDataDetail.status], 'Create Time : ' + CurDataDetail.time] : null, sublist:
title: headTitle CurDataDetail != null
} ? ['Status : ' + treatStatus[CurDataDetail.status], 'Create Time : ' + CurDataDetail.time]
: null,
title: headTitle,
};
return ( return (
<div> <div>
{CurDataDetail != null ? {CurDataDetail != null ? (
<> <>
<Spin spinning={loading}> <Spin spinning={loading}>
<div className={styles.base}> <div className={styles.base}>
<TitleBack {...titleProps} /> <TitleBack {...titleProps} />
<Descriptions> <Descriptions>
<Descriptions.Item >{CurDataDetail.community}</Descriptions.Item> <Descriptions.Item>{CurDataDetail.community}</Descriptions.Item>
<Descriptions.Item span={2}>{CurDataDetail.home}</Descriptions.Item> <Descriptions.Item span={2}>{CurDataDetail.home}</Descriptions.Item>
<Descriptions.Item label="Address" span={3}>{CurDataDetail.address} </Descriptions.Item> <Descriptions.Item label="Address" span={3}>
{CurDataDetail.address}{' '}
</Descriptions.Item>
<Descriptions.Item label="User Name">{CurDataDetail.name}</Descriptions.Item> <Descriptions.Item label="User Name">{CurDataDetail.name}</Descriptions.Item>
<Descriptions.Item label="Contact Details">{CurDataDetail.phone} </Descriptions.Item> <Descriptions.Item label="Contact Details">
<Descriptions.Item >{CurDataDetail.email}</Descriptions.Item> {CurDataDetail.phone}{' '}
</Descriptions.Item>
<Descriptions.Item>{CurDataDetail.email}</Descriptions.Item>
</Descriptions> </Descriptions>
<Row gutter={16}> <Row gutter={16}>
<Col span={3}>Description:</Col> <Col span={3}>Description:</Col>
<Col><TextArea style={{ width: 394, height: 80, padding: 8 }} autoSize={false} disabled value={CurDataDetail.content} /></Col> <Col>
<TextArea
style={{ width: 394, height: 80, padding: 8 }}
autoSize={false}
disabled
value={CurDataDetail.content}
/>
</Col>
</Row> </Row>
<Row gutter={16} style={{ marginTop: 20 }}> <Row gutter={16} style={{ marginTop: 20 }}>
<Col span={3}>Picture:</Col> <Col span={3}>Picture:</Col>
<Col>{ <Col>
CurDataDetail != null ? {CurDataDetail != null ? (
<PictureOptionsRow <PictureOptionsRow
action="/tos/communtiy/service/reply/img" action="/tos/communtiy/service/reply/img"
disabled={true} disabled={true}
defaultValue={CurDataDetail.pictrues} defaultValue={CurDataDetail.pictrues}
data={{ data={{
userToken: "token", userToken: 'token',
imageType: 'tosCommunityImageReply', imageType: 'tosCommunityImageReply',
extends: "", extends: '',
}} }}
// //
/> : null />
}</Col> ) : null}
</Col>
</Row> </Row>
<Line /> <Line />
<Form ref={fromRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}> <Form
{!editorFlag ? ref={fromRef}
name="basic"
onFinish={onFinish}
validateMessages={validateMessages}
>
{!editorFlag ? (
<Row gutter={16}> <Row gutter={16}>
<Col>Response:</Col> <Col>Response:</Col>
<Col span={6}>{getCookie("name")}</Col> <Col span={6}>{getCookie('name')}</Col>
<Col>Contract Detail:</Col> <Col>Contract Detail:</Col>
<Col>{getCookie("phone")}</Col> <Col>{getCookie('phone')}</Col>
</Row> </Row>
: null} ) : null}
<Row gutter={16} style={{ marginTop: 20 }}> <Row gutter={16} style={{ marginTop: 20 }}>
<Col span={3}>Solution & Conclusion:</Col> <Col span={3}>Solution & Conclusion:</Col>
<Col ><Form.Item name="replyContent" rules={[{ required: true, max: 300 }]} ><TextArea style={{ padding: 8, width: 394, height: 80 }} autoSize={false} disabled={!editorFlag} /></Form.Item></Col> <Col>
<Form.Item name="replyContent" rules={[{ required: true, max: 300 }]}>
<TextArea
style={{ padding: 8, width: 394, height: 80 }}
autoSize={false}
disabled={!editorFlag}
/>
</Form.Item>
</Col>
</Row> </Row>
<Row gutter={16}> <Row gutter={16}>
<Col span={3}></Col> <Col span={3}></Col>
<Col > <Col>
{/* putSubmit={PictureOptionsRowRef} */} {/* putSubmit={PictureOptionsRowRef} */}
{ {CurDataDetail.replyImgUrl != null ? (
CurDataDetail.replyImgUrl != null ? <> <>
<Form.Item name="file"> <Form.Item name="file">
<PictureOptionsRow <PictureOptionsRow
action="/tos/communtiy/service/reply/img" action="/tos/communtiy/service/reply/img"
disabled={!editorFlag} disabled={!editorFlag}
data={{ data={{
userToken: "token", userToken: 'token',
imageType: 'tosCommunityImageReply', imageType: 'tosCommunityImageReply',
extends: "", extends: '',
}} /> }}
/>
</Form.Item> </Form.Item>
</> : null </>
} ) : null}
</Col> </Col>
</Row> </Row>
{ {editorFlag ? (
editorFlag ? <>
<><Line /><Row><Col span={3}></Col><Col><Form.Item><Button type="primary" htmlType="submit">Submit</Button></Form.Item></Col></Row></> : null <Line />
} <Row>
<Col span={3}></Col>
<Col>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Col>
</Row>
</>
) : null}
</Form> </Form>
</div> </div>
</Spin> </Spin>
</> </>
: null} ) : null}
</div> </div>
); );
}; };
function mapStateToProps(state: any) { function mapStateToProps(state: any) {
const { CurDataDetail } = state.CommunityService; const { CurDataDetail } = state.CommunityService;
console.log(CurDataDetail);
return { return {
CurDataDetail CurDataDetail,
}; };
} }
export default connect(mapStateToProps)(Detail); export default connect(mapStateToProps)(Detail);
...@@ -9,124 +9,162 @@ import { timestampToTime3 } from '../../utils/time'; ...@@ -9,124 +9,162 @@ import { timestampToTime3 } from '../../utils/time';
import TitleSearch from '../../components/TitleSearch/TitleSearch'; import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method'; import { RA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
const pathname = [
'CommunityMaintenance', // 小区保养
'ShelfLifeService', // 保质期服务
'OwnerComplaints', // 业主投诉
'ReportOnline', // 在线报事
'ProblemFeedback', // 问题反馈
];
const pathname = ["CommunityMaintenance", "ShelfLifeService", "OwnerComplaints", "ReportOnline", "ProblemFeedback"] const handle_Status = [
const handle_Status = [[0, "Pending"], [1, "Processed"]]//["未处理","处理","拒绝"] , [2,"Rejected"] [0, 'Pending'],
const goToName = ["Reply", "Detail"]; [1, 'Processed'],
]; //["未处理","处理","拒绝"] , [2,"Rejected"]
const goToName = ['Reply', 'Detail'];
const module = "CommunityService" const module = 'CommunityService';
const PropertyServices = (props: any) => {
// 页码
let pageNum: number = 1;
const PropertyServices = (props: any) => {
const { dispatch, location, Data } = props; const { dispatch, location, Data } = props;
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false);
const [pageNum, setPageNum] = useState(1) // const [pageNum, setPageNum] = useState(1)
const [serviceTypeGobal, setServiceType] = useState("") const [serviceTypeGobal, setServiceType] = useState('');
const [readyData, setReadyData] = useState(null) const [readyData, setReadyData] = useState(null);
const columns = [ const columns = [
{ title: "Community Name", dataIndex: 'community_name', }, { title: 'Community Name', dataIndex: 'community_name' },
{ title: "Ower Name", dataIndex: 'ower_name', }, { title: 'Ower Name', dataIndex: 'ower_name' },
{ title: "service Content", dataIndex: 'service_content', ellipsis: true, width: 500, render: (text: any) => (<Space size="middle">{text != null ? text : "--"}</Space>) },
{ title: "Create Time", dataIndex: "create_time", render: (text: any, record: any) => (<Space size="middle">{timestampToTime3(text.time)}</Space>) }, {
{ title: "Handle status", dataIndex: 'handle_status', render: (text: any, record: any) => (<Space size="middle">{handle_Status[text][1]}</Space>) }, title: parseInt(serviceTypeGobal) - 1 === 0 ? 'Replier' : 'Content',
{ title: "Actions", dataIndex: 'handle_status', render: (text: any, record: any) => (<Space size="middle"><a onClick={goToDetail.bind(this, text, record)}>{goToName[text]}</a></Space>) }, dataIndex: parseInt(serviceTypeGobal) - 1 === 0 ? 'handle_name' : 'service_content',
ellipsis: true,
width: 400,
render: (text: any) => <Space size="middle">{text != null ? text : '--'}</Space>,
},
{
title: 'Create Time',
dataIndex: 'create_time',
render: (text: any, record: any) => (
<Space size="middle">{timestampToTime3(text.time)}</Space>
),
},
{
title: 'Handle status',
dataIndex: 'handle_status',
render: (text: any, record: any) => <Space size="middle"> {handle_Status[text][1]}</Space>,
},
{
title: 'Actions',
dataIndex: 'handle_status',
render: (text: any, record: any) => (
<Space size="middle">
<a onClick={goToDetail.bind(this, text, record)}>{goToName[text]}</a>
</Space>
),
},
]; ];
const goToDetail = (value: any, record: any, e: any) => { const goToDetail = (value: any, record: any, e: any) => {
console.log(value);
console.log(serviceTypeGobal);
console.log(record);
//页面递进 //页面递进
history.push( history.push(
location.pathname + (value == 0 ? "/Edit" : "/Detail") + urlEncode( location.pathname +
{ (value == 0 ? '/Edit' : '/Detail') +
urlEncode({
serviceType: serviceTypeGobal, serviceType: serviceTypeGobal,
id: record.id, id: record.id,
user_id: record.user_id, user_id: record.user_id,
community_id: record.community_id community_id: record.community_id,
} }),
) );
) };
}
useEffect(() => { useEffect(() => {
if (Data != null) { setLoading(false) } if (Data != null) {
}, [Data]); setLoading(false);
const ClickTitleSearch = (comment: any) => {
//页面搜索
comment.serviceType = serviceTypeGobal
comment.current = 1
history.push(location.pathname + urlEncode(filterObj(comment)))
}
const PageChange = (values: any) => { //.current
//页面跳转参数
var tmp = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName"])
tmp["current"] = values.current
history.push(location.pathname + urlEncode(tmp))
} }
}, [Data]);
useEffect(() => { useEffect(() => {
if (location != null) { if (location != null) {
//细分类:页面指令 //细分类:页面指令
var serviceType = "" var serviceType = '';
pathname.map((item, index) => { pathname.map((item, index) => {
if ((location.pathname).indexOf(item) > -1) { if (location.pathname.indexOf(item) > -1) {
serviceType = "" + (index + 1) serviceType = '' + (index + 1);
setServiceType(serviceType) setServiceType(serviceType);
} }
}) });
//分页设置 //分页设置
if (location.query.current != null) { if (location.query.pageNum != null) {
setPageNum(parseInt(location.query.current)) pageNum = parseInt(location.query.pageNum);
} else { } else {
setPageNum(1) pageNum = 1;
} }
//前置数据 //前置数据
console.log("前置数据"); var tmp: any = filterObjbyTg(location.query, ['handleStatus', 'ownerName', 'communityName']);
var tmp = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName"]) tmp.handleStatus = handle_Status[parseInt(tmp.handleStatus)]; //特殊处理
tmp.handleStatus = handle_Status[parseInt(tmp.handleStatus)] //特殊处理 setReadyData(tmp);
setReadyData(tmp)
//获取数据 //获取数据
setLoading(true) setLoading(true);
console.log(serviceType) RA(
console.log(location.query) 40,
RA(40, { {
serviceType: serviceType, serviceType: serviceType,
handleStatus: location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null, ...tmp,
ownerName: location.query.ownerName != undefined ? (location.query.ownerName) : null, handleStatus:
communityName: location.query.communityName != undefined ? (location.query.communityName) : null, location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null,
pageNum, pageNum,
}, module, dispatch) },
module,
dispatch,
);
} }
}, [location]) }, [location]);
const PageChange = (values: any) => {
//页面跳转参数
var tmp = filterObjbyTg(location.query, ['handleStatus', 'ownerName', 'communityName']);
tmp['pageNum'] = values.current;
history.push(location.pathname + urlEncode(tmp));
};
const ClickTitleSearch = (comment: any) => {
//页面搜索
// comment.serviceType = serviceTypeGobal;
comment.pageNum = 1;
history.push(location.pathname + urlEncode(filterObj(comment)));
};
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleSearch <TitleSearch
communitySelect={true} communitySelect={true}
listkey={['ownerName']} listkey={['ownerName']}
list={['Owner Name']} list={['Owner Name']}
status={[{ name: ["handleStatus", "Status"], data: handle_Status }]} status={[{ name: ['handleStatus', 'Status'], data: handle_Status }]}
defaultValue={readyData} defaultValue={readyData}
onSubmit={ClickTitleSearch} onSubmit={ClickTitleSearch}
/> />
<Table <Table
rowKey={"id"} rowKey={'id'}
style={{ marginTop: 16 }} style={{ marginTop: 16 }}
loading={loading} loading={loading}
columns={columns} columns={columns}
dataSource={Data != null ? Data.data.rows : []} dataSource={Data != null ? Data.data.rows : []}
pagination={Data != null ? { current: pageNum, total: Data.data.rows.length } : {}} pagination={{
defaultPageSize: 15,
current: pageNum,
total: Data != null ? Data.data.page.totalRow : 0,
showSizeChanger: false,
}}
onChange={PageChange} onChange={PageChange}
/> />
</div> </div>
...@@ -136,7 +174,7 @@ const PropertyServices = (props: any) => { ...@@ -136,7 +174,7 @@ const PropertyServices = (props: any) => {
function mapStateToProps(state: any) { function mapStateToProps(state: any) {
const { Data } = state.CommunityService; const { Data } = state.CommunityService;
return { return {
Data Data,
}; };
} }
export default connect(mapStateToProps)(PropertyServices); export default connect(mapStateToProps)(PropertyServices);
...@@ -10,71 +10,117 @@ import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method'; ...@@ -10,71 +10,117 @@ import { RA, SA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
import { objectColumns, stringTab } from '@/utils/string'; import { objectColumns, stringTab } from '@/utils/string';
import { timestampToTime } from '@/utils/time'; import { timestampToTime } from '@/utils/time';
const module = "CommunityService" const module = 'CommunityService';
const Renovation = (props: any) => {
let pageNum: number = 1;
const Renovation = (props: any) => {
// const decoration_status = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]] // const decoration_status = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]]
const decoration_status = [[0, "Pending"], [1, "Approved"], [2, "Rejected"]] const decoration_status = [
const pathname = ["CommunityMaintenance", "ShelfLifeService", "OwnerComplaints", "ReportOnline", "ProblemFeedback"] [0, 'Pending'],
[1, 'Approved'],
[2, 'Rejected'],
];
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false);
const [serviceTypeGobal, setServiceType] = useState("") const [readyData, setReadyData] = useState(null);
const [pageNum, setPageNum] = useState(1)
const [readyData, setReadyData] = useState(null)
const columns = objectColumns([ const columns = objectColumns([
["Community", "community_name"], ['Community', 'community_name'],
["Applicant", "applyfor_name"], ['Applicant', 'applyfor_name'],
["Unit", null, (text: any, record: any) => (<div>{record.community_build_decorate}#{record.community_floor_decorate}-{record.community_room_decoate}</div>)], [
["Content", "decoration_content", (text: any) => (<div>{stringTab(text)}</div>)], 'Unit',
["Request Time", "create_time", (text: any) => (<div>{timestampToTime(text.time)}</div>)], null,
["status", "decoration_status", (text: any) => (<div>{decoration_status[parseInt(text)][1]}</div>)], (text: any, record: any) => (
["Actions", "decoration_status", (text: any, record: any) => (<Space size="middle"> <a onClick={goToDetail.bind(this, record)}> {text === 0 ? "Reply" : "Detail"} </a></Space>)], <div>
]) {record.community_build_decorate}#{record.community_floor_decorate}-
{record.community_room_decoate}
</div>
),
],
['Content', 'decoration_content', (text: any) => <div>{stringTab(text)}</div>],
['Request Time', 'create_time', (text: any) => <div>{timestampToTime(text.time)}</div>],
[
'status',
'decoration_status',
(text: any) => <div>{decoration_status[parseInt(text)][1]}</div>,
],
[
'Actions',
'decoration_status',
(text: any, record: any) => (
<Space size="middle">
{' '}
<a onClick={goToDetail.bind(this, record)}> {text === 0 ? 'Reply' : 'Detail'} </a>
</Space>
),
],
]);
const { dispatch, Data8, location } = props; const { dispatch, Data8, location } = props;
console.log(Data8);
useEffect(() => {
if (Data8 != null) { setLoading(false) }
}, [Data8]);
useEffect(() => { useEffect(() => {
//分页设置
if (location.query.pageNum != null) {
pageNum = parseInt(location.query.pageNum);
} else {
pageNum = 1;
}
if (location != null) {
//前置数据 //前置数据
console.log("前置数据"); console.log('前置数据');
let tmp: any = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName", "current"]) let tmp: any = filterObjbyTg(location.query, ['handleStatus', 'applyforName', 'communityName']);
tmp.handleStatus = decoration_status[parseInt(tmp.handleStatus)] //特殊处理 tmp.handleStatus = decoration_status[parseInt(tmp.handleStatus)]; //特殊处理
setReadyData(tmp) setReadyData(tmp);
//获取数据 //获取数据
setLoading(true) setLoading(true);
RA(23, { serviceType: "6", id: "" }, module, dispatch) RA(
} 23,
{
...tmp,
handleStatus:
location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null,
pageNum,
},
module,
dispatch,
);
}, [location]);
}, [location]) useEffect(() => {
if (Data8 != null) {
setLoading(false);
}
}, [Data8]);
//页面搜索 //页面搜索
const ClickTitleSearch = (comment: any) => { const ClickTitleSearch = (comment: any) => {
let tmp = filterObjbyTg(comment, ["handleStatus", "ownerName", "communityName"]) let tmp = filterObjbyTg(comment, ['handleStatus', 'applyforName', 'communityName']);
tmp["current"] = 1 pageNum = 1;
history.push(location.pathname + urlEncode(tmp)) history.push(location.pathname + urlEncode(tmp));
} };
const goToDetail = (values: any, e: any) => { const goToDetail = (values: any, e: any) => {
SA(values, module, dispatch) // SA(values, module, dispatch);
history.push('./RenovationApplication/Detail') history.push('./RenovationApplication/Detail?id=' + values.id);
} };
const PageChange = (values: any) => {
//页面跳转参数
var tmp = filterObjbyTg(location.query, ['handleStatus', 'ownerName', 'communityName']);
tmp['pageNum'] = values.current;
history.push(location.pathname + urlEncode(tmp));
};
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
{ {Data8 != null ? (
Data8 != null ?
<> <>
<TitleSearch <TitleSearch
communitySelect={true} communitySelect={true}
listkey={['ownerName']} listkey={['applyforName']}
list={['Owner Name']} list={['Owner Name']}
status={[{ name: ["handleStatus", "Status"], data: decoration_status }]} status={[{ name: ['handleStatus', 'Status'], data: decoration_status }]}
defaultValue={readyData} defaultValue={readyData}
onSubmit={ClickTitleSearch} onSubmit={ClickTitleSearch}
/> />
...@@ -84,17 +130,22 @@ const Renovation = (props: any) => { ...@@ -84,17 +130,22 @@ const Renovation = (props: any) => {
style={{ marginTop: 16 }} style={{ marginTop: 16 }}
dataSource={Data8.data.rows} dataSource={Data8.data.rows}
columns={columns} columns={columns}
pagination={{ defaultCurrent: 1, total: Data8.total }} onChange={PageChange}
pagination={{
current: pageNum,
defaultPageSize: 15,
total: Data8.data.page.totalRow,
showSizeChanger: false,
}}
/> />
</> </>
: null ) : null}
}
</div> </div>
); );
}; };
function map(state: any) { function map(state: any) {
const { Data8 } = state[module] const { Data8 } = state[module];
return { Data8 } return { Data8 };
} }
export default connect(map)(Renovation); export default connect(map)(Renovation);
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Input, Tabs, Row, Col, Button, Form, Radio, message } from 'antd'; import { Row, Col, Button, Form, Radio, message, Spin } from 'antd';
const { TabPane, } = Tabs;
import { connect, history } from 'umi'; import { connect, history } from 'umi';
const decoration_status = [[0, "Pending"], [1, "Approved"], [2, "Rejected"]] const decoration_status = [
[0, 'Pending'],
[1, 'Approved'],
[2, 'Rejected'],
];
import { RA, getCookie } from '@/utils/method'; import { RA, getCookie, DataSaveDetailClear } 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 { timestampToTime } from '@/utils/time'; import { timestampToTime } from '@/utils/time';
import { values } from 'lodash'; import { values } from 'lodash';
const module = "CommunityService" const module = 'CommunityService';
let DataSave: any = null;
const RenovationDetail = (props: any) => { const RenovationDetail = (props: any) => {
const { dispatch, DataSaveDetail, location } = props;
const { dispatch, DataSave, DataSaveDetail } = props; const formRef = useRef(null);
const formRef = useRef(null) const [loading, setLoading] = useState(false);
useEffect(() => { useEffect(() => {
if (DataSaveDetail != null) { console.log('初始化页面参数');
console.log("给予的请求页面"); if (location.query.id) {
setLoading(true);
console.log(DataSaveDetail) RA(37, { id: location.query.id }, module, dispatch);
} else {
history.go(-1);
} }
}, [DataSaveDetail]) }, []);
useEffect(() => { useEffect(() => {
if (DataSave != null) { if (DataSaveDetail) {
console.log("初始化页面参数") setLoading(false);
console.log(DataSave); DataSave = DataSaveDetail.data.rows.list[0];
RA(37, { id: DataSave.id }, module, dispatch)
} }
}, [DataSave]) }, [DataSaveDetail]);
const onFinish = (values: any) => { const onFinish = (values: any) => {
console.log(values) console.log(values);
if (values.decorationStatus === "2" && (values.replyView == undefined || values.replyView.trim() === "")) { if (
values.decorationStatus === '2' &&
(values.replyView == undefined || values.replyView.trim() === '')
) {
message.warning('Replies must be entered!'); message.warning('Replies must be entered!');
return; return;
} }
...@@ -47,42 +55,61 @@ const RenovationDetail = (props: any) => { ...@@ -47,42 +55,61 @@ const RenovationDetail = (props: any) => {
id: DataSave.id, id: DataSave.id,
ownerId: DataSave.ownerId, ownerId: DataSave.ownerId,
decorationStatus: values.decorationStatus, decorationStatus: values.decorationStatus,
replyName: getCookie("name"), replyName: getCookie('name'),
replyPhone: getCookie("phone"), replyPhone: getCookie('phone'),
replyView: values.replyView, replyView: values.replyView,
type: "6" type: '6',
} };
// console.log(tmp) // console.log(tmp)
RA(33, tmp, module, dispatch); RA(33, tmp, module, dispatch);
message.success('Success Operation!'); message.success('Success Operation!');
history.push('/CommercialService/RenovationApplication') history.push('/CommercialService/RenovationApplication');
} };
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <Spin size="large" spinning={loading}>
{ <div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
DataSave != null ? <> {DataSave != null ? (
<TitleBack sublist={['Status : ' + decoration_status[DataSave.decoration_status][1], 'Time : ' + timestampToTime(DataSave.create_time.time)]} title={"Renovation Detail"}></TitleBack> <>
<TitleBack
sublist={[
'Status : ' + decoration_status[DataSave.decoration_status][1],
'Time : ' + timestampToTime(DataSave.create_time.time),
]}
title={'Renovation Detail'}
></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>
<Col>unit:</Col> <Col>unit:</Col>
<Col>{DataSave.community_build_decorate}#{DataSave.community_floor_decorate}-{DataSave.community_room_decoate}</Col> <Col>
{DataSave.community_build_decorate}#{DataSave.community_floor_decorate}-
{DataSave.community_room_decoate}
</Col>
</Row> </Row>
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col>Address:</Col> <Col>Address:</Col>
<Col>{DataSaveDetail != null ? DataSaveDetail.data.rows.communityDetail.residentialAddress + " " + DataSaveDetail.data.rows.communityDetail.residentialZipCode : null}</Col> <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 }}>
<Col>Owner Name:</Col> <Col>Owner Name:</Col>
<Col span={3}>{DataSave.applyfor_name}</Col> <Col span={3}>{DataSave.applyfor_name}</Col>
<Col>Phone:</Col> <Col>Phone:</Col>
<Col>13169646231</Col> <Col>{DataSave.applyfor_phone}</Col>
</Row> </Row>
<Line></Line> <Line></Line>
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Contract Name:</Col> <Col span={3}>Contract Name:</Col>
...@@ -97,31 +124,94 @@ const RenovationDetail = (props: any) => { ...@@ -97,31 +124,94 @@ const RenovationDetail = (props: any) => {
</Row> </Row>
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reason:</Col> <Col span={3}>Reason:</Col>
<Col><TextArea disabled value={DataSave.decoration_content} style={{ width: 300, height: 100, padding: 8 }}></TextArea></Col> <Col>
<TextArea
autoSize
disabled
value={DataSave.decoration_content}
style={{ width: 300, minHeight: 100, padding: 8, resize: 'none' }}
></TextArea>
</Col>
</Row> </Row>
<Line></Line> <Line></Line>
{DataSave.decoration_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}>Approval For Application:</Col> <Col span={3}>Approval For Application:</Col>
<Col ><Form.Item name="decorationStatus" rules={[{ required: true, message: 'You have to choose an outcome!' }]}><Radio.Group><Radio.Button value={"1"}>Agree</Radio.Button > <Radio.Button style={{ marginLeft: 10 }} value={"2"}>Reject</Radio.Button ></Radio.Group></Form.Item></Col> <Col>
<Form.Item
name="decorationStatus"
rules={[{ required: true, message: 'You have to choose an outcome!' }]}
>
<Radio.Group>
<Radio.Button value={'1'}>Agree</Radio.Button>{' '}
<Radio.Button style={{ marginLeft: 10 }} value={'2'}>
Reject
</Radio.Button>
</Radio.Group>
</Form.Item>
</Col>
</Row> </Row>
<Row gutter={8} style={{ marginTop: 16 }}> <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reply:</Col> <Col span={3}>Reply:</Col>
<Col><Form.Item name="replyView"><TextArea style={{ width: 300, height: 100, padding: 8 }}></TextArea></Form.Item></Col> <Col>
<Form.Item name="replyView">
<TextArea style={{ width: 300, height: 100, padding: 8 }}></TextArea>
</Form.Item>
</Col>
</Row> </Row>
<Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item> <Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Form> </Form>
</>
) : (
<>
<Row>
<Col span={3}>replier:</Col>
<Col span={3}>{DataSave.reply_name}</Col>
<Col>Phone: </Col>
<Col>{DataSave.reply_phone}</Col>
</Row>
</> : null} <Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Approval For Application:</Col>
<Col>
<Radio.Group value={DataSave.decoration_status === 2 ? '1' : '2'}>
<Radio.Button value={'1'}>Agree</Radio.Button>{' '}
<Radio.Button style={{ marginLeft: 10 }} value={'2'}>
Reject
</Radio.Button>
</Radio.Group>
</Col>
</Row>
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reply:</Col>
<Col>
<TextArea
style={{ width: 300, minHeight: 100, padding: 8, resize: 'none' }}
disabled
value={DataSave.reply_view}
></TextArea>
</Col>
</Row>
</>
)}
</>
) : null}
</div> </div>
</Spin>
); );
}; };
function map(state: any) { function map(state: any) {
const { DataSave, DataSaveDetail } = state[module] const { DataSave, DataSaveDetail } = state[module];
return { DataSave, DataSaveDetail } return { DataSave, DataSaveDetail };
} }
export default connect(map)(RenovationDetail); export default connect(map)(RenovationDetail);
...@@ -6,129 +6,136 @@ ...@@ -6,129 +6,136 @@
background-color: #ffffff; background-color: #ffffff;
padding: 34px; padding: 34px;
min-width: 1020px; min-width: 1020px;
overflow-x:auto overflow-x: auto;
} }
//边栏1 //边栏1
.box{ .box {
width: 100%; width: 100%;
height: 64px; height: 64px;
position: relative; position: relative;
} }
.item1{ .item1 {
position: absolute; position: absolute;
width: 180px; width: 180px;
text-align: center; text-align: center;
border-left: 5px solid rgba(24,144,255,1); border-left: 5px solid rgba(24, 144, 255, 1);
font-family:'Source Han Sans CN'; font-family: 'Source Han Sans CN';
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
color: #000000; color: #000000;
} }
.item2{ .item2 {
width:300px; width: 300px;
position: absolute; position: absolute;
left: (180px+36px); left: (180px+36px);
line-height: 30px; line-height: 30px;
} }
.item3{ .item3 {
width:80px; width: 80px;
height: 32px; height: 32px;
position: absolute; position: absolute;
right: 0; right: 0;
outline: none; outline: none;
background:none; background: none;
cursor: pointer; cursor: pointer;
border:1px solid rgba(217,217,217,1); border: 1px solid rgba(217, 217, 217, 1);
border-radius:2px; border-radius: 2px;
} }
.box2{ .box2 {
width: 100%; width: 100%;
height: 80px; height: 130px;
text-align: center; text-align: center;
position: relative; position: relative;
} }
.item21{ .item21 {
line-height: 32px; line-height: 32px;
width: 200px; width: 200px;
position: absolute; position: absolute;
} }
.item22{ .item22 {
line-height: 32px; line-height: 32px;
position: absolute; position: absolute;
left: 200px; left: 200px;
width: 200px; width: 200px;
height: 32px; height: 32px;
border:1px solid rgba(217,217,217,1); border: 1px solid rgba(217, 217, 217, 1);
border-radius:2px; border-radius: 2px;
} }
.item23{ .item23 {
line-height: 32px; line-height: 32px;
position: absolute; position: absolute;
left: 416px; left: 416px;
border:1px solid rgba(217,217,217,1); border: 1px solid rgba(217, 217, 217, 1);
border-radius:2px; border-radius: 2px;
width: 94px; width: 140px;
height: 32px; height: 32px;
} }
.item234{ .item234 {
line-height: 32px; line-height: 32px;
height: 32px; height: 32px;
position: absolute; position: absolute;
left: 514px; left: 665px;
} }
.item24{ .item24 {
line-height: 32px; line-height: 32px;
border:1px solid rgba(217,217,217,1); border: 1px solid rgba(217, 217, 217, 1);
border-radius:2px; border-radius: 2px;
position: absolute; position: absolute;
left: 529px; left: 580px;
width: 80px; width: 80px;
height: 32px; height: 32px;
} }
.item245{ .item245 {
line-height: 32px; line-height: 32px;
position: absolute; position: absolute;
left: 609px; left: 766px;
} }
.item25{ .item25 {
line-height: 32px; line-height: 32px;
width: 112px; width: 80px;
height: 32px; height: 32px;
border:1px solid rgba(217,217,217,1); border: 1px solid rgba(217, 217, 217, 1);
border-radius:2px; border-radius: 2px;
position: absolute; position: absolute;
left: 640px; left: 680px;
} }
.item26{ .item26 {
width: 80px;
height: 32px;
line-height: 32px;
border: 1px solid rgba(217, 217, 217, 1);
border-radius: 2px;
position: absolute;
left: 800px;
}
.item27 {
width: 200px; width: 200px;
height: 32px; height: 32px;
line-height: 32px; line-height: 32px;
border:1px solid rgba(217,217,217,1); border: 1px solid rgba(217, 217, 217, 1);
border-radius:2px; border-radius: 2px;
position: absolute; position: absolute;
left: 780px; left: 200px;
top: 55px;
} }
.box3out{ .box3out {
padding-left: 200px; padding-left: 200px;
} }
.box3{ .box3 {
width: 780px; width: 780px;
border:1px solid rgba(217,217,217,1); border: 1px solid rgba(217, 217, 217, 1);
background-color: rgba(244,244,244,1); background-color: rgba(244, 244, 244, 1);
cursor: pointer; cursor: pointer;
overflow: auto; overflow: auto;
} }
.box3of{ .box3of {
cursor: pointer; cursor: pointer;
} }
.box4{ .box4 {
padding-left: 200px; padding-left: 200px;
} }
...@@ -38,10 +38,11 @@ const ChargeDetail = (props: any) => { ...@@ -38,10 +38,11 @@ const ChargeDetail = (props: any) => {
const pageChange = (curpage: any) => { const pageChange = (curpage: any) => {
setCurpage(curpage); setCurpage(curpage);
}; };
const goToReturn = () => {
if (!CurData) {
history.back(); history.back();
}; }
console.log(CurData);
return ( return (
<div className={styles.base}> <div className={styles.base}>
{CurData ? ( {CurData ? (
...@@ -53,18 +54,19 @@ const ChargeDetail = (props: any) => { ...@@ -53,18 +54,19 @@ const ChargeDetail = (props: any) => {
<div className={styles.box2}> <div className={styles.box2}>
<div className={styles.item21}>Project (community)</div> <div className={styles.item21}>Project (community)</div>
<div className={styles.item22}>{CurData.billName}</div> <div className={styles.item22}>{CurData.communityName}</div>
<div className={styles.item23}>{CurData.communityName}</div> <div className={styles.item23}>Street name</div>
<div className={styles.item24}>{CurData.floorNumber}</div> <div className={styles.item24}>{CurData.buildingNumber}</div>
<div className={styles.item234}>#</div> <div className={styles.item234}>#</div>
<div className={styles.item25}>{CurData.roomNumber}</div> <div className={styles.item25}>{CurData.floorNumber}</div>
<div className={styles.item245}>——</div> <div className={styles.item245}>——</div>
<div className={styles.item26}>{CurData.tosOwnerName}</div> <div className={styles.item26}>{CurData.roomNumber}</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}>
......
...@@ -5,7 +5,6 @@ import { Input, Menu, Table, Space } from 'antd'; ...@@ -5,7 +5,6 @@ import { Input, Menu, Table, Space } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi'; 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';
...@@ -14,48 +13,51 @@ const ChargeManager = (props: any) => { ...@@ -14,48 +13,51 @@ const ChargeManager = (props: any) => {
const { formatMessage } = useIntl(); const { formatMessage } = useIntl();
const { dispatch, location, Data } = props; const { dispatch, location, Data } = props;
const get = (values: any) => { dispatch({ type: 'PropertyManagement/get', playload: values }) }; const get = (values: any) => {
const getById = (values: any) => { dispatch({ type: 'PropertyManagement/getById', playload: values }) }; dispatch({ type: 'PropertyManagement/get', playload: values });
};
const getById = (values: any) => {
dispatch({ type: 'PropertyManagement/getById', playload: values });
};
useEffect(() => { useEffect(() => {
get(null) get(null);
}, []); }, []);
const nameofowner = formatMessage({ id: 'R.charge.input.nameofowner' });
const nameofowner = formatMessage({ id: 'R.charge.input.nameofowner' }) const inputProject = formatMessage({ id: 'R.charge.input.project' });
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 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 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 paymentsetting = formatMessage({ id: 'R.charge.paymentsetting' })
const menuListNormal = ['A', 'Accounting company'];
const menuListNormal = ["A", 'Accounting company'] const [display, setDisplay] = useState('A'); //小组件:线框
const [display, setDisplay] = useState("A");//小组件:线框
const pagination = {
const pagination = { defaultCurrent: 1, total: 16 } defaultCurrent: 15,
total: 16,
};
const goToDetail = (values: any) => { const goToDetail = (values: any) => {
getById(values) getById(values);
history.push('/PropertyManagementDetail') history.push('/PropertyManagementDetail');
} };
const goToAddAccout = () => { const goToAddAccout = () => {
history.push(location.pathname + '/AccoutingDetail') history.push(location.pathname + '/AccoutingDetail');
} };
const columns = [ const columns = [
{ title: username, dataIndex: 'tosOwnerName' }, { title: username, dataIndex: 'tosOwnerName' },
{ title: project, dataIndex: 'communityName' }, { title: project, dataIndex: 'communityName' },
{ title: unit, dataIndex: 'buildingNumber' }, { title: unit, dataIndex: 'buildingNumber' },
{ title: status, dataIndex: 'enable' },
{ {
title: submissionTime, title: submissionTime,
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space size="middle"> <Space size="middle">{timestampToTime(record.createTime.time)}</Space>
{timestampToTime(record.createTime.time)}
</Space>
), ),
}, },
{ {
...@@ -68,28 +70,45 @@ const ChargeManager = (props: any) => { ...@@ -68,28 +70,45 @@ const ChargeManager = (props: any) => {
}, },
]; ];
const TitleSearchContent = (comment: any) => { const TitleSearchContent = (comment: any) => {
console.log(comment) console.log(comment);
} };
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleSearch
<TitleSearch listkey={['tosOwnerName', 'communityName']} list={['tosOwnerName', 'communityName']} onSubmit={TitleSearchContent} /> listkey={['tosOwnerName', 'communityName']}
list={['tosOwnerName', 'communityName']}
onSubmit={TitleSearchContent}
/>
{/* 内容组件 */} {/* 内容组件 */}
<div className={styles.box2}> <div className={styles.box2}>
{ {menuListNormal.map((item, index) => {
menuListNormal.map((item, index) => { return (
return (<button key={"bt" + index} className={display == item ? styles.buttonChoose : styles.buttonWait} onClick={() => { setDisplay(item) }}>{item}</button>) <button
}) key={'bt' + index}
} className={display == item ? styles.buttonChoose : styles.buttonWait}
<button className={styles.buttonAdd2} onClick={goToAddAccout}>+ {addaccount} </button> onClick={() => {
<button className={styles.buttonAdd} >{paymentsetting}</button> setDisplay(item);
}}
>
{item}
</button>
);
})}
<button className={styles.buttonAdd2} onClick={goToAddAccout}>
+ {addaccount}{' '}
</button>
<button className={styles.buttonAdd}>{paymentsetting}</button>
</div> </div>
{/* 列表组件 */} {/* 列表组件 */}
<Table style={{ marginTop: 16 }} rowKey={"id"} dataSource={Data} columns={columns} pagination={pagination} /> <Table
style={{ marginTop: 16 }}
rowKey={'id'}
dataSource={Data}
columns={columns}
pagination={pagination}
/>
</div> </div>
); );
}; };
...@@ -97,7 +116,7 @@ const ChargeManager = (props: any) => { ...@@ -97,7 +116,7 @@ const ChargeManager = (props: any) => {
function mapStateToProps(state: any) { function mapStateToProps(state: any) {
const { Data } = state.PropertyManagement; const { Data } = state.PropertyManagement;
return { return {
Data Data,
}; };
} }
export default connect(mapStateToProps)(ChargeManager); export default connect(mapStateToProps)(ChargeManager);
...@@ -7,58 +7,61 @@ import { Link, useIntl, connect, Dispatch } from 'umi'; ...@@ -7,58 +7,61 @@ import { Link, useIntl, connect, Dispatch } from 'umi';
import Line from '../../../components/Line/Line'; import Line from '../../../components/Line/Line';
import TitleBack from '../../../components/TitleBack/TitleBack'; import TitleBack from '../../../components/TitleBack/TitleBack';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity'; import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { checkParam, RA } from '../../../utils/method' import { checkParam, RA } from '../../../utils/method';
import { validateMessages } from '@/utils/params'; import { validateMessages } from '@/utils/params';
// import "./UsersAddInput.less" // import "./UsersAddInput.less"
const module = 'User';
const module = "User"
const UsersAdd = (props: any) => { const UsersAdd = (props: any) => {
const { dispatch, communityInfo } = props; const { dispatch, communityInfo } = props;
const [postman, setPostman] = useState({ extend: null }) const [postman, setPostman] = useState({ extend: null });
const formRef = useRef(null as any); const formRef = useRef(null as any);
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false);
const onFinish = (values: any) => { const onFinish = (values: any) => {
console.log(values) console.log(values);
if (postman.extend != null) { if (postman.extend != null) {
values.communityName = postman.extend values.communityName = postman.extend;
} else { } else {
values.communityName = null values.communityName = null;
} }
// var tmp = Object.keys(values); // var tmp = Object.keys(values);
if (checkParam(values)) { if (checkParam(values)) {
values.owerPhone = null values.owerPhone = null;
values.owerEmail = null values.owerEmail = null;
RA(14, values, module, dispatch) RA(14, values, module, dispatch);
setLoading(true) setLoading(true);
} else { } else {
setLoading(false) setLoading(false);
message.error("Error,Please finish it,not empty!", 3) message.error('Error,Please finish it,not empty!', 3);
}
} }
};
const extendName = (values: any) => { const extendName = (values: any) => {
var tmp = postman var tmp = postman;
tmp.extend = values tmp.extend = values;
RA(32, { communityName: values }, module, dispatch); RA(32, { communityName: values }, module, dispatch);
setPostman(tmp) setPostman(tmp);
} };
useEffect(() => { useEffect(() => {
console.log(communityInfo);
if (communityInfo != null) { if (communityInfo != null) {
console.log(communityInfo) console.log(communityInfo);
if (postman.extend != null) { if (postman.extend != null) {
formRef.current.setFieldsValue({ addressAndpostalCode: communityInfo.data.rows[0].residentialAddress + " SINGAPORE" + communityInfo.data.rows[0].residentialZipCode }) formRef.current.setFieldsValue({
addressAndpostalCode:
communityInfo.data.rows[0].residentialAddress +
' SINGAPORE' +
communityInfo.data.rows[0].residentialZipCode,
});
} }
} }
}, [communityInfo]) }, [communityInfo]);
const checkData = (rule: any, value: any, callback: any) => { const checkData = (rule: any, value: any, callback: any) => {
console.log(rule, value) console.log(rule, value);
if (value) { if (value) {
if (/^[a-zA-Z0-9]+$/g.test(value)) { if (/^[a-zA-Z0-9]+$/g.test(value)) {
callback(); callback();
...@@ -70,14 +73,17 @@ const UsersAdd = (props: any) => { ...@@ -70,14 +73,17 @@ const UsersAdd = (props: any) => {
}; };
return ( return (
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件 */} {/* 头部组件 */}
<TitleBack title={"Create New Owner"} /> <TitleBack title={'Create New Owner'} />
<Spin spinning={loading}> <Spin spinning={loading}>
<Form ref={formRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}> <Form ref={formRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}>
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Owner's Name</div> <div className={styles.box1item1}>Owner's Name</div>
<div className={styles.box1item2}><Form.Item name="owerName" rules={[{ required: true, min: 2, max: 30 }]} ><Input placeholder="Ower Name" /></Form.Item></div> <div className={styles.box1item2}>
<Form.Item name="owerName" rules={[{ required: true, min: 2, max: 30 }]}>
<Input placeholder="Ower Name" />
</Form.Item>
</div>
</div> </div>
{/* <div className={styles.box4}> {/* <div className={styles.box4}>
...@@ -88,24 +94,47 @@ const UsersAdd = (props: any) => { ...@@ -88,24 +94,47 @@ const UsersAdd = (props: any) => {
<div className={styles.box2}> <div className={styles.box2}>
<div className={styles.box2item1}>Contact Details</div> <div className={styles.box2item1}>Contact Details</div>
<div className={styles.box2item2}><SearchOptionsCommnity alone={true} onSubmit={extendName} /></div> <div className={styles.box2item2}>
<div className={styles.box2item3}><Form.Item name="buildingNumber" rules={[{ validator: checkData }]}><Input placeholder="Building" style={{ width: 94 }} /></Form.Item></div> <SearchOptionsCommnity alone={true} opname={extendName} />
</div>
<div className={styles.box2item3}>
<Form.Item name="buildingNumber" rules={[{ validator: checkData }]}>
<Input placeholder="Building" style={{ width: 94 }} />
</Form.Item>
</div>
<div className={styles.box2item4}>#</div> <div className={styles.box2item4}>#</div>
<div className={styles.box2item5}><Form.Item name="floorNumber" rules={[{ validator: checkData }]}><Input placeholder="Floor" style={{ width: 80 }} /></Form.Item></div> <div className={styles.box2item5}>
<Form.Item name="floorNumber" rules={[{ validator: checkData }]}>
<Input placeholder="Floor" style={{ width: 80 }} />
</Form.Item>
</div>
<div className={styles.box2item6}>——</div> <div className={styles.box2item6}>——</div>
<div className={styles.box2item7}><Form.Item name="roomNumber" rules={[{ validator: checkData }]}><Input placeholder="Room" style={{ width: 112 }} /></Form.Item></div> <div className={styles.box2item7}>
<Form.Item name="roomNumber" rules={[{ validator: checkData }]}>
<Input placeholder="Room" style={{ width: 112 }} />
</Form.Item>
</div>
</div> </div>
<div className={styles.box3}> <div className={styles.box3}>
<div className={styles.box3item1}> <div className={styles.box3item1}>
<Form.Item name="addressAndpostalCode"><Input style={{ width: 680 }} disabled placeholder="Display the address and postcode automatically according to the" /></Form.Item> <Form.Item name="addressAndpostalCode">
<Input
style={{ width: 680 }}
disabled
placeholder="Display the address and postcode automatically according to the"
/>
</Form.Item>
</div> </div>
</div> </div>
<Line /> <Line />
<Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item> <Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Form> </Form>
</Spin> </Spin>
</div> </div>
); );
}; };
......
...@@ -79,6 +79,12 @@ export const DataClear = (module: string, dispatch: any) => { ...@@ -79,6 +79,12 @@ export const DataClear = (module: string, dispatch: any) => {
export const ResultClear = (module: any, dispatch: any) => { export const ResultClear = (module: any, dispatch: any) => {
dispatch({ type: module + '/ResultClear' }); dispatch({ type: module + '/ResultClear' });
}; };
export const DataSaveDetailClear = (module: any, dispatch: any) => {
dispatch({ type: module + '/DataSaveDetailClear' });
};
export const DataSaveClear = (module: any, dispatch: any) => {
dispatch({ type: module + '/DataSaveClear' });
};
// const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]] // const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
// const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }] // const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }]
export const Fromate = (values: any, reg: any) => { export const Fromate = (values: any, reg: any) => {
......
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