对接单位和部门组件
This commit is contained in:
@ -6,7 +6,7 @@ import CategorySelector from '@/components/CategorySelector/CategorySelector';
|
||||
import './SupplierSelector.less';
|
||||
import { useIntl } from 'umi';
|
||||
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||
|
||||
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
|
||||
const { Option } = Select;
|
||||
|
||||
/**
|
||||
@ -297,23 +297,7 @@ const SupplierSelector: React.FC<SupplierSelectorProps> = ({
|
||||
name="deptId"
|
||||
label={intl.formatMessage({ id: 'supplierTaskManage.form.department' })}
|
||||
>
|
||||
<Select
|
||||
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>
|
||||
<AccessDepartmentSelect orgCategory='' placeholder={'请选择准入单位'} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
|
@ -8,7 +8,7 @@ import { getSupplierAdmissionStatistics } from '@/servers/api/dataStatistics';
|
||||
import { downloadFile } from '@/utils/download';
|
||||
import moment from 'moment';
|
||||
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||
|
||||
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
|
||||
const { Option } = Select;
|
||||
|
||||
const SupplierAnnualStatistics: React.FC = () => {
|
||||
@ -35,13 +35,6 @@ const SupplierAnnualStatistics: React.FC = () => {
|
||||
| undefined
|
||||
>();
|
||||
|
||||
// 准入单位下拉选项 - 假数据
|
||||
const companyOptions = [
|
||||
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
|
||||
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
|
||||
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
|
||||
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
|
||||
];
|
||||
|
||||
// 获取数据
|
||||
const fetchStatisticsData = async (current = 1, pageSize = 10, params = searchParams) => {
|
||||
@ -232,20 +225,7 @@ const SupplierAnnualStatistics: React.FC = () => {
|
||||
name="accessUnit"
|
||||
label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })}
|
||||
>
|
||||
<Select
|
||||
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>
|
||||
<AccessDepartmentSelect placeholder={'请选择准入单位'} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="accessType"
|
||||
|
@ -9,7 +9,7 @@ import './supplierAnnualStatistics.less';
|
||||
import { downloadFile } from '@/utils/download';
|
||||
import moment from 'moment';
|
||||
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||
|
||||
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
|
||||
const { Option } = Select;
|
||||
|
||||
const SupplierAnnualStatistics: React.FC = () => {
|
||||
@ -32,13 +32,6 @@ const SupplierAnnualStatistics: React.FC = () => {
|
||||
const [searchParams, setSearchParams] =
|
||||
useState<DataStatistics.AnnualReviewStatisticsSearchParams>({});
|
||||
|
||||
// 准入单位下拉选项 - 假数据
|
||||
const companyOptions = [
|
||||
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
|
||||
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
|
||||
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
|
||||
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
|
||||
];
|
||||
|
||||
// 年审结果选项
|
||||
const annualResultOptions = Object.entries(AnnualReviewResultText).map(([key, value]) => ({
|
||||
@ -237,20 +230,7 @@ const SupplierAnnualStatistics: React.FC = () => {
|
||||
name="accessUnit"
|
||||
label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })}
|
||||
>
|
||||
<Select
|
||||
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>
|
||||
<AccessDepartmentSelect placeholder={'请选择准入单位'} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="annualStatisticsResult"
|
||||
|
@ -10,7 +10,7 @@ import './supplierEvaluateStatistics.less';
|
||||
import { downloadFile } from '@/utils/download';
|
||||
import moment from 'moment';
|
||||
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||
|
||||
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
|
||||
const { Option } = Select;
|
||||
|
||||
const SupplierEvaluateStatistics: React.FC = () => {
|
||||
@ -37,15 +37,6 @@ const SupplierEvaluateStatistics: React.FC = () => {
|
||||
const [evaluateRules, setEvaluateRules] = useState<SupplierEvaluateRuleManage.EvaluateRuleItem[]>(
|
||||
[],
|
||||
);
|
||||
|
||||
// 准入单位下拉选项 - 假数据
|
||||
const companyOptions = [
|
||||
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
|
||||
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
|
||||
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
|
||||
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
|
||||
];
|
||||
|
||||
// 获取评价规则列表
|
||||
const fetchEvaluateRules = async () => {
|
||||
try {
|
||||
@ -257,20 +248,7 @@ const SupplierEvaluateStatistics: React.FC = () => {
|
||||
name="accessUnit"
|
||||
label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })}
|
||||
>
|
||||
<Select
|
||||
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>
|
||||
<AccessDepartmentSelect placeholder={'请选择准入单位'} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="evaluateResult"
|
||||
|
@ -8,7 +8,7 @@ import moment from 'moment';
|
||||
import './supplierExitStatistics.less';
|
||||
import { downloadFile } from '@/utils/download';
|
||||
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||
|
||||
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
|
||||
const { Option } = Select;
|
||||
|
||||
const SupplierExitStatistics: React.FC = () => {
|
||||
@ -27,15 +27,6 @@ const SupplierExitStatistics: React.FC = () => {
|
||||
showTotal: (total) => intl.formatMessage({ id: 'dataStatistics.common.total' }, { total }),
|
||||
});
|
||||
const [searchParams, setSearchParams] = useState<DataStatistics.ExitStatisticsSearchParams>({});
|
||||
|
||||
// 退出单位下拉选项 - 假数据
|
||||
const companyOptions = [
|
||||
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
|
||||
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
|
||||
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
|
||||
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
|
||||
];
|
||||
|
||||
// 获取数据
|
||||
const fetchStatisticsData = async (
|
||||
current = 1,
|
||||
@ -209,20 +200,7 @@ const SupplierExitStatistics: React.FC = () => {
|
||||
name="accessUnit"
|
||||
label={intl.formatMessage({ id: 'dataStatistics.exit.exitUnit' })}
|
||||
>
|
||||
<Select
|
||||
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>
|
||||
<AccessDepartmentSelect placeholder={'请选择准入单位'} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="year"
|
||||
|
@ -1,31 +1,14 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import {
|
||||
Button,
|
||||
Table,
|
||||
Space,
|
||||
Input,
|
||||
Select,
|
||||
Form,
|
||||
Tooltip,
|
||||
Tag,
|
||||
DatePicker,
|
||||
message
|
||||
} from 'antd';
|
||||
import { Button, Table, Space, Input, Select, Form, Tooltip, Tag, DatePicker, message } from 'antd';
|
||||
import type { TablePaginationConfig } from 'antd';
|
||||
import {
|
||||
SearchOutlined,
|
||||
DeleteOutlined,
|
||||
ExportOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { SearchOutlined, DeleteOutlined, ExportOutlined } from '@ant-design/icons';
|
||||
import { useIntl } from 'umi';
|
||||
import CategorySelector from '@/components/CategorySelector/CategorySelector';
|
||||
import { SupplierTypeText } from '@/dicts/dataStatistics';
|
||||
import { getSupplierQualificationExpire, exportSupplierQualificationExpire } from '@/servers/api/dataStatistics';
|
||||
import { getSupplierQualificationExpire } from '@/servers/api/dataStatistics';
|
||||
import moment from 'moment';
|
||||
import './supplierQualificationWarningStatistics.less';
|
||||
import { downloadFile } from '@/utils/download';
|
||||
import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext';
|
||||
|
||||
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
|
||||
const { Option } = Select;
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
@ -35,7 +18,9 @@ const SupplierQualificationWarningStatistics: React.FC = () => {
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const [statisticsData, setStatisticsData] = useState<DataStatistics.QualificationExpireRecord[]>([]);
|
||||
const [statisticsData, setStatisticsData] = useState<DataStatistics.QualificationExpireRecord[]>(
|
||||
[],
|
||||
);
|
||||
const [pagination, setPagination] = useState<TablePaginationConfig>({
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
@ -44,15 +29,9 @@ const SupplierQualificationWarningStatistics: React.FC = () => {
|
||||
showQuickJumper: true,
|
||||
showTotal: (total) => intl.formatMessage({ id: 'dataStatistics.common.total' }, { total }),
|
||||
});
|
||||
const [searchParams, setSearchParams] = useState<DataStatistics.QualificationExpireSearchParams>({});
|
||||
|
||||
// 准入单位下拉选项 - 假数据
|
||||
const companyOptions = [
|
||||
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
|
||||
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
|
||||
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
|
||||
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
|
||||
];
|
||||
const [searchParams, setSearchParams] = useState<DataStatistics.QualificationExpireSearchParams>(
|
||||
{},
|
||||
);
|
||||
|
||||
// 境内/境外选项
|
||||
const areaOptions = [
|
||||
@ -80,7 +59,7 @@ const SupplierQualificationWarningStatistics: React.FC = () => {
|
||||
pageNo: current,
|
||||
pageSize: pageSize,
|
||||
},
|
||||
...otherParams
|
||||
...otherParams,
|
||||
};
|
||||
|
||||
// 如果有日期范围,转换为开始和结束日期
|
||||
@ -101,7 +80,10 @@ const SupplierQualificationWarningStatistics: React.FC = () => {
|
||||
total: response.data.total,
|
||||
});
|
||||
} else {
|
||||
message.error(response.message || intl.formatMessage({ id: 'dataStatistics.qualification.getDataFailed' }));
|
||||
message.error(
|
||||
response.message ||
|
||||
intl.formatMessage({ id: 'dataStatistics.qualification.getDataFailed' }),
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取资质预警统计数据失败:', error);
|
||||
@ -128,7 +110,7 @@ const SupplierQualificationWarningStatistics: React.FC = () => {
|
||||
|
||||
// 获取境内/境外显示文本
|
||||
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;
|
||||
};
|
||||
|
||||
@ -248,24 +230,41 @@ const SupplierQualificationWarningStatistics: React.FC = () => {
|
||||
layout="inline"
|
||||
className="filter-form"
|
||||
>
|
||||
<Form.Item 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
|
||||
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 name="accessUnit" label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })}>
|
||||
<Select 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
|
||||
name="accessUnit"
|
||||
label={intl.formatMessage({ id: 'dataStatistics.common.accessUnit' })}
|
||||
>
|
||||
<AccessDepartmentSelect placeholder={'请选择准入单位'} />
|
||||
</Form.Item>
|
||||
<Form.Item name="area" label={intl.formatMessage({ id: 'dataStatistics.common.area' })}>
|
||||
<Select placeholder={intl.formatMessage({ id: 'dataStatistics.common.pleaseSelect' })} allowClear style={{ width: 120 }}>
|
||||
{areaOptions.map(option => (
|
||||
<Option key={option.value} value={option.value}>{option.label}</Option>
|
||||
<Select
|
||||
placeholder={intl.formatMessage({ id: 'dataStatistics.common.pleaseSelect' })}
|
||||
allowClear
|
||||
style={{ width: 120 }}
|
||||
>
|
||||
{areaOptions.map((option) => (
|
||||
<Option key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</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 }} />
|
||||
</Form.Item>
|
||||
<Form.Item className="filter-btns">
|
||||
|
@ -21,7 +21,7 @@ import {
|
||||
import CategorySelector from '@/components/CategorySelector/CategorySelector';
|
||||
import { getAnnualTemplateList, enableAnnualTemplate, disableAnnualTemplate } from '@/servers/api/supplierAnnual';
|
||||
import { AnnualTemplateStatus, AnnualTemplateStatusText, AnnualTemplateStatusColor } from '@/dicts/supplierAnnualDict';
|
||||
|
||||
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
|
||||
const { Option } = Select;
|
||||
|
||||
// 搜索参数类型
|
||||
@ -49,13 +49,6 @@ const SupplierAnnualTemplateManage: React.FC = () => {
|
||||
});
|
||||
const [searchParams, setSearchParams] = useState<AnnualTemplateSearchParams>({});
|
||||
|
||||
// 部门下拉选项
|
||||
const [companyOptions, setCompanyOptions] = useState<{ label: string, value: string }[]>([
|
||||
{ label: '中山市合创展包装材料有限公司', value: '中山市合创展包装材料有限公司' },
|
||||
{ label: '广州市科技发展有限公司', value: '广州市科技发展有限公司' },
|
||||
{ label: '深圳市创新科技有限公司', value: '深圳市创新科技有限公司' },
|
||||
{ label: '东莞市制造业有限公司', value: '东莞市制造业有限公司' },
|
||||
]);
|
||||
|
||||
// 获取模板列表
|
||||
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 />
|
||||
</Form.Item>
|
||||
<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 }}>
|
||||
{companyOptions.map(option => (
|
||||
<Option key={option.value} value={option.value}>{option.label}</Option>
|
||||
))}
|
||||
</Select>
|
||||
<AccessDepartmentSelect placeholder={'请选择准入单位'} />
|
||||
</Form.Item>
|
||||
<Form.Item name="categoryId" label={intl.formatMessage({ id: 'supplierAnnualTemplateManage.list.category' })}>
|
||||
<CategorySelector multiple={false} style={{ width: 200 }} />
|
||||
|
@ -10,6 +10,7 @@ import {
|
||||
} from '@/dicts/supplierTemplateDict';
|
||||
import { getTemplateList, enableTemplate, disableTemplate } from '@/servers/api/supplierEvaluate';
|
||||
import CategorySelector from '@/components/CategorySelector/CategorySelector';
|
||||
import AccessDepartmentSelect from '@/components/AccessDepartmentSelect';
|
||||
|
||||
const { Option } = Select;
|
||||
|
||||
@ -30,13 +31,6 @@ const SupplierTemplateManage: React.FC = () => {
|
||||
});
|
||||
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) => {
|
||||
@ -322,19 +316,7 @@ const handleDisableTemplate = (id: string) => {
|
||||
name="tenantName"
|
||||
label={intl.formatMessage({ id: 'supplierTemplateManage.column.tenantName' })}
|
||||
>
|
||||
<Select
|
||||
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>
|
||||
<AccessDepartmentSelect placeholder={'请选择准入单位'} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="categoryId"
|
||||
|
Reference in New Issue
Block a user