Commit e892b86e authored by MrShi's avatar MrShi

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

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