This commit is contained in:
linxd
2025-07-16 11:30:08 +08:00
17 changed files with 147 additions and 117 deletions

View File

@ -102,8 +102,8 @@ const SupplierCategoryEntry: React.FC = () => {
render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
},
{ 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: 'orgName' },
{ title: '准入部门', ellipsis: true, width: 120, dataIndex: 'deptName' },
{ title: '准入方式', ellipsis: true, width: 120, dataIndex: 'accessTypeText' },
{ title: '申请时间', dataIndex: 'createTime', width: 180 },
{ title: '审批状态', ellipsis: true, width: 120, dataIndex: 'approveStatusText' },

View File

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

View File

@ -31,12 +31,6 @@ interface ModalInfo {
record: string | null;
}
const deptOptions = [
{ label: '全部', value: '' },
{ label: '采购部', value: 'DEPT001' },
{ label: '业务部', value: 'DEPT002' },
];
interface Dict {
dicName: string;
code: string;
@ -136,7 +130,7 @@ const SupplierEntryReview: React.FC = () => {
},
{
title: '准入部门',
dataIndex: 'deptId',
dataIndex: 'deptName',
align: 'center',
width: 120,
},

View File

@ -19,6 +19,7 @@ interface Reviewer {
name: string;
id: string;
deptId: string;
orgName: string;
}
// 传入的人接口
interface ReviewerSelectorData {

View File

@ -8,6 +8,7 @@ interface Reviewer {
name: string;
id: string;
deptId: string;
orgName: string;
}
// 传入的人接口
interface ReviewerSelectorData {

View File

@ -10,6 +10,7 @@ interface Reviewer {
name: string;
userId: string;
deptId: string;
orgName: string;
isLeader: number;
}
interface ReviewerSelectorData {
@ -30,7 +31,8 @@ function orgIdAndDeptId(data:any) {
const sss = data.map((item:any) => {
return {
...item,
deptId: item.orgId
deptId: item.orgId,
orgName: item.orgName
}
})
@ -93,7 +95,7 @@ const ReviewerSelector: React.FC<ReviewerSelectorProps> = ({
const columns: ColumnsType<Reviewer> = [
{ title: '姓名', dataIndex: 'name' },
{ title: '工号', dataIndex: 'userId' },
{ title: '部门', dataIndex: 'deptId' },
{ title: '部门', dataIndex: 'orgName' },
{
title: '组长',
render: (_: any, record: Reviewer) => (

View File

@ -92,8 +92,8 @@ const AccessManagement: React.FC = () => {
render: (_: any, __: any, idx: number) => (((pagination.current ?? 1) - 1) * (pagination.pageSize ?? 10)) + idx + 1,
},
{ 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: 'orgName' },
{ title: '准入部门', ellipsis: true, width: 120, dataIndex: 'deptName' },
{ title: '准入方式', ellipsis: true, width: 120, dataIndex: 'accessTypeText' },
{ title: '申请时间', ellipsis: true, width: 180, dataIndex: 'createTime' },
{

View File

@ -99,15 +99,15 @@ const CooperateEnterprise: React.FC = () => {
},
{
title: '发起单位',
dataIndex: 'deptId',
key: 'deptId',
dataIndex: 'orgName',
key: 'orgName',
ellipsis: true,
width: 120,
},
{
title: '准入部门',
dataIndex: 'deptId',
key: 'deptId',
dataIndex: 'deptName',
key: 'deptName',
ellipsis: true,
width: 120,
},

View File

@ -53,7 +53,7 @@ const DetailView: React.FC<DetailViewProps> = ({ visible, onClose, detailId }) =
// 把info数组两两合并成一行显示
function renderInfoTable(infoArr: InfoItem[]) {
const rows = [];
for (let i = 0; i < infoArr.length; i += 2) {
for (let i = 0; i < infoArr.length; i++) {
rows.push(
<>
<Descriptions.Item label={`变更前-${infoArr[i].fieldAnnotation}` }>{infoArr[i].oldValue}</Descriptions.Item>

View File

@ -1,33 +1,51 @@
import React, { useEffect, useState } from 'react';
import React, { useMemo } from 'react';
import { Descriptions } from 'antd';
import { coscoSupplier } from '../services'
import { useIntl } from 'umi';
// 性别转中文
const getGenderLabel = (sex: string | number | undefined) => {
if (sex === '1' || sex === 1) return '男';
if (sex === '0' || sex === 0) return '女';
return '';
};
const PersonalInfo: React.FC = () => {
const intl = useIntl();
const [registerInfo, setRegisterInfo] = useState<any>({ base: {} });
const fetchData = async () => {
const { code, data } = await coscoSupplier({});
if (code === 200) {
setRegisterInfo(data);
// 从缓存读取,推荐用 useMemo 保证只读一次
const localUser = useMemo(() => {
const cacheStr = sessionStorage.getItem('currentUser');
if (!cacheStr) return {};
try {
return JSON.parse(cacheStr);
} catch {
return {};
}
};
// 个人信息
useEffect(() => {
fetchData()
}, []);
}, []);
// 优先显示 user其次 supplierUser
const base = localUser.user || localUser.supplierUser || {};
return (
<div style={{ padding: '24px 24px 0 0' }}>
<Descriptions bordered column={2} labelStyle={{ width: '120px' }}>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.name' })}>{registerInfo.base.name}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.gender' })}>{registerInfo.base.gender}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.phone' })}>{registerInfo.base.phone}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.email' })}>{registerInfo.base.email}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.department' })}>{registerInfo.base.department}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.position' })}>{registerInfo.base.position}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.entryDate' })}>{registerInfo.base.entryDate}</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.name' })}>
{base.name || '-'}
</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.gender' })}>
{getGenderLabel(base.sex)}
</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.phone' })}>
{base.mobile || base.phone || '-'}
</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.email' })}>
{base.email || '-'}
</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.department' })}>
{base.orgName || '-'}
</Descriptions.Item>
<Descriptions.Item label={intl.formatMessage({ id: 'page.workbench.personal.position' })}>
{base.position || '-'}
</Descriptions.Item>
{/* 如有入职日期再补 */}
</Descriptions>
</div>
);

View File

@ -73,7 +73,7 @@ const DetailView: React.FC<DetailViewProps> = ({ visible, onClose, detailId }) =
// 把info数组两两合并成一行显示
function renderInfoTable(infoArr: InfoItem[]) {
const rows = [];
for (let i = 0; i < infoArr.length; i += 2) {
for (let i = 0; i < infoArr.length; i++) {
const left = infoArr[i];
const right = infoArr[i + 1] || { label: '', value: '' };
rows.push(

View File

@ -51,7 +51,7 @@ const DetailView: React.FC<DetailViewProps> = ({ visible, onClose, detailId }) =
// 把info数组两两合并成一行显示
function renderInfoTable(infoArr: InfoItem[]) {
const rows = [];
for (let i = 0; i < infoArr.length; i += 2) {
for (let i = 0; i < infoArr.length; i++) {
rows.push(
<>
<Descriptions.Item label={`变更前-${infoArr[i].fieldAnnotation}` }>{infoArr[i].oldValue}</Descriptions.Item>

View File

@ -210,11 +210,9 @@ const groupQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
render: (record: any) => (
<Space>
<a
style={{ color: '#1677ff' }}
onClick={() => { setCurrentRecord(record.id); setViewVisible(true); }}
></a>
<a
style={{ color: '#1677ff' }}
onClick={() => { setCurrentRecord(record.id); setDetailVisible(true); }}
></a>
</Space>

View File

@ -179,11 +179,9 @@ const mySupplierInquiry: React.FC<mySupplierInquiryProps> = ({ dispatch }) => {
render: (record: any) => (
<Space>
<a
style={{ color: '#1677ff' }}
onClick={() => { setCurrentRecord(record.id); setViewVisible(true); }}
></a>
<a
style={{ color: '#1677ff' }}
onClick={() => { setCurrentRecord(record.id); setDetailVisible(true); }}
></a>
</Space>

View File

@ -195,11 +195,9 @@ const personQualifiedSupplierQuery: React.FC<Props> = ({ dispatch }) => {
render: (record: any) => (
<Space>
<a
style={{ color: '#1677ff' }}
onClick={() => { setCurrentRecord(record.id); setViewVisible(true); }}
></a>
<a
style={{ color: '#1677ff' }}
onClick={() => { setCurrentRecord(record.id); setDetailVisible(true); }}
></a>
</Space>

View File

@ -27,8 +27,8 @@ interface Data {
type OptionType = { label: string; value: string };
//准入状态
const statusColor = (status: string) => {
if (status === '已驳回' || status === '已退出') return 'red';
if (status === '已准入') return 'green';
if (status === '已驳回' || status === '已退出') return '#ef6969';
if (status === '已准入') return '#004f8e';
return undefined;
};
@ -177,11 +177,9 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
render: (record) => (
<Space>
<a
style={{ color: '#1677ff' }}
onClick={() => { setCurrentRecord(record.id); setViewVisible(true); }}
></a>
<a
style={{ color: '#1677ff' }}
onClick={() => { setCurrentRecord(record.id); setDetailVisible(true); }}
></a>
</Space>