Commit e31991a0 authored by cellee's avatar cellee

新增小区修改,设施预订时间bug修复

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 7eab4fdc
/*
* @Author: your name
* @Date: 2020-12-01 18:40:06
* @LastEditTime: 2021-01-15 18:17:37
* @LastEditTime: 2021-01-30 15:56:31
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\config\config.ts
......@@ -388,12 +388,11 @@ export default defineConfig({
name: 'companyinformation',
component: './AccountManagement/CompanyInformation/CompanyInformation',
},
{
path: './LanguageSettings',
name: 'languagesettings',
component: './AccountManagement/LanguageSettings/LanguageSettings',
},
// {
// path: './LanguageSettings',
// name: 'languagesettings',
// component: './AccountManagement/LanguageSettings/LanguageSettings',
// },
{
path: '*',
component: '@/pages/404',
......
import React, { useState } from 'react';
import { Input } from 'antd';
import './zip.less';
interface PriceValue {
residentialZipCode?: String;
residentialAddress?: String;
residentialName?: String;
}
interface PriceInputProps {
value?: PriceValue;
onChange?: (value: PriceValue) => void;
}
const PriceInput: React.FC<PriceInputProps> = ({ value = {}, onChange }) => {
const triggerChange = (changedValue: any) => {
if (onChange) {
onChange({ ...value, ...changedValue });
}
};
const onNumberChange = (e: React.ChangeEvent<HTMLInputElement>) => {
triggerChange({ [e.target.name]: e.target.value });
};
return (
<span>
<div className="zip2">
<Input
type="text"
// value={value.residentialZipCode || number}
maxLength={6}
name="residentialZipCode"
onChange={onNumberChange}
style={{ marginRight: '10px', width: 120 }}
placeholder="6 Postcode"
/>
<Input
type="text"
name="residentialAddress"
// value={value.residentialAddress || number}
onChange={onNumberChange}
style={{ width: '360px' }}
placeholder="Please enter community adds"
/>
</div>
<div className="zip1">
<Input
type="text"
name="residentialName"
// value={value.residentialName || number}
onChange={onNumberChange}
style={{ marginRight: '10px', width: '260px' }}
placeholder="Please enter community name"
/>
</div>
</span>
);
};
export default PriceInput;
.zip2 {
margin-bottom: 15px;
}
.zip1 {
margin-bottom: 10px;
}
......@@ -3,6 +3,7 @@
box-sizing: border-box;
border: 1px solid #d9d9d9;
border-radius: 2px;
cursor: pointer;
&.disabled {
background: #f5f5f5;
border-color: #d9d9d9;
......@@ -15,7 +16,6 @@
color: #000;
font-size: 14px;
transition: all 0.5s;
cursor: pointer;
&.active {
color: #999;
}
......@@ -43,7 +43,7 @@
z-index: 10;
background: #fff;
border-radius: 2px;
min-width: 396px;
min-width: 410px;
// 可选时间
.opens {
......@@ -54,7 +54,7 @@
span.sapa {
cursor: pointer;
display: inline-block;
padding: 2px 4px;
padding: 4px 6px;
margin: 0 8px 8px 0;
font-size: 13px;
letter-spacing: 1px;
......@@ -106,6 +106,8 @@
align-items: center;
margin-bottom: 8px;
button {
width: 80px;
height: 28px;
&:nth-child(1) {
margin-right: 6px;
}
......
......@@ -62,8 +62,20 @@ const OnTime = (porps: any) => {
// 已经选择的时间
useEffect(() => {
if (inhibitTime) {
// 只要数据变化了先清空原来的数据
let a = [] as any;
if (getLocale() == 'zh-CN') {
setImgOpen(['开始时间', '结束时间']);
} else {
setImgOpen(['Start time', 'End time']);
}
setScheduled(false);
time.length = 0;
timeOks.length = 0;
// 先循环一次把所有k的变成可选
for (let k in Quantum) {
Quantum[k].active = false;
Quantum[k].disabled = false;
}
......@@ -206,14 +218,14 @@ const OnTime = (porps: any) => {
return (
<div className={disabled ? 'ontime-box disabled' : 'ontime-box'}>
<div
className={Scheduled ? 'ims' : 'ims active'}
className={time.length > 0 ? 'ims' : 'ims active'}
onClick={() => {
opens();
}}
>
<span>{imgOpen[0]}</span> - <span>{imgOpen[1]}</span>
{Scheduled ? (
<CloseCircleOutlined twoToneColor="#333" />
<DownOutlined style={{ color: '#333' }} className={Scheduled ? 'icon icon-up' : 'icon'} />
) : (
<DownOutlined
style={{ color: '#d9d9d9' }}
......
import React, { useState } from 'react';
import { Form, Input, Select, Button } from 'antd';
const { Option } = Select;
type Currency = 'rmb' | 'dollar';
interface PriceValue {
number?: number;
currency?: Currency;
}
interface PriceInputProps {
value?: PriceValue;
onChange?: (value: PriceValue) => void;
}
const PriceInput: React.FC<PriceInputProps> = ({ value = {}, onChange }) => {
const [number, setNumber] = useState(0);
const [currency, setCurrency] = useState<Currency>('rmb');
const triggerChange = (changedValue: { number?: number; currency?: Currency }) => {
if (onChange) {
onChange({ number, currency, ...value, ...changedValue });
}
};
const onNumberChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const newNumber = parseInt(e.target.value || '0', 10);
if (Number.isNaN(number)) {
return;
}
if (!('number' in value)) {
setNumber(newNumber);
}
triggerChange({ number: newNumber });
};
const onCurrencyChange = (newCurrency: Currency) => {
if (!('currency' in value)) {
setCurrency(newCurrency);
}
triggerChange({ currency: newCurrency });
};
return (
<span>
<Input
type="text"
value={value.number || number}
onChange={onNumberChange}
style={{ width: 100 }}
/>
<Select
value={value.currency || currency}
style={{ width: 80, margin: '0 8px' }}
onChange={onCurrencyChange}
>
<Option value="rmb">RMB</Option>
<Option value="dollar">Dollar</Option>
</Select>
</span>
);
};
const Facilities = () => {
const onFinish = (values: any) => {
console.log('Received values from form: ', values);
};
const checkPrice = (_: any, value: { number: number }) => {
if (value.number > 0) {
return Promise.resolve();
}
return Promise.reject('Price must be greater than zero!');
};
return (
<Form
name="customized_form_controls"
layout="inline"
onFinish={onFinish}
initialValues={{
price: {
number: 0,
currency: 'rmb',
},
}}
>
<Form.Item name="price" label="Price" rules={[{ validator: checkPrice }]}>
<PriceInput />
</Form.Item>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Form>
);
};
export default Facilities;
/*
* @Author: your name
* @Date: 2020-11-19 16:54:53
* @LastEditTime: 2021-01-27 17:23:53
* @LastEditTime: 2021-01-30 15:54:42
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\pages\AccountManagement\CompanyInformation\CompanyInformation.tsx
......@@ -18,7 +18,8 @@ const CompanyInformation = () => {
<div className={styles.box1}>
<div className={styles.box1item1}>Management Company :</div>
<div style={{ position: 'absolute', left: 160 }}>
<Input style={{ width: 200 }} value="TOS Pte Ltd" />
<p>TOS Pte Ltd</p>
{/* <Input style={{ width: 200 }} value="TOS Pte Ltd" /> */}
</div>
{/* <div className={styles.box1item3}> <Button>Edit</Button></div> */}
</div>
......@@ -26,13 +27,15 @@ const CompanyInformation = () => {
<div className={styles.box2}>
<div className={styles.box2item1}>Contact Number :</div>
<div className={styles.box2item2}>
<Input style={{ width: 200 }} value="67441692" />
<p>67441692</p>
{/* <Input style={{ width: 200 }} value="67441692" /> */}
</div>
</div>
<div className={styles.box2}>
<div className={styles.box2item1}>Contact Email :</div>
<div className={styles.box2item2}>
<Input style={{ width: 200 }} value="admin.tos@crems.com.sg" />
<p>admin.tos@crems.com.sg</p>
{/* <Input style={{ width: 200 }} value="admin.tos@crems.com.sg" /> */}
</div>
</div>
</div>
......
......@@ -4,14 +4,14 @@
.base {
width: 100%;
background-color: #ffffff;
padding: 34px;
padding: 30px 30px 10px;
}
.box1 {
width: 100%;
height: 34px;
position: relative;
margin-bottom: 28px;
margin-bottom: 20px;
}
.box1item1 {
position: absolute;
......@@ -29,7 +29,7 @@
width: 100%;
height: 34px;
position: relative;
margin-bottom: 28px;
margin-bottom: 20px;
}
.box2item1 {
position: absolute;
......
import React, { useState, useEffect, useRef } from 'react';
import { Input, Form, Button, message } from 'antd';
import { connect } from 'umi';
const layout = {
labelCol: { span: 2 },
// wrapperCol: { span: 8 },
};
import { RA, ResultClear } from '@/utils/method';
const module = 'CellList';
import FileUpload from '@/components/FileUpload/FileUpload';
import TitleBack from '@/components/TitleBack/TitleBack';
import Line from '@/components/Line/Line';
import { validateMessages } from '@/utils/params';
const Add = (props: any) => {
const { dispatch, Result } = props;
const formRef = useRef(null);
const onFinish = (values: any) => {
console.log(values);
RA(29, values, module, dispatch);
};
const [extend, setExtend] = useState('');
useEffect(() => {
if (Result != null) {
console.log('页面结果');
console.log(Result);
if (Result.error_code == undefined) {
console.log('服务器有问题');
message.error('服务器有问题,请求失败', 5);
}
if (Result.error_code == '0000') {
history.go(-1);
}
ResultClear(module, dispatch);
}
}, [Result]);
const onBillChange = (values: any, allValues: any) => {
if (values['residentialName'] != null) {
var tmp = values['residentialName'];
console.log(tmp.length);
setExtend(tmp);
}
};
return (
<div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
<TitleBack title="Add Commnunity Infomation"></TitleBack>
<Form
ref={formRef}
{...layout}
name="nest-messages"
onFinish={onFinish}
validateMessages={validateMessages}
onValuesChange={onBillChange}
>
<Form.Item name={'residentialName'} label="Community" rules={[{ required: true }]}>
<Input style={{ width: 200 }} />
</Form.Item>
<Form.Item name={'zipcode'} label="Postcode" rules={[{ required: true }]}>
<Input style={{ width: 200 }} />
</Form.Item>
<Form.Item name={'residentialAddress'} label="Address" rules={[{ required: true }]}>
<Input style={{ width: 300 }} />
</Form.Item>
<Form.Item label="Contact Information" style={{ marginBottom: 0 }}>
<Form.Item
style={{ display: 'inline-block', width: '200' }}
name={'residentialPhone'}
rules={[{ required: true }]}
>
<Input placeholder="Contact Number" />
</Form.Item>
<Form.Item
style={{ display: 'inline-block', width: '200', marginLeft: 20 }}
name={'residentialEmail'}
rules={[{ required: true }]}
>
<Input placeholder="Contact Email" />
</Form.Item>
</Form.Item>
<Form.Item
name={'residentialManagerUserName'}
label="Community Manager"
rules={[{ required: true }]}
>
<Input style={{ width: 200 }} />
</Form.Item>
<Line />
<Form.Item label="Help center" style={{ marginBottom: 0 }}>
<Form.Item
style={{ display: 'inline-block', width: '200' }}
name={'residentialHotlineName'}
rules={[]}
>
<Input placeholder="Name Of Hotline" />
</Form.Item>
<Form.Item
style={{ display: 'inline-block', width: '200', marginLeft: 20 }}
name={'residentialHotline'}
rules={[]}
>
<Input placeholder="Hotline" />
</Form.Item>
</Form.Item>
<Line />
{extend.length > 0 ? (
<>
<Form.Item wrapperCol={{ offset: 2 }} style={{ marginBottom: 0 }}>
<Form.Item
style={{ display: 'inline-block', width: '200' }}
name={'balouscheduleFile'}
>
<FileUpload
title="Bus Timetable"
url={'/tos/image/upload'}
data={{ imageType: 'tosCreateCommunity', extends: extend }}
reg="name"
/>
</Form.Item>
<Form.Item
style={{ display: 'inline-block', width: '200', marginLeft: 100 }}
name={'serviceGuideFile'}
>
<FileUpload
title="Service Guide"
url={'/tos/image/upload'}
data={{ imageType: 'tosCreateCommunity', extends: extend }}
reg="name"
/>
</Form.Item>
<Form.Item
style={{ display: 'inline-block', width: '200', marginLeft: 100 }}
name={'lifeServiceFile'}
>
<FileUpload
title="Life Service"
url={'/tos/image/upload'}
data={{ imageType: 'tosCreateCommunity', extends: extend }}
reg="name"
/>
</Form.Item>
</Form.Item>
</>
) : null}
<Form.Item wrapperCol={{ offset: 2 }}>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Form>
</div>
);
};
function map(state: any) {
const { Result } = state[module];
return { Result };
}
export default connect(map)(Add);
This diff is collapsed.
import React, { useState, useEffect,useRef} from 'react';
import { Input ,Tabs,Row,Col, Button} from 'antd';
const { TabPane } = Tabs;
import {connect,history} from 'umi';
import { RA } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
const module="CellList"
const Detail = (props:any) => {
const { dispatch, Data,DataSave,Result} = props;
const formRef = useRef(null)
useEffect(()=>{
if (DataSave != null) {
console.log("初始化页面参数")
console.log(DataSave);
/*
balouscheduleUrl: "Shelf_life_service.pdf"
cdkCode: 154952
cdkStatus: "0"
communityName: ""
count: 0
createTime: {date: 10, day: 4, hours: 22, minutes: 36, month: 8, …}
deleted: 0
description: ""
enable: 0
extend: ""
id: "a71a67d8ba0a43c0a46e73bf166d3484"
lifeServiceUrl: "小课堂课程表2020.08.07.pdf"
residentialAddress: "Tianhe"
residentialEmail: "sales@huahui.com"
residentialEndWorking: null
residentialFeeMethod: 0
residentialHotline: "2222-8888"
residentialHotlineName: "2222-8888"
residentialHotlineServieEndTime: null
residentialHotlineServieStartTime: null
residentialManagerUserName: "张主任"
residentialName: "ZERO Community"
residentialPhone: "2222-8888"
residentialStartWorking: null
residentialZipCode: "589647"
serviceGuideUrl: "propertyServiceGuide.pdf"
serviceProviderId: ""
serviceProviderName: ""
updateTime: */
}
}, [])
// 小区名称,
// 详细地址,
// 工作时间 休息时间
// 小区联系电话 小区邮箱
// 小区管理员
// 物业费
// 楼巴时刻表 物业办事指南 保质期服务
// 帮助中心
// 临时到访码下载
return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
{
DataSave != null ?
<>
<TitleBack title="Community Detail"></TitleBack>
<Row gutter={8}>
<Col span={3}>小区名称:</Col>
<Col>{DataSave.residentialName}</Col>
</Row>
<Row gutter={8} style={{marginTop:16}}>
<Col span={3}>详细地址:</Col>
<Col>{DataSave.residentialAddress}</Col>
</Row>
<Row gutter={8} style={{marginTop:16}}>
<Col span={3}>小区联系电话:</Col>
<Col span={3}>{DataSave.residentialPhone}</Col>
<Col>小区邮箱:</Col>
<Col>{DataSave.residentialEmail}</Col>
</Row>
<Row gutter={8} style={{marginTop:16}}>
<Col span={3}>小区管理员:</Col>
<Col>{DataSave.residentialManagerUserName}</Col>
</Row>
<Row gutter={8} style={{marginTop:16}}>
<Col span={3}>物业费:</Col>
<Col>{DataSave.residentialAddress}</Col>
</Row>
<Row gutter={8} style={{marginTop:16}}>
<Col span={3}>楼巴时刻表:</Col>
<Col span={3}><a>{DataSave.balouscheduleUrl}</a></Col>
<Col>物业办事指南:</Col>
<Col span={3}><a>{DataSave.serviceGuideUrl}</a></Col>
<Col>保质期服务:</Col>
<Col span={3}><a>{DataSave.lifeServiceUrl}</a></Col>
</Row>
<Row gutter={8} style={{marginTop:16}}>
<Col span={3}>帮助中心:</Col>
<Col>{DataSave.residentialHotline}</Col>
<Col>{DataSave.residentialHotlineName}</Col>
</Row>
<Row gutter={8} style={{marginTop:16}}>
<Col span={3}>临时到访码:</Col>
<Col>{DataSave.residentialZipCode}</Col>
</Row>
</> : null
}
</div>
);
};
function map(state:any) {
const { Data,DataSave,Result} = state[module]
return { Data,DataSave,Result}
}
export default connect(map)(Detail);
\ No newline at end of file
......@@ -416,7 +416,7 @@ const Bookings = (props: any) => {
<Col>
<Form.Item label="Reserve Time" name="Time" noStyle>
<OnTimeTow
disabled={prohibit}
disabled={prohibit || dateTime}
limit={curString.categoriesOpenTime} // 设施默认禁止时间段
inhibitTime={result} // 选择日期后的禁止时间
onChanges={onChanges}
......
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