Commit 81903387 authored by cellee's avatar cellee

Merge branch 'final' of http://120.77.240.215:9701/Maple/tostumi.git into final

parents 516960d3 feb9d58f
...@@ -331,7 +331,7 @@ class SelectOptions extends React.Component { ...@@ -331,7 +331,7 @@ class SelectOptions extends React.Component {
{this.props.single != null ? null : ( {this.props.single != null ? null : (
<> <>
<Checkbox <Checkbox
style={{ position: 'absolute', right: 100 }} style={{ position: 'absolute', right: 120 }}
indeterminate={this.state.indeterminate} indeterminate={this.state.indeterminate}
onChange={this.onCheckAllChange} onChange={this.onCheckAllChange}
checked={this.state.checkAll} checked={this.state.checkAll}
......
...@@ -114,10 +114,12 @@ export default { ...@@ -114,10 +114,12 @@ export default {
} }
break; break;
// 删除失败的案例 // 删除失败的案例
// case 16:{ case 16:
// Result = resp; {
// yield put({ type: 'returnResult', Result }); Result = resp;
// } break; yield put({ type: 'returnResult', Result });
}
break;
} }
} else { } else {
switch (playload.index) { switch (playload.index) {
......
...@@ -9,6 +9,7 @@ export default { ...@@ -9,6 +9,7 @@ export default {
Data: null, Data: null,
CurDataFollow: null, CurDataFollow: null,
SaveChooseData: null, SaveChooseData: null,
CurData: null,
}, },
reducers: { reducers: {
...@@ -28,6 +29,10 @@ export default { ...@@ -28,6 +29,10 @@ export default {
returnSaveChooseData(state, { SaveChooseData }) { returnSaveChooseData(state, { SaveChooseData }) {
return { ...state, SaveChooseData }; return { ...state, SaveChooseData };
}, },
returnCurData(state, CurData) {
console.log(CurData);
return { ...state, CurData };
},
}, },
effects: { effects: {
...@@ -51,10 +56,16 @@ export default { ...@@ -51,10 +56,16 @@ export default {
const resp = yield call(service.TosTosServiceProviderSave, playload); const resp = yield call(service.TosTosServiceProviderSave, playload);
console.log(resp); console.log(resp);
if (resp.code == 500) { if (resp.code == 500) {
window.location.href = '/500'; let CurData = false;
yield put({ type: 'returnCurData' }, CurData);
message.error('Creation failed. Please try again!');
// window.location.href = '/500';
} else { } else {
message.success('operator success!', 2); let CurData = true;
window.location.href = '/UserManagement/ServiceProviderManagement'; yield put({ type: 'returnCurData' }, CurData);
message.success('operator success!', 1.5, () => {
window.location.href = '/UserManagement/ServiceProviderManagement';
});
} }
}, },
......
...@@ -57,9 +57,7 @@ const CardAdd = (props: any) => { ...@@ -57,9 +57,7 @@ const CardAdd = (props: any) => {
if (communityInfo != null) { if (communityInfo != null) {
form.setFieldsValue({ form.setFieldsValue({
zipCode: zipCode:
communityInfo.data.rows.residentialAddress + communityInfo.data.rows.residentialAddress + communityInfo.data.rows.residentialZipCode,
' SINGAPORE' +
communityInfo.data.rows.residentialZipCode,
}); });
} }
}, [communityInfo]); }, [communityInfo]);
......
...@@ -10,7 +10,7 @@ import { render } from 'react-dom'; ...@@ -10,7 +10,7 @@ import { render } from 'react-dom';
import { Document } from 'react-pdf/dist/entry.webpack'; import { Document } from 'react-pdf/dist/entry.webpack';
import { stringSplit } from '../../utils/string'; import { stringSplit } from '../../utils/string';
import { timestampToTime2 } from '../../utils/time'; import { timestampToTime } from '../../utils/time';
import TitleBack from '../../components/TitleBack/TitleBack'; import TitleBack from '../../components/TitleBack/TitleBack';
...@@ -49,13 +49,13 @@ const ChargeDetail = (props: any) => { ...@@ -49,13 +49,13 @@ const ChargeDetail = (props: any) => {
{CurData ? ( {CurData ? (
<> <>
<TitleBack <TitleBack
title="Payment Settings" title="Payment Record Details"
sublist={['Upload Time ' + timestampToTime2(CurData.updateTime.time)]} sublist={['Upload Time ' + timestampToTime(CurData.createTime.time)]}
/> />
<div className={styles.box2}> <div className={styles.box2}>
<div className={styles.time1}>uploadTime : </div> <div className={styles.time1}>UploadTime : </div>
<div className={styles.time2}>01-01-2020</div> <div className={styles.time2}>{timestampToTime(CurData.createTime.time)}</div>
<div className={styles.item21}>Project (community)</div> <div className={styles.item21}>Project (community)</div>
<div className={styles.item22}>{CurData.communityName}</div> <div className={styles.item22}>{CurData.communityName}</div>
<div className={styles.item23}>Street name</div> <div className={styles.item23}>Street name</div>
......
...@@ -8,7 +8,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi'; ...@@ -8,7 +8,7 @@ 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';
import { filterObj, urlEncode } from '@/utils/method'; import { filterObj, urlEncode, filterObjbyTg } from '@/utils/method';
import TitleSearch from '../../components/TitleSearch/TitleSearch'; import TitleSearch from '../../components/TitleSearch/TitleSearch';
...@@ -27,7 +27,6 @@ const ChargeManager = (props: any) => { ...@@ -27,7 +27,6 @@ const ChargeManager = (props: any) => {
const unit = formatMessage({ id: 'R.charge.unit' }); const unit = formatMessage({ id: 'R.charge.unit' });
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 addaccount = formatMessage({ id: 'R.charge.addaccount' });
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
...@@ -45,6 +44,7 @@ const ChargeManager = (props: any) => { ...@@ -45,6 +44,7 @@ const ChargeManager = (props: any) => {
}; };
useEffect(() => { useEffect(() => {
console.log(location.query);
if (location.query) { if (location.query) {
readyData = { readyData = {
...readyData, ...readyData,
...@@ -65,15 +65,11 @@ const ChargeManager = (props: any) => { ...@@ -65,15 +65,11 @@ const ChargeManager = (props: any) => {
}, [Data]); }, [Data]);
const TitleSearchContent = (comment: any) => { const TitleSearchContent = (comment: any) => {
history.push( console.log(comment);
location.pathname + readyData.communityName = comment.communityName;
urlEncode( let tmp = filterObjbyTg(comment, ['communityName', 'tosOwnerName']);
filterObj({ tmp['pageNum'] = 1;
...comment, history.push(location.pathname + urlEncode(tmp));
pageNum: 1,
}),
),
);
}; };
const changePage = (values: any) => { const changePage = (values: any) => {
...@@ -87,7 +83,13 @@ const ChargeManager = (props: any) => { ...@@ -87,7 +83,13 @@ const ChargeManager = (props: any) => {
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',
render: (text: any, record: any) => (
<div>{record.buildingNumber + '#' + record.floorNumber + '-' + record.roomNumber}</div>
),
},
{ {
title: submissionTime, title: submissionTime,
render: (text: any, record: any) => ( render: (text: any, record: any) => (
...@@ -113,8 +115,9 @@ const ChargeManager = (props: any) => { ...@@ -113,8 +115,9 @@ const ChargeManager = (props: any) => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleSearch <TitleSearch
listkey={['tosOwnerName', 'communityName']} listkey={['tosOwnerName']}
list={['tosOwnerName', 'communityName']} list={['TosOwnerName']}
communitySelect={true}
onSubmit={TitleSearchContent} onSubmit={TitleSearchContent}
defaultValue={{ ...readyData }} defaultValue={{ ...readyData }}
/> />
......
...@@ -132,6 +132,7 @@ const Users = (props: any) => { ...@@ -132,6 +132,7 @@ const Users = (props: any) => {
// 监听路由变化更新数据 // 监听路由变化更新数据
useEffect(() => { useEffect(() => {
console.log(readyData);
if (location.query) { if (location.query) {
readyData = { readyData = {
...readyData, ...readyData,
...@@ -262,7 +263,7 @@ const Users = (props: any) => { ...@@ -262,7 +263,7 @@ const Users = (props: any) => {
pagination={ pagination={
Data != null Data != null
? { ? {
current: readyData.pageNum, defaultCurrent: parseInt(readyData.pageNum),
total: Data.data.page.totalRow, total: Data.data.page.totalRow,
showSizeChanger: false, showSizeChanger: false,
pageSize: Data.data.page.curPageSize, pageSize: Data.data.page.curPageSize,
......
...@@ -46,9 +46,7 @@ const UsersAdd = (props: any) => { ...@@ -46,9 +46,7 @@ const UsersAdd = (props: any) => {
if (postman.extend != null) { if (postman.extend != null) {
formRef.current.setFieldsValue({ formRef.current.setFieldsValue({
addressAndpostalCode: addressAndpostalCode:
communityInfo.data.rows.residentialAddress + communityInfo.data.rows.residentialAddress + communityInfo.data.rows.residentialZipCode,
' SINGAPORE' +
communityInfo.data.rows.residentialZipCode,
}); });
} }
} }
......
...@@ -94,13 +94,18 @@ const UsersDetail = (props: any) => { ...@@ -94,13 +94,18 @@ const UsersDetail = (props: any) => {
}, [Result]); }, [Result]);
useEffect(() => { useEffect(() => {
console.log(returnValue);
if (returnValue != null) { if (returnValue != null) {
message.success('Delete Successfully!'); if (returnValue.error_code !== '0001') {
RA(13, { message.success('Delete Successfully!', 3);
id: DataSave.id, RA(13, {
owerName: DataSave.owerName, id: DataSave.id,
enable: DataSave.enable, owerName: DataSave.owerName,
}); enable: DataSave.enable,
});
} else {
message.error(returnValue.error_msg, 3);
}
} }
}, [returnValue]); }, [returnValue]);
...@@ -192,10 +197,10 @@ const UsersDetail = (props: any) => { ...@@ -192,10 +197,10 @@ const UsersDetail = (props: any) => {
const checkData = (rule: any, value: any, callback: any) => { const checkData = (rule: any, value: any, callback: any) => {
if (value) { if (value) {
if (/^\d{11}$/g.test(value)) { if (/^1\d{7}|1[3|5|7|8]\d{9}$/g.test(value)) {
callback(); callback();
} else { } else {
callback(new Error('Please enter the correct cell phone number!')); callback(new Error('Incorrect format of mobile phone number!'));
} }
} }
callback('*it is required!'); callback('*it is required!');
......
...@@ -2,173 +2,174 @@ ...@@ -2,173 +2,174 @@
//基石 //基石
.base { .base {
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
padding: 34px; padding: 34px;
min-width: 1020px; min-width: 1020px;
} }
//头部组件 //头部组件
.box{ .box {
width: 100%; width: 100%;
height: 64px; height: 64px;
position: relative; position: relative;
} }
.item1{ .item1 {
position: absolute; position: absolute;
width: 400px; width: 400px;
text-indent: 15px; text-indent: 15px;
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;
}
.item3 {
width: 80px;
height: 32px;
position: absolute;
right: 0;
outline: none;
background: none;
cursor: pointer;
border: 1px solid rgba(217, 217, 217, 1);
border-radius: 2px;
}
.bigbox {
position: relative;
}
.box0 {
position: absolute;
right: 0;
}
.box0item1 {
width: 108px;
height: 108px;
background-color: #e7e7e7;
}
.box0item2 {
width: 108px;
text-align: center;
}
.box1 {
width: 100%;
height: 34px;
position: relative;
line-height: 34px;
margin-bottom: 28px;
}
.box1item1 {
position: absolute;
}
.box1item2 {
position: absolute;
left: 196px;
} }
.item3{
width:80px;
height: 32px;
position: absolute;
right: 0;
outline: none;
background:none;
cursor: pointer;
border:1px solid rgba(217,217,217,1); // 线栏
border-radius:2px; .line {
width: 100%;
height: 1px;
border-top: 1px solid rgba(217, 217, 217, 1);
margin-top: 28px;
margin-bottom: 28px;
} }
.bigbox{ .box2 {
position: relative; width: 100%;
} height: 34px;
.box0{ position: relative;
position: absolute; line-height: 34px;
right: 0; margin-bottom: 28px;
}
.box0item1{
width:108px;
height:108px;
background-color: #e7e7e7;
}
.box0item2{
width:108px;
text-align: center;
}
.box1{
width: 100%;
height: 34px;
position: relative;
line-height: 34px;
margin-bottom: 28px;
} }
.box1item1{ .box2item1 {
position: absolute; position: absolute;
} }
.box1item2{ .box2item2 {
position: absolute; position: absolute;
left: 196px; left: 196px;
} }
.box3 {
// 线栏 width: 100%;
.line{ height: 34px;
width: 100%; position: relative;
height: 1px; line-height: 34px;
border-top: 1px solid rgba(217,217,217,1); margin-bottom: 28px;
margin-top: 28px;
margin-bottom: 28px;
} }
.box3item1 {
position: absolute;
.box2{
width: 100%;
height: 34px;
position: relative;
line-height: 34px;
margin-bottom: 28px;
} }
.box2item1{ .box3item2 {
position: absolute; position: absolute;
} left: 196px;
.box2item2{
position: absolute;
left: 196px;
} }
.box3{ .box4 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
line-height: 34px; line-height: 34px;
margin-bottom: 28px; margin-bottom: 28px;
} }
.box3item1{ .box4item1 {
position: absolute; position: absolute;
} }
.box3item2{ .box4item2 {
position: absolute; position: absolute;
left: 196px; left: 196px;
} }
.box5 {
.box4{ width: 100%;
width: 100%; height: 34px;
height: 34px; position: relative;
position: relative; line-height: 34px;
line-height: 34px; margin-bottom: 28px;
margin-bottom: 28px;
} }
.box4item1{ .box5item1 {
position: absolute; position: absolute;
} }
.box4item2{ .box5item2 {
position: absolute; position: absolute;
left: 196px; left: 196px;
} }
.box5{ .box6 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
line-height: 34px; line-height: 34px;
margin-bottom: 28px; margin-bottom: 28px;
} }
.box5item1{ .box6item1 {
position: absolute; position: absolute;
} }
.box5item2{ .box6item2 {
position: absolute; position: absolute;
left: 196px; left: 196px;
} }
.box7 {
.box6{ width: 100%;
width: 100%; height: 34px;
height: 34px; position: relative;
position: relative; line-height: 34px;
line-height: 34px; margin-bottom: 28px;
margin-bottom: 28px;
} }
.box6item1{ .box7item1 {
position: absolute; position: absolute;
} }
.box6item2{ .box7item2 {
position: absolute; position: absolute;
left: 196px; left: 196px;
} }
.box7{ .writeOff {
width: 100%; position: absolute;
height: 34px; top: 100px;
position: relative; right: 200px;
line-height: 34px;
margin-bottom: 28px;
}
.box7item1{
position: absolute;
}
.box7item2{
position: absolute;
left: 196px;
} }
...@@ -36,10 +36,6 @@ const Detail = (props: any) => { ...@@ -36,10 +36,6 @@ const Detail = (props: any) => {
total: CurDataFollow != null ? CurDataFollow.length : CurDataFollow, total: CurDataFollow != null ? CurDataFollow.length : CurDataFollow,
}; };
const printContent = (comment: any) => {
console.log(comment);
};
const columns = [ const columns = [
{ title: 'User Name', dataIndex: 'saferName' }, { title: 'User Name', dataIndex: 'saferName' },
{ title: 'Service Community', dataIndex: 'projectName' }, { title: 'Service Community', dataIndex: 'projectName' },
...@@ -59,11 +55,15 @@ const Detail = (props: any) => { ...@@ -59,11 +55,15 @@ const Detail = (props: any) => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleBack title="Service Provider Details" /> <TitleBack title="Service Provider Details" />
<div className={styles.writeOff}>
<Button type="primary" danger>
Write Off
</Button>
</div>
<div className={styles.bigbox}> <div className={styles.bigbox}>
<div className={styles.box0}> <div className={styles.box0}>
<div className={styles.box0item1}></div> <div className={styles.box0item1}></div>
<div className={styles.box0item2}>{SaveChooseData.serviceCommunityList}</div> {/* <div className={styles.box0item2}>{SaveChooseData.serviceCommunityList}</div> */}
</div> </div>
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Company Name</div> <div className={styles.box1item1}>Company Name</div>
...@@ -83,7 +83,7 @@ const Detail = (props: any) => { ...@@ -83,7 +83,7 @@ const Detail = (props: any) => {
<div className={styles.box4}> <div className={styles.box4}>
<div className={styles.box4item1}>Contact Details</div> <div className={styles.box4item1}>Contact Details</div>
<div className={styles.box4item2}> <div className={styles.box4item2}>
{SaveChooseData.contactPhone} {SaveChooseData.contactEmail} {SaveChooseData.contactPhone} &nbsp;&nbsp;&nbsp;&nbsp; {SaveChooseData.contactEmail}
</div> </div>
</div> </div>
...@@ -96,11 +96,7 @@ const Detail = (props: any) => { ...@@ -96,11 +96,7 @@ const Detail = (props: any) => {
<div className={styles.box1item1}>Service Community</div> <div className={styles.box1item1}>Service Community</div>
</div> </div>
{SaveChooseData.serviceCommunityList != null ? ( {SaveChooseData.serviceCommunityList != null ? (
<ShowOptions <ShowOptions list={SaveChooseData.serviceCommunityList} defaultValue={'Put It Away'} />
list={SaveChooseData.serviceCommunityList}
defaultValue={'Put It Away'}
onSubmit={printContent}
/>
) : ( ) : (
<></> <></>
)} )}
......
...@@ -2,176 +2,172 @@ ...@@ -2,176 +2,172 @@
//基石 //基石
.base { .base {
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
padding: 34px; padding: 34px;
min-width: 1020px; min-width: 1020px;
} }
//头部组件 //头部组件
.box{ .box {
width: 100%; width: 100%;
height: 64px; height: 64px;
position: relative; position: relative;
} }
.item1{ .item1 {
position: absolute; position: absolute;
width: 400px; width: 400px;
text-indent: 8px; text-indent: 8px;
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;
} }
.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;
} }
.box1 {
.box1{ width: 100%;
width: 100%; height: 34px;
height: 34px; position: relative;
position: relative; line-height: 34px;
line-height: 34px;
} }
.box1item1{ .box1item1 {
position: absolute; position: absolute;
} }
.box1item2{ .box1item2 {
position: absolute; position: absolute;
left: 154px; left: 154px;
} }
.box1item3{ .box1item3 {
position: absolute; position: absolute;
left: 529px; left: 529px;
} }
.box1item4{ .box1item4 {
position: absolute; position: absolute;
left: 650px; left: 650px;
} }
// 线栏 // 线栏
.line{ .line {
width: 100%; width: 100%;
height: 1px; height: 1px;
border-top: 1px solid rgba(217,217,217,1); border-top: 1px solid rgba(217, 217, 217, 1);
margin-top: 28px; margin-top: 28px;
margin-bottom: 28px; margin-bottom: 28px;
} }
.box2{ .box2 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
line-height: 34px; line-height: 34px;
margin-bottom: 28px; margin-bottom: 28px;
margin-top: 28px; margin-top: 28px;
} }
.box2item1{ .box2item1 {
position: absolute; position: absolute;
} }
.box2item2{ .box2item2 {
position: absolute; position: absolute;
left: 192px; left: 192px;
} }
.box3{ .box3 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
line-height: 34px; line-height: 34px;
margin-bottom: 28px; margin-bottom: 28px;
} }
.box3item1{ .box3item1 {
position: absolute; position: absolute;
} }
.box3item2{ .box3item2 {
position: absolute; position: absolute;
left: 189px; left: 189px;
} }
.box4{ .box4 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
line-height: 34px; line-height: 34px;
} }
.box4item1{ .box4item1 {
position: absolute; position: absolute;
} }
.box4item2{ .box4item2 {
position: absolute; position: absolute;
left: 189px; left: 189px;
} }
.box4item3{ .box4item3 {
position: absolute; position: absolute;
left: 405px; left: 455px;
} }
.box5{ .box5 {
width: 100%; width: 100%;
height: 34px; height: 34px;
position: relative; position: relative;
line-height: 34px; line-height: 34px;
} }
.box5item1{ .box5item1 {
position: absolute; position: absolute;
} }
.box5item2{ .box5item2 {
position: absolute; position: absolute;
left: 189px; left: 189px;
} }
.box5item3{ .box5item3 {
position: absolute; position: absolute;
left: 405px; left: 405px;
} }
.box6 {
.box6{ width: 100%;
width: 100%; height: 34px;
height: 34px; position: relative;
position: relative; line-height: 34px;
line-height: 34px;
} }
.box6item1{ .box6item1 {
position: absolute; position: absolute;
} }
.box6item2{ .box6item2 {
position: absolute; position: absolute;
left: 189px; left: 189px;
} }
.box6item3{ .box6item3 {
position: absolute; position: absolute;
left: 405px; left: 405px;
} }
.box7 {
.box7{ width: 100%;
width: 100%; height: 34px;
height: 34px; position: relative;
position: relative; line-height: 34px;
line-height: 34px; }
} .box7item1 {
.box7item1{ position: absolute;
position: absolute; }
} .box7item2 {
.box7item2{ position: absolute;
position: absolute; left: 189px;
left: 189px; }
} .box7item3 {
.box7item3{ position: absolute;
position: absolute; left: 405px;
left: 405px;
} }
...@@ -41,6 +41,13 @@ const Edit = (props: any) => { ...@@ -41,6 +41,13 @@ const Edit = (props: any) => {
} }
}, [DataServices]); }, [DataServices]);
useEffect(() => {
console.log(CurData);
if (CurData != null) {
setload(false);
}
}, [CurData]);
useEffect(() => { useEffect(() => {
if (SaveChooseData != null) { if (SaveChooseData != null) {
console.log(SaveChooseData); console.log(SaveChooseData);
...@@ -63,6 +70,8 @@ const Edit = (props: any) => { ...@@ -63,6 +70,8 @@ const Edit = (props: any) => {
val.serviceCommunityList = CList; val.serviceCommunityList = CList;
val.creator = 'admin'; val.creator = 'admin';
val.updater = 'admin'; val.updater = 'admin';
console.log(val);
return;
setload(true); setload(true);
TosTosServiceProviderSave(val); TosTosServiceProviderSave(val);
}; };
...@@ -70,10 +79,12 @@ const Edit = (props: any) => { ...@@ -70,10 +79,12 @@ const Edit = (props: any) => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件v1.2 */} {/* 头部组件v1.2 */}
<TitleBack title="Edit Service Provider" /> <TitleBack
title={SaveChooseData !== null ? 'Edit Service Provider' : 'Add service provider'}
/>
<Form ref={formRef} name="basic" onFinish={onFinish}> <Form ref={formRef} name="basic" onFinish={onFinish}>
<Spin spinning={load} tip="In the submission,Please Wait..."> <Spin spinning={load}>
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Company Name</div> <div className={styles.box1item1}>Company Name</div>
<div className={styles.box1item2}> <div className={styles.box1item2}>
...@@ -140,6 +151,10 @@ const Edit = (props: any) => { ...@@ -140,6 +151,10 @@ const Edit = (props: any) => {
required: true, required: true,
message: 'Please enter the name of the person in charge!', message: 'Please enter the name of the person in charge!',
}, },
{
len: 2,
message: 'It must be between 2 and 30',
},
]} ]}
> >
<Input style={{ width: 200 }} placeholder="Please enter a name" /> <Input style={{ width: 200 }} placeholder="Please enter a name" />
...@@ -150,7 +165,16 @@ const Edit = (props: any) => { ...@@ -150,7 +165,16 @@ const Edit = (props: any) => {
<div className={styles.box4}> <div className={styles.box4}>
<div className={styles.box4item1}>Contact Details</div> <div className={styles.box4item1}>Contact Details</div>
<div className={styles.box4item2}> <div className={styles.box4item2}>
<Form.Item name="contactPhone"> <Form.Item
name="contactPhone"
rules={[
{
pattern: /^(\d{8}|1[0-9]{10})$/,
message: 'ncorrect format of mobile phone number',
whitespace: true,
},
]}
>
<Input style={{ width: 200 }} placeholder="Telephone" /> <Input style={{ width: 200 }} placeholder="Telephone" />
</Form.Item> </Form.Item>
</div> </div>
...@@ -186,6 +210,8 @@ function mapStateToProps(state: any) { ...@@ -186,6 +210,8 @@ function mapStateToProps(state: any) {
const { CurData, SaveChooseData } = state.ServiceProvider; const { CurData, SaveChooseData } = state.ServiceProvider;
const { DataServices } = state.User; const { DataServices } = state.User;
const { CommunityList } = state.Init; const { CommunityList } = state.Init;
console.log(state.ServiceProvider);
console.log(CurData);
return { return {
CurData, CurData,
SaveChooseData, SaveChooseData,
......
...@@ -25,6 +25,13 @@ let readyData: any = { ...@@ -25,6 +25,13 @@ let readyData: any = {
// 节流阀 // 节流阀
let flag = false; let flag = false;
const services = [
[0, 'Security Guards'],
[0, 'Accountant'],
[0, 'repair'],
[0, 'Clean'],
];
const ServiceProviderManagement = (props: any) => { const ServiceProviderManagement = (props: any) => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
...@@ -88,9 +95,11 @@ const ServiceProviderManagement = (props: any) => { ...@@ -88,9 +95,11 @@ const ServiceProviderManagement = (props: any) => {
useEffect(() => { useEffect(() => {
if (DataServices) { if (DataServices) {
options = DataServices.data.serviceScopeList.map((v: string, i: number) => { console.log(DataServices);
return [i, v];
}); // options = DataServices.data.serviceScopeList.map((v: string, i: number) => {
// return [i, v];
// });
} }
}, [DataServices]); }, [DataServices]);
...@@ -179,16 +188,16 @@ const ServiceProviderManagement = (props: any) => { ...@@ -179,16 +188,16 @@ const ServiceProviderManagement = (props: any) => {
for (let items1 in tmp[items].serviceScopeList) { for (let items1 in tmp[items].serviceScopeList) {
switch (tmp[items].serviceScopeList[items1]) { switch (tmp[items].serviceScopeList[items1]) {
case '0': case '0':
tmp[items].serviceScopeList[items1] = '保安'; tmp[items].serviceScopeList[items1] = 'Security Guards';
break; break;
case '1': case '1':
tmp[items].serviceScopeList[items1] = '会计'; tmp[items].serviceScopeList[items1] = 'Accountant';
break; break;
case '2': case '2':
tmp[items].serviceScopeList[items1] = '维修'; tmp[items].serviceScopeList[items1] = 'repair';
break; break;
case '3': case '3':
tmp[items].serviceScopeList[items1] = '清洁'; tmp[items].serviceScopeList[items1] = 'Clean';
break; break;
} }
} }
...@@ -211,8 +220,8 @@ const ServiceProviderManagement = (props: any) => { ...@@ -211,8 +220,8 @@ const ServiceProviderManagement = (props: any) => {
list={['Service Provider']} list={['Service Provider']}
status={[ status={[
{ {
name: ['status', '服务范围'], name: ['status', 'services'],
data: [[null, '全部'], ...options], data: [[null, 'All'], ...options],
}, },
]} ]}
community={'serviceCommunityList'} community={'serviceCommunityList'}
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './index.less'; import styles from './index.less';
import { Input ,Menu,Table,Space,Pagination,Tooltip, Button,Form,Upload } from 'antd'; import { Input, Menu, Table, Space, Pagination, Tooltip, Button, Form, Upload } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi'; import { Link, useIntl, connect, Dispatch } from 'umi';
...@@ -12,62 +12,36 @@ import TableShow from '../../components/TableShow/TableShow'; ...@@ -12,62 +12,36 @@ import TableShow from '../../components/TableShow/TableShow';
import { getCookie } from '@/utils/method'; import { getCookie } from '@/utils/method';
import PictureOptions from '@/components/PictureOptions/PictureOptions'; import PictureOptions from '@/components/PictureOptions/PictureOptions';
const Guard = (props:any) => { const Guard = (props: any) => {
const { dispatch, CommunityList, token } = props;
const tosCommunityget = (values: any) => {
dispatch({ type: 'Init/tosCommunityget', playload: values });
};
// const [page, setPage] = useState({ token: '' });
const { dispatch, CommunityList,token} = props;
const tosCommunityget = (values: any) => { dispatch({ type: 'Init/tosCommunityget', playload: values }) };
const [page, setPage] = useState({ token: "" })
useEffect(() => { useEffect(() => {
tosCommunityget(null) tosCommunityget(null);
setPage({ token: getCookie("token") }); // setPage({ token: getCookie('token') });
}, []); }, []);
const onFinish = (values:any) => {
console.log(values)
}
const uploadButton = (
<div>
<div className="ant-upload-text">Upload</div>
</div>
);
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleGet title={'Version 1.2.4'} />
<TitleGet title={"Version 1.2.4"} /> {/* <p>
<p> token:{page.token}
token:{page.token} name:{getCookie('name')}
name:{getCookie("name")} phone:{getCookie('phone')}
phone:{getCookie("phone")} </p> */}
</p>
{
/* <Form name="basic" onFinish={onFinish}>
<Form.Item name="">
<PictureOptions
data={{
userToken: token,
imageType: 'categoriesImageName',
extends: "extend",
}} />
</Form.Item>
<Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</Form> */
}
{/* <TableShow /> */}
{/* <div>{token}</div>
<Line /> */}
</div> </div>
); );
}; };
function mapStateToProps(state:any) { function mapStateToProps(state: any) {
const { CommunityList } = state.Init; const { CommunityList } = state.Init;
const { token } = state.login; const { token } = state.login;
return { return {
CommunityList, CommunityList,
token token,
}; };
} }
......
...@@ -4,7 +4,7 @@ import { ...@@ -4,7 +4,7 @@ import {
WeiboCircleOutlined, WeiboCircleOutlined,
ArrowLeftOutlined, ArrowLeftOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import { Alert, Checkbox, Input } from 'antd'; import { Alert, Checkbox, Input, message, Form, Button } from 'antd';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Link, connect, Dispatch, history, Redirect } from 'umi'; import { Link, connect, Dispatch, history, Redirect } from 'umi';
import { StateType } from '@/models/login'; import { StateType } from '@/models/login';
...@@ -22,27 +22,39 @@ interface LoginProps { ...@@ -22,27 +22,39 @@ interface LoginProps {
submitting?: boolean; submitting?: boolean;
} }
let flag = false;
const Login: React.FC<LoginProps> = (props) => { const Login: React.FC<LoginProps> = (props) => {
const { userLogin = {}, submitting } = props; const { userLogin = {}, submitting } = props;
const { status, type: loginType } = userLogin; const { status, type: loginType } = userLogin;
const [type, setType] = useState<string>('account'); const [type, setType] = useState<string>('account');
const [userName, setUsername] = useState(''); const [userName, setUsername] = useState('');
const [password, setPasswd] = useState(''); // const [password, setPasswd] = useState('');
const [forgetflag, setForgetFlag] = useState(false);
const { dispatch } = props;
const handleSubmit = (values: LoginParamsType) => { const handleSubmit = (values: LoginParamsType) => {
const { dispatch } = props; console.log(values);
dispatch({ if (forgetflag) {
type: 'login/login', console.log('验证码!');
payload: { userName, password }, }
});
if (values.userName && values.password) {
dispatch({
type: 'login/login',
payload: { ...values },
});
} else {
message.error('The username or password cannot be empty!');
}
}; };
const usernameHandle = (e: any) => { const usernameHandle = (e: any) => {
setUsername(e.target.value); setUsername(e.target.value);
}; };
const passwdHandle = (e: any) => { // const passwdHandle = (e: any) => {
setPasswd(e.target.value); // setPasswd(e.target.value);
}; // };
const returnHandle = (e: any) => { const returnHandle = (e: any) => {
history.push('/user/login'); history.push('/user/login');
...@@ -52,20 +64,18 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -52,20 +64,18 @@ const Login: React.FC<LoginProps> = (props) => {
}; };
const handleSend = (e: any) => { const handleSend = (e: any) => {
console.log('触发了发送事件', e); console.log(userName);
console.log(password);
if ( if (
password !== '' && userName !== '' &&
/^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(password) /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(userName)
) { ) {
console.log('邮箱正确!'); console.log('邮箱正确!');
flag = true;
} else { } else {
console.log('邮箱格式错误!'); message.warning('Please enter the correct email address!');
} }
}; };
const { location } = props;
const [forgetflag, setForgetFlag] = useState(false);
useEffect(() => { useEffect(() => {
if (location.pathname == '/user/forget') { if (location.pathname == '/user/forget') {
setForgetFlag(true); setForgetFlag(true);
...@@ -74,19 +84,37 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -74,19 +84,37 @@ const Login: React.FC<LoginProps> = (props) => {
} }
}, [location.pathname]); }, [location.pathname]);
const timeOut = () => {
if (flag) {
let number = 60;
let timeId = setTimeout(() => {
number--;
if (number === 0) {
flag = false;
clearTimeout(timeId);
}
}, 60000);
return number;
}
};
return ( return (
<div> <div>
{forgetflag ? ( {/* {forgetflag ? (
<div style={{ position: 'absolute', top: -50, cursor: 'pointer' }} onClick={returnHandle}> <div style={{ position: 'absolute', top: -50, cursor: 'pointer' }} onClick={returnHandle}>
<ArrowLeftOutlined style={{ fontSize: '28px' }} /> <ArrowLeftOutlined style={{ fontSize: '28px' }} />
</div> </div>
) : ( ) : (
<div /> <div />
)} )}
<LoginForm activeKey={type} onTabChange={setType} onSubmit={handleSubmit}> <LoginForm activeKey={type} onTabChange={setType} onSubmit={handleSubmit}>
<div className={styles.box1}>Account Number</div> <div className={styles.box1}>
{forgetflag ? 'Please enter email address' : 'Account Name'}
</div>
<input className={styles.input} onChange={usernameHandle} /> <input className={styles.input} onChange={usernameHandle} />
<div className={styles.box1}>{forgetflag ? 'Please enter email address' : 'Password'}</div> <div className={styles.box1}>
{forgetflag ? 'Please enter a verification code' : 'Password'}
</div>
{forgetflag ? ( {forgetflag ? (
<div className={styles.box2}> <div className={styles.box2}>
<input className={styles.input5} onChange={passwdHandle} /> <input className={styles.input5} onChange={passwdHandle} />
...@@ -95,24 +123,76 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -95,24 +123,76 @@ const Login: React.FC<LoginProps> = (props) => {
</div> </div>
</div> </div>
) : ( ) : (
<div>
<input className={styles.input2} onChange={passwdHandle} type="password" />
<div> <div>
<input className={styles.input2} onChange={passwdHandle} type="password" /> <div className={styles.input3} onClick={gotoForgetHandle}>
<div> Forget Password
<div className={styles.input3} onClick={gotoForgetHandle}>
Forget Password
</div> </div>
<div className={styles.input4}> <div className={styles.input4}>
{status === 'error' && loginType === 'account' && !submitting && ( {status === 'error' && loginType === 'account' && !submitting && (
<div>Wrong account or password</div> <div>Wrong account or password</div>
)} )}
</div>
</div> </div>
</div> </div>
)} </div>
)}
<Submit className={styles.button} loading={submitting} style={{ width: 330 }}> <Submit className={styles.button} loading={submitting} style={{ width: 330 }}>
{forgetflag ? 'Next' : '登录'} {forgetflag ? 'Next' : '登录'}
</Submit> </Submit>
</LoginForm> </LoginForm> */}
{forgetflag ? (
<div style={{ position: 'absolute', top: -50, cursor: 'pointer' }} onClick={returnHandle}>
<ArrowLeftOutlined style={{ fontSize: '28px' }} />
</div>
) : (
<div />
)}
<Form onFinish={handleSubmit}>
<div className={styles.box1}>
{forgetflag ? 'Please enter email address' : 'Account Name'}
</div>
<Form.Item name="userName">
<input className={styles.input} onChange={usernameHandle} />
</Form.Item>
<div className={styles.box1}>
{forgetflag ? 'Please enter a verification code' : 'Password'}
</div>
{forgetflag ? (
<div className={styles.box2}>
<input className={styles.input5} />
<div className={styles.button2} style={{ float: 'right' }} onClick={handleSend}>
{flag ? timeOut : 'Send'}
</div>
</div>
) : (
<div>
<Form.Item name="password">
<input className={styles.input2} type="password" />
</Form.Item>
<div>
<div className={styles.input3} onClick={gotoForgetHandle}>
Forget Password
</div>
<div className={styles.input4}>
{status === 'error' && loginType === 'account' && !submitting && (
<div>Wrong account or password</div>
)}
</div>
</div>
</div>
)}
<Form.Item>
<Button
style={{ width: 330, height: 50, fontSize: 20 }}
type="primary"
htmlType="submit"
shape="round"
>
{forgetflag ? 'Next' : 'Submit'}
</Button>
</Form.Item>
</Form>
</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