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) => {
function mapStateToProps(state: any) {
const { FacilitysList } = state.FacilityBookings;
console.log(FacilitysList);
return {
FacilitysList,
};
......
import React from 'react';
import { Select } from 'antd';
const Option = Select.Option;
import React, { useState, useEffect } from 'react';
import { Select, TimePicker } from 'antd';
const { Option } = Select;
import moment from 'moment';
const OnTime = (porps: any) => {
// placeholder 默认显示 disabled 是否禁止
// 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) => {
var arr = [];
for (let i = 1; i < num; i++) {
for (let i = 0; i < num; i++) {
if (i < 10) {
arr[i] = `0${i}`;
} else {
......@@ -49,14 +60,25 @@ const OnTime = (porps: any) => {
return (
<>
<Select
style={{ width: 140 }}
placeholder={placeholder}
disabled={disabled}
onSelect={openSelect}
>
{hourS}
</Select>
{defaultValue ? (
<TimePicker
defaultValue={moment(defaultValue, 'HH:mm')}
format="HH:mm"
onChange={openSelect}
placeholder={placeholder}
defaultOpenValue={moment('00:00', 'HH:mm')}
disabled={disabled}
/>
) : (
<Select
style={{ width: 140 }}
placeholder={placeholder}
disabled={disabled}
onSelect={openSelect}
>
{hourS}
</Select>
)}
</>
);
};
......
......@@ -161,7 +161,11 @@ export default {
} break;
case 7: {
let tmp = resp.data;
const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
const reg = [
["url", "categoriesImageUrl"],
["name", "categoriesName"],
['imgName','categoriesImageName']
]
const reg2 = [["url", null]]
//let sourceData = tmp;
// sourceData.categoriesOpenTime= timeToMoment(tmp.categoriesOpenTime);
......
......@@ -15,6 +15,8 @@ import {
message,
} from 'antd';
import moment from 'moment';
import { Link, useIntl, connect, Dispatch } from 'umi';
import TitleBack from '../../../components/TitleBack/TitleBack';
......@@ -23,6 +25,7 @@ import { timestampToTime3 } from '../../../utils/time';
import TextArea from 'antd/lib/input/TextArea';
import { getUrlLast } from '../../../utils/string';
import { merge } from 'lodash';
const BookingDetail = (props: any) => {
const { dispatch, location, DataSave, DataSaveDetail, token, load } = props;
......@@ -135,7 +138,8 @@ const BookingDetail = (props: any) => {
{statusDes[DataSave.status]}
</Descriptions.Item>
<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>
......
......@@ -88,6 +88,7 @@ const Bookings = (props: any) => {
}
}, [Result]);
console.log(Data3);
// 选择小区监听是不是有值
useEffect(() => {
setLoading(false);
......@@ -257,7 +258,7 @@ const Bookings = (props: any) => {
alone={true}
placeholder={'Community Name'}
opname={getFacility}
defaultValue={DataSave != null ? DataSave.communityName : null}
defaultName={DataSave != null ? DataSave.communityName : null}
// onSubmit={getFacility}
/>
</Spin>
......@@ -316,7 +317,7 @@ const Bookings = (props: any) => {
<div className={styles.box4item1}>Unit : </div>
<div className="divbox4">
<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>
<span className="jio">#</span>
<Form.Item name="floorNumber" rules={BookingsTip[3]}>
......
......@@ -43,7 +43,9 @@ const FacilityBookings = (props: any) => {
const QA = (values: any) => {
dispatch({ type: 'FacilityBookings/QA', playload: values });
};
const IA = () => {
dispatch({ type: 'FacilityBookings/IA' });
};
const CA = () => {
dispatch({ type: 'FacilityBookings/CA', playload: null });
};
......@@ -52,14 +54,14 @@ const FacilityBookings = (props: any) => {
const [columns2, setColumns2] = useState([]);
const goToFunction = () => {
console.log(curString.tab);
if (curString.tab == 2) {
CA();
// 先清空上传图片列表
dispatch({ type: 'FacilityBookings/overAllImgList' });
} else {
// 清空之前的数据
let Data3 = null;
dispatch({ type: 'FacilityBookings/returnPage3', Data3 });
SA(null);
}
history.push(location.pathname + (curString.tab == 1 ? '/Booking' : '/Adding'));
};
......@@ -74,8 +76,10 @@ const FacilityBookings = (props: any) => {
const makeOperator = (values: any, index: any) => {
const path = ['/FacilityDetail', '/FacilityEdit', '/FacilityApply'];
SA(values);
console.log('准备页面跳转');
console.log(curString);
// 清空设施列表图
let list: any = [];
dispatch({ type: 'FacilityBookings/genxin', list });
history.push(location.pathname + path[index]);
};
......@@ -307,7 +311,7 @@ const FacilityBookings = (props: any) => {
toolBarRender={() => [
<Button key="3" type="primary" onClick={goToFunction}>
<PlusOutlined />
添加预约
Add Appointment
</Button>,
]}
options={{
......@@ -318,7 +322,7 @@ const FacilityBookings = (props: any) => {
},
setting: false,
}}
headerTitle="预约列表"
// headerTitle="预约列表"
/>
{curString ? (
......@@ -343,18 +347,18 @@ const FacilityBookings = (props: any) => {
rowKey="id"
dataSource={Data2.data}
columns={columns2}
pagination={{
current: curString.curPage2,
total: Data2.total.totalRow,
showSizeChanger: false,
onChange: Pagechange,
}}
// pagination={false} // 隐藏默认分页
// pagination={{
// current: curString.curPage2,
// total: Data2.total.totalRow,
// showSizeChanger: false,
// onChange: Pagechange,
// }}
pagination={false} // 隐藏默认分页
search={false}
toolBarRender={() => [
<Button key="3" type="primary" onClick={goToFunction}>
<PlusOutlined />
添加设施
Add Facilities
</Button>,
]}
options={{
......@@ -365,8 +369,23 @@ const FacilityBookings = (props: any) => {
},
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>
</Tabs>
</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 = [
export const NewFaci = [
[{ required: true, message: 'Please select community' }],
[{ required: true, message: 'Please input Facility Name' }],
[{ required: true, message: 'Please Set management fee' }],
[{ required: true, message: 'Please Set Setting deposit' }],
[{ required: false, message: 'Please Set management fee' }],
[{ required: false, message: 'Please Set Setting deposit' }],
[{ required: true, message: 'Please Upload facility photos' }],
[{ 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