Commit e892b86e authored by MrShi's avatar MrShi

[fix] 批量上传业主,条件查询服务商

parent 64895f51
...@@ -19,7 +19,7 @@ const ResultPageFailed = (props:any) => { ...@@ -19,7 +19,7 @@ const ResultPageFailed = (props:any) => {
history.go(-1) history.go(-1)
} }
return ( return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}> <div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
<Result <Result
status="error" status="error"
title="Error submit the file!" title="Error submit the file!"
...@@ -27,7 +27,7 @@ const ResultPageFailed = (props:any) => { ...@@ -27,7 +27,7 @@ const ResultPageFailed = (props:any) => {
extra={[ extra={[
<Button type="primary" key="ok" ><a href="http://47.74.233.180:8651/tos/excel/down?operator_id=123456" >Download</a></Button>, <Button key="back" onClick={backPage}>Back</Button> <Button type="primary" key="ok" ><a href="http://47.74.233.180:8651/tos/excel/down?operator_id=123456" >Download</a></Button>, <Button key="back" onClick={backPage}>Back</Button>
]} ]}
/> />
</div> </div>
); );
}; };
...@@ -36,4 +36,4 @@ function map(state:any) { ...@@ -36,4 +36,4 @@ function map(state:any) {
const { Data} = state[module] const { Data} = state[module]
return { Data} return { Data}
} }
export default connect(map)(ResultPageFailed); export default connect(map)(ResultPageFailed);
\ No newline at end of file
...@@ -77,11 +77,11 @@ const Users = (props:any) => { ...@@ -77,11 +77,11 @@ const Users = (props:any) => {
setFileUploading(true) setFileUploading(true)
} }
if (info.file.status === 'done') { if (info.file.status === 'done') {
if (info.file.response.data.error_code == "0000") { if (info.file.response.error_code == "0000") {
history.push(location.pathname+"/Result") history.push(location.pathname+"/Result")
} else { } else {
history.push(location.pathname+"/ResultFailed") history.push(location.pathname+"/ResultFailed")
message.error(`${info.file.name} file upload failed.`); message.error(`${info.file.name} file upload failed.`+'failed count is '+info.file.response.data.count);
setFileUploading(false) setFileUploading(false)
} }
} else if (info.file.status === 'error') { } else if (info.file.status === 'error') {
......
...@@ -10,13 +10,13 @@ import TitleSearch from '../../../components/TitleSearch/TitleSearch'; ...@@ -10,13 +10,13 @@ import TitleSearch from '../../../components/TitleSearch/TitleSearch';
const ServiceProviderManagement = (props: any) => { const ServiceProviderManagement = (props: any) => {
const { formatMessage } = useIntl(); const { formatMessage } = useIntl();
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 } }) };
const TosTosServiceProviderGet = (values: any) => { dispatch({ type: 'ServiceProvider/TosTosServiceProviderGet', playload: values }) }; const TosTosServiceProviderGet = (values: any) => { dispatch({ type: 'ServiceProvider/TosTosServiceProviderGet', playload: values }) };
const SaveChooseData = (values: any) => { dispatch({ type: 'ServiceProvider/SaveChooseData', playload: values }) };
const SaveChooseData = (values: any) => { dispatch({ type: 'ServiceProvider/SaveChooseData', playload: values }) };
const GetList = () => { const GetList = () => {
if (CommunityList != null) { if (CommunityList != null) {
TosTosServiceProviderGet({ TosTosServiceProviderGet({
...@@ -27,26 +27,26 @@ const ServiceProviderManagement = (props: any) => { ...@@ -27,26 +27,26 @@ const ServiceProviderManagement = (props: any) => {
} }
useEffect(() => { useEffect(() => {
GetList() GetList()
}, []); }, []);
useEffect(() => { useEffect(() => {
GetList() GetList()
}, [CommunityList]); }, [CommunityList]);
const goToDetail = (values: any, e: any) => { const goToDetail = (values: any, e: any) => {
SaveChooseData(values) SaveChooseData(values)
history.push(location.pathname +'/Detail') history.push(location.pathname +'/Detail')
} }
const goToCreate = () => { const goToCreate = () => {
SaveChooseData(null) SaveChooseData(null)
history.push(location.pathname + '/Edit') history.push(location.pathname + '/Edit')
} }
const goToEdit = (values: any, e: any) => { const goToEdit = (values: any, e: any) => {
SaveChooseData(values) SaveChooseData(values)
history.push(location.pathname + '/Edit') history.push(location.pathname + '/Edit')
} }
const goToServices = () => {history.push(location.pathname +'/Services')} const goToServices = () => {history.push(location.pathname +'/Services')}
const pagination={defaultCurrent:1,total: Data!=null?Data.length:0} const pagination={defaultCurrent:1,total: Data!=null?Data.length:0}
const columns = [ const columns = [
...@@ -57,7 +57,7 @@ const ServiceProviderManagement = (props: any) => { ...@@ -57,7 +57,7 @@ const ServiceProviderManagement = (props: any) => {
{ title: "Account Status",dataIndex: 'enable',}, { title: "Account Status",dataIndex: 'enable',},
{ title: "Actions", { title: "Actions",
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space size="middle"><a onClick={goToDetail.bind(this,record)}>Detail</a><a onClick={goToEdit.bind(this,record)}>edit</a></Space> <Space size="middle"><a onClick={goToDetail.bind(this,record)}>Detail</a><a onClick={goToEdit.bind(this,record)}>edit</a></Space>
), ),
}, },
]; ];
...@@ -67,20 +67,26 @@ const ServiceProviderManagement = (props: any) => { ...@@ -67,20 +67,26 @@ const ServiceProviderManagement = (props: any) => {
switch (tmp[items].enable) { switch (tmp[items].enable) {
case 0: tmp[items].enable = "unregistered";break; case 0: tmp[items].enable = "unregistered";break;
case 1: tmp[items].enable = "registered";break; case 1: tmp[items].enable = "registered";break;
case 2:break; case 2:break;
} }
} }
return tmp; return tmp;
} }
const CallBackTitleSearch = (comment: any)=>{ const CallBackTitleSearch = (comment: any)=>{
console.log(comment) console.log(comment)
RA() console.log(location.pathname)
//页面搜索
TosTosServiceProviderGet({
providerName: comment.providerName,
serviceCommunityList: CommunityList
})
// history.push(location.pathname+urlEncode(filterObj({ providerName: comment.providerName})))
} }
return ( return (
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件 */} {/* 头部组件 */}
<TitleSearch <TitleSearch
...@@ -88,25 +94,25 @@ const ServiceProviderManagement = (props: any) => { ...@@ -88,25 +94,25 @@ const ServiceProviderManagement = (props: any) => {
list={["Service Provider"]} list={["Service Provider"]}
community={"serviceCommunityList"} community={"serviceCommunityList"}
onSubmit={CallBackTitleSearch} /> onSubmit={CallBackTitleSearch} />
{/* 内容组件 */} {/* 内容组件 */}
<div className={styles.box2}> <div className={styles.box2}>
<button className={styles.buttonAdd2} onClick={goToServices}>Avail Services</button> <button className={styles.buttonAdd2} onClick={goToServices}>Avail Services</button>
<button className={styles.buttonAdd} onClick={goToCreate}>Create New</button> <button className={styles.buttonAdd} onClick={goToCreate}>Create New</button>
</div> </div>
{/* 列表组件 */} {/* 列表组件 */}
<Spin spinning={Data!=null?false:true}> <Spin spinning={Data!=null?false:true}>
<Table size="small" rowKey={"id"} style={{ marginTop: 16 }} columns={columns} dataSource={Data!=null?dataSource(Data):null} pagination={pagination} /> <Table size="small" rowKey={"id"} style={{ marginTop: 16 }} columns={columns} dataSource={Data!=null?dataSource(Data):null} pagination={pagination} />
</Spin> </Spin>
</div> </div>
); );
}; };
function mapStateToProps(state:any) { function mapStateToProps(state:any) {
const { Data } = state.ServiceProvider; const { Data } = state.ServiceProvider;
const { DataProvider } = state.User; const { DataProvider } = state.User;
const { CommunityList } = state.Init; const { CommunityList } = state.Init;
return { return {
......
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