This commit is contained in:
linxd
2025-07-15 15:19:59 +08:00
20 changed files with 283 additions and 103 deletions

View File

@ -9,6 +9,7 @@ import CreateModal from './components/CreateModal';
import CategorySelector from '@/components/CategorySelector';
//接口
import { getPage, startApprove } from './services'
import { getDictList } from '@/servers/api/dicts'
//统一列表分页
import tableProps from '@/utils/tableProps'
const { Option } = Select;
@ -20,6 +21,11 @@ interface Data {
createTime: string;
approveStatus: string;
}
interface Dict {
dicName: string;
code: string;
}
const SupplierCategoryEntry: React.FC = () => {
// 查询
@ -30,6 +36,8 @@ const SupplierCategoryEntry: React.FC = () => {
const [modalInfo, setModalInfo] = useState<{ type: string; visible: boolean; record?: any }>({ type: '', visible: false, });
//列表分页
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
//
const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
//列表加载
const [loading, setLoading] = useState(false);
// 列表方法
@ -49,6 +57,11 @@ const SupplierCategoryEntry: React.FC = () => {
useEffect(() => {
const values = form.getFieldsValue();
getList(values, 1, 10);
getDictList('approve_type').then((res) => {
if (res.code == 200) {
setEnterpriseType(res.data)
}
})
}, []);
//开启弹窗
const openModal = (type: string, record?: any) => {
@ -93,7 +106,7 @@ const SupplierCategoryEntry: React.FC = () => {
{ title: '准入部门', ellipsis: true, width: 120, dataIndex: 'deptId' },
{ title: '准入方式', ellipsis: true, width: 120, dataIndex: 'accessTypeText' },
{ title: '申请时间', dataIndex: 'createTime', width: 180 },
{ title: '状态', ellipsis: true, width: 120, dataIndex: 'approveStatusText' },
{ title: '审批状态', ellipsis: true, width: 120, dataIndex: 'approveStatusText' },
{
title: '操作',
width: 140,
@ -129,12 +142,11 @@ const SupplierCategoryEntry: React.FC = () => {
<Form.Item name="categoryId" label="准入品类">
<CategorySelector multiple={false} style={{ width: 150 }} />
</Form.Item>
<Form.Item name="approveStatus" label="状态">
<Form.Item name="approveStatus" label="审批状态">
<Select style={{ width: 150 }} placeholder="请选择状态" allowClear>
<Option value="0"></Option>
<Option value="1"></Option>
<Option value="2"></Option>
<Option value="3"></Option>
{enterpriseType?.map(item => (
<Select.Option key={item.code} value={item.code}>{item.dicName}</Select.Option>
))}
</Select>
</Form.Item>
@ -159,7 +171,7 @@ const SupplierCategoryEntry: React.FC = () => {
dataSource={data}
columns={columns}
loading={loading}
pagination={{...tableProps.pagination, total: pagination.total }}
pagination={{ ...tableProps.pagination, total: pagination.total }}
onChange={(pagination) => {
const values = form.getFieldsValue();
getList(values, pagination.current!, pagination.pageSize!)

View File

@ -4,6 +4,7 @@ import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
import type { ColumnsType } from 'antd/es/table';
//接口
import { getApprovePage } from './services';
import { getDictList } from '@/servers/api/dicts'
//组件
import ViewModal from './components/ViewModal';
//统一列表分页
@ -35,7 +36,10 @@ const deptOptions = [
{ label: '采购部', value: 'DEPT001' },
{ label: '业务部', value: 'DEPT002' },
];
interface Dict {
dicName: string;
code: string;
}
const SupplierEntryReview: React.FC = () => {
const [form] = Form.useForm();
@ -43,6 +47,8 @@ const SupplierEntryReview: React.FC = () => {
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
const [loading, setLoading] = useState(false);
const [modalInfo, setModalInfo] = useState<ModalInfo>({ visible: false, record: null });
//
const [enterpriseType, setEnterpriseType] = useState<Dict[]>();
// 查询数据
const fetchData = async (params = {}) => {
setLoading(true);
@ -74,6 +80,11 @@ const SupplierEntryReview: React.FC = () => {
useEffect(() => {
fetchData({ pageNo: 1 });
getDictList('approve_type').then((res) => {
if (res.code == 200) {
setEnterpriseType(res.data)
}
})
}, []);
// 表格分页切换
@ -165,13 +176,13 @@ const SupplierEntryReview: React.FC = () => {
width: 180,
},
{
title: '流程状态',
title: '评审状态',
dataIndex: 'reviewStatusText',
align: 'center',
width: 120,
},
{
title: '审',
title: '审批状态',
dataIndex: 'approveStatusText',
align: 'center',
width: 120,
@ -210,12 +221,11 @@ const SupplierEntryReview: React.FC = () => {
<Select options={deptOptions} allowClear style={{ width: 120 }} placeholder="请选择准入部门" />
</Form.Item>
<Form.Item name="approveStatus" label="流程状态">
<Form.Item name="approveStatus" label="审批状态">
<Select style={{ width: 150 }} placeholder="请选择状态" allowClear>
<Option value="0"></Option>
<Option value="1"></Option>
<Option value="2"></Option>
<Option value="3"></Option>
{enterpriseType?.map(item => (
<Select.Option key={item.code} value={item.code}>{item.dicName}</Select.Option>
))}
</Select>
</Form.Item>

View File

@ -8,6 +8,7 @@ import ReviewerSelector from './ReviewerSelector';
import DivisionModal from './DivisionModal';
// 请求
import { categoryTree, add, uploadFile } from '../services';
const { Option } = Select;
const { RangePicker } = DatePicker;
//selected 类型
@ -232,8 +233,10 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi
if (code == 200) {
setCategoriesTreeData(data)
}
})
form.setFieldsValue({ method: 'online' });
}
}, [visible, form]);

View File

@ -96,7 +96,18 @@ const AccessManagement: React.FC = () => {
{ title: '准入部门', ellipsis: true, width: 120, dataIndex: 'deptId' },
{ title: '准入方式', ellipsis: true, width: 120, dataIndex: 'accessTypeText' },
{ title: '申请时间', ellipsis: true, width: 180, dataIndex: 'createTime' },
{ title: '状态', dataIndex: 'reviewStatusText', width: 80, },
{
title: '评审状态',
dataIndex: 'reviewStatusText',
key: 'reviewStatusText',
width: 120,
},
{
title: '审批状态',
dataIndex: 'approveStatusText',
key: 'approveStatusText',
width: 120,
},
{
title: '操作',
width: 200,
@ -139,8 +150,8 @@ const AccessManagement: React.FC = () => {
<Form.Item name="categoryId" label="准入品类">
<CategorySelector multiple={false} style={{ width: 150 }} />
</Form.Item>
<Form.Item name="approveStatus" label="状态">
<Select style={{ width: 150 }} placeholder="请选择状态" allowClear>
<Form.Item name="approveStatus" label="评审状态">
<Select style={{ width: 150 }} placeholder="请选择评审状态" allowClear>
<Option value="0"></Option>
<Option value="1"></Option>
<Option value="2"></Option>

View File

@ -146,6 +146,12 @@ const CooperateEnterprise: React.FC = () => {
key: 'reviewStatusText',
width: 120,
},
{
title: '审批状态',
dataIndex: 'approveStatusText',
key: 'approveStatusText',
width: 120,
},
{
title: '操作',
width: 140,

View File

@ -55,7 +55,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
setLoading(true);
try {
const values = form.getFieldsValue();
const { code, data, message } = await getCategoryPage({ pageNo, pageSize , id:record, ...values});
const { code, data, message } = await getCategoryPage({ pageNo, pageSize , supplierId:record, ...values});
if (code === 200) {
setData(data.records);
setPagination({ current: pageNo, pageSize, total: data.total });

View File

@ -17,6 +17,7 @@ interface getCategoryPage {
pageNo: number;
pageSize: number;
categoryNames?: string;
supplierId?: string;
}
export const getCategoryPage = (data: getCategoryPage) => request.post('/coscoSupplierBase/getCategoryPage', { data });

View File

@ -51,7 +51,7 @@ const SupplierAccessDetailModal: React.FC<SupplierAccessDetailModalProps> = ({ v
setLoading(true);
try {
const values = form.getFieldsValue();
const { code, data, message } = await getCategoryPage({ pageNo, pageSize, id: record, ...values});
const { code, data, message } = await getCategoryPage({ pageNo, pageSize, supplierId: record, ...values});
if (code === 200) {
setData(data.records);
setPagination({ current: pageNo, pageSize, total: data.total });

View File

@ -13,6 +13,7 @@ interface getCategoryPage {
pageNo: number;
pageSize: number;
categoryNames?: string;
supplierId?: string;
}
export const getCategoryPage = (data: getCategoryPage) => request.post('/coscoSupplierBase/getCategoryPage', { data });

View File

@ -1,5 +1,5 @@
import React, { useEffect , useState } from "react";
import { Modal, Button, Select, Input, Table, message, Form } from "antd";
import { Modal, Button, Select, Input, Table, message, Form, Tooltip } from "antd";
import SupplierSelectModal from "./SupplierSelectModal";
import { blacklist, getAllList } from "../services";
import type { ColumnsType } from 'antd/es/table';
@ -86,7 +86,13 @@ const CreateBlacklistModal: React.FC<CreateBlacklistModalProps> = ({
}
}, [visible]);
const columns: ColumnsType<Supplier> = [
{ title: "供应商名称", dataIndex: "supplierName", align: "center" },
{ title: '供应商名称', dataIndex: 'name', ellipsis: true, width: 160, render: (_: any, record: any) => {
const name = record.supplierType === "ovs"? record.nameEn : record.name;
return(
<Tooltip placement="topLeft" title={name}>
{name}
</Tooltip>)
} },
{ title: "准入部门", dataIndex: "unit", align: "center" },
{ title: "准入时间", dataIndex: "accessTime", align: "center", render: () => "2023-04-20 13:00" },
{ title: "准入品类", dataIndex: "categoryName", align: "center" },
@ -123,6 +129,8 @@ const CreateBlacklistModal: React.FC<CreateBlacklistModalProps> = ({
rowKey="id"
bordered
pagination={false}
style={{ flex: 1, minHeight: 0 }}
scroll={{ y: 'calc(100vh - 650px)' }}
/>
<div style={{ marginTop: 24 }}>

View File

@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react";
import {
Modal, Table, Button, Checkbox, Row, Col, Input, Select, Form, Space, message
Modal, Table, Button, Checkbox, Row, Col, Input, Select, Form, Space, message, Tooltip
} from "antd";
import { getSupplierCategoryPage } from '../services';
import CategorySelector from '@/components/CategorySelector';
@ -52,7 +52,7 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
const fetchData = async (params: any = {}, pageNo = 1, pageSize = 5) => {
setLoading(true);
try {
const res = await getSupplierCategoryPage({ ...params, pageNo, pageSize });
const res = await getSupplierCategoryPage({ ...params, basePageRequest: { pageNo, pageSize } });
if (res.code === 200) {
setData(res.data.records);
setPagination({ current: pageNo, pageSize: pageSize, total: res.data.total });
@ -100,9 +100,9 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
onChange={e => {
setLeftSelected(e.target.checked ? data.map(i => i.id) : []);
}}
></Checkbox>,
></Checkbox>,
dataIndex: "select",
width: 80,
width: 40,
render: (_: any, record: Supplier) => (
<Checkbox
checked={leftSelected.includes(record.id)}
@ -111,11 +111,22 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
? [...leftSelected, record.id]
: leftSelected.filter(id => id !== record.id));
}}
></Checkbox>
></Checkbox>
)
},
{ title: "供应商名称", dataIndex: "supplierName", ellipsis: true },
{ title: "准入品类", dataIndex: "categoryName" }
{ title: '供应商名称', dataIndex: 'name', ellipsis: true, width: 160, render: (_: any, record: any) => {
const name = record.supplierType === "ovs"? record.nameEn : record.name;
return(
<Tooltip placement="topLeft" title={name}>
{name}
</Tooltip>)
} },
{ title: "准入品类", dataIndex: "categoryName", ellipsis: true, width: 100, render: (_: any, record: any) => {
return(
<Tooltip placement="topLeft" title={record.categoryName}>
{record.categoryName}
</Tooltip>)
} }
];
const rightColumns = [
@ -126,9 +137,9 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
onChange={e => {
setRightSelected(e.target.checked ? rightData.map(i => i.id) : []);
}}
></Checkbox>,
></Checkbox>,
dataIndex: "select",
width: 80,
width: 40,
render: (_: any, record: Supplier) => (
<Checkbox
checked={rightSelected.includes(record.id)}
@ -137,11 +148,22 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
? [...rightSelected, record.id]
: rightSelected.filter(id => id !== record.id));
}}
></Checkbox>
></Checkbox>
)
},
{ title: "供应商名称", dataIndex: "supplierName", ellipsis: true },
{ title: "准入品类", dataIndex: "categoryName" }
{ title: '供应商名称', dataIndex: 'name', ellipsis: true, width: 160, render: (_: any, record: any) => {
const name = record.supplierType === "ovs"? record.nameEn : record.name;
return(
<Tooltip placement="topLeft" title={name}>
{name}
</Tooltip>)
} },
{ title: "准入品类", dataIndex: "categoryName", ellipsis: true, width: 100, render: (_: any, record: any) => {
return(
<Tooltip placement="topLeft" title={record.categoryName}>
{record.categoryName}
</Tooltip>)
} }
];
return (

View File

@ -96,11 +96,11 @@ const blacklistManage: React.FC = () => {
width: 60,
render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
},
{ title: "申请主题", dataIndex: "exitTheme", key: "exitTheme", align: "left" },
{ title: "发起单位", dataIndex: "deptId", key: "deptId", align: "center" },
{ title: "申请主题", dataIndex: "themeName", key: "themeName", align: "left", ellipsis: true },
{ title: "发起单位", dataIndex: "unitName", key: "unitName", align: "center" },
{ title: "发起部门", dataIndex: "deptName", key: "deptName", align: "center" },
{ title: "发起时间", dataIndex: "createTime", key: "createTime", align: "center", width: 180 },
{ title: "审批记录状态", dataIndex: "approveStatusText", key: "approveStatusText", align: "center" },
{ title: "审批记录状态", dataIndex: "approveStatusName", key: "approveStatusName", align: "center" },
{
title: "操作",
key: "option",
@ -170,7 +170,13 @@ const blacklistManage: React.FC = () => {
scroll={{ y: 'calc(100vh - 350px)' }}
/>
</div>
<CreateBlacklistModal visible={createVisible} onCancel={() => setCreateVisible(false)} onOk={() => setCreateVisible(false)} />
<CreateBlacklistModal
visible={createVisible}
onCancel={() => setCreateVisible(false)}
onOk={() => {
setCreateVisible(false)
handleSearch
}} />
<ViewBlacklistModal
visible={viewVisible}
recordId={selectedRecordId || ''}

View File

@ -22,8 +22,7 @@ export const getPage = (data: getPageData) => request.post('/black/blacklist/get
* 供应商分页列表查询
*/
interface getSupplierCategoryPageData {
pageNo: number;
pageSize: number;
basePageRequest: basePageRequest;
supplierName?: number;
categoryId?: string;
reviewResult?: string;
@ -31,11 +30,15 @@ interface getSupplierCategoryPageData {
name?: string;
}
interface basePageRequest {
pageNo: number;
pageSize: number;
}
export const getSupplierCategoryPage = (data: getSupplierCategoryPageData) => request.post('/coscoSupplierexit/getSupplierCategoryPage', { data });
export const getSupplierCategoryPage = (data: getSupplierCategoryPageData) => request.post('/coscoSupplierBase/getSupplierPage', { data });
// /coscoSupplierBase/getSupplierPage

View File

@ -170,7 +170,7 @@ const SupplierMessage: React.FC = () => {
{viewRecord && (
<Descriptions bordered column={1} size="small">
<Descriptions.Item labelStyle={{ width: '120px' }} label="消息内容">{viewRecord.content}</Descriptions.Item>
<Descriptions.Item label="业务类型">{viewRecord.type}</Descriptions.Item>
<Descriptions.Item label="业务类型">{viewRecord.typeCn}</Descriptions.Item>
<Descriptions.Item label="接收时间">{viewRecord.createTime}</Descriptions.Item>
</Descriptions>
)}