对接单位和部门组件

This commit is contained in:
linxd
2025-07-21 14:17:52 +08:00
parent e9ebd6ac1c
commit 7dacf6a4ae
8 changed files with 59 additions and 189 deletions

View File

@ -6,7 +6,7 @@ import CategorySelector from '@/components/CategorySelector/CategorySelector';
import './SupplierSelector.less'; import './SupplierSelector.less';
import { useIntl } from 'umi'; import { useIntl } from 'umi';
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext'; import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
const { Option } = Select; const { Option } = Select;
/** /**
@ -297,23 +297,7 @@ const SupplierSelector: React.FC<SupplierSelectorProps> = ({
name="deptId" name="deptId"
label={intl.formatMessage({ id: 'supplierTaskManage.form.department' })} label={intl.formatMessage({ id: 'supplierTaskManage.form.department' })}
> >
<Select <AccessDepartmentSelect orgCategory='' placeholder={'请选择准入单位'} />
placeholder={intl.formatMessage({
id: 'supplierTaskManage.placeholder.selectDepartment',
})}
allowClear
style={{ width: 150 }}
>
<Option value="1">
{intl.formatMessage({ id: 'supplierTaskManage.department.purchase' })}
</Option>
<Option value="2">
{intl.formatMessage({ id: 'supplierTaskManage.department.technology' })}
</Option>
<Option value="3">
{intl.formatMessage({ id: 'supplierTaskManage.department.quality' })}
</Option>
</Select>
</Form.Item> </Form.Item>
<Form.Item <Form.Item

View File

@ -8,7 +8,7 @@ import { getSupplierAdmissionStatistics } from '@/servers/api/dataStatistics';
import { downloadFile } from '@/utils/download'; import { downloadFile } from '@/utils/download';
import moment from 'moment'; import moment from 'moment';
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext'; import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
const { Option } = Select; const { Option } = Select;
const SupplierAnnualStatistics: React.FC = () => { const SupplierAnnualStatistics: React.FC = () => {
@ -35,13 +35,6 @@ const SupplierAnnualStatistics: React.FC = () => {
| undefined | undefined
>(); >();
// 准入单位下拉选项 - 假数据
const companyOptions = [
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
];
// 获取数据 // 获取数据
const fetchStatisticsData = async (current = 1, pageSize = 10, params = searchParams) => { const fetchStatisticsData = async (current = 1, pageSize = 10, params = searchParams) => {
@ -232,20 +225,7 @@ const SupplierAnnualStatistics: React.FC = () => {
name="accessUnit" name="accessUnit"
label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })} label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })}
> >
<Select <AccessDepartmentSelect placeholder={'请选择准入单位'} />
placeholder={
intl.formatMessage({ id: 'dataStatistics.common.pleaseSelect' }) +
intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })
}
allowClear
style={{ width: 200 }}
>
{companyOptions.map((option) => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</Select>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="accessType" name="accessType"

View File

@ -9,7 +9,7 @@ import './supplierAnnualStatistics.less';
import { downloadFile } from '@/utils/download'; import { downloadFile } from '@/utils/download';
import moment from 'moment'; import moment from 'moment';
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext'; import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
const { Option } = Select; const { Option } = Select;
const SupplierAnnualStatistics: React.FC = () => { const SupplierAnnualStatistics: React.FC = () => {
@ -32,13 +32,6 @@ const SupplierAnnualStatistics: React.FC = () => {
const [searchParams, setSearchParams] = const [searchParams, setSearchParams] =
useState<DataStatistics.AnnualReviewStatisticsSearchParams>({}); useState<DataStatistics.AnnualReviewStatisticsSearchParams>({});
// 准入单位下拉选项 - 假数据
const companyOptions = [
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
];
// 年审结果选项 // 年审结果选项
const annualResultOptions = Object.entries(AnnualReviewResultText).map(([key, value]) => ({ const annualResultOptions = Object.entries(AnnualReviewResultText).map(([key, value]) => ({
@ -237,20 +230,7 @@ const SupplierAnnualStatistics: React.FC = () => {
name="accessUnit" name="accessUnit"
label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })} label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })}
> >
<Select <AccessDepartmentSelect placeholder={'请选择准入单位'} />
placeholder={
intl.formatMessage({ id: 'dataStatistics.common.pleaseSelect' }) +
intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })
}
allowClear
style={{ width: 200 }}
>
{companyOptions.map((option) => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</Select>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="annualStatisticsResult" name="annualStatisticsResult"

View File

@ -10,7 +10,7 @@ import './supplierEvaluateStatistics.less';
import { downloadFile } from '@/utils/download'; import { downloadFile } from '@/utils/download';
import moment from 'moment'; import moment from 'moment';
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext'; import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
const { Option } = Select; const { Option } = Select;
const SupplierEvaluateStatistics: React.FC = () => { const SupplierEvaluateStatistics: React.FC = () => {
@ -37,15 +37,6 @@ const SupplierEvaluateStatistics: React.FC = () => {
const [evaluateRules, setEvaluateRules] = useState<SupplierEvaluateRuleManage.EvaluateRuleItem[]>( const [evaluateRules, setEvaluateRules] = useState<SupplierEvaluateRuleManage.EvaluateRuleItem[]>(
[], [],
); );
// 准入单位下拉选项 - 假数据
const companyOptions = [
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
];
// 获取评价规则列表 // 获取评价规则列表
const fetchEvaluateRules = async () => { const fetchEvaluateRules = async () => {
try { try {
@ -257,20 +248,7 @@ const SupplierEvaluateStatistics: React.FC = () => {
name="accessUnit" name="accessUnit"
label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })} label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })}
> >
<Select <AccessDepartmentSelect placeholder={'请选择准入单位'} />
placeholder={
intl.formatMessage({ id: 'dataStatistics.common.pleaseSelect' }) +
intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })
}
allowClear
style={{ width: 200 }}
>
{companyOptions.map((option) => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</Select>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="evaluateResult" name="evaluateResult"

View File

@ -8,7 +8,7 @@ import moment from 'moment';
import './supplierExitStatistics.less'; import './supplierExitStatistics.less';
import { downloadFile } from '@/utils/download'; import { downloadFile } from '@/utils/download';
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext'; import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
const { Option } = Select; const { Option } = Select;
const SupplierExitStatistics: React.FC = () => { const SupplierExitStatistics: React.FC = () => {
@ -27,15 +27,6 @@ const SupplierExitStatistics: React.FC = () => {
showTotal: (total) => intl.formatMessage({ id: 'dataStatistics.common.total' }, { total }), showTotal: (total) => intl.formatMessage({ id: 'dataStatistics.common.total' }, { total }),
}); });
const [searchParams, setSearchParams] = useState<DataStatistics.ExitStatisticsSearchParams>({}); const [searchParams, setSearchParams] = useState<DataStatistics.ExitStatisticsSearchParams>({});
// 退出单位下拉选项 - 假数据
const companyOptions = [
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
];
// 获取数据 // 获取数据
const fetchStatisticsData = async ( const fetchStatisticsData = async (
current = 1, current = 1,
@ -209,20 +200,7 @@ const SupplierExitStatistics: React.FC = () => {
name="accessUnit" name="accessUnit"
label={intl.formatMessage({ id: 'dataStatistics.exit.exitUnit' })} label={intl.formatMessage({ id: 'dataStatistics.exit.exitUnit' })}
> >
<Select <AccessDepartmentSelect placeholder={'请选择准入单位'} />
placeholder={
intl.formatMessage({ id: 'dataStatistics.common.pleaseSelect' }) +
intl.formatMessage({ id: 'dataStatistics.exit.exitUnit' })
}
allowClear
style={{ width: 200 }}
>
{companyOptions.map((option) => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</Select>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="year" name="year"

View File

@ -1,31 +1,14 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { import { Button, Table, Space, Input, Select, Form, Tooltip, Tag, DatePicker, message } from 'antd';
Button,
Table,
Space,
Input,
Select,
Form,
Tooltip,
Tag,
DatePicker,
message
} from 'antd';
import type { TablePaginationConfig } from 'antd'; import type { TablePaginationConfig } from 'antd';
import { import { SearchOutlined, DeleteOutlined, ExportOutlined } from '@ant-design/icons';
SearchOutlined,
DeleteOutlined,
ExportOutlined
} from '@ant-design/icons';
import { useIntl } from 'umi'; import { useIntl } from 'umi';
import CategorySelector from '@/components/CategorySelector/CategorySelector'; import { getSupplierQualificationExpire } from '@/servers/api/dataStatistics';
import { SupplierTypeText } from '@/dicts/dataStatistics';
import { getSupplierQualificationExpire, exportSupplierQualificationExpire } from '@/servers/api/dataStatistics';
import moment from 'moment'; import moment from 'moment';
import './supplierQualificationWarningStatistics.less'; import './supplierQualificationWarningStatistics.less';
import { downloadFile } from '@/utils/download'; import { downloadFile } from '@/utils/download';
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext'; import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
const { Option } = Select; const { Option } = Select;
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
@ -35,7 +18,9 @@ const SupplierQualificationWarningStatistics: React.FC = () => {
const [loading, setLoading] = useState<boolean>(false); const [loading, setLoading] = useState<boolean>(false);
const [form] = Form.useForm(); const [form] = Form.useForm();
const [statisticsData, setStatisticsData] = useState<DataStatistics.QualificationExpireRecord[]>([]); const [statisticsData, setStatisticsData] = useState<DataStatistics.QualificationExpireRecord[]>(
[],
);
const [pagination, setPagination] = useState<TablePaginationConfig>({ const [pagination, setPagination] = useState<TablePaginationConfig>({
current: 1, current: 1,
pageSize: 10, pageSize: 10,
@ -44,15 +29,9 @@ const SupplierQualificationWarningStatistics: React.FC = () => {
showQuickJumper: true, showQuickJumper: true,
showTotal: (total) => intl.formatMessage({ id: 'dataStatistics.common.total' }, { total }), showTotal: (total) => intl.formatMessage({ id: 'dataStatistics.common.total' }, { total }),
}); });
const [searchParams, setSearchParams] = useState<DataStatistics.QualificationExpireSearchParams>({}); const [searchParams, setSearchParams] = useState<DataStatistics.QualificationExpireSearchParams>(
{},
// 准入单位下拉选项 - 假数据 );
const companyOptions = [
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
];
// 境内/境外选项 // 境内/境外选项
const areaOptions = [ const areaOptions = [
@ -80,7 +59,7 @@ const SupplierQualificationWarningStatistics: React.FC = () => {
pageNo: current, pageNo: current,
pageSize: pageSize, pageSize: pageSize,
}, },
...otherParams ...otherParams,
}; };
// 如果有日期范围,转换为开始和结束日期 // 如果有日期范围,转换为开始和结束日期
@ -101,7 +80,10 @@ const SupplierQualificationWarningStatistics: React.FC = () => {
total: response.data.total, total: response.data.total,
}); });
} else { } else {
message.error(response.message || intl.formatMessage({ id: 'dataStatistics.qualification.getDataFailed' })); message.error(
response.message ||
intl.formatMessage({ id: 'dataStatistics.qualification.getDataFailed' }),
);
} }
} catch (error) { } catch (error) {
console.error('获取资质预警统计数据失败:', error); console.error('获取资质预警统计数据失败:', error);
@ -128,7 +110,7 @@ const SupplierQualificationWarningStatistics: React.FC = () => {
// 获取境内/境外显示文本 // 获取境内/境外显示文本
const getAreaText = (areaCode: string) => { const getAreaText = (areaCode: string) => {
const area = areaOptions.find(item => item.value === areaCode); const area = areaOptions.find((item) => item.value === areaCode);
return area ? area.label : areaCode; return area ? area.label : areaCode;
}; };
@ -248,24 +230,41 @@ const SupplierQualificationWarningStatistics: React.FC = () => {
layout="inline" layout="inline"
className="filter-form" className="filter-form"
> >
<Form.Item name="supplierName" label={intl.formatMessage({ id: 'dataStatistics.common.supplierName' })}> <Form.Item
<Input placeholder={intl.formatMessage({ id: 'dataStatistics.common.pleaseInput' }) + intl.formatMessage({ id: 'dataStatistics.common.supplierName' })} allowClear /> name="supplierName"
label={intl.formatMessage({ id: 'dataStatistics.common.supplierName' })}
>
<Input
placeholder={
intl.formatMessage({ id: 'dataStatistics.common.pleaseInput' }) +
intl.formatMessage({ id: 'dataStatistics.common.supplierName' })
}
allowClear
/>
</Form.Item> </Form.Item>
<Form.Item name="accessUnit" label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })}> <Form.Item
<Select placeholder={intl.formatMessage({ id: 'dataStatistics.common.pleaseSelect' }) + intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })} allowClear style={{ width: 200 }}> name="accessUnit"
{companyOptions.map(option => ( label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })}
<Option key={option.value} value={option.value}>{option.label}</Option> >
))} <AccessDepartmentSelect placeholder={'请选择准入单位'} />
</Select>
</Form.Item> </Form.Item>
<Form.Item name="area" label={intl.formatMessage({ id: 'dataStatistics.common.area' })}> <Form.Item name="area" label={intl.formatMessage({ id: 'dataStatistics.common.area' })}>
<Select placeholder={intl.formatMessage({ id: 'dataStatistics.common.pleaseSelect' })} allowClear style={{ width: 120 }}> <Select
{areaOptions.map(option => ( placeholder={intl.formatMessage({ id: 'dataStatistics.common.pleaseSelect' })}
<Option key={option.value} value={option.value}>{option.label}</Option> allowClear
style={{ width: 120 }}
>
{areaOptions.map((option) => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))} ))}
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item name="termOfValidityRange" label={intl.formatMessage({ id: 'dataStatistics.qualification.validityRange' })}> <Form.Item
name="termOfValidityRange"
label={intl.formatMessage({ id: 'dataStatistics.qualification.validityRange' })}
>
<RangePicker style={{ width: 240 }} /> <RangePicker style={{ width: 240 }} />
</Form.Item> </Form.Item>
<Form.Item className="filter-btns"> <Form.Item className="filter-btns">

View File

@ -21,7 +21,7 @@ import {
import CategorySelector from '@/components/CategorySelector/CategorySelector'; import CategorySelector from '@/components/CategorySelector/CategorySelector';
import { getAnnualTemplateList, enableAnnualTemplate, disableAnnualTemplate } from '@/servers/api/supplierAnnual'; import { getAnnualTemplateList, enableAnnualTemplate, disableAnnualTemplate } from '@/servers/api/supplierAnnual';
import { AnnualTemplateStatus, AnnualTemplateStatusText, AnnualTemplateStatusColor } from '@/dicts/supplierAnnualDict'; import { AnnualTemplateStatus, AnnualTemplateStatusText, AnnualTemplateStatusColor } from '@/dicts/supplierAnnualDict';
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
const { Option } = Select; const { Option } = Select;
// 搜索参数类型 // 搜索参数类型
@ -49,13 +49,6 @@ const SupplierAnnualTemplateManage: React.FC = () => {
}); });
const [searchParams, setSearchParams] = useState<AnnualTemplateSearchParams>({}); const [searchParams, setSearchParams] = useState<AnnualTemplateSearchParams>({});
// 部门下拉选项
const [companyOptions, setCompanyOptions] = useState<{ label: string, value: string }[]>([
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
]);
// 获取模板列表 // 获取模板列表
const fetchTemplateList = async ( const fetchTemplateList = async (
@ -338,11 +331,7 @@ const SupplierAnnualTemplateManage: React.FC = () => {
<Input placeholder={`${intl.formatMessage({ id: 'supplierAnnualTemplateManage.common.pleaseInput' })}${intl.formatMessage({ id: 'supplierAnnualTemplateManage.list.templateName' })}`} allowClear /> <Input placeholder={`${intl.formatMessage({ id: 'supplierAnnualTemplateManage.common.pleaseInput' })}${intl.formatMessage({ id: 'supplierAnnualTemplateManage.list.templateName' })}`} allowClear />
</Form.Item> </Form.Item>
<Form.Item name="deptId" label={intl.formatMessage({ id: 'supplierAnnualTemplateManage.list.createUnit' })}> <Form.Item name="deptId" label={intl.formatMessage({ id: 'supplierAnnualTemplateManage.list.createUnit' })}>
<Select placeholder={`${intl.formatMessage({ id: 'supplierAnnualTemplateManage.common.pleaseSelect' })}${intl.formatMessage({ id: 'supplierAnnualTemplateManage.list.createUnit' })}`} allowClear style={{ width: 200 }}> <AccessDepartmentSelect placeholder={'请选择准入单位'} />
{companyOptions.map(option => (
<Option key={option.value} value={option.value}>{option.label}</Option>
))}
</Select>
</Form.Item> </Form.Item>
<Form.Item name="categoryId" label={intl.formatMessage({ id: 'supplierAnnualTemplateManage.list.category' })}> <Form.Item name="categoryId" label={intl.formatMessage({ id: 'supplierAnnualTemplateManage.list.category' })}>
<CategorySelector multiple={false} style={{ width: 200 }} /> <CategorySelector multiple={false} style={{ width: 200 }} />

View File

@ -10,6 +10,7 @@ import {
} from '@/dicts/supplierTemplateDict'; } from '@/dicts/supplierTemplateDict';
import { getTemplateList, enableTemplate, disableTemplate } from '@/servers/api/supplierEvaluate'; import { getTemplateList, enableTemplate, disableTemplate } from '@/servers/api/supplierEvaluate';
import CategorySelector from '@/components/CategorySelector/CategorySelector'; import CategorySelector from '@/components/CategorySelector/CategorySelector';
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
const { Option } = Select; const { Option } = Select;
@ -30,13 +31,6 @@ const SupplierTemplateManage: React.FC = () => {
}); });
const [searchParams, setSearchParams] = useState({}); const [searchParams, setSearchParams] = useState({});
// 部门下拉选项
const [companyOptions, setCompanyOptions] = useState<{ label: string; value: string }[]>([
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
]);
// 获取模板列表 // 获取模板列表
const fetchTemplateList = async (current = 1, pageSize = 10, params = searchParams) => { const fetchTemplateList = async (current = 1, pageSize = 10, params = searchParams) => {
@ -322,19 +316,7 @@ const handleDisableTemplate = (id: string) => {
name="tenantName" name="tenantName"
label={intl.formatMessage({ id: 'supplierTemplateManage.column.tenantName' })} label={intl.formatMessage({ id: 'supplierTemplateManage.column.tenantName' })}
> >
<Select <AccessDepartmentSelect placeholder={'请选择准入单位'} />
placeholder={intl.formatMessage({
id: 'supplierTemplateManage.placeholder.tenantName',
})}
allowClear
style={{ width: 200 }}
>
{companyOptions.map((option) => (
<Option key={option.value} value={option.value}>
{option.label}
</Option>
))}
</Select>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
name="categoryId" name="categoryId"