部署供货商客服入口

This commit is contained in:
unknown
2022-07-11 16:01:49 +08:00
parent e91466b3af
commit 503e8ed03f
7 changed files with 185 additions and 14 deletions

View File

@ -194,6 +194,24 @@ const Promenu: React.FC<{}> = () => {
const handlePopoverClose = () => {
setAnchorEl(null);
};
const initChatUI = () => { //智慧客服
var pathname = window.location.pathname
var consultType = pathname.substring(pathname.lastIndexOf('/')+1)
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
if(tempForm){
var hideInput = document.getElementById('tempInput_CustomerService') as HTMLInputElement
if(hideInput){
hideInput.value= consultType
}else{
hideInput = document.createElement("input")
hideInput.id = 'tempInput_CustomerService'
hideInput.type="hidden"
hideInput.name= 'consultType'
tempForm.appendChild(hideInput)
}
tempForm.submit();
}
}
return (
<div key='promenuDiv1' style={{ borderRadius: "6px", overflow: "hidden" }}>
<div key='promenuDiv2' className="site-page-header-ghost-wrapper" style={{ background: '#ffffff' }}>
@ -212,6 +230,9 @@ const Promenu: React.FC<{}> = () => {
history.push("/ProjectLayout/Archive/projectArchive")
setButtonValue(stepButtonClick(data?.[data?.length - 1]))
}}></Button> : null,
<Button key="customerservice" onClick={() =>{
initChatUI() //智慧客服
}}></Button>,
((randerRole == 'ebtp-agency-project-manager' || randerRole == 'ebtp-purchase' || randerRole == 'ebtp-supervision') && MethodDict != "procurement_mode_7")
? <Button key="manageyiyi" onClick={() => history.push("/Project/ProjectManage/ProjectManager/ObjectionComplaint")}></Button> : null,
(randerRole == 'ebtp-supplier' && MethodDict != "procurement_mode_7")

View File

@ -11,6 +11,7 @@ import { getDictName, getProjectTypeCode, getURLInformation, getUrlParam, getUrl
import { btnAuthority } from '@/utils/authority';
import ProList from '@ant-design/pro-list';
import { MessageOutlined } from '@ant-design/icons';
import CreateForm from '@/pages/ListTableList/components/CreateForm';
const { TabPane } = Tabs;
const { TextArea } = Input;
@ -127,7 +128,7 @@ const Index: React.FC<{}> = () => {
title: '我要咨询',
dataIndex: 'consult',
render: (text: any, record: any) => (
<Button type="text" danger size='large' icon={<MessageOutlined />} onClick={()=>{initChatUI(record)}}/>
<Button type="text" danger size='large' icon={<MessageOutlined />} onClick={()=>{createHiddenForm(record);initChatUI()}}/>
),
},
{
@ -291,6 +292,8 @@ const Index: React.FC<{}> = () => {
}
const saveProject = async (val: any) => { // 点击项目跟进存储项目信息
//创建临时表单-智慧客服
createHiddenForm(val)
val.returnURL = getReturnURL()
await followUpAProjectSupplier(val);
history.push('/ProjectLayout/Supplier/HomePageSectionList')
@ -403,10 +406,12 @@ const Index: React.FC<{}> = () => {
}
})
}
const initChatUI = (record:any) => { //智慧客服
const createHiddenForm = (record:any)=>{//智慧客服-创建临时表单
const customerservice = REACT_APP_CUSTOMERSERVICE_USERCENTER + '&client_id=' + REACT_APP_CUSTOMERSERVICE_CLIENT_ID + '&redirect_uri=' + REACT_APP_CUSTOMERSERVICE_REDIRECT + '/redirect?page=home&mall3_token=';//智慧客服
var tempForm = document.createElement("form")
tempForm.id="tempForm1"
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
if(tempForm) document.body.removeChild(tempForm);
tempForm = document.createElement("form")
tempForm.id="tempForm_CustomerService"
tempForm.method="post"
tempForm.action=customerservice + sessionStorage.getItem('Authorization')
tempForm.target='_blank'
@ -512,12 +517,22 @@ const Index: React.FC<{}> = () => {
tempForm.appendChild(hideInput)
})
document.body.appendChild(tempForm);
tempForm.submit();
document.body.removeChild(tempForm);
}else{
message.warn('参数为空')
}
}
const initChatUI = () => { //智慧客服
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
var hideInput = document.createElement("input")
if(tempForm){
hideInput.type="hidden"
hideInput.name= 'consultType'
hideInput.value= 'PROJECTLIST'
tempForm.appendChild(hideInput)
tempForm.submit();
document.body.removeChild(tempForm);
}
}
return (
<>
<PageHeader

View File

@ -17,6 +17,7 @@ import Weboffice from "@/pages/webOffice/weboffice";
import { queryingPagingData } from '@/utils/PageUtils';
import ExtendUpload from '@/utils/ExtendUpload';
import { btnAuthority } from '@/utils/authority';
import { MessageOutlined } from '@ant-design/icons';
const { TabPane } = Tabs;
@ -107,6 +108,133 @@ const LookingForBusinessOpportunitiesList: React.FC<{}> = () => {
}
return '标段';
}
const createHiddenForm = (record:any)=>{//智慧客服-创建临时表单
const customerservice = REACT_APP_CUSTOMERSERVICE_USERCENTER + '&client_id=' + REACT_APP_CUSTOMERSERVICE_CLIENT_ID + '&redirect_uri=' + REACT_APP_CUSTOMERSERVICE_REDIRECT + '/redirect?page=home&mall3_token=';//智慧客服
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
if(tempForm) document.body.removeChild(tempForm);
tempForm = document.createElement("form")
tempForm.id="tempForm_CustomerService"
tempForm.method="post"
tempForm.action=customerservice + sessionStorage.getItem('Authorization')
tempForm.target='_blank'
const inputList = [
{
paraName:'projectName',
isEncode:true,
defaultVal:null,
},
{
paraName:'projectBizNum',
isEncode:false,
defaultVal:null,
},
{
paraName:'tenderAgencyId',
isEncode:false,
defaultVal:null,
},
{
paraName:'tenderAgencyName',
isEncode:true,
defaultVal:null,
},
{
paraName:'tendereeName',
isEncode:true,
defaultVal:null,
},
{
paraName:'status',
isEncode:false,
defaultVal:null,
},
{
paraName:'ownerContactName',
isEncode:true,
defaultVal:null,
},
{
paraName:'ownerContactId',
isEncode:false,
defaultVal:null,
},
{
paraName:'ownerContactTel',
isEncode:false,
defaultVal:null,
},
{
paraName:'appManagerName',
isEncode:true,
defaultVal:null,
},
{
paraName:'appManagerId',
isEncode:false,
defaultVal:null,
},
{
paraName:'appManagerTel',
isEncode:false,
defaultVal:null,
},
{
paraName:'roleAuthority',
isEncode:false,
defaultVal:null,
},
{
paraName:'module',
isEncode:false,
defaultVal:'10',
},
{
paraName:'custType',
isEncode:false,
defaultVal:'2',
},
]
if(inputList && inputList.length>0){
inputList.map(input=>{
var hideInput = document.createElement("input")
hideInput.type="hidden"
hideInput.name= input.paraName
if(input.paraName=='roleAuthority'){
let roleAuthority: any | null = sessionStorage.getItem('roleAuthority');
hideInput.value = JSON.parse(roleAuthority)[0]
}else{
if(input.isEncode){
hideInput.value = encodeURI(record[input.paraName])
}else{
if(input.defaultVal!=null){
hideInput.value = input.defaultVal
}else{
hideInput.value = record[input.paraName]
}
}
}
tempForm.appendChild(hideInput)
})
document.body.appendChild(tempForm);
}else{
message.warn('参数为空')
}
}
const initChatUI = () => { //智慧客服
var tempForm = document.getElementById('tempForm_CustomerService') as HTMLFormElement
var hideInput = document.createElement("input")
if(tempForm){
hideInput.type="hidden"
hideInput.name= 'consultType'
hideInput.value= 'PROJECTLIST'
tempForm.appendChild(hideInput)
tempForm.submit();
document.body.removeChild(tempForm);
}
}
useEffect(() => {
setTableLoading(true);
if (bidMethodDict.indexOf("procurement_mode_4") > -1) {
@ -155,6 +283,13 @@ const LookingForBusinessOpportunitiesList: React.FC<{}> = () => {
title: '项目名称',
dataIndex: 'projectName',
},
{
title: '我要咨询',
dataIndex: 'consult',
render: (text: any, record: any) => (
<Button type="text" danger size='large' icon={<MessageOutlined />} onClick={()=>{createHiddenForm(record);initChatUI()}}/>
),
},
{
title: bidMethodDict.indexOf("procurement_mode_4") !== -1 ? '招募人' : '采购人',
dataIndex: 'tendereeOrgName',