Commit 4ef109a0 authored by Sixiang_Zzb's avatar Sixiang_Zzb

服务商管理模块处理

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