联系人
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Table, Button, message, Switch, Popconfirm } from 'antd';
|
||||
import { Table, Button, message, Switch, Popconfirm, Tooltip } from 'antd';
|
||||
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
|
||||
import { getCoscoSupplierUserPage, editType, coscoSupplierUserDel } from '../services';
|
||||
import { useIntl } from 'umi';
|
||||
@ -17,6 +17,12 @@ interface getCoscoSupplierUser {
|
||||
certificateUrl?: string;
|
||||
delFlag: string;
|
||||
type: string;
|
||||
coscoSupplierUserCategoryList?: CoscoSupplierUserCategory[];
|
||||
}
|
||||
interface CoscoSupplierUserCategory {
|
||||
categoryId:string;
|
||||
categoryName:string;
|
||||
supplierUserId:string;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
@ -86,6 +92,7 @@ const OtherAttachmentsTab: React.FC<Props> = (props) => {
|
||||
};
|
||||
//是否为主联系人
|
||||
const handleObsoleteChange = async (checked: boolean, id: string) => {
|
||||
if(!checked) return
|
||||
// 调用你的作废接口
|
||||
const res = await editType({ id, supplierId: record });
|
||||
if (res.code === 200) {
|
||||
@ -124,6 +131,29 @@ const OtherAttachmentsTab: React.FC<Props> = (props) => {
|
||||
dataIndex: 'contactsEmail',
|
||||
key: 'contactsEmail',
|
||||
},
|
||||
{
|
||||
title: '负责品类',
|
||||
dataIndex: 'coscoSupplierUserCategoryList',
|
||||
key: 'coscoSupplierUserCategoryList',
|
||||
ellipsis: true,
|
||||
width: 160,
|
||||
render: (value: { categoryName: string }[] = []) => {
|
||||
if (!value || value.length === 0) return '-';
|
||||
if (value.length === 1) {
|
||||
return <span>{value[0].categoryName}</span>;
|
||||
}
|
||||
// 多于1条
|
||||
const allNames = value.map(item => item.categoryName).join('、');
|
||||
return (
|
||||
<Tooltip title={allNames} overlayStyle={{ zIndex: 1200 }}>
|
||||
<span>
|
||||
{value[0].categoryName}
|
||||
<span>等</span>
|
||||
</span>
|
||||
</Tooltip>
|
||||
);
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: '是否为主联系人',
|
||||
@ -181,7 +211,7 @@ const OtherAttachmentsTab: React.FC<Props> = (props) => {
|
||||
rowKey="id"
|
||||
columns={columns.map(column => ({
|
||||
...column,
|
||||
title: intl.formatMessage({ id: column.title as string })
|
||||
title: column.title
|
||||
}))}
|
||||
dataSource={data}
|
||||
pagination={pagination}
|
||||
|
Reference in New Issue
Block a user