采购经理、供应商、代理商嵌入客服

This commit is contained in:
unknown
2022-08-24 15:47:53 +08:00
parent 5821868d56
commit 8a7b0e1dae
10 changed files with 592 additions and 279 deletions

View File

@ -1,5 +1,5 @@
import React, { useState, useRef, useEffect } from 'react';
import { Button, Card } from 'antd';
import { Button, Card, message } from 'antd';
import ProTable, { ProColumns, ActionType } from '@ant-design/pro-table';
import { addInvoice, getList } from './service';
import EditInvoiceSupplier from './components/EditInvoiceSupplier';
@ -7,6 +7,9 @@ import { handleUpdate } from './utils';
import ViewInvoiceSupplier from './components/ViewInvoiceSupplier';
import '@/assets/zjl_style.less';
import { btnAuthority } from '@/utils/authority';
import kefu from '@/assets/img/kefu.png' //智慧客服
import {windowOpenChatUI} from '@/utils/CustomerService' //智慧客服
import { getSessionUserData } from "@/utils/session";
const InvoiceSupplier: React.FC<{}> = () => {
const actionRef = useRef<ActionType>();
@ -45,6 +48,14 @@ const InvoiceSupplier: React.FC<{}> = () => {
dataIndex: 'projectName',
key: 'projectName',
},
{
title: '我要咨询',
dataIndex: 'consult',
width: '5%',
render: (text: any, record: any) => (
<span onClick={()=>{initChatUI(record)}}><img style={{width:20,height:20, cursor:'pointer'}} src={kefu} alt="" /></span>
),
},
{
title: '公司名称',
dataIndex: 'companyName',
@ -96,6 +107,78 @@ const InvoiceSupplier: React.FC<{}> = () => {
),
},
];
const initChatUI = (record:any)=>{//智慧客服-创建临时表单
let roleAuthority: any | null = sessionStorage.getItem('roleAuthority');
const inputList = [
{
label:null,
paraName:'origin',
isEncode:false,
paraVal:'eBid',
},
{
label:null,
paraName:'tenderAgencyId',
isEncode:false,
paraVal:'EMPTY',
},
{
label:null,
paraName:'tenderAgencyName',
isEncode:true,
paraVal:'招投标客服',
},
{
label:null,
paraName:'roleAuthority',
isEncode:false,
paraVal:JSON.parse(roleAuthority)[0],
},
{
label:null,
paraName:'module',
isEncode:false,
paraVal:'2',
},
{
label:null,
paraName:'custType',
isEncode:false,
paraVal:'2',
},
{
label:'项目名称',
paraName:'projectName',
isEncode:true,
paraVal:record.projectName,
},
{
label:'公司名称',
paraName:'companyName',
isEncode:true,
paraVal:record.companyName,
},
{
label:'发票类型',
paraName:'fptype',
isEncode:true,
paraVal:record.type=='0'?'增值税普通发票':record.type=='1'?'增值税专用发票':'-',
},
{
label:'发票状态',
paraName:'fpstate',
isEncode:true,
paraVal:record.state=='0'?'未开':record.state=='1'?'已开':'-',
},
{
label:'是否需要邮寄',
paraName:'isMail',
isEncode:true,
paraVal:record.isMail==-1?'无需邮寄':'需要邮寄',
},
]
windowOpenChatUI(inputList, window.location.pathname)
}
return (
<Card
title="我的发票列表"