Commit 13de2441 authored by Sixiang_Zzb's avatar Sixiang_Zzb

用户管理和物业费管理模块bug处理

parent feb9d58f
......@@ -57,8 +57,10 @@ const PropertyServices = (props: any) => {
},
{
title: 'Handle status',
dataIndex: 'handle_status',
render: (text: any, record: any) => <Space size="middle"> {handle_Status[text][1]}</Space>,
dataIndex: 'id',
render: (text: any, record: any) => (
<Space size="middle"> {handle_Status[record.handle_status][1]}</Space>
),
},
{
title: 'Actions',
......
......@@ -143,11 +143,11 @@
.time1 {
position: absolute;
top: -60px;
left: 200px;
left: 270px;
}
.time2 {
position: absolute;
top: -60px;
left: 285px;
left: 360px;
}
import React, { useState, useEffect } from 'react';
import styles from './ChargeDetail.less';
import { Input, Menu, Table, Space, Pagination, Tooltip } from 'antd';
import { Pagination, Tooltip } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
import { useIntl, connect } from 'umi';
import PDF from 'react-pdf-js';
import { render } from 'react-dom';
import { Document } from 'react-pdf/dist/entry.webpack';
import { stringSplit } from '../../utils/string';
import { timestampToTime } from '../../utils/time';
......@@ -16,13 +13,13 @@ import TitleBack from '../../components/TitleBack/TitleBack';
const ChargeDetail = (props: any) => {
const { CurData } = props;
const { formatMessage } = useIntl();
const [scale, setState] = useState(1.3);
const [pages, setPages] = useState(1);
const [curpage, setCurpage] = useState(1);
useEffect(() => {
console.log(CurData);
if (!CurData) {
history.back();
}
......
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import { Input, Menu, Table, Space } from 'antd';
import { Table, Space } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { useIntl, connect, history } from 'umi';
import { timestampToTime } from '../../utils/time';
import { values } from 'lodash';
import { filterObj, urlEncode, filterObjbyTg } from '@/utils/method';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
let readyData: object = {
interface readyData {
[key: string]: any;
}
let readyData = {
tosOwnerName: '',
communityName: '',
pageNum: 1,
......@@ -43,6 +46,14 @@ const ChargeManager = (props: any) => {
dispatch({ type: 'PropertyManagement/get', playload: values });
};
const pagination = {
defaultPageSize: 15,
total: Data && Data.page.totalRow,
showSizeChanger: false,
// current: 1,
};
// 监听路由变化
useEffect(() => {
console.log(location.query);
if (location.query) {
......@@ -57,6 +68,7 @@ const ChargeManager = (props: any) => {
}
}, [location]);
// 监听数据返回
useEffect(() => {
if (Data != null) {
console.log(Data);
......@@ -64,14 +76,17 @@ const ChargeManager = (props: any) => {
}
}, [Data]);
// 搜索按钮
const TitleSearchContent = (comment: any) => {
console.log(comment);
readyData.communityName = comment.communityName;
readyData = {
...comment,
};
let tmp = filterObjbyTg(comment, ['communityName', 'tosOwnerName']);
tmp['pageNum'] = 1;
history.push(location.pathname + urlEncode(tmp));
};
// 切换页码
const changePage = (values: any) => {
let tmp = {
...location.query,
......@@ -106,12 +121,6 @@ const ChargeManager = (props: any) => {
},
];
const pagination = {
defaultPageSize: 15,
total: Data && Data.page.totalRow,
showSizeChanger: false,
};
return (
<div className={styles.base}>
<TitleSearch
......
......@@ -49,7 +49,7 @@ const UsersDetail = (props: any) => {
};
const [memberDetail, setMemberDetail] = useState(false);
const [memberData, setMemberData] = useState(null);
const [memberData, setMemberData] = useState(null as any);
const [editFlag, setEditFlag] = useState(false);
// const user_status = [[1, "家属"], [2, "租户"]]
......@@ -63,7 +63,9 @@ const UsersDetail = (props: any) => {
const [visible, setVisible] = useState(false);
const formRef = useRef(null);
const formRef = useRef(null as any);
// 提交
const onFinish = (values: any) => {
if (DataSave != null) {
values.id = DataSave.id;
......@@ -83,6 +85,7 @@ const UsersDetail = (props: any) => {
message.error('Error,Please finish it,not empty!', 3);
}
};
useEffect(() => {
if (Result != null) {
console.log(Result);
......@@ -152,8 +155,6 @@ const UsersDetail = (props: any) => {
};
const deleteUnit = (values: any) => {
// console.log(values)
confirm({
title: 'Are you sure delete this infomation?',
icon: <ExclamationCircleOutlined />,
......@@ -180,9 +181,11 @@ const UsersDetail = (props: any) => {
console.log(values);
RA(39, { id: values.id, ownerId: values.owner_id });
};
const titleBackCallBack = () => {
setMemberDetail(false);
};
useEffect(() => {
if (memberResult != null) {
setMemberDetail(false);
......@@ -261,26 +264,34 @@ const UsersDetail = (props: any) => {
) : null}
<Line />
<Spin spinning={DataSaveLoading} tip="Loading Detial">
{DataSaveDetail != null ? (
<TableShow
data={DataSaveDetail}
onSubmit={tableShowCallback}
onChange={deleteUnit}
deleteDisable={editFlag}
/>
) : null}
{editFlag ? (
<>
<Line />
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</>
) : null}
</Spin>
<div style={{ textAlign: 'center' }}>
<Spin spinning={DataSaveLoading} tip="Loading Detial">
{DataSaveDetail ? (
<>
{DataSaveDetail.rows[0].owner.deleted !== 1 ? (
<>
<TableShow
data={DataSaveDetail}
onSubmit={tableShowCallback}
onChange={deleteUnit}
deleteDisable={editFlag}
/>
</>
) : null}
{editFlag && DataSaveDetail.rows[0].owner.deleted !== 1 ? (
<>
<Line />
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</>
) : null}
</>
) : null}
</Spin>
</div>
</Form>
</>
) : null}
......@@ -325,7 +336,6 @@ const UsersDetail = (props: any) => {
function mapStateToProps(state: any) {
const { DataSave, DataSaveDetail, Result, returnValue, memberResult } = state.User;
console.log(state);
return {
DataSave,
DataSaveDetail,
......
......@@ -170,6 +170,6 @@
.writeOff {
position: absolute;
top: 100px;
right: 200px;
top: 34px;
right: 150px;
}
......@@ -6,6 +6,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi';
import ShowOptions from '../../../components/ShowOptions/index';
import TitleBack from '../../../components/TitleBack/TitleBack';
import { PoweroffOutlined } from '@ant-design/icons';
const Detail = (props: any) => {
const { dispatch, Data, CurDataFollow, location, SaveChooseData } = props;
......@@ -19,14 +20,13 @@ const Detail = (props: any) => {
};
useEffect(() => {
TosSecurityGuarderGet({ companyName: SaveChooseData.providerName });
if (SaveChooseData) {
TosSecurityGuarderGet({ companyName: SaveChooseData.providerName });
} else {
history.goBack();
}
}, []);
const [showList, setShowList] = useState([]);
useEffect(() => {
console.log(CurDataFollow);
}, [CurDataFollow]);
const goToGuard = (values: any, e: any) => {
GuarderById(values);
history.push(location.pathname + '/Guard?saferName=' + values.saferName);
......@@ -52,66 +52,80 @@ const Detail = (props: any) => {
},
];
const handleClick = () => {
console.log('注销单元');
};
return (
<div className={styles.base}>
<TitleBack title="Service Provider Details" />
<div className={styles.writeOff}>
<Button type="primary" danger>
Write Off
</Button>
</div>
<div className={styles.bigbox}>
<div className={styles.box0}>
<div className={styles.box0item1}></div>
{/* <div className={styles.box0item2}>{SaveChooseData.serviceCommunityList}</div> */}
</div>
<div className={styles.box1}>
<div className={styles.box1item1}>Company Name</div>
<div className={styles.box1item2}>{SaveChooseData.providerName}</div>
</div>
<div className={styles.box2}>
<div className={styles.box2item1}>Office Address</div>
<div className={styles.box2item2}>{SaveChooseData.providerAddress}</div>
</div>
<div className={styles.box3}>
<div className={styles.box3item1}>Person In Charge</div>
<div className={styles.box3item2}>{SaveChooseData.contactName}</div>
</div>
<div className={styles.box4}>
<div className={styles.box4item1}>Contact Details</div>
<div className={styles.box4item2}>
{SaveChooseData.contactPhone} &nbsp;&nbsp;&nbsp;&nbsp; {SaveChooseData.contactEmail}
{SaveChooseData !== null ? (
<>
<TitleBack title="Service Provider Details" />
{/* <div className={styles.writeOff}>
<Button icon={<PoweroffOutlined />} type="primary" danger onClick={handleClick}>
Write Off
</Button>
</div> */}
<div className={styles.bigbox}>
<div className={styles.box0}>
<div className={styles.box0item1}></div>
{/* <div className={styles.box0item2}>{SaveChooseData.serviceCommunityList}</div> */}
</div>
<div className={styles.box1}>
<div className={styles.box1item1}>Company Name</div>
<div className={styles.box1item2}>{SaveChooseData.providerName}</div>
</div>
<div className={styles.box2}>
<div className={styles.box2item1}>Office Address</div>
<div className={styles.box2item2}>{SaveChooseData.providerAddress}</div>
</div>
<div className={styles.box3}>
<div className={styles.box3item1}>Person In Charge</div>
<div className={styles.box3item2}>{SaveChooseData.contactName}</div>
</div>
<div className={styles.box4}>
<div className={styles.box4item1}>Contact Details</div>
<div className={styles.box4item2}>
{SaveChooseData.contactPhone} &nbsp;&nbsp;&nbsp;&nbsp; {SaveChooseData.contactEmail}
</div>
</div>
<div className={styles.box5}>
<div className={styles.box5item1}>Services Available</div>
<div className={styles.box5item2}>{SaveChooseData.serviceScope}</div>
</div>
<div className={styles.box6}>
<div className={styles.box1item1}>Service Community</div>
</div>
{SaveChooseData.serviceCommunityList != null ? (
<ShowOptions
list={SaveChooseData.serviceCommunityList}
defaultValue={'Put It Away'}
/>
) : (
<></>
)}
</div>
</div>
<div className={styles.box5}>
<div className={styles.box5item1}>Services Available</div>
<div className={styles.box5item2}>Cleaning,Security Guard</div>
</div>
<div className={styles.box6}>
<div className={styles.box1item1}>Service Community</div>
</div>
{SaveChooseData.serviceCommunityList != null ? (
<ShowOptions list={SaveChooseData.serviceCommunityList} defaultValue={'Put It Away'} />
) : (
<></>
)}
<div className={styles.box7}>
<div className={styles.box1item1}>Security Guard Account</div>
</div>
</div>
<Table
rowKey={'id'}
style={{ marginTop: 16 }}
dataSource={CurDataFollow}
columns={columns}
pagination={pagination}
/>
{SaveChooseData.serviceScopeList.some((v: any) => v === 'Security Guards') ? (
<>
<div className={styles.box7}>
<div className={styles.box1item1}>Security Guard Account</div>
</div>
<Table
rowKey={'id'}
style={{ marginTop: 16 }}
dataSource={CurDataFollow}
columns={columns}
pagination={pagination}
/>
</>
) : null}
</>
) : null}
</div>
);
};
......
import React, { useState, useEffect, useRef } from 'react';
import styles from './Edit.less';
import { Input, Button, Form, Result, Pagination, Tooltip, Checkbox, Spin } from 'antd';
import { Link, useIntl, connect } from 'umi';
import {
Input,
Button,
Form,
Result,
Pagination,
Tooltip,
Checkbox,
Spin,
Radio,
message,
} from 'antd';
import { Link, useIntl, connect, history } from 'umi';
import SelectOptions from '../../../components/SelectOptions/index';
import TitleBack from '../../../components/TitleBack/TitleBack';
import { RA } from '@/utils/method';
const module = 'User';
let options: Array<{}> = [];
let options: Array<{ label: string; value: number }> = [];
const Edit = (props: any) => {
const { dispatch, CurData, SaveChooseData, location, CommunityList, DataServices } = props;
const TosTosServiceProviderSave = (values: any) => {
......@@ -25,22 +36,30 @@ const Edit = (props: any) => {
};
const formRef = useRef(null as any);
// 拿取服务范围数据
useEffect(() => {
RA(43, {}, module, dispatch);
}, []);
// 处理服务范围数据
useEffect(() => {
if (DataServices != null) {
var tmp = DataServices.data.serviceScopeList;
options = tmp.map((v: string, i: number) => {
options = DataServices.data.rows.map((v: any) => {
return {
label: v,
value: i.toString(),
label: v.serviceName,
value: v.serviceCode,
};
});
}
}, [DataServices]);
// 判断是否有小区列表数据返回
useEffect(() => {
if (!CommunityList) {
history.goBack();
}
}, []);
useEffect(() => {
console.log(CurData);
if (CurData != null) {
......@@ -50,28 +69,37 @@ const Edit = (props: any) => {
useEffect(() => {
if (SaveChooseData != null) {
console.log(SaveChooseData);
console.log(options);
let arr: [] = [];
SaveChooseData.serviceScopeList.forEach((v: any) => {
options.forEach((ele: any) => {
if (v === ele.label) {
arr.push(ele.value as never);
}
});
});
SaveChooseData.serviceScopeList = arr;
// console.log(SaveChooseData);
// console.log(options);
// let arr: Array<''> = [];
// SaveChooseData.serviceScopeList.forEach((v: any) => {
// options.forEach((ele: any) => {
// if (v === ele.value) {
// arr.push(ele.value as never);
// }
// });
// });
// console.log(arr);
// SaveChooseData.serviceScopeList = arr;
SaveChooseData.serviceScopeList = SaveChooseData.serviceScopeList[0];
formRef.current.setFieldsValue(SaveChooseData);
}
}, [SaveChooseData]);
// 提交按钮
const onFinish = (values: any) => {
if (CList.length === 0) {
message.warning('Please select at least one service Community!', 3);
return;
}
var val = values;
val.serviceCommunityList = CList;
val.creator = 'admin';
val.updater = 'admin';
console.log(val);
return;
val.serviceScopeList = [val.serviceScopeList];
if (SaveChooseData) {
val.id = SaveChooseData.id;
}
setload(true);
TosTosServiceProviderSave(val);
};
......@@ -136,7 +164,8 @@ const Edit = (props: any) => {
},
]}
>
<Checkbox.Group options={options as any} />
{/* <Checkbox.Group options={options as any} /> */}
<Radio.Group options={options as any} />
</Form.Item>
</div>
</div>
......@@ -210,8 +239,6 @@ function mapStateToProps(state: any) {
const { CurData, SaveChooseData } = state.ServiceProvider;
const { DataServices } = state.User;
const { CommunityList } = state.Init;
console.log(state.ServiceProvider);
console.log(CurData);
return {
CurData,
SaveChooseData,
......
......@@ -13,7 +13,7 @@ import { TosSecurityGuarderGet } from '@/services/tos';
const module = 'User';
// 服务范围数据
let options: Array<[]> = [];
let options: Array<[number, string]> = [];
// 筛选参数
let readyData: any = {
......@@ -25,13 +25,6 @@ let readyData: any = {
// 节流阀
let flag = false;
const services = [
[0, 'Security Guards'],
[0, 'Accountant'],
[0, 'repair'],
[0, 'Clean'],
];
const ServiceProviderManagement = (props: any) => {
const [loading, setLoading] = useState(false);
......@@ -42,6 +35,7 @@ const ServiceProviderManagement = (props: any) => {
};
const goToDetail = (values: any, e: any) => {
values.serviceScope = options[values.serviceScopeList[0]][1];
SaveChooseData(values);
history.push(location.pathname + '/Detail');
};
......@@ -69,11 +63,9 @@ const ServiceProviderManagement = (props: any) => {
title: 'Services Available',
dataIndex: 'serviceScopeList',
render: (text: any, record: any) => {
let str: string = '';
text.forEach((v: string, i: number) => {
str += i === text.length - 1 ? v : v + ',';
});
return str;
if (options.length > 0) {
return options[text[0]][1];
}
},
},
{ title: 'Account Status', dataIndex: 'enable' },
......@@ -93,13 +85,13 @@ const ServiceProviderManagement = (props: any) => {
RA(43, {}, module, dispatch);
}, []);
// 处理服务商数据
useEffect(() => {
if (DataServices) {
console.log(DataServices);
// options = DataServices.data.serviceScopeList.map((v: string, i: number) => {
// return [i, v];
// });
options = DataServices.data.rows.map((v: any) => {
return [v.serviceCode, v.serviceName];
});
}
}, [DataServices]);
......@@ -150,6 +142,10 @@ const ServiceProviderManagement = (props: any) => {
//页面搜索
const CallBackTitleSearch = (comment: any) => {
readyData.serviceCommunityList = comment.serviceCommunityList;
console.log(comment);
if (comment.status == undefined) {
comment.status = '';
}
history.push(
location.pathname +
urlEncode(
......@@ -184,24 +180,6 @@ const ServiceProviderManagement = (props: any) => {
break;
}
}
for (let items in tmp) {
for (let items1 in tmp[items].serviceScopeList) {
switch (tmp[items].serviceScopeList[items1]) {
case '0':
tmp[items].serviceScopeList[items1] = 'Security Guards';
break;
case '1':
tmp[items].serviceScopeList[items1] = 'Accountant';
break;
case '2':
tmp[items].serviceScopeList[items1] = 'repair';
break;
case '3':
tmp[items].serviceScopeList[items1] = 'Clean';
break;
}
}
}
return tmp;
};
......@@ -228,7 +206,7 @@ const ServiceProviderManagement = (props: any) => {
onSubmit={CallBackTitleSearch}
defaultValue={{
providerName: readyData.providerName,
status: readyData.serviceScope ? parseInt(readyData.serviceScope) : undefined,
status: readyData.serviceScope ? parseInt(readyData.serviceScope) : null,
}}
checklist={
readyData.serviceCommunityList.length !== 0 ? readyData.serviceCommunityList : null
......
......@@ -9,67 +9,65 @@ import TagSelect from '../../../components/TagSelect/index';
import { RA } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
const module = "User"
const Services = (props: any) => {
const module = 'User';
const services = ['Security Guards', 'Accountant', 'repair', 'Clean'];
const { dispatch, DataServices } = props
const formRef = useRef(null)
const Services = (props: any) => {
const { dispatch, DataServices } = props;
const formRef = useRef(null);
useEffect(() => {
RA(43, { serviceName: "" }, module, dispatch)
}, [location])
RA(43, { serviceName: '' }, module, dispatch);
}, [location]);
useEffect(() => {
if (DataServices != null) {
var tmp = DataServices.data.serviceScopeList
console.log(tmp)
console.log(formRef)
formRef.current.setFieldsValue({ services: tmp })
var tmp = DataServices.data.rows.map((v: any) => {
return services[v.serviceCode - 1];
});
console.log(tmp);
formRef.current.setFieldsValue({ services: tmp });
}
}, [DataServices])
}, [DataServices]);
const onFinish = (values: any) => {
console.log(values)
RA(44, {
id: "5",
serviceName: "律政"
}, module, dispatch)
}
console.log(values);
RA(
44,
{
id: '5',
serviceName: '律政',
},
module,
dispatch,
);
};
const Add = (values: any) => {
console.log(values)
}
const Remove = (values: any) => {
}
console.log(values);
};
const Remove = (values: any) => {};
return (
<div className={styles.base}>
<TitleBack title={"Services Available Management"}></TitleBack>
<TitleBack title={'Services Available Management'}></TitleBack>
<Form ref={formRef} name="basic" onFinish={onFinish}>
{DataServices != null ?
<Form.Item label="Available Services" name="services"><TagSelect onAdd={Add} onRemove={Remove} /></Form.Item>
: null
}
{DataServices != null ? (
<Form.Item label="Available Services" name="serviceCode">
<TagSelect onAdd={Add} onRemove={Remove} />
</Form.Item>
) : null}
<Line />
{/* <Form.Item ><Button type="primary" htmlType="submit">Submit</Button></Form.Item> */}
</Form>
</div>
);
};
function mapStateToProps(state: any) {
const { DataServices } = state.User
const { DataServices } = state.User;
return {
DataServices
}
DataServices,
};
}
export default connect(mapStateToProps)(Services)
export default connect(mapStateToProps)(Services);
......@@ -152,7 +152,7 @@ export const filterObjbyTg = (obj: any, tg: any) => {
var tmp = {};
for (var item in obj) {
if (tg.indexOf(item) > -1) {
if ((obj[item] === 0 || obj[item]) && obj[item] != null) {
if (obj[item] != null) {
tmp[item] = obj[item];
}
}
......
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