Commit 1c2ac72c authored by cellee's avatar cellee

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

parents f208c44a 32a906a3
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
import { defineConfig } from 'umi'; import { defineConfig } from 'umi';
import defaultSettings from './defaultSettings'; import defaultSettings from './defaultSettings';
import proxy from './proxy'; import proxy from './proxy';
import component from '@/locales/en-US/component';
import route from 'mock/route';
const { REACT_APP_ENV } = process.env; const { REACT_APP_ENV } = process.env;
...@@ -138,6 +136,14 @@ export default defineConfig({ ...@@ -138,6 +136,14 @@ export default defineConfig({
path: './Services', path: './Services',
component: './UserManagement/ServiceProviderManagement/Services', component: './UserManagement/ServiceProviderManagement/Services',
}, },
{
path: './AccoutingDetail',
component: './UserManagement/ServiceProviderManagement/AccoutingContent',
},
// {
// path: './AccoutingEdit',
// component: './UserManagement/ServiceProviderManagement/AccoutingContent',
// },
], ],
}, },
], ],
...@@ -148,8 +154,8 @@ export default defineConfig({ ...@@ -148,8 +154,8 @@ export default defineConfig({
icon: 'ReconciliationOutlined', icon: 'ReconciliationOutlined',
routes: [ routes: [
{ path: './', component: './PropertyManagement/ChargeManager' }, { path: './', component: './PropertyManagement/ChargeManager' },
{ path: './AccoutingDetail', component: './PropertyManagement/AccoutingContent' }, // { path: './AccoutingDetail', component: './PropertyManagement/AccoutingContent' },
{ path: './AccoutingEdit', component: './PropertyManagement/AccoutingContent' }, // { path: './AccoutingEdit', component: './PropertyManagement/AccoutingContent' },
], ],
}, },
{ path: '/PropertyManagementDetail', component: './PropertyManagement/ChargeDetail' }, { path: '/PropertyManagementDetail', component: './PropertyManagement/ChargeDetail' },
...@@ -260,8 +266,14 @@ export default defineConfig({ ...@@ -260,8 +266,14 @@ export default defineConfig({
'./CommunityManagement/CommunityAnnouncement/CommunityAnnouncement', './CommunityManagement/CommunityAnnouncement/CommunityAnnouncement',
}, },
{ path: './Add', component: './CommunityManagement/CommunityAnnouncement/Add' }, { path: './Add', component: './CommunityManagement/CommunityAnnouncement/Add' },
{ path: './Edit', component: './CommunityManagement/CommunityAnnouncement/Add' }, {
{ path: './Detail', component: './CommunityManagement/CommunityAnnouncement/Detail' }, path: './Edit',
component: './CommunityManagement/CommunityAnnouncement/Add',
},
{
path: './Detail',
component: './CommunityManagement/CommunityAnnouncement/Detail',
},
], ],
}, },
{ {
......
import * as service from '../services/tos'; import * as service from '../services/tos';
import { message } from 'antd'; import { message } from 'antd';
import { routerRedux } from 'dva/router';
export default { export default {
namespace: 'ServiceProvider', namespace: 'ServiceProvider',
state: { state: {
...@@ -10,34 +8,35 @@ export default { ...@@ -10,34 +8,35 @@ export default {
CurDataFollow: null, CurDataFollow: null,
SaveChooseData: null, SaveChooseData: null,
CurData: null, CurData: null,
Result: null,
}, },
reducers: { reducers: {
returnPage(state, { Data }) { returnPage(state: object, { Data }: any) {
console.log(state);
console.log(Data);
return { ...state, Data }; return { ...state, Data };
}, },
returnCurDataFollow(state, { CurDataFollow }) { returnCurDataFollow(state: object, { CurDataFollow }: any) {
return { ...state, CurDataFollow }; return { ...state, CurDataFollow };
}, },
returnCurDataFollowDetail(state, { CurDataFollowDetail }) { returnCurDataFollowDetail(state: object, { CurDataFollowDetail }: any) {
return { ...state, CurDataFollowDetail }; return { ...state, CurDataFollowDetail };
}, },
returnSaveChooseData(state, { SaveChooseData }) { returnSaveChooseData(state: object, { SaveChooseData }: any) {
return { ...state, SaveChooseData }; return { ...state, SaveChooseData };
}, },
returnCurData(state, CurData) { returnCurData(state: object, { CurData }: any) {
console.log(CurData);
return { ...state, CurData }; return { ...state, CurData };
}, },
returnResult(state: object, { Result }: any) {
return { ...state, Result };
},
}, },
effects: { effects: {
// 获取服务商 // 获取服务商
*TosTosServiceProviderGet({ playload }, { call, put }) { *TosTosServiceProviderGet({ playload }: any, { call, put }: any) {
const resp = yield call(service.TosTosServiceProviderGet, playload); const resp = yield call(service.TosTosServiceProviderGet, playload);
console.log(resp); console.log(resp);
if (resp.error_code == '0000') { if (resp.error_code == '0000') {
...@@ -51,7 +50,7 @@ export default { ...@@ -51,7 +50,7 @@ export default {
} }
}, },
// 新建服务商 // 新建服务商
*TosTosServiceProviderSave({ playload }, { call, put }) { *TosTosServiceProviderSave({ playload }: any, { call, put }: any) {
console.log(playload); console.log(playload);
const resp = yield call(service.TosTosServiceProviderSave, playload); const resp = yield call(service.TosTosServiceProviderSave, playload);
console.log(resp); console.log(resp);
...@@ -70,7 +69,7 @@ export default { ...@@ -70,7 +69,7 @@ export default {
}, },
//获取服务商保安根据服务商名 //获取服务商保安根据服务商名
*TosSecurityGuarderGet({ playload }, { call, put }) { *TosSecurityGuarderGet({ playload }: any, { call, put }: any) {
console.log(playload); console.log(playload);
const resp = yield call(service.TosSecurityGuarderGet, playload); const resp = yield call(service.TosSecurityGuarderGet, playload);
console.log(resp); console.log(resp);
...@@ -79,13 +78,32 @@ export default { ...@@ -79,13 +78,32 @@ export default {
}, },
//获取服务商保安详情根据服务商名 //获取服务商保安详情根据服务商名
*GuarderById({ playload }, { call, put }) { *GuarderById({ playload }: any, { call, put }: any) {
let CurDataFollowDetail = playload; let CurDataFollowDetail = playload;
yield put({ type: 'returnCurDataFollowDetail', CurDataFollowDetail }); yield put({ type: 'returnCurDataFollowDetail', CurDataFollowDetail });
}, },
*SaveChooseData({ playload }, { call, put }) {
*SaveChooseData({ playload }: any, { call, put }: any) {
let SaveChooseData = playload; let SaveChooseData = playload;
yield put({ type: 'returnSaveChooseData', SaveChooseData }); yield put({ type: 'returnSaveChooseData', SaveChooseData });
}, },
// 注销服务商
*DelServiceProvider({ playload }: any, { call, put }: any) {
const resp = yield call(service.TosTosServiceProviderDel, playload);
if (resp.error_code === '0000') {
let Result = true;
yield put({ type: 'returnResult', Result });
} else {
let Result = false;
yield put({ type: 'returnResult', Result });
}
},
*ResultClear({ playload }: any, { call, put }: any) {
console.log('清除数据');
let Result = null;
yield put({ type: 'returnResult', Result });
},
}, },
}; };
@import '~antd/lib/style/themes/default.less';
//基石
.base {
width: 100%;
background-color: #ffffff;
padding: 34px;
min-width: 1020px;
}
//头部组件
.box{
width: 100%;
height: 64px;
position: relative;
}
.item1{
position: absolute;
width: 320px;
text-indent: 15px;
border-left: 5px solid rgba(24,144,255,1);
font-family:'Source Han Sans CN';
font-size: 18px;
font-weight: 600;
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;
}
.box1{
width: 100%;
height: 34px;
position: relative;
}
.box1item1{
position: absolute;
}
.box1item2{
position: absolute;
left: 154px;
}
.box1item3{
position: absolute;
left: 499px;
}
.box1item4{
position: absolute;
left: 648px;
}
.box2{
width: 100%;
height: 34px;
position: relative;
margin-top: 28px;
}
.box2item1{
position: absolute;
}
.box2item2{
position: absolute;
left: 189px;
}
.box3{
width: 100%;
height: 34px;
position: relative;
margin-top: 28px;
}
.box3item1{
position: absolute;
}
.box3item2{
position: absolute;
left: 189px;
}
.box3item3{
position: absolute;
left: 405px;
}
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import styles from './AccoutingContent.less';
import { Input, Button, Table, Space, Pagination, Tooltip } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
import Line from '../../components/Line/Line';
import SelectOptions from '../../components/SelectOptions/index';
import { indexOf } from 'lodash';
const AccoutingContent = (props: { location: any; }) => {
const { location } = props;
const goToReturn = () => {
history.back()
};
const [editFlag, setEditFlag] = useState(false);
useEffect(() => {
if ((location.pathname).indexOf("/AccoutingDetail") > -1) {
setEditFlag(true)
} else {
setEditFlag(false)
}
}, [location.pathname]);
const printContent = (comment: any) => {
console.log(comment)
}
return (
<div className={styles.base}>
{/* 头部组件 */}
<div className={styles.box}>
<div className={styles.item1}>Add Accounting</div>
<button className={styles.item3} onClick={goToReturn}>Return</button>
</div>
<div className={styles.box1}>
<div className={styles.box1item1}>Company Name</div>
<div className={styles.box1item2}>{editFlag ? (<Input style={{ width: 260 }} placeholder="Please enter company name" />) : ("123")}</div>
<div className={styles.box1item3}>Office Address</div>
<div className={styles.box1item4}>{editFlag ? (<Input style={{ width: 200 }} placeholder="Single Line Input" />) : ("123")}</div>
</div>
<Line />
<div style={{ marginBottom: 28 }}>Service Community</div>
<SelectOptions list={["美国", "美丽的", "美好", "加拿大", "加油", "XO"].sort()} onSubmit={printContent} />
<div className={styles.box2}>
<div className={styles.box2item1}>Services Available</div>
<div className={styles.box2item2}>Accounting</div>
</div>
<div className={styles.box2}>
<div className={styles.box2item1}>Person In Charge</div>
<div className={styles.box2item2}>{editFlag ? (<Input placeholder="Please enter a name" style={{ width: 200 }} />) : ("123")}</div>
</div>
<div className={styles.box3}>
<div className={styles.box3item1}>Contact Details</div>
<div className={styles.box3item2}>{editFlag ? (<Input placeholder="Telephone" style={{ width: 200 }} />) : ("123")}</div>
<div className={styles.box3item3}>{editFlag ? (<Input placeholder="E-mail" style={{ width: 200 }} />) : ("123")}</div>
</div>
{
editFlag ? (
<div>
<Line />
<Button type="primary" size="large">submit</Button>
</div>
) : (<div />)
}
</div>
);
};
export default AccoutingContent;
...@@ -46,7 +46,9 @@ const UsersAdd = (props: any) => { ...@@ -46,7 +46,9 @@ 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.residentialZipCode, communityInfo.data.rows.residentialAddress +
' ' +
communityInfo.data.rows.residentialZipCode,
}); });
} }
} }
......
@import '~antd/lib/style/themes/default.less';
//基石
.base {
width: 100%;
background-color: #ffffff;
padding: 34px;
min-width: 1020px;
}
//头部组件
.box {
width: 100%;
height: 64px;
position: relative;
}
.item1 {
position: absolute;
width: 320px;
text-indent: 15px;
border-left: 5px solid rgba(24, 144, 255, 1);
font-family: 'Source Han Sans CN';
font-size: 18px;
font-weight: 600;
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;
}
.box1 {
width: 100%;
height: 34px;
position: relative;
}
.box1item1 {
position: absolute;
}
.box1item2 {
position: absolute;
left: 154px;
}
.box1item3 {
position: absolute;
left: 499px;
}
.box1item4 {
position: absolute;
left: 648px;
}
.box2 {
width: 100%;
height: 34px;
position: relative;
margin-top: 28px;
}
.box2item1 {
position: absolute;
}
.box2item2 {
position: absolute;
left: 189px;
}
.box3 {
width: 100%;
height: 34px;
position: relative;
margin-top: 28px;
}
.box3item1 {
position: absolute;
}
.box3item2 {
position: absolute;
left: 189px;
}
.box3item3 {
position: absolute;
left: 405px;
}
.box4 {
width: 100%;
height: 34px;
position: relative;
margin-top: 28px;
}
.writeOff {
position: absolute;
top: 34px;
right: 150px;
}
import React, { useEffect } from 'react';
import styles from './AccoutingContent.less';
import { Button, Modal, message } from 'antd';
import { connect } from 'umi';
import Line from '@/components/Line/Line';
import ShowOptions from '@/components/ShowOptions/index';
import { PoweroffOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
const { confirm } = Modal;
const AccoutingContent = (props: {
SaveChooseData: any;
dispatch: any;
Result: Boolean;
history: any;
}) => {
const { SaveChooseData, dispatch, Result, history } = props;
const goToReturn = () => {
history.goBack();
};
useEffect(() => {
console.log(SaveChooseData);
if (!SaveChooseData) {
goToReturn();
}
}, []);
const handleClick = (id: string) => {
confirm({
title: 'Warning',
icon: <ExclamationCircleOutlined />,
content: 'Are you sure want to write off?',
onOk() {
dispatch({ type: 'ServiceProvider/DelServiceProvider', playload: { id } });
},
onCancel() {
console.log('Cancel');
},
});
};
useEffect(() => {
console.log(Result);
if (Result !== null) {
if (Result) {
dispatch({ type: 'ServiceProvider/ResultClear' });
message.success('Logout successful!', 3, () => {
history.goBack();
});
} else {
message.error('Logout failed. Please try again!', 3);
dispatch({ type: 'ServiceProvider/ResultClear', playload: '' });
}
}
}, [Result]);
return (
<div className={styles.base}>
{/* 头部组件 */}
<div className={styles.box}>
<div className={styles.item1}>Accounting information</div>
<button className={styles.item3} onClick={goToReturn}>
Back
</button>
</div>
{SaveChooseData.enable}
{SaveChooseData.enable === 'normal' ? (
<div className={styles.writeOff}>
<Button
icon={<PoweroffOutlined />}
type="primary"
danger
onClick={handleClick.bind(this, SaveChooseData.id)}
>
Write Off
</Button>
</div>
) : (
<div />
)}
<div className={styles.box1}>
<div className={styles.box1item1}>Company Name</div>
<div className={styles.box1item2}>{SaveChooseData.providerName}</div>
<div className={styles.box1item3}>Office Address</div>
<div className={styles.box1item4}>{SaveChooseData.providerAddress}</div>
</div>
<Line />
<div style={{ marginBottom: 28 }}>Service Community</div>
<ShowOptions list={SaveChooseData.serviceCommunityList} />
<div className={styles.box2}>
<div className={styles.box2item1}>Services Available</div>
<div className={styles.box2item2}>Accounting</div>
</div>
<div className={styles.box2}>
<div className={styles.box2item1}>Person In Charge</div>
<div className={styles.box2item2}>{SaveChooseData.contactName}</div>
</div>
<div className={styles.box3}>
<div className={styles.box3item1}>Contact Details</div>
<div className={styles.box3item2}>{SaveChooseData.contactPhone}</div>
<div className={styles.box3item3}>{SaveChooseData.contactEmail}</div>
</div>
<div className={styles.box4}>
<div className={styles.box3item1}>Upload the address</div>
<div></div>
</div>
</div>
);
};
function mapStateToProps(state: { ServiceProvider: any }) {
const { SaveChooseData, Result } = state.ServiceProvider;
return {
SaveChooseData,
Result,
};
}
export default connect(mapStateToProps)(AccoutingContent);
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './Detail.less'; import styles from './Detail.less';
import { Input, Button, Table, Space, Pagination, Tooltip, Checkbox } from 'antd'; import { Button, Table, Space, message, Modal } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi'; import { Link, useIntl, connect, Dispatch, history } from 'umi';
import ShowOptions from '../../../components/ShowOptions/index'; import ShowOptions from '../../../components/ShowOptions/index';
import TitleBack from '../../../components/TitleBack/TitleBack'; import TitleBack from '../../../components/TitleBack/TitleBack';
import { PoweroffOutlined } from '@ant-design/icons'; import { PoweroffOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
const { confirm } = Modal;
const Detail = (props: any) => { const Detail = (props: any) => {
const { dispatch, Data, CurDataFollow, location, SaveChooseData } = props; const { dispatch, Data, CurDataFollow, location, SaveChooseData, Result } = props;
const TosSecurityGuarderGet = (values: any) => { const TosSecurityGuarderGet = (values: any) => {
dispatch({ type: 'ServiceProvider/TosSecurityGuarderGet', playload: values }); dispatch({ type: 'ServiceProvider/TosSecurityGuarderGet', playload: values });
...@@ -32,7 +34,7 @@ const Detail = (props: any) => { ...@@ -32,7 +34,7 @@ const Detail = (props: any) => {
history.push(location.pathname + '/Guard?saferName=' + values.saferName); history.push(location.pathname + '/Guard?saferName=' + values.saferName);
}; };
const pagination = { const pagination = {
defaultCurrent: 1, current: 1,
total: CurDataFollow != null ? CurDataFollow.length : CurDataFollow, total: CurDataFollow != null ? CurDataFollow.length : CurDataFollow,
}; };
...@@ -52,20 +54,54 @@ const Detail = (props: any) => { ...@@ -52,20 +54,54 @@ const Detail = (props: any) => {
}, },
]; ];
const handleClick = () => { const handleClick = (id: string) => {
console.log('注销单元'); confirm({
title: 'Warning',
icon: <ExclamationCircleOutlined />,
content: 'Are you sure want to write off?',
onOk() {
dispatch({ type: 'ServiceProvider/DelServiceProvider', playload: { id } });
},
onCancel() {
console.log('Cancel');
},
});
}; };
useEffect(() => {
console.log(Result);
if (Result !== null) {
if (Result) {
dispatch({ type: 'ServiceProvider/ResultClear' });
message.success('Logout successful!', 3, () => {
history.goBack();
});
} else {
message.error('Logout failed. Please try again!', 3);
dispatch({ type: 'ServiceProvider/ResultClear', playload: '' });
}
}
}, [Result]);
return ( return (
<div className={styles.base}> <div className={styles.base}>
{SaveChooseData !== null ? ( {SaveChooseData !== null ? (
<> <>
<TitleBack title="Service Provider Details" /> <TitleBack title="Service Provider Details" />
{/* <div className={styles.writeOff}> {SaveChooseData.enable === 'normal' ? (
<Button icon={<PoweroffOutlined />} type="primary" danger onClick={handleClick}> <div className={styles.writeOff}>
Write Off <Button
</Button> icon={<PoweroffOutlined />}
</div> */} type="primary"
danger
onClick={handleClick.bind(this, SaveChooseData.id)}
>
Write Off
</Button>
</div>
) : (
<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>
...@@ -131,11 +167,12 @@ const Detail = (props: any) => { ...@@ -131,11 +167,12 @@ const Detail = (props: any) => {
}; };
function mapStateToProps(state: any) { function mapStateToProps(state: any) {
const { Data, CurDataFollow, SaveChooseData } = state.ServiceProvider; const { Data, CurDataFollow, SaveChooseData, Result } = state.ServiceProvider;
return { return {
Data, Data,
CurDataFollow, CurDataFollow,
SaveChooseData, SaveChooseData,
Result,
}; };
} }
export default connect(mapStateToProps)(Detail); export default connect(mapStateToProps)(Detail);
...@@ -37,15 +37,27 @@ const ServiceProviderManagement = (props: any) => { ...@@ -37,15 +37,27 @@ const ServiceProviderManagement = (props: any) => {
const goToDetail = (values: any, e: any) => { const goToDetail = (values: any, e: any) => {
values.serviceScope = options[values.serviceScopeList[0]][1]; values.serviceScope = options[values.serviceScopeList[0]][1];
SaveChooseData(values); SaveChooseData(values);
history.push(location.pathname + '/Detail'); if (values.serviceScopeList[0] === '0') {
}; history.push(location.pathname + '/Detail');
const goToCreate = () => { } else if (values.serviceScopeList[0] === '1') {
SaveChooseData(null); history.push(location.pathname + '/AccoutingDetail');
history.push(location.pathname + '/Edit'); } else {
history.push('/404');
}
}; };
const goToEdit = (values: any, e: any) => { const goToEdit = (values: any, e: any) => {
SaveChooseData(values); SaveChooseData(values);
history.push(location.pathname + '/Edit'); history.push(location.pathname + '/Edit');
// if (values.serviceScopeList[0] === '0') {
// } else if (values.serviceScopeList[0] === '1') {
// history.push(location.pathname + '/AccoutingEdit');
// } else {
// history.push('/404');
// }
};
const goToCreate = () => {
SaveChooseData(null);
history.push(location.pathname + '/Edit');
}; };
const goToServices = () => { const goToServices = () => {
history.push(location.pathname + '/Services'); history.push(location.pathname + '/Services');
...@@ -74,7 +86,12 @@ const ServiceProviderManagement = (props: any) => { ...@@ -74,7 +86,12 @@ const ServiceProviderManagement = (props: any) => {
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space size="middle"> <Space size="middle">
<a onClick={goToDetail.bind(this, record)}>Detail</a> <a onClick={goToDetail.bind(this, record)}>Detail</a>
<a onClick={goToEdit.bind(this, record)}>edit</a> <a
disabled={record.enable == 'Deregistered' ? true : false}
onClick={goToEdit.bind(this, record)}
>
edit
</a>
</Space> </Space>
), ),
}, },
...@@ -142,10 +159,14 @@ const ServiceProviderManagement = (props: any) => { ...@@ -142,10 +159,14 @@ const ServiceProviderManagement = (props: any) => {
//页面搜索 //页面搜索
const CallBackTitleSearch = (comment: any) => { const CallBackTitleSearch = (comment: any) => {
readyData.serviceCommunityList = comment.serviceCommunityList; readyData.serviceCommunityList = comment.serviceCommunityList;
console.log(comment);
if (comment.status == undefined) { if (comment.status == undefined) {
comment.status = ''; comment.status = '';
} }
console.log(comment);
// if (comment.status) {
// }
history.push( history.push(
location.pathname + location.pathname +
urlEncode( urlEncode(
...@@ -171,10 +192,10 @@ const ServiceProviderManagement = (props: any) => { ...@@ -171,10 +192,10 @@ const ServiceProviderManagement = (props: any) => {
for (let items in tmp) { for (let items in tmp) {
switch (tmp[items].enable) { switch (tmp[items].enable) {
case 0: case 0:
tmp[items].enable = 'unregistered'; tmp[items].enable = 'normal';
break; break;
case 1: case 1:
tmp[items].enable = 'registered'; tmp[items].enable = 'Deregistered';
break; break;
case 2: case 2:
break; break;
...@@ -191,15 +212,19 @@ const ServiceProviderManagement = (props: any) => { ...@@ -191,15 +212,19 @@ const ServiceProviderManagement = (props: any) => {
list={['Service Provider']} list={['Service Provider']}
status={[ status={[
{ {
name: ['status', 'services'], name: ['status', 'Services'],
data: [[null, 'All'], ...options], data: [...options],
}, },
]} ]}
community={'serviceCommunityList'} community={'serviceCommunityList'}
onSubmit={CallBackTitleSearch} onSubmit={CallBackTitleSearch}
defaultValue={{ defaultValue={{
providerName: readyData.providerName, providerName: readyData.providerName,
status: readyData.serviceScope ? parseInt(readyData.serviceScope) : null, status: readyData.serviceScope
? parseInt(readyData.serviceScope) === 0
? 'SecurutyGuard'
: 'Accountant'
: null,
}} }}
checklist={ checklist={
readyData.serviceCommunityList.length !== 0 ? readyData.serviceCommunityList : null readyData.serviceCommunityList.length !== 0 ? readyData.serviceCommunityList : null
......
...@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from 'react'; ...@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from 'react';
import styles from './Services.less'; import styles from './Services.less';
import { Form, Button, Modal, Space, Pagination, Tooltip, Checkbox } from 'antd'; import { Form, Button, Modal, Space, Pagination, Tooltip, Checkbox } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi'; import { connect } from 'umi';
import Line from '../../../components/Line/Line'; import Line from '../../../components/Line/Line';
import TagSelect from '../../../components/TagSelect/index'; import TagSelect from '../../../components/TagSelect/index';
...@@ -11,11 +11,9 @@ import TitleBack from '@/components/TitleBack/TitleBack'; ...@@ -11,11 +11,9 @@ import TitleBack from '@/components/TitleBack/TitleBack';
const module = 'User'; const module = 'User';
const services = ['Security Guards', 'Accountant', 'repair', 'Clean'];
const Services = (props: any) => { const Services = (props: any) => {
const { dispatch, DataServices } = props; const { dispatch, DataServices } = props;
const formRef = useRef(null); const formRef = useRef(null as any);
useEffect(() => { useEffect(() => {
RA(43, { serviceName: '' }, module, dispatch); RA(43, { serviceName: '' }, module, dispatch);
...@@ -23,25 +21,26 @@ const Services = (props: any) => { ...@@ -23,25 +21,26 @@ const Services = (props: any) => {
useEffect(() => { useEffect(() => {
if (DataServices != null) { if (DataServices != null) {
var tmp = DataServices.data.rows.map((v: any) => { console.log(DataServices);
return services[v.serviceCode - 1]; let tmp = DataServices.data.rows.map((v: object, i: number) => {
return v['serviceName'];
}); });
console.log(tmp); console.log(tmp);
formRef.current.setFieldsValue({ services: tmp }); formRef.current['setFieldsValue']({ serviceName: tmp });
} }
}, [DataServices]); }, [DataServices]);
const onFinish = (values: any) => { const onFinish = (values: any) => {
console.log(values); console.log(values);
RA( // RA(
44, // 44,
{ // {
id: '5', // id: '5',
serviceName: '律政', // serviceName: '律政',
}, // },
module, // module,
dispatch, // dispatch,
); // );
}; };
const Add = (values: any) => { const Add = (values: any) => {
console.log(values); console.log(values);
...@@ -53,7 +52,7 @@ const Services = (props: any) => { ...@@ -53,7 +52,7 @@ const Services = (props: any) => {
<Form ref={formRef} name="basic" onFinish={onFinish}> <Form ref={formRef} name="basic" onFinish={onFinish}>
{DataServices != null ? ( {DataServices != null ? (
<Form.Item label="Available Services" name="serviceCode"> <Form.Item label="Available Services" name="serviceName">
<TagSelect onAdd={Add} onRemove={Remove} /> <TagSelect onAdd={Add} onRemove={Remove} />
</Form.Item> </Form.Item>
) : null} ) : null}
......
...@@ -121,7 +121,7 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -121,7 +121,7 @@ const Login: React.FC<LoginProps> = (props) => {
{forgetflag ? 'Please enter email address' : 'Account Name'} {forgetflag ? 'Please enter email address' : 'Account Name'}
</div> </div>
<Form.Item name="userName"> <Form.Item name="userName">
<input className={styles.input} value={userName || ''} onChange={usernameHandle} /> <input className={styles.input} defaultValue={userName || ''} onChange={usernameHandle} />
</Form.Item> </Form.Item>
<div className={styles.box1}> <div className={styles.box1}>
{forgetflag ? 'Please enter a verification code' : 'Password'} {forgetflag ? 'Please enter a verification code' : 'Password'}
......
...@@ -70,7 +70,13 @@ export function TosTosServiceProviderSave(values: any) { ...@@ -70,7 +70,13 @@ export function TosTosServiceProviderSave(values: any) {
headers: { 'Content-Type': 'application/json' }, headers: { 'Content-Type': 'application/json' },
}); });
} }
export function TosTosServiceProviderDel(values: any) {
return request('/tos/tosServiceProvider/del', {
method: 'POST',
body: JSON.stringify(values),
headers: { 'Content-Type': 'application/json' },
});
}
// /tos/community/facilities/fuzzy/query // /tos/community/facilities/fuzzy/query
//配置文件 //配置文件
// const yellowcolor ="\033[40;33m" // const yellowcolor ="\033[40;33m"
......
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