Commit 7611da70 authored by cellee's avatar cellee

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

parents 59f00b7a e1d97977
......@@ -197,7 +197,11 @@ export default defineConfig({
{
path: './ProblemFeedback',
name: 'problemfeedback',
component: './CommercialService/PropertyServices',
routes: [
{ path: './', component: './CommercialService/PropertyServices' },
{ path: './Detail', component: './CommercialService/Detail' },
{ path: './Edit', component: './CommercialService/Detail' },
]
},
{
path: './RenovationApplication',
......@@ -205,6 +209,8 @@ export default defineConfig({
routes: [
{ path: './', component: './CommercialService/Renovation' },
{ path: './Detail', component: './CommercialService/RenovationDetail' },
{ path: './Detail', component: './CommercialService/Detail' },
{ path: './Edit', component: './CommercialService/Detail' },
],
},
{
......@@ -219,7 +225,11 @@ export default defineConfig({
{
path: './ReportOnline',
name: 'reportonline',
component: './CommercialService/PropertyServices',
routes: [
{ path: "./", component: './CommercialService/PropertyServices' },
{ path: './Detail', component: './CommercialService/Detail' },
{ path: './Edit', component: './CommercialService/Detail' },
]
},
{
path: './ShelfLifeService',
......@@ -232,12 +242,6 @@ export default defineConfig({
},
{ path: './OwnerComplaints/Detail', component: './CommercialService/Detail' },
{ path: './OwnerComplaints/Edit', component: './CommercialService/Detail' },
{ path: './ProblemFeedback/Detail', component: './CommercialService/Detail' },
{ path: './ProblemFeedback/Edit', component: './CommercialService/Detail' },
{ path: './RenovationApplication/Detail', component: './CommercialService/Detail' },
{ path: './RenovationApplication/Edit', component: './CommercialService/Detail' },
{ path: './ReportOnline/Detail', component: './CommercialService/Detail' },
{ path: './ReportOnline/Edit', component: './CommercialService/Detail' },
],
},
{
......
import React, { useEffect } from 'react';
import { connect } from 'umi';
import SearchOptions from './SearchOptions';
import SearchOptionsTow from './SearchOptionsTow';
const SearchOptionsCommnity = (props: any) => {
......@@ -37,7 +36,7 @@ const SearchOptionsCommnity = (props: any) => {
extendName={extendName}
def={defaultName}
type={type}
></SearchOptionsTow>
/>
) : null}
</>
);
......
......@@ -6,25 +6,36 @@
* @Description: In User Settings Edit
* @FilePath: \tostumi\src\components\SearchOptions\SearchOptionsTow.tsx
*/
import React from 'react';
import React, { useEffect, useState } from 'react';
import { Select } from 'antd';
const { Option } = Select;
const SearchOptionsTow = (porps: any) => {
const { list, extendName, def, type, disabled } = porps;
const [value, setValue] = useState(undefined);
const options = list.map((d: any, index: number) => (
<Option value={d} key={index}>
{d}
</Option>
));
function onChange(value: any) {
// console.log(`selected ${value}`);
if (!value) {
value = '';
} else {
setValue(value);
}
extendName(value);
}
useEffect(() => {
if (def) {
setValue(def);
} else {
setValue(undefined);
}
}, [def]);
return (
<div>
{type ? (
......@@ -37,7 +48,7 @@ const SearchOptionsTow = (porps: any) => {
placeholder="Community Name"
optionFilterProp="children"
onChange={onChange}
defaultValue={def ? def : null}
value={value}
disabled={disabled}
>
{options}
......@@ -50,7 +61,7 @@ const SearchOptionsTow = (porps: any) => {
placeholder="Community Name"
optionFilterProp="children"
onChange={onChange}
defaultValue={def ? def : null}
value={value}
disabled={disabled}
>
{options}
......
import React, { useState, useEffect } from 'react';
import { connect } from 'umi';
import { Input, Row, Col, Form, Select, Button, DatePicker } from 'antd';
import { SearchOutlined } from '@ant-design/icons';
import SearchOptionsCommnity from '../SearchOptions/SearchOptionsCommnity';
import SelectOptions from '../SelectOptions/index';
import { Input, Row, Col, Form, Select, Button, DatePicker } from 'antd';
const { Option } = Select;
import SelectOptions from '../../components/SelectOptions/index';
import SearchOptionsCommnity from '../SearchOptions/SearchOptionsCommnity';
const TitleSearch = (props: any) => {
const {
dispatch,
......@@ -58,7 +56,7 @@ const TitleSearch = (props: any) => {
useEffect(() => {
if (CommunityList != null) {
var tmp = {};
const tmp = {};
tmp[community] = CommunityList;
// props.onSubmit(tmp) 禁用 改用组件初始化
setCommunitys(CommunityList);
......@@ -73,13 +71,10 @@ const TitleSearch = (props: any) => {
if (community) {
values[community] = communitys;
}
console.log('Success:', values);
props.onSubmit(values);
};
const onFinishFailed = (errorInfo: any) => {
console.log('Failed:', errorInfo);
};
const onFinishFailed = () => {};
const onChange = (date: any, dateString: string) => {
setDate(dateString);
......@@ -110,8 +105,8 @@ const TitleSearch = (props: any) => {
<Form form={form} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed}>
<Row gutter={32}>
{communitySelect != null ? (
<Col key={'communitySelect_'}>
<Form.Item name={'communityName'}>
<Col key="communitySelect_">
<Form.Item name="communityName">
<SearchOptionsCommnity
defaultName={defalueName}
titleSearch={true}
......@@ -149,7 +144,7 @@ const TitleSearch = (props: any) => {
<Select
style={{ width: 160 }}
placeholder={item.name[1]}
allowClear={true}
allowClear
defaultValue={item.default}
>
{item.data.map((word) => {
......@@ -166,7 +161,7 @@ const TitleSearch = (props: any) => {
})
: null}
{time != null ? (
<Col key={'datePicker_'}>
<Col key="datePicker_">
{' '}
<DatePicker placeholder={time[1]} onChange={onChange} />
</Col>
......
......@@ -150,7 +150,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
<span>{route.breadcrumbName}</span>
);
}}
//footerRender={() => defaultFooterDom}
// footerRender={() => defaultFooterDom}
menuDataRender={menuDataRender}
rightContentRender={() => <RightContent />}
{...props}
......
......@@ -83,15 +83,14 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
];
// 用户重新打开需要重新登录
let time = localStorage.getItem('loginTime');
const time = localStorage.getItem('loginTime');
const tokenLogin = time ? JSON.parse(time) : false;
// 登录
if (history.location.pathname == '/') {
var isLogin = false;
let isLogin = false;
console.log(getCookie('token'));
if (getCookie('token').length != 0) {
if (getCookie('token').length !== 0) {
isLogin = true;
}
const queryString = stringify({
......@@ -107,7 +106,7 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
// 在判断权限
const permission = JSON.parse(localStorage.getItem('permission') || '[]');
let perObj = perList.filter((obj) => {
const perObj = perList.filter((obj) => {
return obj.path === location.pathname;
});
......@@ -123,7 +122,7 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
// 退出登录
const key = 'outLogin';
message.warning({ content: 'Expired login !', key });
setTimeout(function () {
setTimeout(() => {
logOut();
}, 1000);
......
......@@ -15,25 +15,25 @@ export interface UserLayoutProps extends Partial<ConnectProps> {
const UserLayout: React.FC<UserLayoutProps> = (props) => {
const {
route = {
routes: [],
},
// route = {
// routes: [],
// },
children,
location = {
pathname: '',
},
// location = {
// pathname: '',
// },
result,
dispatch,
// dispatch,
} = props;
const { routes = [] } = route;
const { formatMessage } = useIntl();
const { breadcrumb } = getMenuData(routes);
const title = getPageTitle({
pathname: location.pathname,
formatMessage,
breadcrumb,
...props,
});
// const { routes = [] } = route;
// const { formatMessage } = useIntl();
// const { breadcrumb } = getMenuData(routes);
// const title = getPageTitle({
// pathname: location.pathname,
// formatMessage,
// breadcrumb,
// ...props,
// });
return (
<div className={styles.container + ' ' + (result ? styles.active : '')}>
......
import * as service from '@/services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router';
import { timestampToTime, timestampToTime4 } from '@/utils/time';
import { history } from 'umi';
import { timestampToTime4 } from '@/utils/time';
import { picFromate, Fromate } from '@/utils/method';
export default {
......@@ -52,37 +49,37 @@ export default {
},
effects: {
//预订设施查询
// 预订设施查询
*RA({ playload }: any, { call, put }: any) {
switch (playload.index) {
case 40:
{
var Data = null;
const Data = null;
yield put({ type: 'returnPage', Data });
}
break;
default:
break;
}
const resp = yield call(service.RA, playload);
console.log(resp);
if (resp.code == 500 || resp.error_code != '0000') {
if (resp.code === 500 || resp.error_code !== '0000') {
// window.location.href = '/500';
message.error(`${resp.error_code}:${resp.error_msg}`);
}
if (resp.error_code != '0000') {
if (resp.error_code !== '0000') {
message.error(`${resp.error_code}:${resp.error_msg}`);
} else {
switch (playload.index) {
case 21:
{
var tmp = resp.data.tosOwerModel || resp.data.tosOwnerRelationModel;
var tmp2 = resp.data;
console.log(resp);
const tmp = resp.data.tosOwerModel || resp.data.tosOwnerRelationModel;
const tmp2 = resp.data;
if (!tmp) {
message.error('Data loading error!');
history.go(-1);
history.goBack();
return;
}
var CurDataDetail: {
const CurDataDetail: {
community: string;
address: string;
home: string;
......@@ -121,86 +118,84 @@ export default {
case 33:
case 34:
case 22:
{
message.success('Success Operation!', 3);
history.go(-1);
// history.push("/CommercialService/CommunityMaintenance")
}
// message.success('Success Operation!', 3);
history.go(-1);
// history.push("/CommercialService/CommunityMaintenance")
break;
case 23:
{
let Data8 = resp;
const Data8 = resp;
yield put({ type: 'returnPage8', Data8 });
}
break;
case 31:
{
let Data7 = resp;
const Data7 = resp;
yield put({ type: 'returnPage7', Data7 });
}
break;
case 35:
{
let Result = resp;
const Result = resp;
yield put({ type: 'returnResult', Result });
}
break;
case 37:
{
let DataSaveDetail = resp;
const DataSaveDetail = resp;
yield put({ type: 'returnDataSaveDetail', DataSaveDetail });
}
break;
case 36:
{
let DataSaveDetail = resp;
const DataSaveDetail = resp;
yield put({ type: 'returnDataSaveDetail', DataSaveDetail });
}
break;
case 40:
{
let Data = resp;
const Data = resp;
yield put({ type: 'returnPage', Data });
}
break;
default:
break;
}
}
},
*SA({ playload }: any, { call, put }: any) {
var DataSave = playload;
const DataSave = playload;
yield put({ type: 'returnDataSave', DataSave });
},
*setCurData({ playload }: any, { call, put }: any) {
var CurData = playload;
const CurData = playload;
yield put({ type: 'returnCurData', CurData });
},
*setCurDataDetail({ playload }: any, { call, put }: any) {
var CurDataDetail = null;
const CurDataDetail = null;
yield put({ type: 'returnCurDataDetail', CurDataDetail });
},
*ResultClear({ }, { put }: any) {
var Result = null;
console.log('清除');
const Result = null;
yield put({ type: 'returnResult', Result });
},
*DataSaveDetailClear({ }, { put }: any) {
console.log('清楚数据');
let DataSaveDetail = null;
const DataSaveDetail = null;
yield put({ type: 'returnDataSaveDetail', DataSaveDetail });
},
*DataSaveClear({ }, { put }: any) {
let DataSave = null;
const DataSave = null;
yield put({ type: 'returnDataSave', DataSave });
},
*Data7Clear({ }, { put }: any) {
let Data7 = null;
const Data7 = null;
yield put({ type: 'returnPage7', Data7 });
},
......
import * as service from '../../services/tos';
import { history } from 'umi';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router';
import * as service from '../../services/tos';
export default {
namespace: 'User',
......@@ -24,7 +22,7 @@ export default {
DataServices: null,
Data4Error: null,
Data4Error: false,
},
reducers: {
......@@ -74,186 +72,175 @@ export default {
switch (playload.index) {
case 12:
{
let Data = null;
const Data = null;
yield put({ type: 'returnPage', Data });
}
break;
case 13:
{
let DataSaveDetail = null;
let returnValue = null;
const DataSaveDetail = null;
const returnValue = null;
yield put({ type: 'DataSaveDetail', DataSaveDetail, returnValue });
}
break;
case 43:
{
let DataServices = null;
const DataServices = null;
yield put({ type: 'returnDataServices', DataServices });
}
break;
default:
break;
}
const resp = yield call(service.RA, playload);
console.log('resp', resp);
if (resp.code == 500 || resp.error_code != '0000') {
// message.error('Server Error,try again,error code:500', 3);
// window.location.href = '/500';
// message.error(resp.msg);
}
if (resp.error_code != '0000') {
if (resp.error_code !== '0000') {
if (playload.index !== 53) {
message.error(`${resp.error_code}:${resp.error_msg}`);
message.error(`${resp.error_msg}`);
}
var Data3Error = null;
var Result = null;
let Data4Error = null;
let Data3Error = null;
let Result = null;
switch (playload.index) {
case 11:
{
Data3Error = { msg: 'Information Wrong!' };
yield put({ type: 'returnData3Error', Data3Error });
}
Data3Error = { msg: 'Information Wrong!' };
yield put({ type: 'returnData3Error', Data3Error });
break;
case 13:
{
// message.error('Request exception please retry!!!');
history.push('/UserManagement/LIFEUserManagement');
}
// message.error('Request exception please retry!!!');
history.push('/UserManagement/LIFEUserManagement');
break;
// 删除失败的案例
case 16:
{
Result = resp;
yield put({ type: 'returnResult', Result });
}
Result = resp;
yield put({ type: 'returnResult', Result });
break;
case 14:
{
Data4Error = { msg: 'The community or unit is already registered!' };
const Data4Error = true;
yield put({ type: 'returnData4Error', Data4Error });
}
yield put({ type: 'returnData4Error', Data4Error });
break;
case 18:
case 53:
{
Result = resp;
yield put({ type: 'returnResult', Result });
}
Result = resp;
yield put({ type: 'returnResult', Result });
break;
default:
break;
}
} else {
switch (playload.index) {
case 12:
{
let Data = resp;
const Data = resp;
yield put({ type: 'returnPage', Data });
}
break;
case 18:
case 14:
{
message.success('Success Operation!');
// window.location.href = '/CommunityManagement/FacilityBookings';
history.push('/UserManagement/LIFEUserManagement');
}
// window.location.href = '/CommunityManagement/FacilityBookings';
history.push('/UserManagement/LIFEUserManagement');
break;
case 13:
{
let DataSaveDetail = resp.data;
const DataSaveDetail = resp.data;
yield put({ type: 'DataSaveDetail', DataSaveDetail });
}
break;
case 16:
{
console.log('等待删除完成');
var returnValue = resp;
const returnValue = resp;
yield put({ type: 'ReturnValue', returnValue });
}
break;
case 32:
{
let communityInfo = resp;
const communityInfo = resp;
yield put({ type: 'returnCommunityInfo', communityInfo });
}
break;
case 39:
{
let memberResult = resp;
const memberResult = resp;
yield put({ type: 'returnMemberResult', memberResult });
}
break;
case 43:
{
let DataServices = resp;
const DataServices = resp;
yield put({ type: 'returnDataServices', DataServices });
}
break;
case 44: {
let Result = resp;
yield put({ type: 'returnResult', Result });
}
case 44:
{
const Result = resp;
yield put({ type: 'returnResult', Result });
}
break;
default:
break;
}
}
},
*IA({ }, { put }: any) {
var Data3 = null;
*IA({ }, { call, put }: any) {
const Data3 = null;
yield put({ type: 'returnPage3', Data3 });
},
*IA2({ }, { put }: any) {
var Data3Error = null;
*IA2({ }, { call, put }: any) {
const Data3Error = null;
yield put({ type: 'returnData3Error', Data3Error });
},
*SA({ playload }: any, { put }: any) {
var DataSave = playload;
*SA({ playload }: any, { call, put }: any) {
const DataSave = playload;
yield put({ type: 'returnDataSave', DataSave });
},
*CA({ playload }: any, { put }: any) {
var sourceData = playload;
*CA({ playload }: any, { call, put }: any) {
const sourceData = playload;
yield put({ type: 'returnSource', sourceData });
},
*QA({ playload }: any, { put }: any) {
var curString = playload;
*QA({ playload }: any, { call, put }: any) {
const curString = playload;
yield put({ type: 'returnCurString', curString });
},
*ResultClear({ }, { put }: any) {
var tmp = null;
*ResultClear({ }: any, { call, put }: any) {
const tmp = null;
yield put({ type: 'returnResult', tmp });
},
*PAGE({ playload }: any, { put }: any) {
var pageDate = playload;
*PAGE({ playload }: any, { call, put }: any) {
const pageDate = playload;
yield put({ type: 'PageDate', pageDate });
},
*DataClear({ }, { put }: any) {
var pageDate = null;
*DataClear({ }: any, { call, put }: any) {
const pageDate = null;
yield put({ type: 'returnPage', pageDate });
},
*MemberResultClear({ }, { put }: any) {
let memberResult = null;
*MemberResultClear({ }: any, { call, put }: any) {
const memberResult = null;
yield put({ type: 'returnMemberResult', memberResult });
},
*Data4ErrorClear({ }, { put }: any) {
let Data4Error = null;
*Data4ErrorClear({ }: any, { call, put }: any) {
const Data4Error = false;
yield put({ type: 'returnData4Error', Data4Error });
},
*ClearResult({ }, { put }: any) {
let Result = null;
*ClearResult({ }: any, { call, put }: any) {
const Result = null;
yield put({ type: 'returnResult', Result });
},
*ClearReturnValue({ }, { put }: any) {
let returnValue = null;
*ClearReturnValue({ }: any, { call, put }: any) {
const returnValue = null;
yield put({ type: "ReturnValue", returnValue })
}
},
......
......@@ -17,15 +17,14 @@ export default {
},
effects: {
//获取物业费列表
// 获取物业费列表
*get({ playload }: any, { call, put }: any) {
const resp = yield call(service.get, playload);
console.log(resp);
let Data = resp.data;
const Data = resp.data;
yield put({ type: 'returnData', Data });
},
*getById({ playload }: any, { call, put }: any) {
let CurData = playload;
const CurData = playload;
yield put({ type: 'returnCurData', CurData });
},
},
......
import * as service from '../services/tos';
import { message, Modal } from 'antd';
import { history } from 'umi';
import * as service from '../services/tos';
export default {
namespace: 'ServiceProvider',
......@@ -27,7 +28,6 @@ export default {
return { ...state, SaveChooseData };
},
returnCurData(state: object, { CurData }: any) {
console.log(CurData)
return { ...state, CurData };
},
returnResult(state: object, { Result }: any) {
......@@ -39,28 +39,22 @@ export default {
// 获取服务商
*TosTosServiceProviderGet({ playload }: any, { call, put }: any) {
const resp = yield call(service.TosTosServiceProviderGet, playload);
console.log(resp);
if (resp.error_code == '0000') {
let Data = resp.data;
if (resp.error_code === '0000') {
const Data = resp.data;
yield put({ type: 'returnPage', Data });
} else {
console.log(resp);
console.log('请求错误码:' + resp.error_code);
message.error(resp.error_msg);
let Data = undefined;
console.log(playload);
const Data = undefined;
yield put({ type: 'returnPage', Data });
}
},
// 新建服务商
*TosTosServiceProviderSave({ playload }: any, { call, put }: any) {
console.log(playload);
const resp = yield call(service.TosTosServiceProviderSave, playload);
console.log(resp);
// 服务范围选择错误
if (resp.error_code === "0002") {
let CurData: Boolean = false;
const CurData: Boolean = false;
yield put({ type: "returnCurData", CurData });
// message.error("Service scope selection error!!!")
Modal.error({
......@@ -72,7 +66,7 @@ export default {
// 小区选择错误
if (resp.error_code === "0003") {
let CurData: Boolean = false;
const CurData: Boolean = false;
yield put({ type: "returnCurData", CurData });
Modal.error({
title: 'Service selection error',
......@@ -83,7 +77,7 @@ export default {
// 提交失败
if (resp.error_code === "0001") {
let CurData: Boolean = false;
const CurData: Boolean = false;
yield put({ type: 'returnCurData', CurData });
message.error('Creation failed. Please try again!');
return;
......@@ -93,38 +87,35 @@ export default {
if (resp.error_code === "0000") {
// message.success('Operator Success!', 1.5, () => {
// });
window.location.href = '/UserManagement/ServiceProviderManagement';
let CurData: Boolean = true;
const CurData: Boolean = true;
yield put({ type: 'returnCurData', CurData });
window.location.href = '/UserManagement/ServiceProviderManagement';
return;
}
// 小区选择错误
if (resp.error_code === "0004") {
let CurData: Boolean = false;
const CurData: Boolean = false;
yield put({ type: "returnCurData", CurData });
message.error("Company name already exists!")
return;
message.error("Company name already exists!");
}
},
//获取服务商保安根据服务商名
// 获取服务商保安根据服务商名
*TosSecurityGuarderGet({ playload }: any, { call, put }: any) {
console.log(playload);
const resp = yield call(service.TosSecurityGuarderGet, playload);
console.log(resp);
let CurDataFollow = resp.data.rows;
const CurDataFollow = resp.data.rows;
yield put({ type: 'returnCurDataFollow', CurDataFollow });
},
//获取服务商保安详情根据服务商名
// 获取服务商保安详情根据服务商名
*GuarderById({ playload }: any, { call, put }: any) {
let CurDataFollowDetail = playload;
const CurDataFollowDetail = playload;
yield put({ type: 'returnCurDataFollowDetail', CurDataFollowDetail });
},
*SaveChooseData({ playload }: any, { call, put }: any) {
let SaveChooseData = playload;
const SaveChooseData = playload;
yield put({ type: 'returnSaveChooseData', SaveChooseData });
},
......@@ -132,36 +123,31 @@ export default {
*DelServiceProvider({ playload }: any, { call, put }: any) {
const resp = yield call(service.TosTosServiceProviderDel, playload);
if (resp.error_code === '0000') {
let Result = true;
const Result = true;
yield put({ type: 'returnResult', Result });
} else {
let Result = false;
const Result = false;
yield put({ type: 'returnResult', Result });
}
},
*ResultClear({ playload }: any, { call, put }: any) {
console.log('清除数据');
let Result = null;
const Result = null;
yield put({ type: 'returnResult', Result });
},
*DelGuarder({ playload }: any, { call, put }: any) {
console.log('删除保安');
console.log(playload);
const res = yield call(service.TosGuarderDel, playload);
console.log(res);
if (res.error_code === '0000') {
message.success('Safer information deleted successfully!!!');
history.go(-1);
history.goBack();
} else {
message.error('Deletion failed,Please try again');
}
},
*CurDataClear({ playload }: any, { call, put }: any) {
console.log('清除数据');
let CurData = null;
const CurData = null;
yield put({ type: 'returnCurData', CurData });
},
},
......
......@@ -109,9 +109,7 @@ const Model: LoginModelType = {
setCookie("remenberUserName", "", -1)
setCookie("remenberPwd", "", -1)
}
// Login successfully response.status === 'ok'
message.success('Login Successfully!', 3);
const userMessage = yield call(AccountCheckLogin, payload.values); //请求时间网络
const userMessage = yield call(AccountCheckLogin, payload.values); // 请求时间网络
setCookie('token', userMessage.token);
setCookie('id', userMessage.userModel.id);
......@@ -199,7 +197,7 @@ const Model: LoginModelType = {
}
},
*goResetPwd({ payload }, { call, put }) {
*goResetPwd({ payload }, { put }) {
yield put({
type: 'resetPwd',
result: true,
......@@ -209,7 +207,7 @@ const Model: LoginModelType = {
history.push('login2');
},
*setResult({ payload }, { call, put }) {
*setResult({ payload }, { put }) {
yield put({
type: "setResultLogin",
resultLogin: payload.resultLogin || false,
......
......@@ -37,8 +37,7 @@ const UserModel: UserModelType = {
},
effects: {
*fetch(_, { call, put }) {
console.log(call);
*fetch() {
// const response = yield call(queryUsers);
// console.error(response)
// yield put({
......@@ -49,11 +48,10 @@ const UserModel: UserModelType = {
*fetchCurrent({ playload }, { call, put }) {
// console.log("response")
const userInfo = JSON.parse(localStorage.getItem('userInfo') || 'null');
console.log('存储用户信息');
console.log(userInfo);
if (!userInfo) {
const response = yield call(queryCurrent, playload);
console.log(response);
localStorage.setItem('userInfo', JSON.stringify(response));
yield put({
type: 'saveCurrentUser',
......@@ -67,7 +65,7 @@ const UserModel: UserModelType = {
}
},
*deleteCurrent({ playload }, { call, put }) {
*deleteCurrent({ put }) {
yield put({
type: 'deleteCurrentUser',
});
......@@ -81,7 +79,7 @@ const UserModel: UserModelType = {
currentUser: action.payload || {},
};
},
deleteCurrentUser(state, action) {
deleteCurrentUser(state) {
return {
...state,
currentUser: {},
......
import React, { useState, useEffect, useRef } from 'react';
import { Input, Tabs, Table, Space, Button, message } from 'antd';
const { TabPane } = Tabs;
import React, { useState, useEffect } from 'react';
import { Table, Space, Button, message } from 'antd';
import { connect, history } from 'umi';
import { RA, urlEncode, filterObjbyTg, Clear } from '@/utils/method';
import { objectColumns } from '@/utils/string';
import { timestampToTime } from '@/utils/time';
import Login from '../user/login/components/Login';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, SA, urlEncode, filterObj, filterObjbyTg, Clear } from '@/utils/method';
let readyData: any = {
communityName: '',
ownerName: '',
......@@ -61,7 +55,7 @@ const Card = (props: any) => {
[
'Account Type',
'apply_relation_owner',
(text: string, record: any) => <div>{apply_relation[text][1]}</div>,
(text: string) => <div>{apply_relation[text][1]}</div>,
],
[
'Application Time',
......@@ -73,7 +67,7 @@ const Card = (props: any) => {
[
'Status',
'apply_status',
(text: any, record: any) => <Space size="middle">{apply_status[parseInt(text)][1]}</Space>,
(text: any) => <Space size="middle">{apply_status[parseInt(text)][1]}</Space>,
],
[
'Actions',
......@@ -87,13 +81,13 @@ const Card = (props: any) => {
]);
useEffect(() => {
//前置数据
// 前置数据
readyData = {
...location.query,
pageNum: location.query.pageNum ? parseInt(location.query.pageNum) : 1,
};
//获取数据
// 获取数据
setLoading(true);
RA(
31,
......@@ -120,7 +114,7 @@ const Card = (props: any) => {
}
}, [Data7]);
const goToDetail = (values: any, e: any) => {
const goToDetail = (values: any) => {
if (permissionArr.indexOf('30') < 0) {
message.error('No Permissions!!!', 3);
return;
......@@ -136,19 +130,19 @@ const Card = (props: any) => {
history.push('./AccessCardApplication/Add');
};
//页面搜索
// 页面搜索
const ClickTitleSearch = (comment: any) => {
if (comment.handleStatus instanceof Array) {
comment.handleStatus = comment.handleStatus[0];
}
let tmp = filterObjbyTg(comment, ['handleStatus', 'ownerName', 'communityName']);
const tmp = filterObjbyTg(comment, ['handleStatus', 'ownerName', 'communityName']);
tmp['pageNum'] = 1;
history.push(location.pathname + urlEncode(tmp));
};
// 切换页码
const changePage = (values: any) => {
let tmp = {
const tmp = {
...location.query,
pageNum: values.current,
};
......
......@@ -22,8 +22,8 @@ const CardAdd = (props: any) => {
useEffect(() => {
if (Result != null) {
if ((Result.error_code = '0000')) {
message.success('Operation Success!');
if (Result.error_code === '0000') {
// message.success('Operation Success!');
setLoading(false);
ResultClear(module, dispatch);
history.push('/CommercialService/AccessCardApplication');
......@@ -69,17 +69,6 @@ const CardAdd = (props: any) => {
form.resetFields();
}, []);
const checkData2: (rule: any, value: string, cb: any) => void = (rule, value, cb) => {
if (value) {
if (/^[a-zA-Z0-9]+$/g.test(value)) {
cb();
} else {
cb(new Error('Only numbers and letters can be entered!'));
}
}
cb();
};
// 手机号码验证
const phoneNumber: (rule: any, value: string, cb: any) => void = (rule, value, cb) => {
if (value) {
......@@ -94,8 +83,7 @@ const CardAdd = (props: any) => {
return (
<div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
<TitleBack title={'New Application For Access Card'}></TitleBack>
<TitleBack title="New Application For Access Card" />
<Form form={form} name="basic" onFinish={onFinish} validateMessages={validateMessages}>
<Spin spinning={loading}>
<Form.Item labelCol={{ span: 3 }} label="Community" style={{ marginBottom: 0 }}>
......@@ -115,7 +103,7 @@ const CardAdd = (props: any) => {
},
]}
>
<Input style={{ width: 80 }} placeholder={'BLK'} />
<Input style={{ width: 80 }} placeholder="BLK" />
</Form.Item>
<div style={{ lineHeight: 2, marginRight: 16 }}>#</div>
<Form.Item
......@@ -130,7 +118,7 @@ const CardAdd = (props: any) => {
},
]}
>
<Input style={{ width: 80 }} placeholder={'Floor'} />
<Input style={{ width: 80 }} placeholder="Floor" />
</Form.Item>
<div style={{ lineHeight: 2, marginRight: 16 }}>-</div>
<Form.Item
......@@ -144,7 +132,7 @@ const CardAdd = (props: any) => {
},
]}
>
<Input style={{ width: 120 }} placeholder={'Room'} />
<Input style={{ width: 120 }} placeholder="Room" />
</Form.Item>
</Input.Group>
</Form.Item>
......@@ -152,9 +140,9 @@ const CardAdd = (props: any) => {
<Form.Item name="zipCode" wrapperCol={{ offset: 3 }} rules={[{ required: true }]}>
<Input
style={{ width: 580 }}
placeholder={'Display the address and postcode automatically according to the'}
placeholder="Display the address and postcode automatically according to the"
disabled
></Input>
/>
</Form.Item>
<Form.Item labelCol={{ span: 3 }} label="Owner" style={{ marginBottom: -40 }}>
......@@ -164,25 +152,25 @@ const CardAdd = (props: any) => {
style={{ marginRight: 20 }}
rules={[{ required: true, max: 30, min: 2 }]}
>
<Input placeholder={'Name'} />
<Input placeholder="Name" />
</Form.Item>
<Form.Item style={{ marginRight: 20 }} label={'Contact Details'}>
<Input hidden={true} />
<Form.Item style={{ marginRight: 20 }} label="Contact Details">
<Input hidden />
</Form.Item>
<Form.Item
name="communityOwnerPhone"
style={{ marginRight: 20 }}
rules={[{ validator: phoneNumber }]}
>
<Input placeholder={'Phone number'} />
<Input placeholder="Phone number" />
</Form.Item>
<Form.Item name="communityOwnerEmail" rules={[{ required: true, type: 'email' }]}>
<Input placeholder={'Email'} />
<Input placeholder="Email" />
</Form.Item>
</Input.Group>
</Form.Item>
<Line></Line>
<Line />
<Form.Item labelCol={{ span: 3 }} label="Applicant" style={{ marginBottom: -40 }}>
<Input.Group compact>
......@@ -191,37 +179,37 @@ const CardAdd = (props: any) => {
style={{ marginRight: 20 }}
rules={[{ required: true, max: 30, min: 2 }]}
>
<Input placeholder={'Name'} />
<Input placeholder="Name" />
</Form.Item>
<Form.Item style={{ marginRight: 20 }} label={'Contact Details'}>
<Input hidden={true} />
<Form.Item style={{ marginRight: 20 }} label="Contact Details">
<Input hidden />
</Form.Item>
<Form.Item
name="applyNamePhone"
style={{ marginRight: 20 }}
rules={[{ validator: phoneNumber }]}
>
<Input placeholder={'Phone number'} />
<Input placeholder="Phone number" />
</Form.Item>
<Form.Item name="applyNameEmail" rules={[{ required: true, type: 'email' }]}>
<Input placeholder={'Email'} />
<Input placeholder="Email" />
</Form.Item>
</Input.Group>
</Form.Item>
{/* label={"Contact Information"} */}
<Form.Item labelCol={{ span: 3 }} name="applyRelationOwner" label={'Relationship'}>
<Form.Item labelCol={{ span: 3 }} name="applyRelationOwner" label="Relationship">
<Relationship />
</Form.Item>
<Form.Item
labelCol={{ span: 3 }}
name="applyReasonContent"
label={'Reason'}
label="Reason"
rules={[{ required: true, max: 500 }]}
>
<TextArea style={{ width: 400 }}></TextArea>
<TextArea style={{ width: 400 }} />
</Form.Item>
<Line></Line>
<Line />
<Form.Item wrapperCol={{ offset: 3 }}>
<Button type="primary" htmlType="submit">
Submit
......
......@@ -2,11 +2,12 @@ import React, { useState, useEffect, useRef } from 'react';
import { Spin, Row, Col, Button, Form, Radio, message } from 'antd';
import { connect, history } from 'umi';
import { RA, getCookie, Clear } from '@/utils/method';
import { RA, Clear } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea';
import * as moment from 'moment';
import { RadioChangeEvent } from 'antd/lib/radio';
const module = 'CommunityService';
......@@ -26,7 +27,15 @@ const CardDetail = (props: any) => {
const [loading, setLoading] = useState(false);
const [listData, setListData] = useState(null) as any;
const [onwerDetail, setOnwerDetail] = useState(null) as any;
const [isShowText, setIsShowText] = useState(false);
const onRadioChange = (e: RadioChangeEvent) => {
if (e.target.value === '2') {
setIsShowText(true);
} else {
setIsShowText(false);
}
};
useEffect(() => {
if (location.query) {
setLoading(true);
......@@ -42,8 +51,8 @@ const CardDetail = (props: any) => {
}, []);
useEffect(() => {
console.log(DataSaveDetail);
if (DataSaveDetail) {
console.log(DataSaveDetail);
setListData(DataSaveDetail.data.rows.list[0]);
setOnwerDetail(DataSaveDetail.data.rows.onwerDetail);
setLoading(false);
......@@ -57,15 +66,10 @@ const CardDetail = (props: any) => {
return;
}
if (values.applyStatus === '2' && !values.replyContent) {
message.error('Replies must be filled in!', 3);
return;
}
const userInfo = localStorage.getItem('userInfo') || '';
const id = JSON.parse(userInfo).userModel.id;
const { id } = JSON.parse(userInfo).userModel;
let tmp = {
const tmp = {
communityId: listData.communityId,
id: listData.id,
ownerId: listData.ownerId,
......@@ -77,12 +81,9 @@ const CardDetail = (props: any) => {
: values.replyContent,
type: '7',
};
RA(34, tmp, module, dispatch);
setLoading(true);
};
console.log(listData);
return (
<Spin size="large" spinning={loading}>
<div style={{ width: '100%', minWidth: 1020, padding: 34, backgroundColor: '#ffffff' }}>
......@@ -94,7 +95,7 @@ const CardDetail = (props: any) => {
'Time : ' + moment(listData.create_time.time).format('DD-MM-YYYY'),
]}
title="Access Card Application Details"
></TitleBack>
/>
<Row gutter={8}>
<Col>Community:</Col>
......@@ -119,7 +120,7 @@ const CardDetail = (props: any) => {
<Col span={2}>{onwerDetail.owerPhone}</Col>
<Col>{onwerDetail.owerEmail}</Col>
</Row>
<Line></Line>
<Line />
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Applicant:</Col>
<Col span={3}>{listData.apply_name}</Col>
......@@ -138,10 +139,10 @@ const CardDetail = (props: any) => {
disabled
value={listData.apply_reason_content}
style={{ width: 300, height: 100, padding: 8 }}
></TextArea>
/>
</Col>
</Row>
<Line></Line>
<Line />
{listData.apply_status === 0 ? (
<Form ref={formRef} name="basic" onFinish={onFinish}>
......@@ -157,9 +158,9 @@ const CardDetail = (props: any) => {
},
]}
>
<Radio.Group>
<Radio.Button value={'1'}>Approve</Radio.Button>
<Radio.Button style={{ marginLeft: 10 }} value={'2'}>
<Radio.Group onChange={onRadioChange}>
<Radio.Button value="1">Approve</Radio.Button>
<Radio.Button style={{ marginLeft: 10 }} value="2">
Reject
</Radio.Button>
</Radio.Group>
......@@ -170,8 +171,11 @@ const CardDetail = (props: any) => {
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reply:</Col>
<Col>
<Form.Item name="replyContent">
<TextArea style={{ width: 300, height: 100, padding: 8 }}></TextArea>
<Form.Item
name="replyContent"
rules={[{ required: isShowText, max: 300, message: '*it is required!' }]}
>
<TextArea style={{ width: 300, height: 100, padding: 8 }} />
</Form.Item>
</Col>
</Row>
......@@ -183,16 +187,21 @@ const CardDetail = (props: any) => {
<Col span={4}>
<Form.Item name="applyStatus">
<Radio.Group>
<Radio value={'3'}>Receive</Radio>
<Radio value="3">Receive</Radio>
</Radio.Group>
</Form.Item>
</Col>
</Row>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
<Row>
<Col span={3} />
<Col>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Col>
</Row>
</Form>
) : (
<>
......@@ -206,8 +215,14 @@ const CardDetail = (props: any) => {
<Col span={3}>Examine:</Col>
<Col span={5}>
<Radio.Group value={listData.apply_status === 2 ? '2' : '1'}>
<Radio.Button value={'1'}>Approve</Radio.Button>
<Radio.Button style={{ marginLeft: 10 }} value={'2'}>
<Radio.Button value="1" disabled={listData.apply_status === 2}>
Approve
</Radio.Button>
<Radio.Button
style={{ marginLeft: 10 }}
value="2"
disabled={listData.apply_status !== 2}
>
Reject
</Radio.Button>
</Radio.Group>
......@@ -220,8 +235,13 @@ const CardDetail = (props: any) => {
<TextArea
disabled
value={listData.reply_content}
style={{ width: 300, height: 100, padding: 8 }}
></TextArea>
style={{
width: 300,
height: 100,
padding: 8,
color: listData.apply_status === 2 ? 'red' : '',
}}
/>
</Col>
</Row>
......@@ -234,16 +254,21 @@ const CardDetail = (props: any) => {
<Col span={4}>
<Form.Item name="applyStatus">
<Radio.Group>
<Radio value={'3'}>Receive</Radio>
<Radio value="3">Receive</Radio>
</Radio.Group>
</Form.Item>
</Col>
</Row>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
<Row>
<Col span={3} />
<Col>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Col>
</Row>
</Form>
) : (
<Row gutter={8} style={{ marginTop: 16 }}>
......@@ -251,8 +276,11 @@ const CardDetail = (props: any) => {
Card Received:
</Col>
<Col span={4}>
<Radio.Group value={listData.apply_status === 3 ? '3' : ''}>
<Radio value={'3'}>Receive</Radio>
<Radio.Group
value={listData.apply_status === 3 ? '3' : ''}
disabled={listData.apply_status !== 3}
>
<Radio value="3">Receive</Radio>
</Radio.Group>
</Col>
</Row>
......
import React, { useState, useEffect, useRef } from 'react';
import styles from './css/Detail.less';
import { Form, Row, Col, Spin, Button, Descriptions, message } from 'antd';
import { connect } from 'umi';
import TextArea from 'antd/lib/input/TextArea';
import { getCookie } from '@/utils/method';
import { validateMessages } from '@/utils/params';
import Line from '../../components/Line/Line';
import TitleBack from '../../components/TitleBack/TitleBack';
import PictureOptionsRow from '../../components/PictureOptions/PictureOptionsRow';
import { getCookie } from '@/utils/method';
import { validateMessages } from '@/utils/params';
import styles from './css/Detail.less';
const treatStatus = ['Pending', 'Processed'];
......@@ -19,7 +17,7 @@ const Detail = (props: any) => {
const { dispatch, location, CurDataDetail, loadding } = props;
const fromRef = useRef(null) as any;
const RA = (index: any, values: any) => {
dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } });
dispatch({ type: 'CommunityService/RA', playload: { index, body: values } });
};
const [curString, setCurString] = useState({ readyState: false });
......@@ -61,17 +59,15 @@ const Detail = (props: any) => {
useEffect(() => {
setCurString({ readyState: true });
console.log('页面准备好了');
}, []);
useEffect(() => {
if (CurDataDetail != null && curString.readyState == true) {
if (CurDataDetail != null && curString.readyState === true) {
if (!editorFlag) {
var tmp = { replyContent: CurDataDetail.replyContent, file: CurDataDetail.replyImgUrl };
const tmp = { replyContent: CurDataDetail.replyContent, file: CurDataDetail.replyImgUrl };
fromRef.current.setFieldsValue(tmp);
}
setLoading(false);
console.log(CurDataDetail);
}
}, [CurDataDetail]);
......@@ -105,16 +101,15 @@ const Detail = (props: any) => {
}
}
var val = values;
const val = values;
val.handleName = getCookie('name');
val.handleContacts = getCookie('phone');
val.type = '' + location.query.serviceType;
val.type = `${location.query.serviceType}`;
val.id = location.query.id;
val.userId = location.query.user_id;
val.communityId = location.query.community_id;
val.handleStatus = '1';
// val.file=fileList
console.log('Success:', val);
RA(22, val);
setLoading(true);
};
......@@ -208,7 +203,7 @@ const Detail = (props: any) => {
</Col>
</Row>
<Row gutter={16}>
<Col span={3}></Col>
<Col span={3} />
<Col>
{/* putSubmit={PictureOptionsRowRef} */}
<Form.Item name="file">
......@@ -220,7 +215,7 @@ const Detail = (props: any) => {
imageType: 'tosCommunityImageReply',
extends: '',
}}
over={CurDataDetail.replyImgUrl.length > 0 ? true : false}
over={CurDataDetail.replyImgUrl.length > 0}
/>
</Form.Item>
</Col>
......@@ -229,7 +224,7 @@ const Detail = (props: any) => {
<>
<Line />
<Row>
<Col span={3}></Col>
<Col span={3} />
<Col>
<Form.Item>
<Button disabled={loadding} type="primary" htmlType="submit">
......
import React, { useState, useEffect } from 'react';
import { connect, history } from 'umi';
import { Table, Space, message } from 'antd';
import { RA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
import styles from './css/index.less';
import { Input, Menu, Table, Space, Upload, message, Pagination, Button } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { timestampToTime3 } from '../../utils/time';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
const pathname = [
'CommunityMaintenance', // 小区保养
......@@ -17,10 +14,10 @@ const pathname = [
'ProblemFeedback', // 问题反馈
];
const handle_Status = [
const handleStatus = [
[0, 'Pending'],
[1, 'Processed'],
]; //["未处理","处理","拒绝"] , [2,"Rejected"]
]; // ["未处理","处理","拒绝"] , [2,"Rejected"]
const goToName = ['Reply', 'Detail'];
const module = 'CommunityService';
......@@ -73,15 +70,13 @@ const PropertyServices = (props: any) => {
{
title: 'Submission Time',
dataIndex: 'create_time',
render: (text: any, record: any) => (
<Space size="middle">{timestampToTime3(text.time)}</Space>
),
render: (text: any) => <Space size="middle">{timestampToTime3(text.time)}</Space>,
},
{
title: 'Status',
dataIndex: 'id',
render: (text: any, record: any) => (
<Space size="middle">{handle_Status[record.handle_status][1]}</Space>
<Space size="middle">{handleStatus[record.handle_status][1]}</Space>
),
},
{
......@@ -95,9 +90,7 @@ const PropertyServices = (props: any) => {
},
];
const goToDetail = (value: any, record: any, e: any) => {
console.log(serviceTypeGobal);
const goToDetail = (value: any, record: any) => {
if (serviceTypeGobal === '1') {
if (permissionArr.indexOf('18') < 0) {
message.error('No Permissions!!!', 3);
......@@ -125,10 +118,10 @@ const PropertyServices = (props: any) => {
}
}
//页面递进
// 页面递进
history.push(
location.pathname +
(value == 0 ? '/Edit' : '/Detail') +
(value === 0 ? '/Edit' : '/Detail') +
urlEncode({
serviceType: serviceTypeGobal,
id: record.id,
......@@ -145,73 +138,69 @@ const PropertyServices = (props: any) => {
}, [Data]);
useEffect(() => {
console.log(readyData);
if (location != null) {
//细分类:页面指令
var serviceType = '';
pathname.map((item, index) => {
// 重置数据
readyData = {
handleStatus: '',
ownerName: '',
communityName: '',
};
if (location !== null) {
// 细分类:页面指令
let serviceType = '';
pathname.forEach((item, index) => {
if (location.pathname.indexOf(item) > -1) {
serviceType = '' + (index + 1);
serviceType = `${index + 1}`;
setServiceType(serviceType);
}
});
//分页设置
// 分页设置
if (location.query.pageNum != null) {
pageNum = parseInt(location.query.pageNum);
} else {
pageNum = 1;
}
//前置数据
var tmp: DataType = filterObjbyTg(location.query, [
// 前置数据
const tmp: DataType = filterObjbyTg(location.query, [
'handleStatus',
'ownerName',
'communityName',
]);
console.log(tmp);
tmp.ownerName = tmp.ownerName || '';
tmp.communityName = tmp.communityName || '';
tmp.handleStatus = handle_Status[parseInt(tmp.handleStatus as string)] as Array<string>; //特殊处理
console.log(tmp);
// setReadyData(tmp);
tmp.handleStatus = handleStatus[parseInt(tmp.handleStatus as string)] as Array<string>; //特殊处理
readyData = {
...tmp,
};
//获取数据
// 获取数据
setLoading(true);
RA(
40,
{
serviceType: serviceType,
serviceType,
...tmp,
handleStatus:
location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null,
location.query.handleStatus !== undefined
? parseInt(location.query.handleStatus)
: null,
pageNum,
},
module,
dispatch,
);
}
return () => {
readyData = {
...readyData,
handleStatus: '',
ownerName: '',
communityName: '',
};
};
}, [location]);
const PageChange = (values: any) => {
//页面跳转参数
var tmp = filterObjbyTg(location.query, ['handleStatus', 'ownerName', 'communityName']);
// 页面跳转参数
const tmp = filterObjbyTg(location.query, ['handleStatus', 'ownerName', 'communityName']);
tmp['pageNum'] = values.current;
history.push(location.pathname + urlEncode(tmp));
};
const ClickTitleSearch = (comment: any) => {
//页面搜索
// 页面搜索
// comment.serviceType = serviceTypeGobal;
comment.pageNum = 1;
history.push(location.pathname + urlEncode(filterObj(comment)));
......@@ -223,12 +212,12 @@ const PropertyServices = (props: any) => {
communitySelect={true}
listkey={['ownerName']}
list={['Owner Name']}
status={[{ name: ['handleStatus', 'Status'], data: handle_Status }]}
status={[{ name: ['handleStatus', 'Status'], data: handleStatus }]}
defaultValue={readyData}
onSubmit={ClickTitleSearch}
/>
<Table
rowKey={'id'}
rowKey="id"
style={{ marginTop: 16 }}
loading={loading}
columns={columns}
......
import React, { useState, useEffect } from 'react';
import { Table, Space, message } from 'antd';
import { connect, history } from 'umi';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, urlEncode, filterObjbyTg } from '@/utils/method';
import { objectColumns, stringTab } from '@/utils/string';
import { timestampToTime } from '@/utils/time';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
const module = 'CommunityService';
let pageNum: any = 1;
const Renovation = (props: any) => {
const permissionArr = JSON.parse(localStorage.getItem('permission') || '');
// const decoration_status = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]]
const decoration_status = [
// const decorationStatus = [[0, "待处理"], [1, "已批准"], [2, "已拒绝"]]
const decorationStatus = [
[0, 'Pending'],
[1, 'Approved'],
[2, 'Rejected'],
......@@ -25,8 +22,6 @@ const Renovation = (props: any) => {
const [loading, setLoading] = useState(false);
const [readyData, setReadyData] = useState(null);
console.log(Data8);
const columns = objectColumns([
['Community', 'communityName'],
[
......@@ -50,11 +45,7 @@ const Renovation = (props: any) => {
],
['Content', 'decorationContent', (text: any) => <div>{stringTab(text)}</div>],
['Application Time', 'createTime', (text: any) => <div>{timestampToTime(text.time)}</div>],
[
'status',
'decorationStatus',
(text: any) => <div>{decoration_status[parseInt(text)][1]}</div>,
],
['status', 'decorationStatus', (text: any) => <div>{decorationStatus[parseInt(text)][1]}</div>],
[
'Actions',
'decorationStatus',
......@@ -68,27 +59,30 @@ const Renovation = (props: any) => {
]);
useEffect(() => {
pageNum = 1;
//分页设置
// 分页设置
if (location.query.pageNum != null) {
pageNum = location.query.pageNum;
} else {
pageNum = 1;
}
//前置数据
console.log('前置数据');
let tmp: any = filterObjbyTg(location.query, ['handleStatus', 'applyforName', 'communityName']);
tmp.handleStatus = decoration_status[parseInt(tmp.handleStatus)]; //特殊处理
// 前置数据
const tmp: any = filterObjbyTg(location.query, [
'handleStatus',
'applyforName',
'communityName',
]);
tmp.handleStatus = decorationStatus[parseInt(tmp.handleStatus)]; // 特殊处理
setReadyData(tmp);
//获取数据
// 获取数据
setLoading(true);
RA(
23,
{
...tmp,
handleStatus:
location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null,
location.query.handleStatus !== undefined ? parseInt(location.query.handleStatus) : null,
pageNum,
},
module,
......@@ -102,14 +96,14 @@ const Renovation = (props: any) => {
}
}, [Data8]);
//页面搜索
// 页面搜索
const ClickTitleSearch = (comment: any) => {
let tmp = filterObjbyTg(comment, ['handleStatus', 'applyforName', 'communityName']);
const tmp = filterObjbyTg(comment, ['handleStatus', 'applyforName', 'communityName']);
pageNum = 1;
history.push(location.pathname + urlEncode(tmp));
};
const goToDetail = (values: any, e: any) => {
const goToDetail = (values: any) => {
if (permissionArr.indexOf('27') < 0) {
message.error('No Permissions!!!', 3);
return;
......@@ -118,8 +112,8 @@ const Renovation = (props: any) => {
};
const PageChange = (values: any) => {
//页面跳转参数
var tmp = filterObjbyTg(location.query, ['handleStatus', 'ownerName', 'communityName']);
// 页面跳转参数
const tmp = filterObjbyTg(location.query, ['handleStatus', 'ownerName', 'communityName']);
tmp['pageNum'] = values.current;
history.push(location.pathname + urlEncode(tmp));
};
......@@ -131,7 +125,7 @@ const Renovation = (props: any) => {
communitySelect={true}
listkey={['applyforName']}
list={['Owner Name']}
status={[{ name: ['handleStatus', 'Status'], data: decoration_status }]}
status={[{ name: ['handleStatus', 'Status'], data: decorationStatus }]}
defaultValue={readyData}
onSubmit={ClickTitleSearch}
/>
......
import React, { useState, useEffect, useRef } from 'react';
import { Row, Col, Button, Form, Radio, message, Spin } from 'antd';
import { connect, history } from 'umi';
const decoration_status = [
[0, 'Pending'],
[1, 'Approved'],
[2, 'Rejected'],
];
import { RA, getCookie, Clear } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack';
import Line from '@/components/Line/Line';
import TextArea from 'antd/lib/input/TextArea';
import { timestampToTime } from '@/utils/time';
import { RadioChangeEvent } from 'antd/lib/radio';
const module = 'CommunityService';
const decoration_status = [
[0, 'Pending'],
[1, 'Approved'],
[2, 'Rejected'],
];
const RenovationDetail = (props: any) => {
const { dispatch, DataSaveDetail, location } = props;
const formRef = useRef(null);
const [loading, setLoading] = useState(false);
const [listData, setListData] = useState(null) as any;
const [onwerDetail, setOnwerDetail] = useState(null) as any;
const [isShowText, setIsShowText] = useState(false);
const onRadioChange = (e: RadioChangeEvent) => {
if (e.target.value === '2') {
setIsShowText(true);
} else {
setIsShowText(false);
}
};
useEffect(() => {
// 发起请求拿取数据
......@@ -54,13 +62,13 @@ const RenovationDetail = (props: any) => {
if (
values.decorationStatus === '2' &&
(values.replyView == undefined || values.replyView.trim() === '')
(values.replyView === undefined || values.replyView.trim() === '')
) {
message.warning('Replies must be entered!');
return;
}
var tmp = {
const tmp = {
communityId: listData.communityId,
id: listData.id,
ownerId: listData.ownerId,
......@@ -86,7 +94,7 @@ const RenovationDetail = (props: any) => {
'Time : ' + timestampToTime(listData.createTime.time),
]}
title={listData.decorationStatus === 0 ? 'Renovation Reply' : 'Renovation Detail'}
></TitleBack>
/>
<Row gutter={8}>
<Col>Community:</Col>
......@@ -112,7 +120,7 @@ const RenovationDetail = (props: any) => {
<Col>{onwerDetail.owerEmail}</Col>
</Row>
<Line></Line>
<Line />
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Applicant:</Col>
<Col span={3}>{listData.contactName}</Col>
......@@ -133,10 +141,10 @@ const RenovationDetail = (props: any) => {
disabled
value={listData.decorationContent}
style={{ width: 300, minHeight: 100, padding: 8, resize: 'none' }}
></TextArea>
/>
</Col>
</Row>
<Line></Line>
<Line />
{listData.decorationStatus === '0' ? (
<>
......@@ -153,9 +161,9 @@ const RenovationDetail = (props: any) => {
},
]}
>
<Radio.Group>
<Radio.Button value={'1'}>Approve</Radio.Button>{' '}
<Radio.Button style={{ marginLeft: 10 }} value={'2'}>
<Radio.Group onChange={onRadioChange}>
<Radio.Button value="1">Approve</Radio.Button>{' '}
<Radio.Button style={{ marginLeft: 10 }} value="2">
Reject
</Radio.Button>
</Radio.Group>
......@@ -166,16 +174,25 @@ const RenovationDetail = (props: any) => {
<Row gutter={8} style={{ marginTop: 16 }}>
<Col span={3}>Reply:</Col>
<Col>
<Form.Item name="replyView">
<TextArea style={{ width: 300, height: 100, padding: 8 }}></TextArea>
<Form.Item
name="replyView"
rules={[{ required: isShowText, max: 300, message: '*it is required!' }]}
>
<TextArea style={{ width: 300, height: 100, padding: 8 }} />
</Form.Item>
</Col>
</Row>
<Row>
<Col span={3} />
<Col>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Col>
</Row>
<Form.Item>
<Button type="primary" htmlType="submit">
Submit
</Button>
</Form.Item>
</Form>
</>
) : (
......@@ -191,8 +208,14 @@ const RenovationDetail = (props: any) => {
<Col span={3}>Approval For Application:</Col>
<Col>
<Radio.Group value={listData.decorationStatus}>
<Radio.Button value={'1'}>Approve</Radio.Button>{' '}
<Radio.Button style={{ marginLeft: 10 }} value={'2'}>
<Radio.Button value="1" disabled={listData.decorationStatus !== '1'}>
Approve
</Radio.Button>{' '}
<Radio.Button
style={{ marginLeft: 10 }}
value="2"
disabled={listData.decorationStatus !== '2'}
>
Reject
</Radio.Button>
</Radio.Group>
......@@ -203,10 +226,16 @@ const RenovationDetail = (props: any) => {
<Col span={3}>Reply:</Col>
<Col>
<TextArea
style={{ width: 300, minHeight: 100, padding: 8, resize: 'none' }}
style={{
width: 300,
minHeight: 100,
padding: 8,
resize: 'none',
color: listData.decorationStatus === '2' ? 'red' : '',
}}
disabled
value={listData.replyView}
></TextArea>
/>
</Col>
</Row>
</>
......
import React, { useState, useEffect, useRef } from 'react';
import styles from './index.less';
import { useIntl, connect, history } from 'umi';
import { Button, Tag, Table, Space, message } from 'antd';
import React, { useState, useEffect } from 'react';
import { connect, history } from 'umi';
import { message } from 'antd';
import { filterObj, urlEncode } from '@/utils/method';
import ProTable, { ProColumns } from '@ant-design/pro-table';
import { timestampToTime } from '../../utils/time';
import { filterObj, urlEncode, filterObjbyTg } from '@/utils/method';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
import styles from './index.less';
import ProTable, { ProColumns } from '@ant-design/pro-table';
interface readyData {
[key: string]: any;
}
......@@ -42,6 +37,11 @@ const ChargeManager = (props: any) => {
const { dispatch, location, Data } = props;
const [loading, setLoading] = useState(false);
// 存储详情页数据
const getById = (values: any) => {
dispatch({ type: 'PropertyManagement/getById', playload: values });
};
// 详情页
const goToDetail = (values: any) => {
const permissionArr = JSON.parse(localStorage.getItem('permission') || '');
......@@ -53,10 +53,6 @@ const ChargeManager = (props: any) => {
history.push('/PropertyManagementDetail');
};
// 存储详情页数据
const getById = (values: any) => {
dispatch({ type: 'PropertyManagement/getById', playload: values });
};
// 获取数据
const get = (values: any) => {
dispatch({ type: 'PropertyManagement/get', playload: values });
......@@ -90,7 +86,6 @@ const ChargeManager = (props: any) => {
// 搜索按钮
const TitleSearchContent = (comment: any) => {
setLoading(true);
console.log(comment);
history.push(
location.pathname +
urlEncode(
......@@ -133,17 +128,6 @@ const ChargeManager = (props: any) => {
},
];
// 重置表单触发
const resetHandler = () => {
setLoading(true);
readyData = {
communityName: '',
pageNum: 1,
tosOwnerName: '',
};
history.push(location.pathname + urlEncode(filterObj(readyData)));
};
// 切换页码
const changePage = (value: any) => {
setLoading(true);
......@@ -157,13 +141,13 @@ const ChargeManager = (props: any) => {
),
);
};
console.log(Data);
return (
<div className={styles.base}>
<TitleSearch
listkey={['tosOwnerName']}
list={['Name Of Owner']}
communitySelect={true}
communitySelect
onSubmit={TitleSearchContent}
defaultValue={readyData}
/>
......@@ -173,7 +157,7 @@ const ChargeManager = (props: any) => {
columnEmptyText={false}
columns={columns}
dataSource={Data.list}
rowKey={'id'}
rowKey="id"
search={false}
loading={loading}
onChange={changePage}
......@@ -183,12 +167,7 @@ const ChargeManager = (props: any) => {
total: Data.page.totalRow,
current: +readyData.pageNum,
}}
options={{
density: true,
fullScreen: true,
reload: false,
setting: false,
}}
options={false}
/>
) : (
<></>
......
......@@ -104,20 +104,19 @@ const Users = (props: any) => {
if (file.name.indexOf('.xlsx') === -1 && file.name.indexOf('.xls') === -1) {
message.error(`${file.name} file format is incorrect!`);
return false;
} else {
return true;
}
return true;
},
onChange(info: any) {
if (info.file.status == 'uploading') {
if (info.file.status === 'uploading') {
setFileUploading(true);
}
if (info.file.status === 'done') {
if (info.file.response.error_code == '0000') {
if (info.file.response.error_code === '0000') {
history.push(location.pathname + '/Result');
} else if (info.file.response.error_code == '0002') {
} else if (info.file.response.error_code === '0002') {
message.error(info.file.response.error_msg);
} else if (info.file.response.error_code == '0001') {
} else if (info.file.response.error_code === '0001') {
history.push(location.pathname + '/ResultFailed');
message.error(
`${info.file.name} file upload failed.` +
......@@ -139,7 +138,13 @@ const Users = (props: any) => {
// 监听路由变化更新数据
useEffect(() => {
console.log(readyData);
// 重置数据
readyData = {
pageNum: 1,
owerName: '',
communityArray: [],
};
if (location.query) {
readyData = {
...readyData,
......@@ -168,7 +173,7 @@ const Users = (props: any) => {
readyData.communityArray = CommunityList;
}
setLoading(true);
//获取数据
// 获取数据
RA(
12,
{
......@@ -187,7 +192,7 @@ const Users = (props: any) => {
}
}, [Data]);
const goToDetail = (values: any, e: any) => {
const goToDetail = (values: any) => {
if (permissionArr.indexOf('2') < 0) {
message.error('No Permissions!!!', 3);
return;
......@@ -196,7 +201,7 @@ const Users = (props: any) => {
history.push(location.pathname + '/Detail');
};
const goToEdit = (values: any, e: any) => {
const goToEdit = (values: any) => {
if (permissionArr.indexOf('3') < 0) {
message.error('No Permissions!!!', 3);
return;
......@@ -217,10 +222,9 @@ const Users = (props: any) => {
// LIFE用户管理页面的搜索按钮
const CallBackTitleSearch = (comment: any) => {
console.log(comment);
readyData.communityArray = comment.serviceCommunityList;
/*页面跳转*/
// 页面跳转
history.push(
location.pathname +
urlEncode(
......@@ -246,7 +250,7 @@ const Users = (props: any) => {
<TitleSearch
listkey={['OwnerName']}
list={['Owner Name']}
community={'serviceCommunityList'}
community="serviceCommunityList"
onSubmit={CallBackTitleSearch}
defaultValue={{ OwnerName: readyData.owerName }}
checklist={readyData.communityArray.length !== 0 ? readyData.communityArray : null}
......@@ -277,7 +281,7 @@ const Users = (props: any) => {
{/* 列表组件 */}
<Table
rowKey={'id'}
rowKey="id"
loading={loading}
style={{ marginTop: 16 }}
dataSource={Data != null ? Data.data.list : []}
......
import React, { useState, useEffect, useRef } from 'react';
import { Input, Spin, Button, Form, message } from 'antd';
import { connect } from 'umi';
import { validateMessages } from '@/utils/params';
import styles from './UsersAdd.less';
import Line from '../../../components/Line/Line';
import TitleBack from '../../../components/TitleBack/TitleBack';
import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptionsCommnity';
import { checkParam, RA, Clear } from '../../../utils/method';
import { validateMessages } from '@/utils/params';
import { checkParam, RA } from '../../../utils/method';
const module = 'User';
const UsersAdd = (props: any) => {
......@@ -21,11 +19,11 @@ const UsersAdd = (props: any) => {
useEffect(() => {
if (Data4Error) {
if (Data4Error.msg) {
setLoading(false);
message.error(Data4Error.msg, 3);
Clear(module + '/Data4ErrorClear', dispatch);
}
setLoading(false);
dispatch({
type: `${module}/Data4ErrorClear`,
payload: {},
});
}
}, [Data4Error]);
......@@ -39,17 +37,16 @@ const UsersAdd = (props: any) => {
values.owerPhone = null;
values.owerEmail = null;
values.buildingNumber = 'BLK ' + values.buildingNumber;
console.log(values);
RA(14, values, module, dispatch);
setLoading(true);
} else {
setLoading(false);
message.error('Error,Please finish it,not empty!', 3);
message.error('Error,Please finish it,not empty!');
}
};
const extendName = (values: any) => {
var tmp = postman;
const tmp = postman;
tmp.extend = values;
RA(32, { communityName: values }, module, dispatch);
setPostman(tmp);
......@@ -82,7 +79,7 @@ const UsersAdd = (props: any) => {
return (
<div className={styles.base}>
{/* 头部组件 */}
<TitleBack title={'Create New Owner'} />
<TitleBack title="Create New Owner" />
<Spin spinning={loading}>
<Form ref={formRef} name="basic" onFinish={onFinish} validateMessages={validateMessages}>
<div className={styles.box1}>
......@@ -149,7 +146,8 @@ const UsersAdd = (props: any) => {
</div>
</div>
<Line />
<Form.Item>
<Form.Item style={{ marginLeft: 146 }}>
<Button type="primary" htmlType="submit">
Submit
</Button>
......
import React, { useState, useEffect, useRef } from 'react';
import { Input, Modal, Button, Form, Row, Col, message, Spin } from 'antd';
const { confirm } = Modal;
import { ExclamationCircleOutlined } from '@ant-design/icons';
import { connect } from 'umi';
import styles from './UsersAdd.less';
import Line from '../../../components/Line/Line';
import TitleBack from '../../../components/TitleBack/TitleBack';
import { checkParam } from '../../../utils/method';
import TableShow from '@/components/TableShow/TableShow';
import { connect, history } from 'umi';
import { timestampToTime } from '@/utils/time';
import { validateMessages } from '@/utils/params';
import TableShow from '@/components/TableShow/TableShow';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import { checkParam } from '../../../utils/method';
import TitleBack from '../../../components/TitleBack/TitleBack';
import Line from '../../../components/Line/Line';
import styles from './UsersAdd.less';
const { confirm } = Modal;
const UsersDetail = (props: any) => {
const { dispatch, DataSave, DataSaveDetail, Result, returnValue, memberResult } = props;
const { dispatch, DataSave, DataSaveDetail, Result, returnValue, memberResult, location } = props;
const RA = (index: any, values: any) => {
dispatch({
type: 'User/RA',
playload: {
index: index,
index,
body: values,
},
});
......@@ -61,11 +60,6 @@ const UsersDetail = (props: any) => {
} else {
values.id = null;
}
var tmp = Object.keys(values);
console.log('添加业主提交的参数:' + tmp.length);
console.log(values);
if (checkParam(values)) {
setVisible(true);
RA(18, values);
......@@ -77,36 +71,24 @@ const UsersDetail = (props: any) => {
// 监听删除结果
useEffect(() => {
if (Result != null) {
console.log(Result);
if (Result.error_code !== '0000') {
message.error(Result.error_msg);
ResultClear();
history.go(0);
history.goBack();
}
}
}, [Result]);
// 监听返回内容
useEffect(() => {
console.log(returnValue);
if (returnValue != null) {
if (returnValue.error_code !== '0001') {
message.success('Delete Successfully!', 3);
// RA(13, {
// id: DataSave.id,
// owerName: DataSave.owerName,
// enable: DataSave.enable,
// buildingNumber: DataSave.buildingNumber,
// floorNumber: DataSave.floorNumber,
// roomNumber: DataSave.roomNumber,
// });
dispatch({
type: 'User/ClearReturnValue',
playload: {},
});
history.back();
history.goBack();
} else {
message.error(returnValue.error_msg, 3);
}
......@@ -116,9 +98,7 @@ const UsersDetail = (props: any) => {
// 监听数据返回
useEffect(() => {
if (DataSave != null) {
console.log('给予页面数据');
console.log(DataSave);
var tmp = {
const tmp = {
owerName: DataSave.owerName,
owerPhone: DataSave.owerPhone,
owerEmail: DataSave.owerEmail,
......@@ -133,25 +113,22 @@ const UsersDetail = (props: any) => {
roomNumber: DataSave.roomNumber,
});
} else {
history.go(-1);
history.goBack();
}
}, [DataSave]);
// 监听数据返回
useEffect(() => {
if (DataSaveDetail != null) {
console.log('页面数据副歌');
console.log(DataSaveDetail);
setDataSaveLoading(false);
}
}, [DataSaveDetail]);
// 存储住户详情页的数据
useEffect(() => {
console.log(memberDetail);
if (DataSave) {
if (!memberDetail) {
var tmp = {
const tmp = {
owerName: DataSave.owerName,
owerPhone: DataSave.owerPhone,
owerEmail: DataSave.owerEmail,
......@@ -170,8 +147,6 @@ const UsersDetail = (props: any) => {
// 住户详情页
const tableShowCallback = (values: any) => {
console.log('成员信息');
console.log(values);
setMemberData(values);
setMemberDetail(true);
......@@ -193,8 +168,7 @@ const UsersDetail = (props: any) => {
onCancel() {},
onOk() {
if (DataSave != null) {
// console.log(DataSave);
var tmp = {
const tmp = {
owerName: DataSave.owerName,
communityName: DataSave.communityName,
unit: values,
......@@ -206,8 +180,7 @@ const UsersDetail = (props: any) => {
};
// 删除住户
const DeleteMember = (values: any, e: any) => {
console.log(values);
const DeleteMember = (values: any) => {
if (permissionArr.indexOf('7') < 0) {
message.error('No Permissions!!!', 3);
return;
......@@ -237,7 +210,6 @@ const UsersDetail = (props: any) => {
if (memberResult != null) {
setMemberDetail(false);
setLoadding(false);
message.success('Successfully delete!!!');
RA(13, {
id: DataSave.id,
owerName: DataSave.owerName,
......@@ -265,7 +237,7 @@ const UsersDetail = (props: any) => {
return (
<div className={styles.base}>
<Spin spinning={visible} tip="Loading Submit">
{memberDetail == false ? (
{memberDetail === false ? (
<>
{DataSave != null ? (
<>
......@@ -290,7 +262,7 @@ const UsersDetail = (props: any) => {
</Form.Item>
</div>
</div>
{DataSave.enable == 1 ? (
{DataSave.enable === 1 ? (
<>
<div className={styles.box4}>
<div className={styles.box4item0}>Contact Details</div>
......@@ -334,7 +306,7 @@ const UsersDetail = (props: any) => {
{editFlag && DataSaveDetail.rows[0].owner.deleted !== 1 ? (
<>
<Line />
<Form.Item>
<Form.Item style={{ textAlign: 'left' }}>
<Button type="primary" htmlType="submit">
Submit
</Button>
......@@ -353,11 +325,7 @@ const UsersDetail = (props: any) => {
<>
<Spin spinning={loadding}>
<div>
<TitleBack
title={'Family/Tenant Details'}
url="none"
titleBack={titleBackCallBack}
></TitleBack>
<TitleBack title="Family/Tenant Details" url="none" titleBack={titleBackCallBack} />
<Row>
<Col span={4}>User Type:</Col>
<Col span={4}>
......@@ -375,7 +343,7 @@ const UsersDetail = (props: any) => {
<Col span={4}>{memberData.owner_family_phone}</Col>
<Col span={4}>{memberData.owner_family_email}</Col>
</Row>
<Line></Line>
<Line />
<Button danger onClick={DeleteMember.bind(this, memberData)}>
Delete
......
......@@ -2,130 +2,130 @@
//基石
.base {
width: 100%;
background-color: #ffffff;
padding: 34px;
width: 100%;
background-color: #ffffff;
padding: 34px;
}
//边栏1
//头部组件
.box{
width: 100%;
height: 34px;
position: relative;
margin-bottom: 16px;
}
.input{
width:200px;
height:32px;
background:none;
outline: none;
border:1px solid rgba(217,217,217,1);
border-radius:2px;
font-size:14px;
font-weight:400;
line-height:30px;
text-indent: 19px;
.box {
width: 100%;
height: 34px;
position: relative;
margin-bottom: 16px;
}
.input {
width: 200px;
height: 32px;
background: none;
outline: none;
border: 1px solid rgba(217, 217, 217, 1);
border-radius: 2px;
font-size: 14px;
font-weight: 400;
line-height: 30px;
text-indent: 19px;
}
.item1{
.input();
}
.item2{
.input();
margin-left: 20px;
}
.item3{
width:80px;
height:32px;
border:1px solid rgba(24,144,255,1);
border-radius:2px;
background-color:#e7f4ff;
outline: none;
font-size:14px;
font-weight:400;
color:rgba(24,144,255,1);
line-height:30px;
cursor: pointer;
margin-top: 16px;
}
.item3:active{
background-color:#ffffff;
.item1 {
.input();
}
.item2 {
.input();
margin-left: 20px;
}
.item3 {
width: 80px;
height: 32px;
border: 1px solid rgba(24, 144, 255, 1);
border-radius: 2px;
background-color: #e7f4ff;
outline: none;
font-size: 14px;
font-weight: 400;
color: rgba(24, 144, 255, 1);
line-height: 30px;
cursor: pointer;
margin-top: 16px;
}
.item3:active {
background-color: #ffffff;
}
//边栏2
.box2{
width: 100%;
height: 40px;
margin-top: 0px;
position: relative;
.box2 {
width: 90%;
height: 40px;
margin-top: -35px;
margin-left: 150/1920 * 100vw;
position: relative;
}
//小组件1
.buttonLine{
width:240px;
height:32px;
border:none;
background:none;
outline: none;
font-size:14px;
font-weight:400;
line-height:30px;
cursor: pointer;
.buttonLine {
width: 240px;
height: 32px;
border: none;
background: none;
outline: none;
font-size: 14px;
font-weight: 400;
line-height: 30px;
cursor: pointer;
}
.fontgz(){
font-size:16px;
font-family:'Source Han Sans CN;';
font-weight:800;
.fontgz() {
font-size: 16px;
font-family: 'Source Han Sans CN;';
font-weight: 800;
}
.buttonWait{
.buttonLine();
border-bottom:2px solid#dedede;
color:#454545;
.fontgz();
.buttonWait {
.buttonLine();
border-bottom: 2px solid#dedede;
color: #454545;
.fontgz();
}
.buttonWait:hover{
border-bottom:3px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
.fontgz();
.buttonWait:hover {
border-bottom: 3px solid rgba(24, 144, 255, 1);
color: rgba(24, 144, 255, 1);
.fontgz();
}
.buttonChoose{
.buttonLine();
border-bottom:3px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
.fontgz();
.buttonChoose {
.buttonLine();
border-bottom: 3px solid rgba(24, 144, 255, 1);
color: rgba(24, 144, 255, 1);
.fontgz();
}
.butttonAdd0{
border:1px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
border-radius:2px;
}
.buttonAdd{
// .butttonAdd0();
background:none;
outline: none;
cursor: pointer;
// width:170px;
// height:32px;
position: absolute;
right: 0;
.butttonAdd0 {
border: 1px solid rgba(24, 144, 255, 1);
color: rgba(24, 144, 255, 1);
border-radius: 2px;
}
.buttonAdd {
// .butttonAdd0();
background: none;
outline: none;
cursor: pointer;
// width:170px;
// height:32px;
position: absolute;
right: 0;
}
.buttonAdd2{
background:none;
outline: none;
cursor: pointer;
width:170px;
height:32px;
border:1px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
border-radius:2px;
position: absolute;
right: 180px;
.buttonAdd2 {
background: none;
outline: none;
cursor: pointer;
width: 170px;
height: 32px;
border: 1px solid rgba(24, 144, 255, 1);
color: rgba(24, 144, 255, 1);
border-radius: 2px;
position: absolute;
right: 180px;
}
import React, { useState, useEffect, useRef } from 'react';
import { Input, Button, Form, Spin, message, Checkbox } from 'antd';
import { Input, Button, Form, Spin, Modal, Checkbox } from 'antd';
import { connect, history } from 'umi';
......@@ -18,14 +18,15 @@ let optionsList: {
const Edit = (props: any) => {
const { dispatch, CurData, SaveChooseData, CommunityList, DataServices } = props;
const TosTosServiceProviderSave = (values: any) => {
dispatch({ type: 'ServiceProvider/TosTosServiceProviderSave', playload: values });
};
const [CList, setCList] = useState(CommunityList);
const [load, setload] = useState(false);
const TosTosServiceProviderSave = (values: any) => {
dispatch({ type: 'ServiceProvider/TosTosServiceProviderSave', playload: values });
};
const printContent = (List: any) => {
setCList(List);
};
......@@ -33,7 +34,12 @@ const Edit = (props: any) => {
// 选择服务商事件
const onSelectCheckBox = (checkedValue: CheckboxValueType[]) => {
console.log(checkedValue);
if (checkedValue.indexOf('0') > -1 && checkedValue.indexOf('1') > -1) {
Modal.error({
title: 'Error',
content: <div>Accountant and security can only choose one!!!</div>,
});
}
};
// 拿取服务范围数据
......@@ -107,7 +113,6 @@ const Edit = (props: any) => {
if (SaveChooseData) {
val.id = SaveChooseData.id;
}
setload(true);
TosTosServiceProviderSave(val);
};
......@@ -233,7 +238,7 @@ const Edit = (props: any) => {
</div>
<div className={styles.line} />
<Form.Item>
<Form.Item style={{ marginLeft: 190 }}>
<Button type="primary" htmlType="submit">
Submit
</Button>
......
......@@ -152,7 +152,6 @@ const ServiceProviderManagement = (props: propsType) => {
// 处理服务商数据
useEffect(() => {
if (DataServices) {
console.log(DataServices);
options = DataServices.data.rows.map((v: any) => {
return [v.serviceCode, v.serviceName];
});
......@@ -161,14 +160,20 @@ const ServiceProviderManagement = (props: propsType) => {
// 监听路由url
useEffect(() => {
// 重置数据
readyData = {
pageNum: 1,
serviceCommunityList: [],
serviceScope: '',
providerName: '',
};
if (location.query) {
readyData = {
...readyData,
...location.query,
};
}
console.log(location.query);
console.log(readyData);
if (CommunityList && flag === false) {
flag = true;
setLoading(true);
......@@ -194,14 +199,12 @@ const ServiceProviderManagement = (props: propsType) => {
}
}, [Data]);
//页面搜索
// 页面搜索
const CallBackTitleSearch = (comment: any) => {
console.log(comment);
readyData.serviceCommunityList = comment.serviceCommunityList;
if (comment.status == undefined) {
if (comment.status === undefined) {
comment.status = '';
}
console.log(comment);
history.push(
location.pathname +
......@@ -217,7 +220,7 @@ const ServiceProviderManagement = (props: propsType) => {
// 切换页码
const pageChange = (values: any) => {
let tmp = filterObjbyTg(location.query, ['providerName', 'serviceScope']);
const tmp = filterObjbyTg(location.query, ['providerName', 'serviceScope']);
tmp['pageNum'] = values.current;
history.push(location.pathname + urlEncode(tmp));
};
......@@ -233,7 +236,7 @@ const ServiceProviderManagement = (props: propsType) => {
case 1:
tmp[items].enable = 'Deregistered';
break;
case 2:
default:
break;
}
}
......@@ -252,7 +255,7 @@ const ServiceProviderManagement = (props: propsType) => {
data: [...options],
},
]}
community={'serviceCommunityList'}
community="serviceCommunityList"
onSubmit={CallBackTitleSearch}
defaultValue={{
providerName: readyData.providerName,
......@@ -274,26 +277,24 @@ const ServiceProviderManagement = (props: propsType) => {
</div>
{/* 列表组件 */}
{
<Table
rowKey={'id'}
style={{ marginTop: 16 }}
loading={loading}
columns={columns}
dataSource={Data ? dataSource(Data.rows) : []}
pagination={
Data
? {
current: +readyData.pageNum,
total: Data.page.totalRow,
showSizeChanger: false,
pageSize: Data.page.curPageSize,
}
: {}
}
onChange={pageChange}
/>
}
<Table
rowKey={'id'}
style={{ marginTop: 16 }}
loading={loading}
columns={columns}
dataSource={Data ? dataSource(Data.rows) : []}
pagination={
Data
? {
current: +readyData.pageNum,
total: Data.page.totalRow,
showSizeChanger: false,
pageSize: Data.page.curPageSize,
}
: {}
}
onChange={pageChange}
/>
</div>
);
};
......
......@@ -24,14 +24,12 @@ const Services = (props: any) => {
useEffect(() => {
if (DataServices != null) {
console.log(DataServices);
setDataList(DataServices.data.rows);
let tmp = DataServices.data.rows.map(
(v: { serviceName: string; deleted: number }, i: number) => {
return v.deleted !== 1 && v.serviceName;
},
);
console.log(tmp);
formRef.current['setFieldsValue']({ serviceName: tmp });
}
}, [DataServices]);
......@@ -66,12 +64,9 @@ const Services = (props: any) => {
};
useEffect(() => {
console.log(Result);
if (Result) {
if (Result.error_code !== '0000') {
message.error('Failed: binding service provider!!!');
} else {
message.success('Operate Success!!!');
}
Clear(module + '/ClearResult', dispatch);
RA(43, {}, module, dispatch);
......
......@@ -2,108 +2,107 @@
//基石
.base {
width: 100%;
min-width: 980px;
background-color: #ffffff;
padding: 34px;
overflow: auto;
width: 100%;
min-width: 980px;
background-color: #ffffff;
padding: 34px;
overflow: auto;
}
//边栏1
//头部组件
.box{
width: 100%;
height: 64px;
position: relative;
.box {
width: 100%;
height: 64px;
position: relative;
}
.input{
width:200px;
height:32px;
background:none;
outline: none;
border:1px solid rgba(217,217,217,1);
border-radius:2px;
font-size:14px;
font-weight:400;
line-height:30px;
text-indent: 19px;
.input {
width: 200px;
height: 32px;
background: none;
outline: none;
border: 1px solid rgba(217, 217, 217, 1);
border-radius: 2px;
font-size: 14px;
font-weight: 400;
line-height: 30px;
text-indent: 19px;
}
.item1{
.input();
.item1 {
.input();
}
.item2{
.input();
margin-left: 20px;
.item2 {
.input();
margin-left: 20px;
}
.item3{
width:80px;
height:32px;
border:1px solid rgba(24,144,255,1);
border-radius:2px;
background-color:#e7f4ff;
outline: none;
font-size:14px;
font-weight:400;
color:rgba(24,144,255,1);
line-height:30px;
cursor: pointer;
margin-top: 16px;
.item3 {
width: 80px;
height: 32px;
border: 1px solid rgba(24, 144, 255, 1);
border-radius: 2px;
background-color: #e7f4ff;
outline: none;
font-size: 14px;
font-weight: 400;
color: rgba(24, 144, 255, 1);
line-height: 30px;
cursor: pointer;
margin-top: 16px;
}
.item3:active{
background-color:#ffffff;
.item3:active {
background-color: #ffffff;
}
//边栏2
.box2{
width: 100%;
height: 40px;
margin-top: 0px;
position: relative;
.box2 {
width: 90%;
height: 40px;
margin-top: -35px;
margin-left: 150/1920 * 100vw;
position: relative;
}
//小组件1
.buttonLine{
width:200px;
height:32px;
border:none;
background:none;
outline: none;
font-size:14px;
font-weight:400;
line-height:30px;
cursor: pointer;
.buttonLine {
width: 200px;
height: 32px;
border: none;
background: none;
outline: none;
font-size: 14px;
font-weight: 400;
line-height: 30px;
cursor: pointer;
}
.buttonWait{
.buttonLine();
border-bottom:2px solid#dedede;
color:#454545;
.buttonWait {
.buttonLine();
border-bottom: 2px solid#dedede;
color: #454545;
}
.buttonWait:hover{
border-bottom:3px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
.buttonWait:hover {
border-bottom: 3px solid rgba(24, 144, 255, 1);
color: rgba(24, 144, 255, 1);
}
.buttonChoose{
.buttonLine();
border-bottom:3px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
.buttonChoose {
.buttonLine();
border-bottom: 3px solid rgba(24, 144, 255, 1);
color: rgba(24, 144, 255, 1);
}
.buttonAdd{
background:none;
outline: none;
cursor: pointer;
font-size:14px;
width:154px;
height:32px;
border:1px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
border-radius:2px;
position: absolute;
right: 0;
.buttonAdd {
background: none;
outline: none;
cursor: pointer;
font-size: 14px;
width: 154px;
height: 32px;
border: 1px solid rgba(24, 144, 255, 1);
color: rgba(24, 144, 255, 1);
border-radius: 2px;
position: absolute;
right: 0;
}
.buttonAdd2{
.buttonAdd();
right: 168px;
.buttonAdd2 {
.buttonAdd();
right: 168px;
}
import request from '@/utils/request';
export function get(values: any) {
console.log(values)
const userInfo = localStorage.getItem('userInfo') || '';
const id = JSON.parse(userInfo).userModel.id;
const { id } = JSON.parse(userInfo).userModel;
return request('/tos/tosPropertyFee/get', {
method: 'POST',
body: JSON.stringify({
......
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