白名单修改;修改上传组件样式;注册资质信息上传使用组件;年审查询第三步添加供应商id参数

This commit is contained in:
linxd
2025-07-16 10:16:46 +08:00
parent 68e6ea3fc0
commit 27d6d10d27
4 changed files with 96 additions and 65 deletions

View File

@ -2,7 +2,7 @@ import { history } from 'umi';
export function onRouteChange({ location }: any) { export function onRouteChange({ location }: any) {
const token = sessionStorage.getItem('token'); const token = sessionStorage.getItem('token');
const whiteList = ['/login', '/user/register', '/403', '/404']; const whiteList = ['/login', '/register/supplier', '/register/expert', '/403', '/404'];
if (!token && !whiteList.includes(location.pathname)) { if (!token && !whiteList.includes(location.pathname)) {
history.replace('/login'); history.replace('/login');
} }

View File

@ -203,7 +203,7 @@ const FileUpload: React.FC<FileUploadProps> = ({
} }
return ( return (
<Button icon={<UploadOutlined />} disabled={disabled}> <Button type="link" icon={<UploadOutlined />} disabled={disabled}>
{buttonText || defaultButtonText} {buttonText || defaultButtonText}
</Button> </Button>
); );

View File

@ -23,6 +23,7 @@ import { validateFileSize } from '@/utils/utils';
import { getRegionTree, getregionInternational } from '@/servers/api/register'; import { getRegionTree, getregionInternational } from '@/servers/api/register';
import { getDictList } from '@/servers/api/dicts'; import { getDictList } from '@/servers/api/dicts';
import type { DictItem } from '@/servers/api/dicts'; import type { DictItem } from '@/servers/api/dicts';
import FileUpload from '@/components/FileUpload/FileUpload';
const { Option } = Select; const { Option } = Select;
@ -36,10 +37,13 @@ interface SurveySectionProps extends CommonFormSectionsProps {
surveyQuestions?: API.SurveyQuestionResponse; surveyQuestions?: API.SurveyQuestionResponse;
} }
function convertToCascaderOptions(data: any[]): any[] { function convertToCascaderOptions(data: any[]): any[] {
return data.map(item => ({ return data.map((item) => ({
label: item.name, label: item.name,
value: item.id, value: item.id,
children: item.children && item.children.length > 0 ? convertToCascaderOptions(item.children) : undefined, children:
item.children && item.children.length > 0
? convertToCascaderOptions(item.children)
: undefined,
})); }));
} }
/** /**
@ -50,15 +54,29 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
// 检查行是否有任何字段被填写 // 检查行是否有任何字段被填写
const hasRowValue = (formInstance: any, recordObj: any, currentField: string) => { const hasRowValue = (formInstance: any, recordObj: any, currentField: string) => {
const values = formInstance.getFieldsValue(['coscoSupplierQualifications']); const values = formInstance.getFieldsValue(['coscoSupplierQualifications']);
if (!values.coscoSupplierQualifications || !values.coscoSupplierQualifications[recordObj.name]) { if (
!values.coscoSupplierQualifications ||
!values.coscoSupplierQualifications[recordObj.name]
) {
return false; return false;
} }
const rowData = values.coscoSupplierQualifications[recordObj.name]; const rowData = values.coscoSupplierQualifications[recordObj.name];
const fields = ['certType', 'certName', 'certNumber', 'certLevel', 'issuingAuthority', 'dateTime', 'termOfValidity', 'certFile']; const fields = [
'certType',
'certName',
'certNumber',
'certLevel',
'issuingAuthority',
'dateTime',
'termOfValidity',
'certFile',
];
// 过滤掉当前正在验证的字段 // 过滤掉当前正在验证的字段
return fields.filter(field => field !== currentField).some(field => { return fields
.filter((field) => field !== currentField)
.some((field) => {
const value = rowData[field]; const value = rowData[field];
if (field === 'certFile' && value) { if (field === 'certFile' && value) {
return value.fileList && value.fileList.length > 0; return value.fileList && value.fileList.length > 0;
@ -121,6 +139,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
name={[record.name, 'certType']} name={[record.name, 'certType']}
rules={[createConditionalRule('certType', '请输入资质证书类型')]} rules={[createConditionalRule('certType', '请输入资质证书类型')]}
style={{ margin: 0}} style={{ margin: 0}}
wrapperCol={{ span: 24 }}
> >
<Input placeholder="请输入资质证书类型" /> <Input placeholder="请输入资质证书类型" />
</Form.Item> </Form.Item>
@ -134,6 +153,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
name={[record.name, 'certName']} name={[record.name, 'certName']}
rules={[createConditionalRule('certName', '请输入资质名称')]} rules={[createConditionalRule('certName', '请输入资质名称')]}
style={{ margin: 0 }} style={{ margin: 0 }}
wrapperCol={{ span: 24 }}
> >
<Input placeholder="请输入资质名称" /> <Input placeholder="请输入资质名称" />
</Form.Item> </Form.Item>
@ -147,6 +167,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
name={[record.name, 'certNumber']} name={[record.name, 'certNumber']}
rules={[createConditionalRule('certNumber', '请输入资质证书编号')]} rules={[createConditionalRule('certNumber', '请输入资质证书编号')]}
style={{ margin: 0 }} style={{ margin: 0 }}
wrapperCol={{ span: 24 }}
> >
<Input placeholder="请输入证书编号" /> <Input placeholder="请输入证书编号" />
</Form.Item> </Form.Item>
@ -156,10 +177,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
title: createRequiredTitle('资质类别和等级'), title: createRequiredTitle('资质类别和等级'),
dataIndex: 'certLevel', dataIndex: 'certLevel',
render: (_, record) => ( render: (_, record) => (
<Form.Item <Form.Item name={[record.name, 'certLevel']} style={{ margin: 0 }} wrapperCol={{ span: 24 }}>
name={[record.name, 'certLevel']}
style={{ margin: 0 }}
>
<Input placeholder="请输入资质类别和等级" /> <Input placeholder="请输入资质类别和等级" />
</Form.Item> </Form.Item>
), ),
@ -172,6 +190,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
name={[record.name, 'issuingAuthority']} name={[record.name, 'issuingAuthority']}
rules={[createConditionalRule('issuingAuthority', '请输入发证机构')]} rules={[createConditionalRule('issuingAuthority', '请输入发证机构')]}
style={{ margin: 0 }} style={{ margin: 0 }}
wrapperCol={{ span: 24 }}
> >
<Input placeholder="请输入发证机构" /> <Input placeholder="请输入发证机构" />
</Form.Item> </Form.Item>
@ -185,6 +204,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
name={[record.name, 'dateTime']} name={[record.name, 'dateTime']}
rules={[createConditionalRule('dateTime', '请选择发证日期')]} rules={[createConditionalRule('dateTime', '请选择发证日期')]}
style={{ margin: 0 }} style={{ margin: 0 }}
wrapperCol={{ span: 24 }}
> >
<DatePicker <DatePicker
placeholder="年/月/日" placeholder="年/月/日"
@ -202,6 +222,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
name={[record.name, 'termOfValidity']} name={[record.name, 'termOfValidity']}
rules={[createConditionalRule('termOfValidity', '请选择资质有效期')]} rules={[createConditionalRule('termOfValidity', '请选择资质有效期')]}
style={{ margin: 0 }} style={{ margin: 0 }}
wrapperCol={{ span: 24 }}
> >
<DatePicker <DatePicker
placeholder="年/月/日" placeholder="年/月/日"
@ -219,12 +240,13 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
name={[record.name, 'certFile']} name={[record.name, 'certFile']}
rules={[createConditionalRule('certFile', '请上传资质证书附件')]} rules={[createConditionalRule('certFile', '请上传资质证书附件')]}
style={{ margin: 0 }} style={{ margin: 0 }}
wrapperCol={{ span: 24 }}
> >
<Upload name="certFile" action="/api/upload" listType="text" maxCount={1}> <FileUpload
<Button type="link" size="small"> listType="text"
maxCount={1}
</Button> allowedTypes={['pdf', 'jpg', 'jpeg', 'png']}
</Upload> />
</Form.Item> </Form.Item>
), ),
}, },
@ -263,7 +285,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
export const InvoiceSection: React.FC<CommonFormSectionsProps> = ({ form }) => { export const InvoiceSection: React.FC<CommonFormSectionsProps> = ({ form }) => {
const [taxpayerTypeOptions, setTaxpayerTypeOptions] = useState<DictItem[]>([]); const [taxpayerTypeOptions, setTaxpayerTypeOptions] = useState<DictItem[]>([]);
useEffect(() => { useEffect(() => {
getDictList('taxpayer_type').then(res => { getDictList('taxpayer_type').then((res) => {
if (res.code === 200) { if (res.code === 200) {
setTaxpayerTypeOptions(res.data); setTaxpayerTypeOptions(res.data);
} }
@ -280,10 +302,13 @@ export const InvoiceSection: React.FC<CommonFormSectionsProps> = ({ form }) => {
label="纳税人类型" label="纳税人类型"
rules={[{ required: true, message: '请选择纳税人类型' }]} rules={[{ required: true, message: '请选择纳税人类型' }]}
> >
<Select placeholder="请选择纳税人类型" options={taxpayerTypeOptions.map(item => ({ <Select
placeholder="请选择纳税人类型"
options={taxpayerTypeOptions.map((item) => ({
label: item.dicName, label: item.dicName,
value: item.code, value: item.code,
}))} /> }))}
/>
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={8}> <Col span={8}>
@ -352,7 +377,7 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
const [addressOptions, setAddressOptions] = useState<API.RegionOption[]>([]); const [addressOptions, setAddressOptions] = useState<API.RegionOption[]>([]);
const [currencyOptions, setCurrencyOptions] = useState<DictItem[]>([]); const [currencyOptions, setCurrencyOptions] = useState<DictItem[]>([]);
useEffect(() => { useEffect(() => {
getDictList('currency').then(res => { getDictList('currency').then((res) => {
if (res.code === 200) { if (res.code === 200) {
setCurrencyOptions(res.data); setCurrencyOptions(res.data);
} }
@ -361,13 +386,12 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
useEffect(() => { useEffect(() => {
if (supplierType) { if (supplierType) {
const submitInterface = supplierType === 'dvs' ? getRegionTree : getregionInternational; const submitInterface = supplierType === 'dvs' ? getRegionTree : getregionInternational;
submitInterface().then(res => { submitInterface().then((res) => {
if (res.code === 200) { if (res.code === 200) {
setAddressOptions(convertToCascaderOptions(res.data)); setAddressOptions(convertToCascaderOptions(res.data));
} }
}); });
} }
}, [supplierType]); }, [supplierType]);
// 定义表格记录和表格列类型 // 定义表格记录和表格列类型
@ -400,11 +424,13 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
dataIndex: 'name', dataIndex: 'name',
width: 60, width: 60,
render: (text, record, index = 0) => index + 1, render: (text, record, index = 0) => index + 1,
} },
]; ];
// 境内企业特有列 // 境内企业特有列
const domesticColumns: ColumnType[] = supplierType === 'dvs' ? [ const domesticColumns: ColumnType[] =
supplierType === 'dvs'
? [
{ {
title: '银联号', title: '银联号',
dataIndex: 'interbankNumber', dataIndex: 'interbankNumber',
@ -417,11 +443,14 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
<Input placeholder="请输入银联号" /> <Input placeholder="请输入银联号" />
</Form.Item> </Form.Item>
), ),
} },
] : []; ]
: [];
// 境外企业特有列 // 境外企业特有列
const foreignColumns: ColumnType[] = supplierType === 'ovs' ? [ const foreignColumns: ColumnType[] =
supplierType === 'ovs'
? [
{ {
title: 'SWIFT CODE', title: 'SWIFT CODE',
dataIndex: 'swiftCode', dataIndex: 'swiftCode',
@ -434,8 +463,9 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
<Input placeholder="请输入SWIFT CODE" /> <Input placeholder="请输入SWIFT CODE" />
</Form.Item> </Form.Item>
), ),
} },
] : []; ]
: [];
// 通用列 // 通用列
const commonColumns: ColumnType[] = [ const commonColumns: ColumnType[] = [
@ -491,7 +521,7 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
<Select <Select
style={{ width: '100%' }} style={{ width: '100%' }}
placeholder="请选择币种" placeholder="请选择币种"
options={currencyOptions.map(item => ({ options={currencyOptions.map((item) => ({
label: item.dicName, label: item.dicName,
value: item.code, value: item.code,
}))} }))}
@ -540,7 +570,7 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
</Button> </Button>
), ),
} },
]; ];
// 合并所有列 // 合并所有列

View File

@ -70,6 +70,7 @@ const SupplierAnnualResultQuery2: React.FC = () => {
}, },
userId: '', userId: '',
annualreviewTaskId, annualreviewTaskId,
supplierId,
...searchParams, ...searchParams,
}); });