Commit 988b4f10 authored by cellee's avatar cellee

设施管理解决

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 47d17e5f
...@@ -222,7 +222,6 @@ const Facilitys = (props: any) => { ...@@ -222,7 +222,6 @@ const Facilitys = (props: any) => {
function mapStateToProps(state: any) { function mapStateToProps(state: any) {
const { FacilitysList } = state.FacilityBookings; const { FacilitysList } = state.FacilityBookings;
console.log(FacilitysList);
return { return {
FacilitysList, FacilitysList,
}; };
......
import React from 'react'; import React, { useState, useEffect } from 'react';
import { Select } from 'antd'; import { Select, TimePicker } from 'antd';
const Option = Select.Option; const { Option } = Select;
import moment from 'moment';
const OnTime = (porps: any) => { const OnTime = (porps: any) => {
// placeholder 默认显示 disabled 是否禁止 // placeholder 默认显示 disabled 是否禁止
// openSelect 选中函数 limit 限制时间 type 类型 时开始还是结束 1 就是结束 结尾是59 // openSelect 选中函数 limit 限制时间 type 类型 时开始还是结束 1 就是结束 结尾是59
let { placeholder, disabled, openSelect, limit, type } = porps; // defaultValue 默认时间
let { placeholder, disabled, openSelect, limit, type, defaultValue } = porps;
console.log(limit); const [imgOpen, setImgOpen] = useState(null as any);
useEffect(() => {
if (defaultValue != null) {
let a = moment(defaultValue, 'HH:mm');
setImgOpen(a);
}
}, [defaultValue]);
// console.log(limit);
// 生成数组 -- 时间 // 生成数组 -- 时间
const createArray = (num: any) => { const createArray = (num: any) => {
var arr = []; var arr = [];
for (let i = 1; i < num; i++) { for (let i = 0; i < num; i++) {
if (i < 10) { if (i < 10) {
arr[i] = `0${i}`; arr[i] = `0${i}`;
} else { } else {
...@@ -49,6 +60,16 @@ const OnTime = (porps: any) => { ...@@ -49,6 +60,16 @@ const OnTime = (porps: any) => {
return ( return (
<> <>
{defaultValue ? (
<TimePicker
defaultValue={moment(defaultValue, 'HH:mm')}
format="HH:mm"
onChange={openSelect}
placeholder={placeholder}
defaultOpenValue={moment('00:00', 'HH:mm')}
disabled={disabled}
/>
) : (
<Select <Select
style={{ width: 140 }} style={{ width: 140 }}
placeholder={placeholder} placeholder={placeholder}
...@@ -57,6 +78,7 @@ const OnTime = (porps: any) => { ...@@ -57,6 +78,7 @@ const OnTime = (porps: any) => {
> >
{hourS} {hourS}
</Select> </Select>
)}
</> </>
); );
}; };
......
...@@ -161,7 +161,11 @@ export default { ...@@ -161,7 +161,11 @@ export default {
} break; } break;
case 7: { case 7: {
let tmp = resp.data; let tmp = resp.data;
const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]] const reg = [
["url", "categoriesImageUrl"],
["name", "categoriesName"],
['imgName','categoriesImageName']
]
const reg2 = [["url", null]] const reg2 = [["url", null]]
//let sourceData = tmp; //let sourceData = tmp;
// sourceData.categoriesOpenTime= timeToMoment(tmp.categoriesOpenTime); // sourceData.categoriesOpenTime= timeToMoment(tmp.categoriesOpenTime);
......
...@@ -15,6 +15,8 @@ import { ...@@ -15,6 +15,8 @@ import {
message, message,
} from 'antd'; } from 'antd';
import moment from 'moment';
import { Link, useIntl, connect, Dispatch } from 'umi'; import { Link, useIntl, connect, Dispatch } from 'umi';
import TitleBack from '../../../components/TitleBack/TitleBack'; import TitleBack from '../../../components/TitleBack/TitleBack';
...@@ -23,6 +25,7 @@ import { timestampToTime3 } from '../../../utils/time'; ...@@ -23,6 +25,7 @@ import { timestampToTime3 } from '../../../utils/time';
import TextArea from 'antd/lib/input/TextArea'; import TextArea from 'antd/lib/input/TextArea';
import { getUrlLast } from '../../../utils/string'; import { getUrlLast } from '../../../utils/string';
import { merge } from 'lodash';
const BookingDetail = (props: any) => { const BookingDetail = (props: any) => {
const { dispatch, location, DataSave, DataSaveDetail, token, load } = props; const { dispatch, location, DataSave, DataSaveDetail, token, load } = props;
...@@ -135,7 +138,8 @@ const BookingDetail = (props: any) => { ...@@ -135,7 +138,8 @@ const BookingDetail = (props: any) => {
{statusDes[DataSave.status]} {statusDes[DataSave.status]}
</Descriptions.Item> </Descriptions.Item>
<Descriptions.Item label="Order Time"> <Descriptions.Item label="Order Time">
{timestampToTime3(DataSave.createTime.time)} {/* {timestampToTime3(DataSave.createTime.time)} */}
{moment(DataSave.createTime.time).format('MM-DD HH:mm')}
</Descriptions.Item> </Descriptions.Item>
</Descriptions> </Descriptions>
......
...@@ -88,6 +88,7 @@ const Bookings = (props: any) => { ...@@ -88,6 +88,7 @@ const Bookings = (props: any) => {
} }
}, [Result]); }, [Result]);
console.log(Data3);
// 选择小区监听是不是有值 // 选择小区监听是不是有值
useEffect(() => { useEffect(() => {
setLoading(false); setLoading(false);
...@@ -257,7 +258,7 @@ const Bookings = (props: any) => { ...@@ -257,7 +258,7 @@ const Bookings = (props: any) => {
alone={true} alone={true}
placeholder={'Community Name'} placeholder={'Community Name'}
opname={getFacility} opname={getFacility}
defaultValue={DataSave != null ? DataSave.communityName : null} defaultName={DataSave != null ? DataSave.communityName : null}
// onSubmit={getFacility} // onSubmit={getFacility}
/> />
</Spin> </Spin>
...@@ -316,7 +317,7 @@ const Bookings = (props: any) => { ...@@ -316,7 +317,7 @@ const Bookings = (props: any) => {
<div className={styles.box4item1}>Unit : </div> <div className={styles.box4item1}>Unit : </div>
<div className="divbox4"> <div className="divbox4">
<Form.Item name="buildNumber" rules={BookingsTip[2]}> <Form.Item name="buildNumber" rules={BookingsTip[2]}>
<Input placeholder="Building" style={{ width: 80 }} disabled={prohibit} /> <Input placeholder="Blk" style={{ width: 80 }} disabled={prohibit} />
</Form.Item> </Form.Item>
<span className="jio">#</span> <span className="jio">#</span>
<Form.Item name="floorNumber" rules={BookingsTip[3]}> <Form.Item name="floorNumber" rules={BookingsTip[3]}>
......
...@@ -43,7 +43,9 @@ const FacilityBookings = (props: any) => { ...@@ -43,7 +43,9 @@ const FacilityBookings = (props: any) => {
const QA = (values: any) => { const QA = (values: any) => {
dispatch({ type: 'FacilityBookings/QA', playload: values }); dispatch({ type: 'FacilityBookings/QA', playload: values });
}; };
const IA = () => {
dispatch({ type: 'FacilityBookings/IA' });
};
const CA = () => { const CA = () => {
dispatch({ type: 'FacilityBookings/CA', playload: null }); dispatch({ type: 'FacilityBookings/CA', playload: null });
}; };
...@@ -52,14 +54,14 @@ const FacilityBookings = (props: any) => { ...@@ -52,14 +54,14 @@ const FacilityBookings = (props: any) => {
const [columns2, setColumns2] = useState([]); const [columns2, setColumns2] = useState([]);
const goToFunction = () => { const goToFunction = () => {
console.log(curString.tab);
if (curString.tab == 2) { if (curString.tab == 2) {
CA(); CA();
// 先清空上传图片列表 // 先清空上传图片列表
dispatch({ type: 'FacilityBookings/overAllImgList' }); dispatch({ type: 'FacilityBookings/overAllImgList' });
} else { } else {
// 清空之前的数据 // 清空之前的数据
let Data3 = null; SA(null);
dispatch({ type: 'FacilityBookings/returnPage3', Data3 });
} }
history.push(location.pathname + (curString.tab == 1 ? '/Booking' : '/Adding')); history.push(location.pathname + (curString.tab == 1 ? '/Booking' : '/Adding'));
}; };
...@@ -74,8 +76,10 @@ const FacilityBookings = (props: any) => { ...@@ -74,8 +76,10 @@ const FacilityBookings = (props: any) => {
const makeOperator = (values: any, index: any) => { const makeOperator = (values: any, index: any) => {
const path = ['/FacilityDetail', '/FacilityEdit', '/FacilityApply']; const path = ['/FacilityDetail', '/FacilityEdit', '/FacilityApply'];
SA(values); SA(values);
console.log('准备页面跳转'); // 清空设施列表图
console.log(curString); let list: any = [];
dispatch({ type: 'FacilityBookings/genxin', list });
history.push(location.pathname + path[index]); history.push(location.pathname + path[index]);
}; };
...@@ -307,7 +311,7 @@ const FacilityBookings = (props: any) => { ...@@ -307,7 +311,7 @@ const FacilityBookings = (props: any) => {
toolBarRender={() => [ toolBarRender={() => [
<Button key="3" type="primary" onClick={goToFunction}> <Button key="3" type="primary" onClick={goToFunction}>
<PlusOutlined /> <PlusOutlined />
添加预约 Add Appointment
</Button>, </Button>,
]} ]}
options={{ options={{
...@@ -318,7 +322,7 @@ const FacilityBookings = (props: any) => { ...@@ -318,7 +322,7 @@ const FacilityBookings = (props: any) => {
}, },
setting: false, setting: false,
}} }}
headerTitle="预约列表" // headerTitle="预约列表"
/> />
{curString ? ( {curString ? (
...@@ -343,18 +347,18 @@ const FacilityBookings = (props: any) => { ...@@ -343,18 +347,18 @@ const FacilityBookings = (props: any) => {
rowKey="id" rowKey="id"
dataSource={Data2.data} dataSource={Data2.data}
columns={columns2} columns={columns2}
pagination={{ // pagination={{
current: curString.curPage2, // current: curString.curPage2,
total: Data2.total.totalRow, // total: Data2.total.totalRow,
showSizeChanger: false, // showSizeChanger: false,
onChange: Pagechange, // onChange: Pagechange,
}} // }}
// pagination={false} // 隐藏默认分页 pagination={false} // 隐藏默认分页
search={false} search={false}
toolBarRender={() => [ toolBarRender={() => [
<Button key="3" type="primary" onClick={goToFunction}> <Button key="3" type="primary" onClick={goToFunction}>
<PlusOutlined /> <PlusOutlined />
添加设施 Add Facilities
</Button>, </Button>,
]} ]}
options={{ options={{
...@@ -365,8 +369,23 @@ const FacilityBookings = (props: any) => { ...@@ -365,8 +369,23 @@ const FacilityBookings = (props: any) => {
}, },
setting: false, setting: false,
}} }}
headerTitle="设施列表" // headerTitle="Facilities List"
/>
{curString ? (
<div className="pages">
<Pagination
current={curString.curPage2}
total={Data2.total.totalRow}
// pageSizeOptions={[]}
showSizeChanger={false}
// pageSize={village.page.curPageSize}
onChange={Pagechange}
/> />
</div>
) : (
''
)}
</TabPane> </TabPane>
</Tabs> </Tabs>
</div> </div>
......
import React, { useState, useEffect } from 'react';
import { Input ,Tabs,Table,Space, Button} from 'antd';
const { TabPane } = Tabs;
import {connect} from 'umi';
import { objectColumns } from '@/utils/string';
// cdkCode: 998974
// cdkStatus: "0"
// count: 0
// createTime: "Sep 7, 2020 6:12:35 PM"
// deleted: 0
// enable: 0
// extend: ""
// id: "8f8b49308c0b4fb4a0e6b9d6af0aaa1e"
// inviterAddress: "TANGDE2#01#01#01"
// inviterId: "2597108b72f64a5da34892c14f0e6a57"
// inviterName: "啊啊啊"
// inviterPhone: "2536727886@qq.com"
// linkStatus: 1
// numberPlate: "粤A465123"
// securityGuardCommunity: "unkown"
// securityGuardName: "unkown"
// securityGuardPhone: "unkown"
// status: 1
// updateTime: "Sep 7, 2020 6:13:06 PM"
// visitorsName: "销赃"
// visitorsPhone: "18535669865"
const columns = objectColumns( [
["User Name", "inviterName"],
["Visitor", "visitorsName"],
["Security Guard", "securityGuardName"],
["Number Plate", "numberPlate"],
["time", "updateTime"],
["community", "visitorCommunity"],
["unit", "inviterAddress"]
// ["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)],
])
import TitleSearch from '@/components/TitleSearch/TitleSearch'
import { RA } from '@/utils/method';
const module="VisitorRecord"
const VisitorRecord = (props:any) => {
const { dispatch, Data } = props;
const TosVisitorRecordGet = (values: any) => { dispatch({ type: 'tosVisitorRecord/get', playload: values }) };
useEffect(() => {
RA(26,{inviterAddress: "", visitorCommunity: ""},module,dispatch)
}, [])
const CallBackTitleSearch = (values:any) => {
console.log(values)
// visitorCommunity
TosVisitorRecordGet({
visitorCommunity: values.inviterAddress,
})
}
const pagination={defaultCurrent:1,total: Data!=null?Data.length:0}
return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
<TitleSearch listkey={['inviterAddress']}
list={['Community Name']}
community={"serviceCommunityList"}
onSubmit={CallBackTitleSearch}/>
{Data!=null?
<Table
loading={false}
rowKey="id"
style={{ marginTop: 16 }}
dataSource={Data.rows}
columns={columns}
pagination={pagination}
// pagination={{ current: 1, total: Data.total}}
/>:null}
</div>
);
};
function map(state:any) {
const { Data} = state[module]
return { Data}
}
export default connect(map)(VisitorRecord);
// 备注
// 列表缺少访客时间
// 搜索缺少到达时间、访客姓名
...@@ -31,8 +31,8 @@ export const Notice = [ ...@@ -31,8 +31,8 @@ export const Notice = [
export const NewFaci = [ export const NewFaci = [
[{ required: true, message: 'Please select community' }], [{ required: true, message: 'Please select community' }],
[{ required: true, message: 'Please input Facility Name' }], [{ required: true, message: 'Please input Facility Name' }],
[{ required: true, message: 'Please Set management fee' }], [{ required: false, message: 'Please Set management fee' }],
[{ required: true, message: 'Please Set Setting deposit' }], [{ required: false, message: 'Please Set Setting deposit' }],
[{ required: true, message: 'Please Upload facility photos' }], [{ required: true, message: 'Please Upload facility photos' }],
[{ required: true, message: 'Required' }], [{ required: true, message: 'Required' }],
[{ required: true, message: 'Required' }], [{ required: true, message: 'Required' }],
......
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