对接注册
This commit is contained in:
@ -9,12 +9,8 @@
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.ant-upload-select {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.file-upload-tip {
|
||||
margin-top: 8px;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
|
@ -203,7 +203,7 @@ const FileUpload: React.FC<FileUploadProps> = ({
|
||||
}
|
||||
|
||||
return (
|
||||
<Button type="link" icon={<UploadOutlined />} disabled={disabled}>
|
||||
<Button type="link" style={{ padding: 0, height: 'auto',marginTop: 6 }} icon={<UploadOutlined />} disabled={disabled}>
|
||||
{buttonText || defaultButtonText}
|
||||
</Button>
|
||||
);
|
||||
|
@ -13,6 +13,7 @@ import supplierAnnualTemplateManage from './en-US/supplierAnnualTemplateManage';
|
||||
import supplierAnnualReview from './en-US/supplierAnnualReview';
|
||||
import supplierAnnualResult from './en-US/supplierAnnualResult';
|
||||
import supplierAnnualTaskManage from './en-US/supplierAnnualTaskManage';
|
||||
import components from './en-US/component';
|
||||
|
||||
export default {
|
||||
'navBar.lang': 'Languages',
|
||||
@ -39,4 +40,5 @@ export default {
|
||||
...supplierAnnualReview,
|
||||
...supplierAnnualResult,
|
||||
...supplierAnnualTaskManage,
|
||||
...components,
|
||||
};
|
||||
|
3
src/locales/en-US/component.ts
Normal file
3
src/locales/en-US/component.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export default {
|
||||
'component.fileUpload.buttonText': 'Upload File',
|
||||
};
|
@ -13,6 +13,7 @@ import supplierAnnualTemplateManage from './zh-CN/supplierAnnualTemplateManage';
|
||||
import supplierAnnualReview from './zh-CN/supplierAnnualReview';
|
||||
import supplierAnnualResult from './zh-CN/supplierAnnualResult';
|
||||
import supplierAnnualTaskManage from './zh-CN/supplierAnnualTaskManage';
|
||||
import components from './zh-CN/component';
|
||||
|
||||
export default {
|
||||
'navBar.lang': '语言',
|
||||
@ -39,4 +40,5 @@ export default {
|
||||
...supplierAnnualReview,
|
||||
...supplierAnnualResult,
|
||||
...supplierAnnualTaskManage,
|
||||
...components,
|
||||
};
|
||||
|
3
src/locales/zh-CN/component.ts
Normal file
3
src/locales/zh-CN/component.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export default {
|
||||
'component.fileUpload.buttonText': '上传文件',
|
||||
};
|
@ -138,7 +138,7 @@ 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="请输入资质证书类型" />
|
||||
@ -177,7 +177,11 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
|
||||
title: createRequiredTitle('资质类别和等级'),
|
||||
dataIndex: 'certLevel',
|
||||
render: (_, record) => (
|
||||
<Form.Item name={[record.name, 'certLevel']} style={{ margin: 0 }} wrapperCol={{ span: 24 }}>
|
||||
<Form.Item
|
||||
name={[record.name, 'certLevel']}
|
||||
style={{ margin: 0 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
>
|
||||
<Input placeholder="请输入资质类别和等级" />
|
||||
</Form.Item>
|
||||
),
|
||||
@ -241,11 +245,21 @@ export const QualificationSection: React.FC<CommonFormSectionsProps> = ({ form }
|
||||
rules={[createConditionalRule('certFile', '请上传资质证书附件')]}
|
||||
style={{ margin: 0 }}
|
||||
wrapperCol={{ span: 24 }}
|
||||
getValueProps={(value) => {
|
||||
return {
|
||||
value: value?.length > 0 ? value[0]?.url : undefined,
|
||||
};
|
||||
}}
|
||||
getValueFromEvent={(value) => {
|
||||
return value.length > 0 && value[0].url;
|
||||
}}
|
||||
>
|
||||
<FileUpload
|
||||
listType="text"
|
||||
maxCount={1}
|
||||
allowedTypes={['pdf', 'jpg', 'jpeg', 'png']}
|
||||
maxSize={10}
|
||||
tip="pdf,jpg,jpeg,png类型的文件,大小不超过10MB"
|
||||
/>
|
||||
</Form.Item>
|
||||
),
|
||||
@ -350,16 +364,25 @@ export const InvoiceSection: React.FC<CommonFormSectionsProps> = ({ form }) => {
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item name="generalTaxpayerCert" label="一般纳税人资格证明">
|
||||
<Upload
|
||||
name="generalTaxpayerCert"
|
||||
action="/api/upload"
|
||||
<Form.Item
|
||||
name="generalTaxpayerCert"
|
||||
label="一般纳税人资格证明"
|
||||
getValueProps={(value) => {
|
||||
return {
|
||||
value: value?.length > 0 ? value[0]?.url : undefined,
|
||||
};
|
||||
}}
|
||||
getValueFromEvent={(value) => {
|
||||
return value.length > 0 && value[0].url;
|
||||
}}
|
||||
>
|
||||
<FileUpload
|
||||
listType="text"
|
||||
maxCount={1}
|
||||
beforeUpload={(file) => validateFileSize(file, 10, ['pdf', 'jpg', 'jpeg', 'png'])}
|
||||
>
|
||||
<Button icon={<UploadOutlined />}>上传文件</Button>
|
||||
</Upload>
|
||||
allowedTypes={['pdf', 'jpg', 'jpeg', 'png']}
|
||||
maxSize={10}
|
||||
tip="pdf,jpg,jpeg,png类型的文件,大小不超过10MB"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
@ -796,43 +819,22 @@ export const AttachmentSection: React.FC<CommonFormSectionsProps> = ({ form }) =
|
||||
<Form.Item
|
||||
name={[field.name, 'fileUrl']}
|
||||
rules={[{ required: true, message: '请上传已盖章的反商业贿赂承诺书' }]}
|
||||
getValueFromEvent={(value) => {
|
||||
return value.length > 0 && value[0].url;
|
||||
}}
|
||||
getValueProps={(value) => {
|
||||
return {
|
||||
value: value?.length > 0 ? value[0]?.url : undefined,
|
||||
};
|
||||
}}
|
||||
>
|
||||
<Upload
|
||||
name="file"
|
||||
action="/api/upload"
|
||||
<FileUpload
|
||||
listType="text"
|
||||
maxCount={1}
|
||||
beforeUpload={(file) =>
|
||||
validateFileSize(file, 10, ['pdf', 'doc', 'docx'])
|
||||
}
|
||||
onChange={(info) => {
|
||||
if (info.file.status === 'done') {
|
||||
const response = info.file.response;
|
||||
if (response && response.success) {
|
||||
// 填充文件信息
|
||||
form.setFieldsValue({
|
||||
coscoSupplierSurveyAttachments: [
|
||||
{
|
||||
...form.getFieldValue([
|
||||
'coscoSupplierSurveyAttachments',
|
||||
field.name,
|
||||
]),
|
||||
fileName: info.file.name,
|
||||
fileType: info.file.type,
|
||||
fileSize: info.file.size?.toString() || '0',
|
||||
filePath: response.filePath || response.url,
|
||||
},
|
||||
],
|
||||
});
|
||||
message.success(`${info.file.name} 上传成功`);
|
||||
} else {
|
||||
message.error(`${info.file.name} 上传失败`);
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Button icon={<UploadOutlined />}>上传文件</Button>
|
||||
</Upload>
|
||||
allowedTypes={['pdf', 'doc', 'docx', 'jpg', 'jpeg', 'png']}
|
||||
maxSize={10}
|
||||
tip="pdf,doc,docx,jpg,jpeg,png类型的文件,大小不超过10MB"
|
||||
/>
|
||||
</Form.Item>
|
||||
</div>
|
||||
))}
|
||||
@ -869,42 +871,23 @@ export const AttachmentSection: React.FC<CommonFormSectionsProps> = ({ form }) =
|
||||
)}
|
||||
|
||||
{index > 0 && (
|
||||
<Form.Item name={[field.name, 'fileUrl']}>
|
||||
<Upload
|
||||
name="file"
|
||||
action="/api/upload"
|
||||
<Form.Item
|
||||
name={[field.name, 'fileUrl']}
|
||||
getValueFromEvent={(value) => {
|
||||
return value.length > 0 && value[0].url;
|
||||
}}
|
||||
getValueProps={(value) => {
|
||||
return {
|
||||
value: value?.length > 0 ? value[0]?.url : undefined,
|
||||
};
|
||||
}}
|
||||
>
|
||||
<FileUpload
|
||||
listType="text"
|
||||
maxCount={1}
|
||||
beforeUpload={(file) => validateFileSize(file, 20, ['*'])}
|
||||
onChange={(info) => {
|
||||
if (info.file.status === 'done') {
|
||||
const response = info.file.response;
|
||||
if (response && response.success) {
|
||||
// 填充文件信息
|
||||
const fieldValue = form.getFieldValue([
|
||||
'coscoSupplierSurveyAttachments',
|
||||
field.name,
|
||||
]);
|
||||
form.setFieldsValue({
|
||||
coscoSupplierSurveyAttachments: [
|
||||
{
|
||||
...fieldValue,
|
||||
fileName: info.file.name,
|
||||
fileType: info.file.type,
|
||||
fileSize: info.file.size?.toString() || '0',
|
||||
filePath: response.filePath || response.url,
|
||||
},
|
||||
],
|
||||
});
|
||||
message.success(`${info.file.name} 上传成功`);
|
||||
} else {
|
||||
message.error(`${info.file.name} 上传失败`);
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Button icon={<UploadOutlined />}>上传</Button>
|
||||
</Upload>
|
||||
maxSize={10}
|
||||
tip="大小不超过10MB"
|
||||
/>
|
||||
</Form.Item>
|
||||
)}
|
||||
</div>
|
||||
|
@ -72,13 +72,12 @@ const DomesticForm: React.FC<DomesticFormProps> = ({
|
||||
<Form.Item
|
||||
name={['coscoSupplierBase', 'licenceAccessory']}
|
||||
label="营业执照附件"
|
||||
extra="pdf,jpg,jpeg,png类型的文件,大小不超过10MB"
|
||||
rules={[{ required: true, message: '请上传营业执照附件' }]}
|
||||
// getValueProps={(value) => {
|
||||
// return {
|
||||
// value: value?.length > 0 ? value[0]?.url : undefined,
|
||||
// };
|
||||
// }}
|
||||
getValueProps={(value) => {
|
||||
return {
|
||||
value: value?.length > 0 ? value[0]?.url : undefined,
|
||||
};
|
||||
}}
|
||||
getValueFromEvent={(value) => {
|
||||
return value?.length > 0 ? value[0]?.url : undefined;
|
||||
}}
|
||||
@ -88,6 +87,7 @@ const DomesticForm: React.FC<DomesticFormProps> = ({
|
||||
maxCount={1}
|
||||
maxSize={10}
|
||||
allowedTypes={['pdf', 'jpg', 'jpeg', 'png']}
|
||||
tip="pdf,jpg,jpeg,png类型的文件,大小不超过10MB"
|
||||
>
|
||||
<Button icon={<UploadOutlined />}>上传文件</Button>
|
||||
</FileUpload>
|
||||
@ -220,7 +220,11 @@ const DomesticForm: React.FC<DomesticFormProps> = ({
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item name="officeAddress" label="办公地址" rules={[{ required: true, message: '请输入办公地址' }]}>
|
||||
<Form.Item
|
||||
name="officeAddress"
|
||||
label="办公地址"
|
||||
rules={[{ required: true, message: '请输入办公地址' }]}
|
||||
>
|
||||
<Input
|
||||
prefix={<EnvironmentOutlined />}
|
||||
placeholder="请具体注明省、市、区、路、门牌号"
|
||||
|
Reference in New Issue
Block a user