带录入 供应商名称 点击
This commit is contained in:
@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
|
|||||||
import { Modal, Input, Button, Form, Table, Tooltip } from 'antd';
|
import { Modal, Input, Button, Form, Table, Tooltip } from 'antd';
|
||||||
import { coscoSupplierBase } from '../services';
|
import { coscoSupplierBase } from '../services';
|
||||||
import RegionTypeSelect from '@/components/CommonSelect/RegionTypeSelect'
|
import RegionTypeSelect from '@/components/CommonSelect/RegionTypeSelect'
|
||||||
|
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||||
|
|
||||||
const SupplierSelector: React.FC<{
|
const SupplierSelector: React.FC<{
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
@ -21,6 +22,7 @@ const SupplierSelector: React.FC<{
|
|||||||
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
|
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
|
||||||
// 加载态
|
// 加载态
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
|
const supplierDetailModal = useSupplierDetailModal();
|
||||||
|
|
||||||
// 查询
|
// 查询
|
||||||
const getTableList = async (values: any = {}, pageNo: number = 1, pageSize: number = 10) => {
|
const getTableList = async (values: any = {}, pageNo: number = 1, pageSize: number = 10) => {
|
||||||
@ -59,7 +61,7 @@ const SupplierSelector: React.FC<{
|
|||||||
const name = record.supplierType === "ovs" ? record.nameEn : record.name;
|
const name = record.supplierType === "ovs" ? record.nameEn : record.name;
|
||||||
return (
|
return (
|
||||||
<Tooltip placement="topLeft" title={name}>
|
<Tooltip placement="topLeft" title={name}>
|
||||||
{name}
|
<a onClick={() => supplierDetailModal?.(record.id)}>{name || ''}</a>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { Table, Form, Input, Button, Row, Col, DatePicker, Tabs, Space, message } from 'antd';
|
import { Table, Form, Input, Button, Row, Col, DatePicker, Tabs, Space, Tooltip } from 'antd';
|
||||||
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||||
import type { ColumnsType } from 'antd/es/table';
|
import type { ColumnsType } from 'antd/es/table';
|
||||||
//组件
|
//组件
|
||||||
@ -9,6 +9,7 @@ import SupplierExitModal from './components/SupplierExitModal';
|
|||||||
import { getPageAgent } from './services';
|
import { getPageAgent } from './services';
|
||||||
//统一列表分页
|
//统一列表分页
|
||||||
import tableProps from '@/utils/tableProps'
|
import tableProps from '@/utils/tableProps'
|
||||||
|
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||||
|
|
||||||
const { RangePicker } = DatePicker;
|
const { RangePicker } = DatePicker;
|
||||||
const { TabPane } = Tabs;
|
const { TabPane } = Tabs;
|
||||||
@ -33,6 +34,7 @@ const SupplierRegisterAgent: React.FC = () => {
|
|||||||
// 新增与修改
|
// 新增与修改
|
||||||
const [exitModalVisible, setExitModalVisible] = useState(false);
|
const [exitModalVisible, setExitModalVisible] = useState(false);
|
||||||
const [exitId, setExitId] = useState('');
|
const [exitId, setExitId] = useState('');
|
||||||
|
const supplierDetailModal = useSupplierDetailModal();
|
||||||
|
|
||||||
// 查询数据
|
// 查询数据
|
||||||
const fetchData = async (page = 1, pageSize = 10) => {
|
const fetchData = async (page = 1, pageSize = 10) => {
|
||||||
@ -95,11 +97,18 @@ const SupplierRegisterAgent: React.FC = () => {
|
|||||||
width: 80,
|
width: 80,
|
||||||
render: (_: any, __: any, idx: number) => ((pagination.current - 1) * pagination.pageSize) + idx + 1,
|
render: (_: any, __: any, idx: number) => ((pagination.current - 1) * pagination.pageSize) + idx + 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '供应商名称',
|
title: "供应商名称", dataIndex: "name", align: "left",
|
||||||
dataIndex: 'name',
|
width: 200,
|
||||||
align: 'left',
|
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
render: (dom, record) => {
|
||||||
|
return (
|
||||||
|
<Tooltip title={record.name} overlayStyle={{ zIndex: 1200 }}>
|
||||||
|
<a onClick={() => supplierDetailModal?.(record.id)}>{record.name || ''}</a>
|
||||||
|
</Tooltip>
|
||||||
|
)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '创建单位',
|
title: '创建单位',
|
||||||
|
Reference in New Issue
Block a user