更新代码

This commit is contained in:
孙景学
2025-07-15 09:07:43 +08:00
parent e1dd6bfa98
commit 658c403dbd
23 changed files with 181 additions and 97 deletions

View File

@ -71,7 +71,7 @@ const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSel
}, [visible])
//供应商名称
const columns = [
{ title: '供应商名称', dataIndex: 'name', ellipsis: true, render: (name: string) => (
{ title: '供应商名称', dataIndex: 'name', ellipsis: true, width: 160, render: (name: string) => (
<Tooltip placement="topLeft" title={name}>
{name}
</Tooltip>

View File

@ -88,12 +88,12 @@ const SupplierCategoryEntry: React.FC = () => {
width: 60,
render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
},
{ title: '准入工作', ellipsis: true, dataIndex: 'accessWorkName' },
{ title: '准入单位', ellipsis: true, dataIndex: 'deptId' },
{ title: '准入部门', ellipsis: true, dataIndex: 'deptId' },
{ title: '准入方式', ellipsis: true, dataIndex: 'accessTypeText' },
{ title: '准入工作', ellipsis: true, width: 120, dataIndex: 'accessWorkName' },
{ title: '准入单位', ellipsis: true, width: 120, dataIndex: 'deptId' },
{ title: '准入部门', ellipsis: true, width: 120, dataIndex: 'deptId' },
{ title: '准入方式', ellipsis: true, width: 120, dataIndex: 'accessTypeText' },
{ title: '申请时间', dataIndex: 'createTime', width: 180 },
{ title: '状态', ellipsis: true, dataIndex: 'approveStatusText' },
{ title: '状态', ellipsis: true, width: 120, dataIndex: 'approveStatusText' },
{
title: '操作',
width: 140,

View File

@ -120,21 +120,25 @@ const SupplierEntryReview: React.FC = () => {
dataIndex: 'accessWorkName',
align: 'center',
ellipsis: true,
width: 120,
},
{
title: '准入部门',
dataIndex: 'deptId',
align: 'center',
width: 120,
},
{
title: '准入方式',
dataIndex: 'accessTypeText',
align: 'center',
ellipsis: true,
width: 120,
},
{
title: '准入品类',
dataIndex: 'categoryNameList',
width: 120,
align: 'center',
render: (_: any, record: any) => {
return (
@ -164,15 +168,18 @@ const SupplierEntryReview: React.FC = () => {
title: '流程状态',
dataIndex: 'reviewStatusText',
align: 'center',
width: 120,
},
{
title: '审核',
dataIndex: 'approveStatusText',
align: 'center',
width: 120,
},
{
title: '操作',
width: 120,
fixed: 'right',
render: (_: any, record: any) => {
return (
<Space>

View File

@ -497,7 +497,7 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi
</Button>
</Form.Item>
</Form>
{/* 供应商选择 */}
<SupplierSelector
visible={supplierModalVisible}
onCancel={() => setSupplierModalVisible(false)}
@ -507,7 +507,7 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi
setSupplierModalVisible(false);
}}
/>
{/* 评审人员选择 */}
<ReviewerSelector
visible={reviewerModalVisible}
onCancel={() => setReviewerModalVisible(false)}
@ -519,7 +519,7 @@ const CreateModal: React.FC<{ visible: boolean; onCancel: () => void; }> = ({ vi
setReviewerModalVisible(false);
}}
/>
{/* 评审分工选择 */}
<DivisionModal
reviewerSelector={selectedReviewers}
visible={divisionModalVisible}

View File

@ -2,6 +2,8 @@ import React, { useState, useEffect, useMemo } from 'react';
import { Modal, Table, Radio, Button, message } from 'antd';
import type { ColumnsType } from 'antd/es/table';
import { getUserPage } from '../services'
// 评审人数据结构
interface Reviewer {
id: string;
@ -23,31 +25,6 @@ interface ReviewerSelectorProps {
leader?: string; // 回显组长userId
}
// 模拟分页接口
const fetchReviewers = async ({
pageNum,
pageSize,
}: {
pageNum: number;
pageSize: number;
}): Promise<{ list: Reviewer[]; total: number }> => {
return new Promise((resolve) => {
setTimeout(() => {
const all: Reviewer[] = Array.from({ length: 36 }, (_, i) => ({
id: `u-${i + 1}`,
name: `评审人${i + 1}`,
userId: `E000${i + 1}`,
deptId: `部门${(i % 3) + 1}`,
isLeader: 0,
}));
resolve({
list: all.slice((pageNum - 1) * pageSize, pageNum * pageSize),
total: all.length,
});
}, 300);
});
};
const ReviewerSelector: React.FC<ReviewerSelectorProps> = ({
visible,
onCancel,
@ -82,19 +59,22 @@ const ReviewerSelector: React.FC<ReviewerSelectorProps> = ({
useEffect(() => {
if (!visible) return;
setLoading(true);
fetchReviewers({ pageNum: page, pageSize })
getUserPage({ basePageRequest: { pageNo: page, pageSize } })
.then((res) => {
setData(res.list);
setTotal(res.total);
const { code, data } = res;
if(code == 200) {
setData(data.records);
setTotal(data.total);
}
})
.finally(() => setLoading(false));
}, [visible, page, pageSize]);
// 当前已选项(全局选中的都能做组长)
const selectedReviewerObjs = useMemo(
() => data.filter((item) => selectedRowKeys.includes(item.userId)),
[data, selectedRowKeys]
);
// const selectedReviewerObjs = useMemo(
// () => data.filter((item) => selectedRowKeys.includes(item.userId)),
// [data, selectedRowKeys]
// );
// 列
const columns: ColumnsType<Reviewer> = [
@ -134,7 +114,8 @@ const ReviewerSelector: React.FC<ReviewerSelectorProps> = ({
...item,
isLeader: item.userId === leaderUserId ? 1 : 0,
}));
console.log(selected);
// 完整数据传回
onSelect?.({
selected,

View File

@ -70,7 +70,7 @@ const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSel
}, [visible])
//供应商名称
const columns = [
{ title: '供应商名称', dataIndex: 'name', ellipsis: true, render: (name: string) => (
{ title: '供应商名称', dataIndex: 'name', ellipsis: true, width: 160, render: (name: string) => (
<Tooltip placement="topLeft" title={name}>
{name}
</Tooltip>

View File

@ -91,15 +91,16 @@ const AccessManagement: React.FC = () => {
width: 80,
render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
},
{ title: '准入工作', ellipsis: true, dataIndex: 'accessWorkName' },
{ title: '准入单位', ellipsis: true, dataIndex: 'deptId' },
{ title: '准入部门', ellipsis: true, dataIndex: 'deptId' },
{ title: '准入方式', ellipsis: true, dataIndex: 'accessTypeText' },
{ title: '申请时间', ellipsis: true, dataIndex: 'createTime' },
{ title: '状态', dataIndex: 'reviewStatusText' },
{ title: '准入工作', ellipsis: true, width: 120, dataIndex: 'accessWorkName' },
{ title: '准入单位', ellipsis: true, width: 120, dataIndex: 'deptId' },
{ 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: '操作',
width: 200,
fixed: 'right',
render: (_: any, record: any) => (
<Space>
<a onClick={() => openModal('view', record)}></a>

View File

@ -68,6 +68,17 @@ interface CoscoAccessWork {
}
export const add = (data: addInterface) => request.post('/coscoAccessWork/add', { data });
interface getUserPage {
basePageRequest: basePageRequest;
}
interface basePageRequest {
pageNo: number;
pageSize: number;
}
export const getUserPage = (data: getUserPage) => request.post('/user/getUserPage', { data });
/**
* 品类选择查询树
*/

View File

@ -94,6 +94,7 @@ const CooperateEnterprise: React.FC = () => {
title: '准入工作',
dataIndex: 'accessWorkName',
key: 'accessWorkName',
width: 120,
ellipsis: true,
},
{
@ -101,14 +102,14 @@ const CooperateEnterprise: React.FC = () => {
dataIndex: 'deptId',
key: 'deptId',
ellipsis: true,
width: 180,
width: 120,
},
{
title: '准入部门',
dataIndex: 'deptId',
key: 'deptId',
ellipsis: true,
width: 180,
width: 120,
},
{
title: '准入品类',
@ -130,7 +131,7 @@ const CooperateEnterprise: React.FC = () => {
dataIndex: 'accessTypeText',
key: 'accessTypeText',
ellipsis: true,
width: 160,
width: 120,
},
{
title: '评审时间',
@ -148,6 +149,7 @@ const CooperateEnterprise: React.FC = () => {
{
title: '操作',
width: 140,
fixed: 'right',
render: (_: any, record: any) => {
// 已完成 3 、结果汇总中 2 、进行中1 、 未开始0
// 显示评审 按钮