修改fe_service_ebtp_frontend\src\pages\MainPage\ProjectManager\manager.js

This commit is contained in:
unknown
2022-04-29 16:43:07 +08:00
22 changed files with 1023 additions and 322 deletions

View File

@ -14,8 +14,9 @@ import { getURLInformation } from '@/utils/CommonUtils';
import MessageDetail from '@/pages/SystemMessage/message/components/messageDetail'
import NoticeDetail from '@/pages/notice/noticeList/components/NoticeDetail'
import QuestDetail from '@/pages/SystemMessage/message/components/questDetail'
import ChatUI from '@/pages/customerservice/support/conversation'
import { getQuestList } from '@/pages/SystemMessage/message/service'
import ApprovalDetail from '@/pages/SystemMessage/message/components/approvalDetail'
import ChatUI from '@/pages/customerservice/support/conversation' //智慧客服
@connect(({ dashboard, loading }) => ({
...dashboard,
downlistLoading: loading.effects['dashboard/fetchDowntlist'],
@ -30,7 +31,8 @@ class manager extends PureComponent {
detailId: '1', // 公告id
noticeDetail: false, // 公告弹窗
questData: {},//问卷数据
questVisible: false, //问卷弹窗
questVisible: false,//问卷弹窗
mainDetail: false, // 审批单消息弹窗
isModalVisible: false, //智慧客服
isFlash: false, //智慧客服
isCloseWs: true, //智慧客服
@ -65,6 +67,10 @@ class manager extends PureComponent {
type: "dashboard/fetchtlistre",
payload: { pageNo: 1, pageSize: 7 }
})
this.props.dispatch({
type: "dashboard/fetchtClarify",
payload: { authorizestate: '0', templatetype: '4', size: 6 }
})
NTKF_PARAM = {
siteid: "bl_1000",                    //企业ID,为固定值
settingid: "bl_1000_1492484340268",           //接待组ID为固定值必填
@ -80,6 +86,7 @@ class manager extends PureComponent {
this.setState({staffId: userData.userId})
this.setState({staffName: userData.fullName})
this.setState({supplierNumber: userData? userData.organizationId: 'EMPTY'})
this.approvalDetail()
}
onChange = (date, dateString) => {
this.setState({
@ -106,7 +113,8 @@ class manager extends PureComponent {
}
closeModel = () => { // 关闭消息弹窗
this.setState({
messageDetail: false
messageDetail: false,
mainDetail: false,
})
}
lookInfo = (id) => { // 公告查看
@ -120,17 +128,22 @@ class manager extends PureComponent {
noticeDetail: false
})
}
approvalDetail = () => { // 审批单消息查看详情
this.setState({
mainDetail: true
})
}
toParticipate = async (servicecode) => {//问卷调查弹窗
const { questId } = JSON.parse(servicecode);
await getQuestList({ id: questId }).then(res => {
if (res?.code == 200 && res?.success) {
this.setState({
questData: res?.data,
questVisible: true,
})
}
if (res?.code == 200 && res?.success) {
this.setState({
questData: res?.data,
questVisible: true,
})
}
})
}
}
closeParticipate = () => { // 关闭问卷调查弹窗
this.setState({
questVisible: false
@ -159,26 +172,27 @@ class manager extends PureComponent {
history.push('/ProjectLayout/Manager/HomePageSectionList');
};
render() {
const { downlist, projectlist, staloading, tlist, trelist } = this.props;
const { datevalue, messId, messageDetail, detailId, noticeDetail, questData, questVisible, isModalVisible, isCloseWs, optionsModal, projectModal, supplierNumber, staffId, staffName,} = this.state; //智慧客服
const { downlist, projectlist, staloading, tlist, trelist, idList, dateNum } = this.props;
const { datevalue, messId, messageDetail, detailId, noticeDetail, questData, questVisible, mainDetail, isModalVisible, isCloseWs, optionsModal, projectModal, supplierNumber, staffId, staffName, } = this.state;
return (
<>
{
START_ENV == 'UAT' || START_ENV == 'DEV' || START_ENV == 'sim' ? '' :
<a className="talk" onClick={() => this.talkXy()}>咨询服务<span>8:30</span><span>|</span><span>12:30</span><span>13:00</span><span>|</span><span>17:00</span><img src={talkPng} /></a>
START_ENV == 'UAT' || START_ENV == 'DEV' || START_ENV == 'sim' ? '' :
<a className="talk" onClick={() => this.talkXy()}>咨询服务<span>8:30</span><span>|</span><span>12:30</span><span>13:00</span><span>|</span><span>17:00</span><img src={talkPng} /></a>
}
<div className="dashboard" style={{ height: innerHeight - 70, overflow: "hidden" }}>
<Row className="topt">
<Col span={8}><Card title="我的消息" bordered={false} className="cardtre" style={{ marginRight: "10px" }} extra={<div className="moret" onClick={() =>{
/*history.push('/SystemMessage/message')*/
if(isCloseWs){
<Col span={8}><Card title="我的消息" bordered={false} className="cardtre" style={{ marginRight: "10px" }} extra={<div className="moret" onClick={() => {
//history.push('/SystemMessage/message')
//智慧客服
if(isCloseWs){
this.setState({optionsModal: true})
}else{
this.setState({isModalVisible: true})
this.setState({isCloseWs: false})
this.setState({isFlash :false})
}
}}>更多<RightOutlined /></div>}>
}}>更多<RightOutlined /></div>}>
{trelist != [] && trelist.map((item, index) => {
return (
<div onClick={() => { item.templatetype == '3' ? this.toParticipate(item.servicecode) : this.lookDetail(item.msgId) }} className="messagetre" key={item.id}>
@ -295,11 +309,14 @@ class manager extends PureComponent {
/></Card></Col>
</Row>
</div>
{messageDetail ? <MessageDetail messId={messId} onCancel={() => { this.closeModel(), this.props.dispatch({type: "dashboard/fetchtlistre", payload: { pageNo: 1, pageSize: 7 }}) }} modalVisible={messageDetail} /> : null}
{questVisible ? <QuestDetail questData={questData} onCancel={() => { this.closeParticipate(), this.props.dispatch({type: "dashboard/fetchtlistre", payload: { pageNo: 1, pageSize: 7 }}) }} modalVisible={questVisible} /> : null}
{messageDetail ? <MessageDetail messId={messId} onCancel={() => { this.closeModel(), this.props.dispatch({ type: "dashboard/fetchtlistre", payload: { pageNo: 1, pageSize: 7 } }) }} modalVisible={messageDetail} /> : null}
{questVisible ? <QuestDetail questData={questData} onCancel={() => { this.closeParticipate(), this.props.dispatch({ type: "dashboard/fetchtlistre", payload: { pageNo: 1, pageSize: 7 } }) }} modalVisible={questVisible} /> : null}
{noticeDetail && <NoticeDetail detailId={detailId} onCancel={() => { this.noticeModel() }} modalVisible={noticeDetail} />}
{/*智慧客服*/}
<ChatUI
{
idList.length > 0 ? <ApprovalDetail approvalId={idList[0]} dateNum={dateNum} trelist={idList} onCancel={() => { this.closeModel(), this.props.dispatch({ type: "dashboard/fetchtClarify", payload: { authorizestate: '0', templatetype: '4', size: 6 } }) }} modalVisible={mainDetail} /> : null
}
{/*智慧客服*/}
<ChatUI
openProjectWin={()=>{
this.setState({projectModal: true})
}}

View File

@ -15,6 +15,7 @@ import MessageDetail from '@/pages/SystemMessage/message/components/messageDetai
import NoticeDetail from '@/pages/notice/noticeList/components/NoticeDetail'
import QuestDetail from '@/pages/SystemMessage/message/components/questDetail'
import { getQuestList } from '@/pages/SystemMessage/message/service'
import ApprovalDetail from '@/pages/SystemMessage/message/components/approvalDetail'
@connect(({ dashboard, loading }) => ({
...dashboard,
@ -30,7 +31,8 @@ class manager extends PureComponent {
detailId: '1', // 公告id
noticeDetail: false, // 公告弹窗
questData: {},//问卷数据
questVisible: false //问卷弹窗
questVisible: false, //问卷弹窗
mainDetail: false, // 审批单消息弹窗
}
componentDidMount() {
this.props.dispatch({
@ -49,6 +51,10 @@ class manager extends PureComponent {
type: "dashboard/fetchtlistre",
payload: { pageNo: 1, pageSize: 7 }
})
this.props.dispatch({
type: "dashboard/fetchtClarify",
payload: { authorizestate: '0', templatetype: '4', size: 6 }
})
NTKF_PARAM = {
siteid: "bl_1000",                    //企业ID,为固定值
settingid: "bl_1000_1492484340268",           //接待组ID为固定值必填
@ -58,6 +64,7 @@ class manager extends PureComponent {
userlevel: "1",                       //网站自定义会员级别1-N可根据选择判断取值显示到小能客户端
erpparam: "abc"                          //erpparam为erp功能的扩展字段可选购买erp功能后用于erp功能集成
}
this.approvalDetail()
}
onChange = (date, dateString) => {
this.setState({
@ -84,7 +91,8 @@ class manager extends PureComponent {
}
closeModel = () => { // 关闭消息弹窗
this.setState({
messageDetail: false
messageDetail: false,
mainDetail: false,
})
}
lookInfo = (id) => { // 公告查看
@ -98,17 +106,22 @@ class manager extends PureComponent {
noticeDetail: false
})
}
approvalDetail = () => { // 审批单消息查看详情
this.setState({
mainDetail: true
})
}
toParticipate = async (servicecode) => {//问卷调查弹窗
const { questId } = JSON.parse(servicecode);
await getQuestList({ id: questId }).then(res => {
if (res?.code == 200 && res?.success) {
this.setState({
questData: res?.data,
questVisible: true,
})
}
if (res?.code == 200 && res?.success) {
this.setState({
questData: res?.data,
questVisible: true,
})
}
})
}
}
closeParticipate = () => { // 关闭问卷调查弹窗
this.setState({
questVisible: false
@ -119,20 +132,20 @@ class manager extends PureComponent {
history.push('/ProjectLayout/Manager/HomePageSectionList');
};
talkXy = () => {
if(NTKF){
if (NTKF) {
NTKF.im_openInPageChat('bl_1000_1492484340268');
} else {
message.warn('小优客服初始化失败,请联系系统管理员!')
}
}
render() {
const { downlist, projectlist, staloading, tlist, trelist } = this.props;
const { datevalue, messId, messageDetail, detailId, noticeDetail, questData, questVisible } = this.state;
const { downlist, projectlist, staloading, tlist, trelist, idList, dateNum } = this.props;
const { datevalue, messId, messageDetail, detailId, noticeDetail, questData, questVisible, mainDetail } = this.state;
return (
<>
{
START_ENV == 'UAT' || START_ENV == 'DEV' || START_ENV == 'sim' ? '' :
<a className="talk" onClick={() => this.talkXy()}>咨询服务<span>8:30</span><span>|</span><span>12:30</span><span>13:00</span><span>|</span><span>17:00</span><img src={talkPng} /></a>
<a className="talk" onClick={() => this.talkXy()}>咨询服务<span>8:30</span><span>|</span><span>12:30</span><span>13:00</span><span>|</span><span>17:00</span><img src={talkPng} /></a>
}
<div className="dashboard" style={{ height: innerHeight - 70, overflow: "hidden" }}>
<Row className="topt">
@ -249,9 +262,12 @@ class manager extends PureComponent {
/></Card></Col>
</Row>
</div>
{messageDetail ? <MessageDetail messId={messId} onCancel={() => { this.closeModel(), this.props.dispatch({type: "dashboard/fetchtlistre", payload: { pageNo: 1, pageSize: 7 }}) }} modalVisible={messageDetail} /> : null }
{questVisible ? <QuestDetail questData={questData} onCancel={() => { this.closeParticipate(), this.props.dispatch({type: "dashboard/fetchtlistre", payload: { pageNo: 1, pageSize: 7 }}) }} modalVisible={questVisible} /> : null}
{messageDetail ? <MessageDetail messId={messId} onCancel={() => { this.closeModel(), this.props.dispatch({ type: "dashboard/fetchtlistre", payload: { pageNo: 1, pageSize: 7 } }) }} modalVisible={messageDetail} /> : null}
{questVisible ? <QuestDetail questData={questData} onCancel={() => { this.closeParticipate(), this.props.dispatch({ type: "dashboard/fetchtlistre", payload: { pageNo: 1, pageSize: 7 } }) }} modalVisible={questVisible} /> : null}
{noticeDetail && <NoticeDetail detailId={detailId} onCancel={() => { this.noticeModel() }} modalVisible={noticeDetail} />}
{
idList.length > 0 ? <ApprovalDetail approvalId={idList[0]} dateNum={dateNum} trelist={idList} onCancel={() => { this.closeModel(), this.props.dispatch({ type: "dashboard/fetchtClarify", payload: { authorizestate: '0', templatetype: '4', size: 6 } }) }} modalVisible={mainDetail} /> : null
}
</>
)
}