5.17 增加寻找商机中间页和供应商项目跟进跳转页
This commit is contained in:
@ -50,10 +50,6 @@ export default [
|
|||||||
path: '/redirect',
|
path: '/redirect',
|
||||||
component: './LoadingPage',
|
component: './LoadingPage',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: '/toAuth',
|
|
||||||
component: './LoadingPage/ToAuth',
|
|
||||||
},
|
|
||||||
//跨工程跳转中间页开始
|
//跨工程跳转中间页开始
|
||||||
{
|
{
|
||||||
path: '/xunjia',
|
path: '/xunjia',
|
||||||
|
@ -1,19 +1,54 @@
|
|||||||
import { getURLInformation } from '@/utils/CommonUtils';
|
import { getURLInformation, isNotEmpty } from '@/utils/CommonUtils';
|
||||||
import { Result } from 'antd';
|
import { getSessionRoleData } from '@/utils/session';
|
||||||
import React from 'react';
|
import { Result, Typography } from 'antd';
|
||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { history } from 'umi';
|
||||||
|
|
||||||
const message = {
|
const message = {
|
||||||
401: '您的用户信息有误,请联系管理员',
|
401: '您的用户信息有误,请联系管理员',
|
||||||
|
402: '您的用户角色信息缺失,请联系管理员',
|
||||||
90401: '您的登录已超时,请重新登录',
|
90401: '您的登录已超时,请重新登录',
|
||||||
404: '系统错误,请联系管理员',
|
404: '系统错误,请联系管理员',
|
||||||
};
|
};
|
||||||
|
|
||||||
const RequestTimeoutPage: React.FC<{}> = () => {
|
const RequestTimeoutPage: React.FC<{}> = () => {
|
||||||
const code: any = getURLInformation('code') == null ? '404' : getURLInformation('code');
|
const code: any = getURLInformation('code') == null ? '404' : getURLInformation('code');
|
||||||
|
const { Text } = Typography;
|
||||||
|
const [time, setTime] = useState<number>(10);
|
||||||
|
const roleData = getSessionRoleData();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
let timeInteval: any
|
||||||
|
if (code == 402 && isNotEmpty(roleData)) {
|
||||||
|
timeInteval = setInterval(() => { // 倒计时
|
||||||
|
setTime(n => {
|
||||||
|
if (n == 1) {
|
||||||
|
clearInterval(timeInteval)
|
||||||
|
redirect();
|
||||||
|
}
|
||||||
|
return n - 1;
|
||||||
|
})
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
clearInterval(timeInteval);
|
||||||
|
}
|
||||||
|
return () => {
|
||||||
|
clearInterval(timeInteval);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const redirect = () => {
|
||||||
|
if (isNotEmpty(roleData)) {
|
||||||
|
history.replace({
|
||||||
|
pathname: '/Dashboard',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Result
|
<Result
|
||||||
title={message[code]}
|
title={message[code]}
|
||||||
|
extra={isNotEmpty(roleData) && code == 402 && <Text type="secondary" strong>{time}秒后进入默认角色</Text>}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
import request from '@/utils/request';
|
|
||||||
|
|
||||||
// 获取字典信息
|
|
||||||
export async function getDictionaries(){
|
|
||||||
return request('/api/biz-service-ebtp-project/v1/dictProject/refreshDictCache');
|
|
||||||
}
|
|
50
src/pages/LoadingPage/MiddleLoading/ToFindBusiness.tsx
Normal file
50
src/pages/LoadingPage/MiddleLoading/ToFindBusiness.tsx
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
import React, { useEffect } from 'react';
|
||||||
|
import { message, Spin } from 'antd';
|
||||||
|
import { getURLInformation, isEmpty } from '@/utils/CommonUtils';
|
||||||
|
import { history } from 'umi';
|
||||||
|
const Loading: React.FC<{}> = () => {
|
||||||
|
/**
|
||||||
|
* 寻找商机中转页
|
||||||
|
*/
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
//获取必要参数
|
||||||
|
//项目编号
|
||||||
|
const number = getURLInformation('ebpProjectNumber') === null ? '' : getURLInformation('ebpProjectNumber');
|
||||||
|
//菜单类型
|
||||||
|
const type = getURLInformation('type') === null ? '' : getURLInformation('type');
|
||||||
|
if (isEmpty(type)) {
|
||||||
|
message.error('缺少必要参数,请重试');
|
||||||
|
} else {
|
||||||
|
let params = {}
|
||||||
|
isEmpty(number) ? null : params['number'] = number
|
||||||
|
if (type == 'procurement_mode_1' || type == 'procurement_mode_2') {//招标类
|
||||||
|
history.push({ pathname: '/Bid/FindBusiness', query: { ...params } });
|
||||||
|
} else if (type == 'procurement_mode_5' || type == 'procurement_mode_6') {//谈判类
|
||||||
|
history.push({ pathname: '/Negotiation/FindBusiness', query: { ...params } });
|
||||||
|
} else if (type == 'procurement_mode_4') {//招募类
|
||||||
|
history.push({ pathname: '/Recruit/FindBusiness', query: { ...params } });
|
||||||
|
} else if (type == 'procurement_mode_3') {//比选类
|
||||||
|
history.push({ pathname: '/Comparison/FindBusiness', query: { ...params } });
|
||||||
|
} 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;
|
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;
|
@ -1,30 +0,0 @@
|
|||||||
import React, { useEffect } from 'react';
|
|
||||||
import { Button, message, Spin } from 'antd';
|
|
||||||
import request from '@/utils/request';
|
|
||||||
import { JumpToOutside } from '@/utils/CommonUtils';
|
|
||||||
const Loading: React.FC<{}> = () => {
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
// request('/auth/oauth/authorize', {
|
|
||||||
// method: 'get',
|
|
||||||
// params: {
|
|
||||||
// response_type: 'code',
|
|
||||||
// client_id: 'KgPEkttG',
|
|
||||||
// redirect_uri: 'http://10.242.31.158:18022/redirect?page=xunjia&pid=123&vid=456&qid=789',
|
|
||||||
// mall3_token: sessionStorage.getItem('Authorization'),
|
|
||||||
// },
|
|
||||||
// }).then(res => {
|
|
||||||
|
|
||||||
// })
|
|
||||||
|
|
||||||
}, []);
|
|
||||||
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..." />
|
|
||||||
<Button onClick={() => JumpToOutside("http://10.242.31.158:18022/redirect?page=xunjia%26pid=123%26vid=456%26qid=789")}>再点一次</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
export default Loading;
|
|
@ -1,11 +1,10 @@
|
|||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import { message, Spin } from 'antd';
|
import { message, Spin } from 'antd';
|
||||||
import { history } from 'umi';
|
import { history } from 'umi';
|
||||||
import { cloudReloadToken, cooperReloadToken, fgetUserMsg, getTokenByCode } from './service';
|
import { cloudReloadToken, cooperReloadToken, fgetUserMsg, getDictionaries, getTokenByCode } from './service';
|
||||||
import { getDictionaries } from './BasDicData';
|
import { getTotalURLInformation, getURLInformation, isNotEmpty } from '@/utils/CommonUtils';
|
||||||
import { getTotalURLInformation, getURLInformation } from '@/utils/CommonUtils';
|
|
||||||
import { refreshTokenApi } from '@/services/login';
|
import { refreshTokenApi } from '@/services/login';
|
||||||
import { getUserRefreshToken, getUserScope } from '@/utils/session';
|
import { getUserRefreshToken, getUserScope, setUserData } from '@/utils/session';
|
||||||
const Loading: React.FC<{}> = () => {
|
const Loading: React.FC<{}> = () => {
|
||||||
//存字典
|
//存字典
|
||||||
async function setDict() {
|
async function setDict() {
|
||||||
@ -17,7 +16,7 @@ const Loading: React.FC<{}> = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
//用户信息错误处理方法
|
//用户信息错误处理方法
|
||||||
async function refreshUserData(userType: string,token: string, url: string,extra: any) {
|
async function refreshUserData(userType: string, token: string, url: string, extra: any) {
|
||||||
const headers = {
|
const headers = {
|
||||||
Authorization: token,
|
Authorization: token,
|
||||||
clientId: REACT_APP_CLIENT_KEY,
|
clientId: REACT_APP_CLIENT_KEY,
|
||||||
@ -32,84 +31,89 @@ const Loading: React.FC<{}> = () => {
|
|||||||
const header = {
|
const header = {
|
||||||
clientId: REACT_APP_CLIENT_KEY,
|
clientId: REACT_APP_CLIENT_KEY,
|
||||||
}
|
}
|
||||||
if(userType == '0') {//联通用户
|
if (userType == '0') {//联通用户
|
||||||
await cloudReloadToken('',headers)
|
await cloudReloadToken('', headers)
|
||||||
await getUserData(token, url, extra, 1)
|
await getUserData(token, url, extra, 1)
|
||||||
} else if(userType == '1') {//合作方
|
} else if (userType == '1') {//合作方
|
||||||
await cooperReloadToken('',headers)
|
await cooperReloadToken('', headers)
|
||||||
await getUserData(token, url, extra, 1)
|
await getUserData(token, url, extra, 1)
|
||||||
} else if(userType == '2') {//专家
|
} else if (userType == '2') {//专家
|
||||||
await refreshTokenApi(params,header).then(async res => {
|
await refreshTokenApi(params, header).then(async res => {
|
||||||
if(res?.success == true) {
|
if (res?.success == true) {
|
||||||
sessionStorage.setItem('Authorization', res?.data?.value);
|
sessionStorage.setItem('Authorization', res?.data?.value);
|
||||||
await getUserData(token, url, extra, 1)
|
await getUserData(token, url, extra, 1)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//错误页
|
||||||
//获取用户信息
|
const error = (code: string) => {
|
||||||
async function getUserData(token: string, url: string,extra: any,status: number) {
|
|
||||||
await fgetUserMsg(token).then(async res => {
|
|
||||||
if (res) {
|
|
||||||
if(res?.userType == null) {
|
|
||||||
history.replace({
|
history.replace({
|
||||||
pathname: '/401',
|
pathname: '/401',
|
||||||
query: {
|
query: {
|
||||||
code: '401'
|
code: code
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
//跳转
|
||||||
|
const redirect = async (userData: any, url: string, extra: any) => {
|
||||||
|
const roleId = getURLInformation('roleId');
|
||||||
|
if (isNotEmpty(roleId)) {
|
||||||
|
const authIndex = userData.authorityList.findIndex((ite: any) => ite.roleId == roleId);
|
||||||
|
if (authIndex != -1) {
|
||||||
|
setUserData(userData, userData.authorityList[authIndex].roleCode, userData.authorityList[authIndex])//角色信息存储
|
||||||
} else {
|
} else {
|
||||||
if(res?.authorityList == null || res?.authorityList?.length == 0) {
|
setUserData(userData, userData.authorityList[0].roleCode, userData.authorityList[0]);
|
||||||
if(url == 'ExamineAndApprove/Announcement' || url == 'ExamineAndApprove/ChangeTheAnnouncement' || url == 'ExamineAndApprove/Publicity' || url == 'ExamineAndApprove/InvitationLetter' || url == 'ExamineAndApprove/ExternalReference' || url == 'ExamineAndApprove/FailureAnnouncement') {
|
error('402');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setUserData(userData, userData.authorityList[0].roleCode, userData.authorityList[0]);
|
||||||
|
}
|
||||||
|
await setDict();//存字典
|
||||||
|
setTimeout(() => {
|
||||||
|
history.push({
|
||||||
|
pathname: `/${url}`,
|
||||||
|
query: {
|
||||||
|
...extra
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 2000)
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取用户信息
|
||||||
|
async function getUserData(token: string, url: string, extra: any, status: number) {
|
||||||
|
await fgetUserMsg(token).then(async res => {
|
||||||
|
if (res) {
|
||||||
|
if (res?.userType == null) {
|
||||||
|
error('401');
|
||||||
|
} else {
|
||||||
|
if (res?.authorityList == null || res?.authorityList?.length == 0) {
|
||||||
|
if (url == 'ExamineAndApprove/Announcement' ||
|
||||||
|
url == 'ExamineAndApprove/ChangeTheAnnouncement' ||
|
||||||
|
url == 'ExamineAndApprove/Publicity' ||
|
||||||
|
url == 'ExamineAndApprove/InvitationLetter' ||
|
||||||
|
url == 'ExamineAndApprove/ExternalReference' ||
|
||||||
|
url == 'ExamineAndApprove/FailureAnnouncement') {
|
||||||
let newAuthority: any[] = []
|
let newAuthority: any[] = []
|
||||||
newAuthority.push({
|
newAuthority.push({
|
||||||
authorities: [null,"system:user:test","system:user:test","system:user:test","system:user:test",null,null],
|
authorities: [null, "system:user:test", "system:user:test", "system:user:test", "system:user:test", null, null],
|
||||||
roleCode: "ebtp-unicom-default",
|
roleCode: "ebtp-unicom-default",
|
||||||
roleId: "20004",
|
roleId: "20004",
|
||||||
roleName: "联通普通用户",
|
roleName: "联通普通用户",
|
||||||
roleScope: "EBTP"
|
roleScope: "EBTP"
|
||||||
})
|
})
|
||||||
res.authorityList = [...newAuthority]
|
res.authorityList = [...newAuthority];
|
||||||
setDict();//存字典
|
await redirect(res, url, extra);
|
||||||
res.roleIds = res.authorityList[0].roleCode;
|
|
||||||
sessionStorage.setItem('userData', JSON.stringify(res));
|
|
||||||
sessionStorage.setItem('roleAuthority', JSON.stringify([res.roleIds]));
|
|
||||||
sessionStorage.setItem('roleData', JSON.stringify(res.authorityList[0]));
|
|
||||||
setTimeout(() => {
|
|
||||||
history.push({
|
|
||||||
pathname: `/${url}`,
|
|
||||||
query: {
|
|
||||||
...extra
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}, 2000)
|
|
||||||
} else {
|
} else {
|
||||||
if(status == 0) {
|
if (status == 0) {
|
||||||
await refreshUserData(res?.userType,token,url,extra)
|
await refreshUserData(res?.userType, token, url, extra);
|
||||||
} else {
|
} else {
|
||||||
history.replace({
|
error('401');
|
||||||
pathname: '/401',
|
|
||||||
query: {
|
|
||||||
code: '401'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setDict();//存字典
|
await redirect(res, url, extra);
|
||||||
res.roleIds = res.authorityList[0].roleCode;
|
|
||||||
sessionStorage.setItem('userData', JSON.stringify(res));
|
|
||||||
sessionStorage.setItem('roleAuthority', JSON.stringify([res.roleIds]));
|
|
||||||
sessionStorage.setItem('roleData', JSON.stringify(res.authorityList[0]));
|
|
||||||
setTimeout(() => {
|
|
||||||
history.push({
|
|
||||||
pathname: `/${url}`,
|
|
||||||
query: {
|
|
||||||
...extra
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}, 2000)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -120,7 +124,7 @@ const Loading: React.FC<{}> = () => {
|
|||||||
//通过code取token
|
//通过code取token
|
||||||
async function getToken(code: string, data: any) {
|
async function getToken(code: string, data: any) {
|
||||||
let e = ''
|
let e = ''
|
||||||
if(data != null && data != undefined && data != '') {
|
if (data != null && data != undefined && data != '') {
|
||||||
e = '?' + data
|
e = '?' + data
|
||||||
}
|
}
|
||||||
//获取当前浏览器主机部分(含端口号)
|
//获取当前浏览器主机部分(含端口号)
|
||||||
@ -128,17 +132,13 @@ const Loading: React.FC<{}> = () => {
|
|||||||
//获取协议部分 http: https:
|
//获取协议部分 http: https:
|
||||||
const protocol = window.location.protocol
|
const protocol = window.location.protocol
|
||||||
const grant_type = 'authorization_code';
|
const grant_type = 'authorization_code';
|
||||||
// const client_id = 'KgPEkttG';
|
|
||||||
// const client_secret = 'ae5bdb183c502355d2055b3de73300aa73cbfdf3';
|
|
||||||
// const redirect_uri = `http://10.242.31.158:18022/redirect${e}`;
|
|
||||||
const client_id = REACT_APP_CLIENT_KEY;
|
const client_id = REACT_APP_CLIENT_KEY;
|
||||||
const client_secret = REACT_APP_CLIENT_SECRET;
|
const client_secret = REACT_APP_CLIENT_SECRET;
|
||||||
// const redirect_uri = `${process.env.client_redirect}${e}`;
|
|
||||||
const redirect_uri = `${protocol}//${host}/redirect${e}`;
|
const redirect_uri = `${protocol}//${host}/redirect${e}`;
|
||||||
let token = '';
|
let token = '';
|
||||||
await getTokenByCode({ grant_type, client_id, client_secret, redirect_uri, code }).then(res => {
|
await getTokenByCode({ grant_type, client_id, client_secret, redirect_uri, code }).then(res => {
|
||||||
if (res?.success == true) {
|
if (res?.success == true) {
|
||||||
sessionStorage.setItem('Authorization',res?.data?.value)
|
sessionStorage.setItem('Authorization', res?.data?.value)
|
||||||
token = 'Bearer ' + res?.data?.value;
|
token = 'Bearer ' + res?.data?.value;
|
||||||
} else {
|
} else {
|
||||||
message.error("认证请求失败,请联系管理员")
|
message.error("认证请求失败,请联系管理员")
|
||||||
@ -149,15 +149,14 @@ const Loading: React.FC<{}> = () => {
|
|||||||
//主方法
|
//主方法
|
||||||
async function mainFc() {
|
async function mainFc() {
|
||||||
const code = getURLInformation('code');
|
const code = getURLInformation('code');
|
||||||
const urlData: any = getTotalURLInformation()||{};
|
const urlData: any = getTotalURLInformation() || {};
|
||||||
// const urlData: any = {};
|
|
||||||
//形成url额外参数
|
//形成url额外参数
|
||||||
let str: string = ''
|
let str: string = ''
|
||||||
let obj: any = {}
|
let obj: any = {}
|
||||||
for (let key in urlData) {
|
for (let key in urlData) {
|
||||||
if(key != 'code') {
|
if (key != 'code') {
|
||||||
str = str + '&' + key + '=' + urlData[key]
|
str = str + '&' + key + '=' + urlData[key]
|
||||||
if(key != 'page') {
|
if (key != 'page' && key != 'roleId') {
|
||||||
obj[key] = urlData[key]
|
obj[key] = urlData[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import request from '@/utils/request';
|
|||||||
export async function fgetUserMsg(params: any) {
|
export async function fgetUserMsg(params: any) {
|
||||||
return request('/api/biz-service-ebtp-extend/v1/userinfo/get', {
|
return request('/api/biz-service-ebtp-extend/v1/userinfo/get', {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {'Authorization': params},
|
headers: { 'Authorization': params },
|
||||||
data: params,
|
data: params,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -28,7 +28,7 @@ export async function getTokenByCode(params: any) {
|
|||||||
* 根据询价单id查询项目数据
|
* 根据询价单id查询项目数据
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
export function getProjectByInquiryId(inquiryId?:any){
|
export function getProjectByInquiryId(inquiryId?: any) {
|
||||||
return request('/api/biz-service-ebtp-project/v1/projectRecord/getByInquiryId/' + inquiryId);
|
return request('/api/biz-service-ebtp-project/v1/projectRecord/getByInquiryId/' + inquiryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ export async function getTokenByCode(params: any) {
|
|||||||
* 刷新上下文接口(云门户)
|
* 刷新上下文接口(云门户)
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
export function cloudReloadToken(params: any,header: any) {
|
export function cloudReloadToken(params: any, header: any) {
|
||||||
return request('/api/auth/reloadToken', {
|
return request('/api/auth/reloadToken', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: header
|
headers: header
|
||||||
@ -46,11 +46,25 @@ export async function getTokenByCode(params: any) {
|
|||||||
* 刷新上下文接口(合作方)
|
* 刷新上下文接口(合作方)
|
||||||
* @param id
|
* @param id
|
||||||
*/
|
*/
|
||||||
export function cooperReloadToken(params: any,header: any) {
|
export function cooperReloadToken(params: any, header: any) {
|
||||||
return request('/api/auth/reloadPartnerToken', {
|
return request('/api/auth/reloadPartnerToken', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: header
|
headers: header
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 获取字典信息
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export async function getDictionaries() {
|
||||||
|
return request('/api/biz-service-ebtp-project/v1/dictProject/refreshDictCache');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据projectId获取项目信息
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
export async function getProjectById(id?: any) {
|
||||||
|
return request('/api/biz-service-ebtp-project/v1/projectRecord/' + id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,6 +95,8 @@ const LookingForBusinessOpportunitiesList: React.FC<{}> = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const docSaveBtn = "compact";//保存按钮是否展示
|
const docSaveBtn = "compact";//保存按钮是否展示
|
||||||
|
//项目编号
|
||||||
|
const ebpProjectNumber = getURLInformation('number');
|
||||||
|
|
||||||
function getBsName() {
|
function getBsName() {
|
||||||
if (bidMethodDict.indexOf("procurement_mode_4") !== -1) {
|
if (bidMethodDict.indexOf("procurement_mode_4") !== -1) {
|
||||||
@ -108,12 +110,14 @@ const LookingForBusinessOpportunitiesList: React.FC<{}> = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTableLoading(true);
|
setTableLoading(true);
|
||||||
if (bidMethodDict.indexOf("procurement_mode_4") > -1) {
|
if (bidMethodDict.indexOf("procurement_mode_4") > -1) {
|
||||||
lookingForBussinessOther(bussinessParams).then(res => {
|
lookingForBussinessOther(isNotEmpty(ebpProjectNumber) ? { ...bussinessParams, ebpProjectNumber } : bussinessParams).then(res => {
|
||||||
|
isNotEmpty(window.location.search) && history.push(window.location.pathname);
|
||||||
setTableList(res.data);
|
setTableList(res.data);
|
||||||
setTableLoading(false);
|
setTableLoading(false);
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
lookingForBussiness(bussinessParams).then(res => {
|
lookingForBussiness(isNotEmpty(ebpProjectNumber) ? { ...bussinessParams, ebpProjectNumber } : bussinessParams).then(res => {
|
||||||
|
isNotEmpty(window.location.search) && history.push(window.location.pathname);
|
||||||
setTableList(res.data);
|
setTableList(res.data);
|
||||||
setTableLoading(false);
|
setTableLoading(false);
|
||||||
})
|
})
|
||||||
|
@ -160,7 +160,7 @@ export function getUserToken() {
|
|||||||
/**
|
/**
|
||||||
* 获取session userRefreshToken
|
* 获取session userRefreshToken
|
||||||
*/
|
*/
|
||||||
export function getUserRefreshToken() {
|
export function getUserRefreshToken() {
|
||||||
let userRefreshToken: any | null = sessionStorage.getItem('refreshToken');
|
let userRefreshToken: any | null = sessionStorage.getItem('refreshToken');
|
||||||
return userRefreshToken;
|
return userRefreshToken;
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ export function getUserToken() {
|
|||||||
/**
|
/**
|
||||||
* 获取session userScope
|
* 获取session userScope
|
||||||
*/
|
*/
|
||||||
export function getUserScope() {
|
export function getUserScope() {
|
||||||
let userScope: any | null = sessionStorage.getItem('scope');
|
let userScope: any | null = sessionStorage.getItem('scope');
|
||||||
return userScope;
|
return userScope;
|
||||||
}
|
}
|
||||||
@ -246,7 +246,7 @@ export async function jurySaveInfo(record: any) {
|
|||||||
}));
|
}));
|
||||||
sessionStorage.setItem('roomId', record.id);
|
sessionStorage.setItem('roomId', record.id);
|
||||||
sessionStorage.setItem("groupId", record.chatGroupId)
|
sessionStorage.setItem("groupId", record.chatGroupId)
|
||||||
sessionStorage.setItem("expertGroupId",record.expertChatGroupId)
|
sessionStorage.setItem("expertGroupId", record.expertChatGroupId)
|
||||||
await getQuotationMethodById(record.id)
|
await getQuotationMethodById(record.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -270,7 +270,7 @@ export interface projectDataItem {
|
|||||||
isIPassFile?: string
|
isIPassFile?: string
|
||||||
projectName?: string
|
projectName?: string
|
||||||
openTenderForm?: string
|
openTenderForm?: string
|
||||||
returnURL?:string
|
returnURL?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -301,7 +301,7 @@ export function followUpAProjectManager(projectData: projectDataItem): Promise<b
|
|||||||
export function followUpAProjectSupplier(projectData: projectDataItem): Promise<boolean> {
|
export function followUpAProjectSupplier(projectData: projectDataItem): Promise<boolean> {
|
||||||
removePurchaseCanOperate();
|
removePurchaseCanOperate();
|
||||||
return new Promise<boolean>(resolve => {
|
return new Promise<boolean>(resolve => {
|
||||||
if(projectData?.id == undefined || projectData?.id == null) {
|
if (projectData?.id == undefined || projectData?.id == null) {
|
||||||
message.error("项目数据错误,无法获取流程,请联系管理员")
|
message.error("项目数据错误,无法获取流程,请联系管理员")
|
||||||
} else {
|
} else {
|
||||||
getDefById(projectData?.id).then((res) => {
|
getDefById(projectData?.id).then((res) => {
|
||||||
@ -358,21 +358,21 @@ export function getPurchaseCanOperate() {
|
|||||||
/**
|
/**
|
||||||
* 设置session roleAuthority
|
* 设置session roleAuthority
|
||||||
*/
|
*/
|
||||||
export function setPurchaseCanOperate() {
|
export function setPurchaseCanOperate() {
|
||||||
sessionStorage.setItem('purchaseCanOperate', '1');
|
sessionStorage.setItem('purchaseCanOperate', '1');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除session roleAuthority
|
* 删除session roleAuthority
|
||||||
*/
|
*/
|
||||||
export function removePurchaseCanOperate() {
|
export function removePurchaseCanOperate() {
|
||||||
sessionStorage.removeItem('purchaseCanOperate');
|
sessionStorage.removeItem('purchaseCanOperate');
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 获取returnURL
|
* 获取returnURL
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getReturnURL () {
|
export function getReturnURL() {
|
||||||
let returnURL = sessionStorage.getItem('returnURL');
|
let returnURL = sessionStorage.getItem('returnURL');
|
||||||
return returnURL === null ? "" : returnURL;
|
return returnURL === null ? "" : returnURL;
|
||||||
}
|
}
|
||||||
@ -381,7 +381,7 @@ export function getReturnURL () {
|
|||||||
* 获取getRoomReturnURL
|
* 获取getRoomReturnURL
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getRoomReturnURL () {
|
export function getRoomReturnURL() {
|
||||||
let roomReturnURL = sessionStorage.getItem('roomReturnURL');
|
let roomReturnURL = sessionStorage.getItem('roomReturnURL');
|
||||||
return roomReturnURL === null ? "" : roomReturnURL;
|
return roomReturnURL === null ? "" : roomReturnURL;
|
||||||
}
|
}
|
||||||
@ -390,7 +390,7 @@ export function getReturnURL () {
|
|||||||
* 获取当前评审室对应标段的报价类型(只能在评审室内使用)
|
* 获取当前评审室对应标段的报价类型(只能在评审室内使用)
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getSectionQuot () {
|
export function getSectionQuot() {
|
||||||
let returnURL = sessionStorage.getItem('sectionQuot');
|
let returnURL = sessionStorage.getItem('sectionQuot');
|
||||||
return returnURL === null ? "0" : returnURL;
|
return returnURL === null ? "0" : returnURL;
|
||||||
}
|
}
|
||||||
@ -401,15 +401,15 @@ export function getReturnURL () {
|
|||||||
* @returns 1-%(优惠率,折扣率) 0-元(总价,单价)
|
* @returns 1-%(优惠率,折扣率) 0-元(总价,单价)
|
||||||
*/
|
*/
|
||||||
export async function getQuotationMethodById(roomId: any) {
|
export async function getQuotationMethodById(roomId: any) {
|
||||||
if(roomId == undefined || roomId == '' || roomId == null) {
|
if (roomId == undefined || roomId == '' || roomId == null) {
|
||||||
message.error('参数缺失')
|
message.error('参数缺失')
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
await getRoomDataById(roomId).then(async res => {
|
await getRoomDataById(roomId).then(async res => {
|
||||||
if(res?.code == 200 && res?.success == true) {
|
if (res?.code == 200 && res?.success == true) {
|
||||||
let roomData = res?.data
|
let roomData = res?.data
|
||||||
await getSectionDataById(roomData?.sectionId).then(response => {
|
await getSectionDataById(roomData?.sectionId).then(response => {
|
||||||
if(response?.code == 200 && response?.success == true) {
|
if (response?.code == 200 && response?.success == true) {
|
||||||
let quotationMethodDict = response?.data?.quotationMethodDict
|
let quotationMethodDict = response?.data?.quotationMethodDict
|
||||||
let result = (quotationMethodDict == "quotation_method_2" || quotationMethodDict == "quotation_method_3") ? "1" : "0"
|
let result = (quotationMethodDict == "quotation_method_2" || quotationMethodDict == "quotation_method_3") ? "1" : "0"
|
||||||
sessionStorage.setItem("sectionQuot", result)//roomType存入session
|
sessionStorage.setItem("sectionQuot", result)//roomType存入session
|
||||||
@ -419,3 +419,14 @@ export async function getQuotationMethodById(roomId: any) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 存储角色信息
|
||||||
|
* @param {总数据} userData
|
||||||
|
* @param {权限} role
|
||||||
|
* @param {当前角色} roleData
|
||||||
|
*/
|
||||||
|
export function setUserData(userData: any, role: string, roleData: any): void {
|
||||||
|
sessionStorage.setItem('userData', JSON.stringify(userData));
|
||||||
|
sessionStorage.setItem('roleAuthority', JSON.stringify([role]));
|
||||||
|
sessionStorage.setItem('roleData', JSON.stringify(roleData));
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user