5.17 增加寻找商机中间页和供应商项目跟进跳转页
This commit is contained in:
59
src/pages/LoadingPage/MiddleLoading/ToHomePage.tsx
Normal file
59
src/pages/LoadingPage/MiddleLoading/ToHomePage.tsx
Normal file
@ -0,0 +1,59 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { message, Spin } from 'antd';
|
||||
import { getURLInformation, isEmpty } from '@/utils/CommonUtils';
|
||||
import { followUpAProjectManager, followUpAProjectSupplier, getSessionRoleData } from '@/utils/session';
|
||||
import { history } from 'umi';
|
||||
import { getProjectById } from '../service';
|
||||
const Loading: React.FC<{}> = () => {
|
||||
/**
|
||||
* 项目跟进中转页
|
||||
*/
|
||||
|
||||
//获取角色
|
||||
const role = getSessionRoleData()?.roleCode;
|
||||
|
||||
useEffect(() => {
|
||||
//获取必要参数
|
||||
const projectId = getURLInformation('id') === null ? '' : getURLInformation('id');
|
||||
if (isEmpty(projectId)) {
|
||||
message.error('缺少必要参数,请重试');
|
||||
} else {
|
||||
//获取项目数据
|
||||
getProjectById(projectId).then((res) => {
|
||||
if (res?.code == 200 && res?.success == true) {
|
||||
const data = res?.data;
|
||||
if (role == "ebtp-purchase" || role == "ebtp-agency-project-manager") {//采购经理或代理
|
||||
//调用存储session方法
|
||||
followUpAProjectManager(data);
|
||||
setTimeout(() => {
|
||||
history.push('./ProjectLayout/Manager/HomePageSectionList');
|
||||
}, 1000);
|
||||
} else if (role == "ebtp-supplier") {//供应商
|
||||
followUpAProjectSupplier(data);
|
||||
setTimeout(() => {
|
||||
history.push('./ProjectLayout/Supplier/HomePageSectionList');
|
||||
}, 1000);
|
||||
} else {
|
||||
message.error("用户角色信息获取错误,请联系管理员")
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
height: '100%',
|
||||
background: 'rgba(0,0,0,.05)',
|
||||
position: 'relative',
|
||||
}}
|
||||
>
|
||||
<div style={{ position: 'absolute', left: '50%', top: '48%' }}>
|
||||
<Spin tip="Loading..." />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
export default Loading;
|
Reference in New Issue
Block a user