白名单修改;修改上传组件样式;注册资质信息上传使用组件;年审查询第三步添加供应商id参数
This commit is contained in:
@ -23,6 +23,7 @@ import { validateFileSize } from '@/utils/utils';
|
||||
import { getRegionTree, getregionInternational } from '@/servers/api/register';
|
||||
import { getDictList } from '@/servers/api/dicts';
|
||||
import type { DictItem } from '@/servers/api/dicts';
|
||||
import FileUpload from '@/components/FileUpload/FileUpload';
|
||||
|
||||
const { Option } = Select;
|
||||
|
||||
@ -36,10 +37,13 @@ interface SurveySectionProps extends CommonFormSectionsProps {
|
||||
surveyQuestions?: API.SurveyQuestionResponse;
|
||||
}
|
||||
function convertToCascaderOptions(data: any[]): any[] {
|
||||
return data.map(item => ({
|
||||
return data.map((item) => ({
|
||||
label: item.name,
|
||||
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,21 +54,35 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
|
||||
// 检查行是否有任何字段被填写
|
||||
const hasRowValue = (formInstance: any, recordObj: any, currentField: string) => {
|
||||
const values = formInstance.getFieldsValue(['coscoSupplierQualifications']);
|
||||
if (!values.coscoSupplierQualifications || !values.coscoSupplierQualifications[recordObj.name]) {
|
||||
if (
|
||||
!values.coscoSupplierQualifications ||
|
||||
!values.coscoSupplierQualifications[recordObj.name]
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
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 => {
|
||||
const value = rowData[field];
|
||||
if (field === 'certFile' && value) {
|
||||
return value.fileList && value.fileList.length > 0;
|
||||
}
|
||||
return value !== undefined && value !== null && value !== '';
|
||||
});
|
||||
return fields
|
||||
.filter((field) => field !== currentField)
|
||||
.some((field) => {
|
||||
const value = rowData[field];
|
||||
if (field === 'certFile' && value) {
|
||||
return value.fileList && value.fileList.length > 0;
|
||||
}
|
||||
return value !== undefined && value !== null && value !== '';
|
||||
});
|
||||
};
|
||||
|
||||
// 生成条件性验证规则
|
||||
@ -120,7 +138,8 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
|
||||
<Form.Item
|
||||
name={[record.name, 'certType']}
|
||||
rules={[createConditionalRule('certType', '请输入资质证书类型')]}
|
||||
style={{ margin: 0 }}
|
||||
style={{ margin: 0}}
|
||||
wrapperCol={{ span: 24 }}
|
||||
>
|
||||
<Input placeholder="请输入资质证书类型" />
|
||||
</Form.Item>
|
||||
@ -134,6 +153,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
|
||||
name={[record.name, 'certName']}
|
||||
rules={[createConditionalRule('certName', '请输入资质名称')]}
|
||||
style={{ margin: 0 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
>
|
||||
<Input placeholder="请输入资质名称" />
|
||||
</Form.Item>
|
||||
@ -147,6 +167,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
|
||||
name={[record.name, 'certNumber']}
|
||||
rules={[createConditionalRule('certNumber', '请输入资质证书编号')]}
|
||||
style={{ margin: 0 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
>
|
||||
<Input placeholder="请输入证书编号" />
|
||||
</Form.Item>
|
||||
@ -156,10 +177,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
|
||||
title: createRequiredTitle('资质类别和等级'),
|
||||
dataIndex: 'certLevel',
|
||||
render: (_, record) => (
|
||||
<Form.Item
|
||||
name={[record.name, 'certLevel']}
|
||||
style={{ margin: 0 }}
|
||||
>
|
||||
<Form.Item name={[record.name, 'certLevel']} style={{ margin: 0 }} wrapperCol={{ span: 24 }}>
|
||||
<Input placeholder="请输入资质类别和等级" />
|
||||
</Form.Item>
|
||||
),
|
||||
@ -172,6 +190,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
|
||||
name={[record.name, 'issuingAuthority']}
|
||||
rules={[createConditionalRule('issuingAuthority', '请输入发证机构')]}
|
||||
style={{ margin: 0 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
>
|
||||
<Input placeholder="请输入发证机构" />
|
||||
</Form.Item>
|
||||
@ -185,6 +204,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
|
||||
name={[record.name, 'dateTime']}
|
||||
rules={[createConditionalRule('dateTime', '请选择发证日期')]}
|
||||
style={{ margin: 0 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
>
|
||||
<DatePicker
|
||||
placeholder="年/月/日"
|
||||
@ -202,6 +222,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
|
||||
name={[record.name, 'termOfValidity']}
|
||||
rules={[createConditionalRule('termOfValidity', '请选择资质有效期')]}
|
||||
style={{ margin: 0 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
>
|
||||
<DatePicker
|
||||
placeholder="年/月/日"
|
||||
@ -219,12 +240,13 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
|
||||
name={[record.name, 'certFile']}
|
||||
rules={[createConditionalRule('certFile', '请上传资质证书附件')]}
|
||||
style={{ margin: 0 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
>
|
||||
<Upload name="certFile" action="/api/upload" listType="text" maxCount={1}>
|
||||
<Button type="link" size="small">
|
||||
上传
|
||||
</Button>
|
||||
</Upload>
|
||||
<FileUpload
|
||||
listType="text"
|
||||
maxCount={1}
|
||||
allowedTypes={['pdf', 'jpg', 'jpeg', 'png']}
|
||||
/>
|
||||
</Form.Item>
|
||||
),
|
||||
},
|
||||
@ -263,7 +285,7 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
|
||||
export const InvoiceSection: React.FC<CommonFormSectionsProps> = ({ form }) => {
|
||||
const [taxpayerTypeOptions, setTaxpayerTypeOptions] = useState<DictItem[]>([]);
|
||||
useEffect(() => {
|
||||
getDictList('taxpayer_type').then(res => {
|
||||
getDictList('taxpayer_type').then((res) => {
|
||||
if (res.code === 200) {
|
||||
setTaxpayerTypeOptions(res.data);
|
||||
}
|
||||
@ -280,10 +302,13 @@ export const InvoiceSection: React.FC<CommonFormSectionsProps> = ({ form }) => {
|
||||
label="纳税人类型"
|
||||
rules={[{ required: true, message: '请选择纳税人类型' }]}
|
||||
>
|
||||
<Select placeholder="请选择纳税人类型" options={taxpayerTypeOptions.map(item => ({
|
||||
label: item.dicName,
|
||||
value: item.code,
|
||||
}))} />
|
||||
<Select
|
||||
placeholder="请选择纳税人类型"
|
||||
options={taxpayerTypeOptions.map((item) => ({
|
||||
label: item.dicName,
|
||||
value: item.code,
|
||||
}))}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
@ -352,7 +377,7 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
|
||||
const [addressOptions, setAddressOptions] = useState<API.RegionOption[]>([]);
|
||||
const [currencyOptions, setCurrencyOptions] = useState<DictItem[]>([]);
|
||||
useEffect(() => {
|
||||
getDictList('currency').then(res => {
|
||||
getDictList('currency').then((res) => {
|
||||
if (res.code === 200) {
|
||||
setCurrencyOptions(res.data);
|
||||
}
|
||||
@ -361,13 +386,12 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
|
||||
useEffect(() => {
|
||||
if (supplierType) {
|
||||
const submitInterface = supplierType === 'dvs' ? getRegionTree : getregionInternational;
|
||||
submitInterface().then(res => {
|
||||
submitInterface().then((res) => {
|
||||
if (res.code === 200) {
|
||||
setAddressOptions(convertToCascaderOptions(res.data));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}, [supplierType]);
|
||||
|
||||
// 定义表格记录和表格列类型
|
||||
@ -400,42 +424,48 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
|
||||
dataIndex: 'name',
|
||||
width: 60,
|
||||
render: (text, record, index = 0) => index + 1,
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
// 境内企业特有列
|
||||
const domesticColumns: ColumnType[] = supplierType === 'dvs' ? [
|
||||
{
|
||||
title: '银联号',
|
||||
dataIndex: 'interbankNumber',
|
||||
render: (text, record) => (
|
||||
<Form.Item
|
||||
name={[record.name, 'interbankNumber']}
|
||||
noStyle
|
||||
rules={[{ required: true, message: '请输入银联号' }]}
|
||||
>
|
||||
<Input placeholder="请输入银联号" />
|
||||
</Form.Item>
|
||||
),
|
||||
}
|
||||
] : [];
|
||||
const domesticColumns: ColumnType[] =
|
||||
supplierType === 'dvs'
|
||||
? [
|
||||
{
|
||||
title: '银联号',
|
||||
dataIndex: 'interbankNumber',
|
||||
render: (text, record) => (
|
||||
<Form.Item
|
||||
name={[record.name, 'interbankNumber']}
|
||||
noStyle
|
||||
rules={[{ required: true, message: '请输入银联号' }]}
|
||||
>
|
||||
<Input placeholder="请输入银联号" />
|
||||
</Form.Item>
|
||||
),
|
||||
},
|
||||
]
|
||||
: [];
|
||||
|
||||
// 境外企业特有列
|
||||
const foreignColumns: ColumnType[] = supplierType === 'ovs' ? [
|
||||
{
|
||||
title: 'SWIFT CODE',
|
||||
dataIndex: 'swiftCode',
|
||||
render: (text, record) => (
|
||||
<Form.Item
|
||||
name={[record.name, 'swiftCode']}
|
||||
noStyle
|
||||
rules={[{ required: true, message: '请输入SWIFT CODE' }]}
|
||||
>
|
||||
<Input placeholder="请输入SWIFT CODE" />
|
||||
</Form.Item>
|
||||
),
|
||||
}
|
||||
] : [];
|
||||
const foreignColumns: ColumnType[] =
|
||||
supplierType === 'ovs'
|
||||
? [
|
||||
{
|
||||
title: 'SWIFT CODE',
|
||||
dataIndex: 'swiftCode',
|
||||
render: (text, record) => (
|
||||
<Form.Item
|
||||
name={[record.name, 'swiftCode']}
|
||||
noStyle
|
||||
rules={[{ required: true, message: '请输入SWIFT CODE' }]}
|
||||
>
|
||||
<Input placeholder="请输入SWIFT CODE" />
|
||||
</Form.Item>
|
||||
),
|
||||
},
|
||||
]
|
||||
: [];
|
||||
|
||||
// 通用列
|
||||
const commonColumns: ColumnType[] = [
|
||||
@ -491,7 +521,7 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
|
||||
<Select
|
||||
style={{ width: '100%' }}
|
||||
placeholder="请选择币种"
|
||||
options={currencyOptions.map(item => ({
|
||||
options={currencyOptions.map((item) => ({
|
||||
label: item.dicName,
|
||||
value: item.code,
|
||||
}))}
|
||||
@ -540,7 +570,7 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
|
||||
删除
|
||||
</Button>
|
||||
),
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
// 合并所有列
|
||||
|
@ -70,6 +70,7 @@ const SupplierAnnualResultQuery2: React.FC = () => {
|
||||
},
|
||||
userId: '',
|
||||
annualreviewTaskId,
|
||||
supplierId,
|
||||
...searchParams,
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user