Commit 3708790d authored by cellee's avatar cellee

测试各bug修复

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent 851262aa
...@@ -67,6 +67,7 @@ const Model: LoginModelType = { ...@@ -67,6 +67,7 @@ const Model: LoginModelType = {
console.log(userMessage); console.log(userMessage);
console.log(userMessage.token); console.log(userMessage.token);
setCookie('token', userMessage.token); setCookie('token', userMessage.token);
setCookie('id', userMessage.userModel.id);
setCookie('name', userMessage.userModel.tosUserName); setCookie('name', userMessage.userModel.tosUserName);
setCookie('phone', userMessage.userModel.tosUserPhone); setCookie('phone', userMessage.userModel.tosUserPhone);
localStorage.setItem('permission', JSON.stringify(userMessage.permission)); localStorage.setItem('permission', JSON.stringify(userMessage.permission));
......
...@@ -10,6 +10,7 @@ import { village } from '@/utils/tip'; ...@@ -10,6 +10,7 @@ import { village } from '@/utils/tip';
import moment from 'moment'; import moment from 'moment';
import { parseInt } from 'lodash'; import { parseInt } from 'lodash';
import { event } from '@/.umi/plugin-locale/locale';
const { RangePicker } = TimePicker; const { RangePicker } = TimePicker;
...@@ -204,6 +205,7 @@ const Adds = (props: any) => { ...@@ -204,6 +205,7 @@ const Adds = (props: any) => {
// 表单验证 // 表单验证
const onFinish = (values: any) => { const onFinish = (values: any) => {
let { residentialZipCode, residentialAddress, residentialName } = values.des; let { residentialZipCode, residentialAddress, residentialName } = values.des;
if (residentialZipCode.length < 6) { if (residentialZipCode.length < 6) {
message.error('Please Enter 6-digit Zip Code!'); message.error('Please Enter 6-digit Zip Code!');
} else { } else {
...@@ -280,6 +282,11 @@ const Adds = (props: any) => { ...@@ -280,6 +282,11 @@ const Adds = (props: any) => {
return value; return value;
} }
// 键盘回车事件
const onKeyDowns = (event: any) => {
console.log(event);
};
return ( return (
<> <>
<Spin spinning={loading} tip="信息提交中..." size="large"> <Spin spinning={loading} tip="信息提交中..." size="large">
...@@ -295,6 +302,7 @@ const Adds = (props: any) => { ...@@ -295,6 +302,7 @@ const Adds = (props: any) => {
</div> </div>
</h3> </h3>
<Form <Form
onKeyDown={onKeyDowns}
name="basic" name="basic"
form={form} form={form}
onFinish={onFinish} onFinish={onFinish}
...@@ -466,9 +474,9 @@ const Adds = (props: any) => { ...@@ -466,9 +474,9 @@ const Adds = (props: any) => {
// export default Adds; // export default Adds;
function map(state: any) { function map(state: any) {
console.log(state); // console.log(state);
const Data = state.CellList.DataSave; const Data = state.CellList.DataSave;
const loading = state.loading.models.CellList; const loading = state.loading.models.CellList ? state.loading.models.CellList : false;
const { Result } = state.CellList; const { Result } = state.CellList;
return { Data, loading, Result }; return { Data, loading, Result };
} }
......
...@@ -20,25 +20,30 @@ import { getCookie } from '@/utils/method'; ...@@ -20,25 +20,30 @@ import { getCookie } from '@/utils/method';
import moment from 'moment'; import moment from 'moment';
const module = 'CommunityAnnouncement'; const module = 'CommunityAnnouncement';
const Add = (props: any) => { const Add = (props: any) => {
const { dispatch, Result, loading, DataSave, ImgSrc } = props; const { dispatch, Result, loading, DataSave, ImgSrc } = props;
const formRef = useRef(null); const formRef = useRef(null);
const [form] = Form.useForm(); const [form] = Form.useForm();
// 图片地址
const [ImageSrc, setImageSrc] = useState([] as any);
console.log(ImgSrc); console.log(ImgSrc);
// 监听传递过来的值 // 监听传递过来的值
useEffect(() => { useEffect(() => {
if (DataSave != null) { if (DataSave != null) {
// let tim = DataSave.noticStartTime.time; let day = moment(DataSave.noticStartTime.time);
let day2 = DataSave.noticEndTime ? moment(DataSave.noticEndTime.time) : null;
// 赋值 // 赋值
form.setFieldsValue({ form.setFieldsValue({
noticTitle: DataSave.noticTitlel, noticTitle: DataSave.noticTitlel,
noticText: DataSave.noticText, noticText: DataSave.noticText,
// noticStartTime: moment(tim).format('YYYY-MM-DD'), noticStartTime: day,
// noticEndTime:DataSave.noticEndTime?moment(DataSave.noticEndTime, 'YYYY-MM-DD HH:mm:ss'):'', noticEndTime: day2,
}); });
// 发起请求图片 // 发起请求图片
let msg = { let msg = {
type: 'tosCommunityNoticePreview', type: 'tosCommunityNoticePreview',
...@@ -48,9 +53,6 @@ const Add = (props: any) => { ...@@ -48,9 +53,6 @@ const Add = (props: any) => {
} }
}, [DataSave]); }, [DataSave]);
// 图片地址
const [ImageSrc, setImageSrc] = useState([] as any);
// 监听图片状态 ImgSrc // 监听图片状态 ImgSrc
useEffect(() => { useEffect(() => {
if (ImgSrc != null) { if (ImgSrc != null) {
...@@ -151,7 +153,9 @@ const Add = (props: any) => { ...@@ -151,7 +153,9 @@ const Add = (props: any) => {
rules={Notice[2]} rules={Notice[2]}
> >
<TextArea <TextArea
style={{ width: 400, height: 100 }} style={{ height: 100, maxWidth: 600 }}
maxLength={1000}
showCount={true}
placeholder="Please input the announcement content" placeholder="Please input the announcement content"
/> />
</Form.Item> </Form.Item>
...@@ -162,7 +166,7 @@ const Add = (props: any) => { ...@@ -162,7 +166,7 @@ const Add = (props: any) => {
data={{ data={{
imageType: 'tosNotice', imageType: 'tosNotice',
}} }}
limitNums={1} limitNums={5}
defaultValue={ImageSrc} defaultValue={ImageSrc}
/> />
</Form.Item> </Form.Item>
...@@ -179,11 +183,7 @@ const Add = (props: any) => { ...@@ -179,11 +183,7 @@ const Add = (props: any) => {
/> />
</Form.Item> </Form.Item>
<Form.Item name="noticEndTime" className="diyItem" label="Expiration Date" rules={[]}> <Form.Item name="noticEndTime" className="diyItem" label="Expiration Date" rules={[]}>
<DatePicker <DatePicker style={{ width: 200 }} placeholder="Expiration Dates" />
style={{ width: 200 }}
placeholder="Expiration Dates"
disabledDate={disabledDate}
/>
</Form.Item> </Form.Item>
<hr /> <hr />
<Form.Item style={{ marginBottom: 5 }} className="diyItem" label=" " colon={false}> <Form.Item style={{ marginBottom: 5 }} className="diyItem" label=" " colon={false}>
...@@ -200,7 +200,9 @@ const Add = (props: any) => { ...@@ -200,7 +200,9 @@ const Add = (props: any) => {
function map(state: any) { function map(state: any) {
const { Result, DataSave, ImgSrc } = state[module]; const { Result, DataSave, ImgSrc } = state[module];
const loading = state.loading.models.CommunityAnnouncement; const loading = state.loading.models.CommunityAnnouncement
? state.loading.models.CommunityAnnouncement
: false;
return { Result, loading, DataSave, ImgSrc }; return { Result, loading, DataSave, ImgSrc };
} }
export default connect(map)(Add); export default connect(map)(Add);
...@@ -65,18 +65,18 @@ const CommunityAnnouncement = (props: any) => { ...@@ -65,18 +65,18 @@ const CommunityAnnouncement = (props: any) => {
), ),
}, },
{ {
title: 'NoticScope', title: 'Status',
dataIndex: 'noticStatus', dataIndex: 'noticStatus',
render: function (text: any) { render: function (text: any) {
switch (text) { switch (text) {
case 1: case 1:
return <Tag color="green">Publishing</Tag>; // 发布中 return <Tag color="green">Take Effect</Tag>; // 发布中
break; break;
case 2: case 2:
return <Tag color="red">Expired</Tag>; // 已过期 return <Tag color="red">Invalid</Tag>; // 已过期
break; break;
default: default:
return <Tag color="cyan">Waiting for release</Tag>; // 等待发布 return <Tag color="cyan">Waiting For Release</Tag>; // 等待发布
break; break;
} }
}, },
...@@ -84,7 +84,7 @@ const CommunityAnnouncement = (props: any) => { ...@@ -84,7 +84,7 @@ const CommunityAnnouncement = (props: any) => {
{ {
title: 'Actions', title: 'Actions',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space size="middle"> <Space size={0}>
<Button <Button
type="link" type="link"
onClick={() => { onClick={() => {
......
...@@ -48,14 +48,14 @@ const Detail = (props: any) => { ...@@ -48,14 +48,14 @@ const Detail = (props: any) => {
function hanFunStart(start: any) { function hanFunStart(start: any) {
switch (start) { switch (start) {
case 1: case 1:
return <Badge status="success" text="Publishing" />; return <Badge status="success" text="Take effect" />;
// <Tag color="green">Publishing</Tag>; // 发布中 // <Tag color="green">Publishing</Tag>; // 发布中
break; break;
case 2: case 2:
return <Badge status="error" text="Expired" />; // 已过期 return <Badge status="error" text="Invalid" />; // 已过期
break; break;
default: default:
return <Badge status="processing" text="Waiting for release" />; // 等待发布 return <Badge status="processing" text="Waiting For Release" />; // 等待发布
break; break;
} }
} }
......
...@@ -7,51 +7,54 @@ ...@@ -7,51 +7,54 @@
.ant-form-item-label { .ant-form-item-label {
label { label {
min-width : 120px; min-width: 120px;
text-align: right; text-align: right;
} }
} }
} }
hr { hr {
border : 0; border: 0;
height : 1px; height: 1px;
background : #eee; background: #eee;
margin-bottom: 20px; margin-bottom: 20px;
} }
// bianji // bianji
.form { .form {
padding : 20px; padding: 20px;
border : 1px solid #efefef; border: 1px solid #efefef;
border-radius: 3px; border-radius: 3px;
background : #fff; background: #fff;
box-shadow : 0 1px 1px #ccc; box-shadow: 0 1px 1px #ccc;
h3 { h3 {
margin-bottom: 30px; margin-bottom: 30px;
position : relative; position: relative;
line-height : 35px; line-height: 35px;
.back { .back {
position : absolute; position: absolute;
right : 0; right: 0;
top : 0; top: 0;
margin-bottom: 20px; margin-bottom: 20px;
background : #fff; background: #fff;
} }
} }
.famg { .famg {
display : flex; display: flex;
justify-content: center; justify-content: center;
align-items : center; align-items: center;
div{ div {
padding:10% 0; padding: 10% 0;
} }
span { span {
margin: 10px auto; margin: 10px auto;
} }
} }
}
.ant-form-item textarea.ant-input {
height: 100%;
} }
...@@ -30,8 +30,9 @@ import { validateMessages } from '@/utils/params'; ...@@ -30,8 +30,9 @@ import { validateMessages } from '@/utils/params';
// 日期 // 日期
import moment from 'moment'; import moment from 'moment';
import { BookingsTip } from '@/utils/tip'; import { BookingsTip } from '@/utils/tip';
// 自定义时间段
import OnTime from '@/components/OnTime/OnTime'; import OnTime from '@/components/OnTime/OnTime';
import { getNumber } from '@/utils/string'; // 正则
const Bookings = (props: any) => { const Bookings = (props: any) => {
const { dispatch, Data3, Result, DataSave, token, load, resultTime } = props; const { dispatch, Data3, Result, DataSave, token, load, resultTime } = props;
...@@ -57,7 +58,8 @@ const Bookings = (props: any) => { ...@@ -57,7 +58,8 @@ const Bookings = (props: any) => {
categoriesOpenTime: null, categoriesOpenTime: null,
} as any); } as any);
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const formRef = useRef(null);
const formRef = useRef(null as any);
const [prohibit, setProhibit] = useState(true); // 输入框是否不可选 const [prohibit, setProhibit] = useState(true); // 输入框是否不可选
const [result, setResultTime] = useState(resultTime); // 已预约时间段 const [result, setResultTime] = useState(resultTime); // 已预约时间段
...@@ -132,14 +134,17 @@ const Bookings = (props: any) => { ...@@ -132,14 +134,17 @@ const Bookings = (props: any) => {
// 保存提交 // 保存提交
const onFinish = (value: any) => { const onFinish = (value: any) => {
console.log('Success:');
var tmp = value; var tmp = value;
console.log(value);
// 判断时间选择 // 判断时间选择
if (soltTime.length < 2 || !soltTime[0]) { if (soltTime.length < 2 || !soltTime[0]) {
message.error('Please Fill In The Appointment Period!'); message.error('Please Fill In The Appointment Period!');
return false;
}
// 手机判断
if (tmp.accountPhone.length != 11 && tmp.accountPhone.length != 8) {
message.error('Please Fill In The Contact Information Correctly!');
return false;
} }
// tmp.categoriesId = null // tmp.categoriesId = null
// tmp.facilitiesId = null // tmp.facilitiesId = null
// tmp.communityName = null // tmp.communityName = null
...@@ -179,7 +184,7 @@ const Bookings = (props: any) => { ...@@ -179,7 +184,7 @@ const Bookings = (props: any) => {
// console.log(comminityValues) // console.log(comminityValues)
// console.log(tmp) // console.log(tmp)
}; };
// 选择 // 选择设施
const RadioChoose = (e: any) => { const RadioChoose = (e: any) => {
Data3.map((item: any, index: any) => { Data3.map((item: any, index: any) => {
item.categorieList.map((thing: any, i: any) => { item.categorieList.map((thing: any, i: any) => {
...@@ -196,7 +201,7 @@ const Bookings = (props: any) => { ...@@ -196,7 +201,7 @@ const Bookings = (props: any) => {
// 选择后取消输入框禁止 // 选择后取消输入框禁止
setProhibit(false); setProhibit(false);
// 赋值给延后天数 // 赋值给延后天数
setBookTime(-thing.pageSize); setBookTime(-item.canReservationDay + 1);
// console.log(item.communityManagerFee) // console.log(item.communityManagerFee)
// console.log(item.communityMargin) // console.log(item.communityMargin)
} }
...@@ -217,6 +222,7 @@ const Bookings = (props: any) => { ...@@ -217,6 +222,7 @@ const Bookings = (props: any) => {
setProhibit(true); setProhibit(true);
setResultTime(null); setResultTime(null);
setSoltTime([]); setSoltTime([]);
// formRef.current.resetFields({ accountName: null }); // 清空已填写的表单
}; };
// 设置之前时间不能选择 // 设置之前时间不能选择
...@@ -249,6 +255,16 @@ const Bookings = (props: any) => { ...@@ -249,6 +255,16 @@ const Bookings = (props: any) => {
setSoltTime(s); setSoltTime(s);
}; };
// 正则手机号
const keyup_tool = (value: any) => {
return getNumber(value.replace(/[^\d^\.]+/g, ''));
};
// 手机号
const keyup_communityManagerFee = (e: any) => {
e.target.value = keyup_tool(e.target.value);
};
return ( return (
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件v1.2 */} {/* 头部组件v1.2 */}
...@@ -313,6 +329,8 @@ const Bookings = (props: any) => { ...@@ -313,6 +329,8 @@ const Bookings = (props: any) => {
style={{ width: 200 }} style={{ width: 200 }}
placeholder="Contact Information" placeholder="Contact Information"
disabled={prohibit} disabled={prohibit}
onKeyUp={keyup_communityManagerFee}
maxLength={11}
/> />
</Form.Item> </Form.Item>
</div> </div>
...@@ -322,11 +340,23 @@ const Bookings = (props: any) => { ...@@ -322,11 +340,23 @@ 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="Blk" style={{ width: 80 }} disabled={prohibit} /> <Input
placeholder="Blk"
style={{ width: 80 }}
disabled={prohibit}
onKeyUp={keyup_communityManagerFee}
maxLength={10}
/>
</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]}>
<Input placeholder="Floor" style={{ width: 80 }} disabled={prohibit} /> <Input
placeholder="Floor"
style={{ width: 80 }}
disabled={prohibit}
onKeyUp={keyup_communityManagerFee}
maxLength={10}
/>
</Form.Item> </Form.Item>
<span className="heng">--</span> <span className="heng">--</span>
<Form.Item name="roomNumber" rules={BookingsTip[4]}> <Form.Item name="roomNumber" rules={BookingsTip[4]}>
......
...@@ -59,10 +59,6 @@ const Facility = (props: any) => { ...@@ -59,10 +59,6 @@ const Facility = (props: any) => {
const openCheck = true; const openCheck = true;
const [Ref3, setRef3] = useState([]);
const [extend, setExtend] = useState(null); // 小区名称
const [timeExtend, setTimeExtend] = useState(null);
const [pictrueExtend, setPictrueExtend] = useState({ pic: null, pics: null, tab: 3 }); const [pictrueExtend, setPictrueExtend] = useState({ pic: null, pics: null, tab: 3 });
const [facilityDetail, setFacilityDetail] = useState(false); const [facilityDetail, setFacilityDetail] = useState(false);
const [PATHNAME, setPATHNAME] = useState(''); const [PATHNAME, setPATHNAME] = useState('');
......
This diff is collapsed.
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import styles from './ContractContent.less'; import styles from './ContractContent.less';
import { Input, Form, message, Upload, Button, DatePicker, Space } from 'antd'; import { Input, Form, message, Upload, Button, DatePicker, Space } from 'antd';
import { UploadOutlined, LeftOutlined } from '@ant-design/icons'; import { PlusOutlined, LeftOutlined } from '@ant-design/icons';
import { Link, useIntl, connect, Dispatch, Loading } from 'umi'; import { Link, useIntl, connect, Dispatch, Loading } from 'umi';
import { RA } from '@/services/tos'; import { RA } from '@/services/tos';
...@@ -137,7 +137,7 @@ const ContractContent = (props: any) => { ...@@ -137,7 +137,7 @@ const ContractContent = (props: any) => {
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件 */} {/* 头部组件 */}
<div className={styles.box}> <div className={styles.box}>
<div className={styles.item1}>{ContractModel.type} Service Provider</div> <div className={styles.item1}>{ContractModel.type} Contract</div>
<button className={styles.item3} onClick={goToReturn}> <button className={styles.item3} onClick={goToReturn}>
<LeftOutlined /> <LeftOutlined />
Back Back
...@@ -225,6 +225,7 @@ const ContractContent = (props: any) => { ...@@ -225,6 +225,7 @@ const ContractContent = (props: any) => {
locale={locale} locale={locale}
defaultValue={ContractModel.time} defaultValue={ContractModel.time}
disabledDate={disabledDate} disabledDate={disabledDate}
placeholder={['Effective Date', 'Expiration Date']}
// onChange={changeTime} // onChange={changeTime}
/> />
</Form.Item> </Form.Item>
...@@ -237,10 +238,8 @@ const ContractContent = (props: any) => { ...@@ -237,10 +238,8 @@ const ContractContent = (props: any) => {
label="Contract Annex" label="Contract Annex"
rules={[{ required: true, message: `${tipList[6]}` }]} rules={[{ required: true, message: `${tipList[6]}` }]}
> >
<Upload {...uploadProps}> <Upload {...uploadProps} listType={'picture-card'}>
<Button> {fileList.length >= 3 ? null : <PlusOutlined />}
<UploadOutlined /> Upload
</Button>
</Upload> </Upload>
</Form.Item> </Form.Item>
</div> </div>
......
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