Commit 4ef109a0 authored by Sixiang_Zzb's avatar Sixiang_Zzb

服务商管理模块处理

parent ed4331b3
......@@ -7,8 +7,6 @@ import TitleGet from '../TitleGet/TitleGet';
const TitleBack = (props: any) => {
// <TitleBack sublist={['Handle Status : '+CurDataDetail.status,'Create Time : '+CurDataDetail.time]} title={headTitle} />
console.log(props, "创建时间====================")
const backData = (values: any) => {
props.titleBack(values)
}
......
......@@ -13,6 +13,8 @@ export default {
reducers: {
returnPage(state, { Data }) {
console.log(state);
console.log(Data);
return { ...state, Data };
},
......@@ -33,12 +35,8 @@ export default {
*TosTosServiceProviderGet({ playload }, { call, put }) {
const resp = yield call(service.TosTosServiceProviderGet, playload);
console.log(resp);
if (resp.code == 500) {
// window.location.href = '/500';
}
if (resp.error_code == '0000') {
let Data = resp.data.rows;
let Data = resp.data;
yield put({ type: 'returnPage', Data });
} else {
console.log('请求错误码:' + resp.error_code);
......
import React, { useState, useEffect } from 'react';
import styles from './AccoutingContent.less';
import { Input ,Button,Table,Space,Pagination,Tooltip } from 'antd';
import { Input, Button, Table, Space, Pagination, Tooltip } from 'antd';
import { Link, useIntl, connect, Dispatch } from 'umi';
......@@ -17,39 +17,39 @@ const AccoutingContent = (props: { location: any; }) => {
history.back()
};
const [ editFlag, setEditFlag ] = useState(false);
useEffect(() => {
if ((location.pathname).indexOf("/AccoutingDetail")>-1) {
setEditFlag(true)
const [editFlag, setEditFlag] = useState(false);
useEffect(() => {
if ((location.pathname).indexOf("/AccoutingDetail") > -1) {
setEditFlag(true)
} else {
setEditFlag(false)
setEditFlag(false)
}
},[location.pathname]);
}, [location.pathname]);
const printContent = (comment: any)=>{
const printContent = (comment: any) => {
console.log(comment)
}
return (
<div className={styles.base}>
{/* 头部组件 */}
{/* 头部组件 */}
<div className={styles.box}>
<div className={styles.item1}>Add Accounting</div>
<button className={styles.item3} onClick={goToReturn}>Return</button>
</div>
<div className={styles.box1}>
<div className={styles.box1item1}>Company Name</div>
<div className={styles.box1item2}>{editFlag ? (<Input style={{ width: 260 }} placeholder="Please enter company name" />) : ("123")}</div>
<div className={styles.box1item3}>Office Address</div>
<div className={styles.box1item4}>{editFlag ? (<Input style={{ width: 200 }} placeholder="Single Line Input" />) : ("123")}</div>
</div>
<Line/>
<div style={{marginBottom:28}}>Service Community</div>
<SelectOptions list={["美国","美丽的","美好","加拿大","加油","XO"].sort()} onSubmit={printContent}/>
<Line />
<div style={{ marginBottom: 28 }}>Service Community</div>
<SelectOptions list={["美国", "美丽的", "美好", "加拿大", "加油", "XO"].sort()} onSubmit={printContent} />
<div className={styles.box2}>
<div className={styles.box2item1}>Services Available</div>
<div className={styles.box2item2}>Accounting</div>
......@@ -57,21 +57,21 @@ const AccoutingContent = (props: { location: any; }) => {
<div className={styles.box2}>
<div className={styles.box2item1}>Person In Charge</div>
<div className={styles.box2item2}>{editFlag?(<Input placeholder="Please enter a name" style={{width:200}}/>):("123")}</div>
<div className={styles.box2item2}>{editFlag ? (<Input placeholder="Please enter a name" style={{ width: 200 }} />) : ("123")}</div>
</div>
<div className={styles.box3}>
<div className={styles.box3item1}>Contact Details</div>
<div className={styles.box3item2}>{editFlag?(<Input placeholder="Telephone" style={{width:200}}/>):("123")}</div>
<div className={styles.box3item3}>{editFlag?(<Input placeholder="E-mail" style={{width:200}}/>):("123")}</div>
<div className={styles.box3item2}>{editFlag ? (<Input placeholder="Telephone" style={{ width: 200 }} />) : ("123")}</div>
<div className={styles.box3item3}>{editFlag ? (<Input placeholder="E-mail" style={{ width: 200 }} />) : ("123")}</div>
</div>
{
editFlag ? (
<div>
<Line/>
<Button type="primary" size="large">提交</Button>
<Line />
<Button type="primary" size="large">submit</Button>
</div>
):(<div/>)
) : (<div />)
}
</div>
......
import React, { useState, useEffect } from 'react';
import styles from './index.less';
import { Input ,Menu,Table,Space} from 'antd';
import { Input, Menu, Table, Space } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
......@@ -10,15 +10,15 @@ import { timestampToTime } from '../../utils/time';
import { values } from 'lodash';
import TitleSearch from '../../components/TitleSearch/TitleSearch';
const ChargeManager = (props:any) => {
const ChargeManager = (props: any) => {
const { formatMessage } = useIntl();
const { dispatch, location, Data } = props;
const get = (values: any) => { dispatch({ type: 'PropertyManagement/get', playload: values }) };
const getById = (values:any) => {dispatch({type: 'PropertyManagement/getById',playload:values})};
const get = (values: any) => { dispatch({ type: 'PropertyManagement/get', playload: values }) };
const getById = (values: any) => { dispatch({ type: 'PropertyManagement/getById', playload: values }) };
useEffect(() => {
get(null)
}, []);
}, []);
const nameofowner = formatMessage({ id: 'R.charge.input.nameofowner' })
......@@ -32,24 +32,24 @@ const ChargeManager = (props:any) => {
const search = formatMessage({ id: 'R.charge.search' })
const addaccount = formatMessage({ id: 'R.charge.addaccount' })
const paymentsetting = formatMessage({ id: 'R.charge.paymentsetting' })
const menuListNormal = ["A",'Accounting company']
const menuListNormal = ["A", 'Accounting company']
const [display, setDisplay] = useState("A");//小组件:线框
const pagination={defaultCurrent:1,total: 16}
const goToDetail = (values:any) => {
const pagination = { defaultCurrent: 1, total: 16 }
const goToDetail = (values: any) => {
getById(values)
history.push('/PropertyManagementDetail?')
history.push('/PropertyManagementDetail')
}
const goToAddAccout = () => {
history.push(location.pathname+'/AccoutingDetail')
history.push(location.pathname + '/AccoutingDetail')
}
const columns = [
{ title: username,dataIndex: 'tosOwnerName'},
{ title: project,dataIndex: 'communityName'},
{ title: unit,dataIndex: 'buildingNumber'},
{ title: status,dataIndex: 'enable'},
{ title: username, dataIndex: 'tosOwnerName' },
{ title: project, dataIndex: 'communityName' },
{ title: unit, dataIndex: 'buildingNumber' },
{ title: status, dataIndex: 'enable' },
{
title: submissionTime,
render: (text: any, record: any) => (
......@@ -58,43 +58,44 @@ const ChargeManager = (props:any) => {
</Space>
),
},
{ title: actions,
{
title: actions,
render: (text: any, record: any) => (
<Space size="middle">
<a onClick={goToDetail.bind(this,record)}>Detail</a>
<a onClick={goToDetail.bind(this, record)}>Detail</a>
</Space>
),
},
];
const TitleSearchContent = (comment: any)=>{
const TitleSearchContent = (comment: any) => {
console.log(comment)
}
return (
<div className={styles.base}>
<TitleSearch listkey={['tosOwnerName', 'communityName']} list={['tosOwnerName', 'communityName']} onSubmit={TitleSearchContent}/>
<div className={styles.base}>
{/* 内容组件 */}
<TitleSearch listkey={['tosOwnerName', 'communityName']} list={['tosOwnerName', 'communityName']} onSubmit={TitleSearchContent} />
{/* 内容组件 */}
<div className={styles.box2}>
{
menuListNormal.map((item, index) => {
return (<button key={"bt"+ index } className={display==item?styles.buttonChoose:styles.buttonWait} onClick={()=>{setDisplay(item)}}>{item}</button>)
menuListNormal.map((item, index) => {
return (<button key={"bt" + index} className={display == item ? styles.buttonChoose : styles.buttonWait} onClick={() => { setDisplay(item) }}>{item}</button>)
})
}
<button className={styles.buttonAdd2} onClick={goToAddAccout}>+ {addaccount} </button>
<button className={styles.buttonAdd} >{paymentsetting}</button>
</div>
</div>
{/* 列表组件 */}
<Table style={{ marginTop: 16 }} rowKey={"id"} dataSource={Data} columns={columns} pagination={pagination} />
</div>
);
};
function mapStateToProps(state:any) {
const { Data } = state.PropertyManagement;
function mapStateToProps(state: any) {
const { Data } = state.PropertyManagement;
return {
Data
};
......
......@@ -83,7 +83,6 @@ const Users = (props: any) => {
return file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
},
onChange(info: any) {
console.log(info)
if (info.file.status == 'uploading') {
setFileUploading(true)
}
......@@ -107,8 +106,6 @@ const Users = (props: any) => {
useEffect(() => {
if (Data != null) {
setLoading(false)
// console.log("核查的地方")
// console.log(Data)
}
}, [Data])
......@@ -121,17 +118,17 @@ const Users = (props: any) => {
setPageNum(parseInt(location.query.pageNum) || 1)
setLoading(true)
//获取数据
RA(12, {
owerName: location.query.owerName !== undefined ? (location.query.owerName) : null,
communityArray: readyData !== null ? readyData : CommunityList,
communityArray: (readyData === null || readyData.length === 0) ? CommunityList : readyData,
pageNum: location.query.pageNum || 1
}, module, dispatch);
}, [location])
const goToDetail = (values: any, e: any) => {
console.log(values, readyData, "137=========")
SA(values)
PAGE(readyData, module3, dispatch)//保存页面参数
history.push(location.pathname + '/Detail')
......
......@@ -19,7 +19,7 @@ const UsersAdd = (props: any) => {
const { dispatch, communityInfo } = props;
const [postman, setPostman] = useState({ extend: null })
const formRef = useRef(null);
const formRef = useRef(null as any);
const [loading, setLoading] = useState(false)
const onFinish = (values: any) => {
......@@ -29,9 +29,7 @@ const UsersAdd = (props: any) => {
} else {
values.communityName = null
}
var tmp = Object.keys(values);
console.log("添加业主提交的参数:" + tmp.length)
console.log(values)
// var tmp = Object.keys(values);
if (checkParam(values)) {
values.owerPhone = null
values.owerEmail = null
......
import React, { useState, useEffect } from 'react';
import styles from './Detail.less';
import { Input ,Button,Table,Space,Pagination,Tooltip, Checkbox } from 'antd';
import { Input, Button, Table, Space, Pagination, Tooltip, Checkbox } from 'antd';
import { Link, useIntl, connect, Dispatch,history } from 'umi';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import ShowOptions from '../../../components/ShowOptions/index';
import TitleBack from '../../../components/TitleBack/TitleBack';
const Detail = (props:any) => {
const Detail = (props: any) => {
const { dispatch, Data, CurDataFollow, location, SaveChooseData } = props;
const { dispatch, Data,CurDataFollow,location,SaveChooseData } = props;
const TosSecurityGuarderGet = (values: any) => { dispatch({ type: 'ServiceProvider/TosSecurityGuarderGet', playload: values }) };
const GuarderById = (values: any) => { dispatch({ type: 'ServiceProvider/GuarderById', playload: values }) };
useEffect(() => {
TosSecurityGuarderGet({companyName:SaveChooseData.providerName})
}, []);
useEffect(() => {
TosSecurityGuarderGet({ companyName: SaveChooseData.providerName })
}, []);
const [showList,setShowList]=useState([])
useEffect(() => {
const [showList, setShowList] = useState([])
useEffect(() => {
console.log(CurDataFollow)
}, [CurDataFollow]);
}, [CurDataFollow]);
const goToGuard = (values: any, e: any) => {
GuarderById(values)
history.push(location.pathname +'/Guard?saferName='+values.saferName)
history.push(location.pathname + '/Guard?saferName=' + values.saferName)
}
const pagination={defaultCurrent:1,total: CurDataFollow!=null?CurDataFollow.length:CurDataFollow}
const pagination = { defaultCurrent: 1, total: CurDataFollow != null ? CurDataFollow.length : CurDataFollow }
const printContent = (comment: any)=>{
console.log(comment)
const printContent = (comment: any) => {
console.log(comment)
}
const columns = [
{ title: "User Name",dataIndex: 'saferName',},
{ title: "User Name", dataIndex: 'saferName', },
{ title: "Service Community", dataIndex: 'projectName', },
{ title: "Job Title", dataIndex: 'cdkCode', },
{ title: "User Status",dataIndex: 'cdkStatus',},
{ title: "User Status", dataIndex: 'cdkStatus', },
{
title: "actions",
render: (text: any, record: any) => (
<Space size="middle"> <a onClick={goToGuard.bind(this,record)}>Detail</a></Space>
<Space size="middle"> <a onClick={goToGuard.bind(this, record)}>Detail</a></Space>
),
},
];
return (
<div className={styles.base}>
<TitleBack title="Service Provider Details" />
<div className={styles.bigbox}>
<div className={styles.box0}>
<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>
<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.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 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} {SaveChooseData.contactEmail}</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.box4}>
<div className={styles.box4item1}>Contact Details</div>
<div className={styles.box4item2}>{SaveChooseData.contactPhone} {SaveChooseData.contactEmail}</div>
</div>
<div className={styles.box6}>
<div className={styles.box1item1}>Service Community</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"} onSubmit={printContent} />
:<></>
: <></>
}
<div className={styles.box7}>
<div className={styles.box1item1}>Security Guard Account</div>
</div>
<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} />
<Button >Cancellation</Button>
</div>
);
};
function mapStateToProps(state:any) {
const { Data,CurDataFollow,SaveChooseData } = state.ServiceProvider;
function mapStateToProps(state: any) {
const { Data, CurDataFollow, SaveChooseData } = state.ServiceProvider;
return {
Data,
CurDataFollow,
......
......@@ -27,17 +27,18 @@ const Edit = (props: any) => {
}, []);
useEffect(() => {
if (DataServices != null) {
console.log(DataServices)
var tmp = DataServices.data.serviceScopeList
console.log(tmp)
if (SaveChooseData != null) {
formRef.current.setFieldsValue(SaveChooseData)
}
}
}, [DataServices])
const onFinish = (values: any) => {
console.log(values)
return;
var val = values
val.serviceCommunityList = CList
// val.serviceScopeList = SList
......
......@@ -17,7 +17,7 @@ const ServiceProviderManagement = (props: any) => {
const [loading, setLoading] = useState(false)
const [testData, setTestData] = useState(null);
const [testData, setTestData] = useState(null as any);
const { dispatch, location, Data, CommunityList } = props;
const RA = (index: any, values: any) => { dispatch({ type: 'ServiceProvider/RA', playload: { index: index, body: values } }) };
......@@ -109,18 +109,19 @@ const ServiceProviderManagement = (props: any) => {
useEffect(() => {
//分页设置
if (location.query.pageNum != null) {
setPageNum(parseInt(location.query.pageNum))
// if (location.query.pageNum != null) {
// setPageNum(parseInt(location.query.pageNum))
// } else {
} else {
setPageNum(1)
//获取数据
setLoading(true)
}
// }
setPageNum(1)
setLoading(true)
//获取数据
TosTosServiceProviderGet({
...location.query,
serviceCommunityList: testData != null ? testData : CommunityList,
serviceCommunityList: (testData === null || testData.length === 0) ? CommunityList : testData,
pageNum: 1
})
}, [location])
......@@ -128,17 +129,13 @@ const ServiceProviderManagement = (props: any) => {
const CallBackTitleSearch = (comment: any) => {
console.log(comment)
console.log(location.pathname)
//页面搜索
// TosTosServiceProviderGet({
// providerName: comment.providerName,
// serviceScope: comment.status,
// serviceCommunityList: comment.serviceCommunityList
// })
setTestData(comment.serviceCommunityList)
history.push(location.pathname + urlEncode(filterObj({
providerName: comment.providerName,
serviceScope: comment.status,
pageNum: 1
pageNum: location.query.pageNum || 1
})))
}
......@@ -154,7 +151,7 @@ const ServiceProviderManagement = (props: any) => {
const pagination = {
current: pageNum,
// total: Data.total,
total: Data !== null ? Data.page.totalRow : null,
showSizeChanger: false
}
......@@ -186,7 +183,7 @@ const ServiceProviderManagement = (props: any) => {
style={{ marginTop: 16 }}
loading={loading}
columns={columns}
dataSource={Data != null ? dataSource(Data) : null}
dataSource={Data != null ? dataSource(Data.rows) : null}
pagination={Data != null ? pagination : {}}
onChange={pageChange}
/>
......
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