From 6325c023be17f6bd48b6131b5c17bbbaf0a6dad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E6=99=AF=E5=AD=A6?= <5412262+sun_jing_xue@user.noreply.gitee.com> Date: Fri, 4 Jul 2025 10:15:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=A6=E5=BD=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/register/register.less | 17 + src/pages/register/supplier.tsx | 53 +- .../components/SupplierExitModal.tsx | 30 + .../SupplierRegisterAgent/index.tsx | 19 +- src/pages/supplier/register/expert.tsx | 241 ------ src/pages/supplier/register/register.less | 108 --- src/pages/supplier/register/supplier.tsx | 226 ----- .../register/supplier/CommonFormSections.tsx | 770 ------------------ .../register/supplier/DomesticForm.tsx | 282 ------- .../register/supplier/ForeignForm.tsx | 317 ------- src/servers/api/register.ts | 8 +- 11 files changed, 108 insertions(+), 1963 deletions(-) create mode 100644 src/pages/supplier/informationManagement/SupplierRegisterAgent/components/SupplierExitModal.tsx delete mode 100644 src/pages/supplier/register/expert.tsx delete mode 100644 src/pages/supplier/register/register.less delete mode 100644 src/pages/supplier/register/supplier.tsx delete mode 100644 src/pages/supplier/register/supplier/CommonFormSections.tsx delete mode 100644 src/pages/supplier/register/supplier/DomesticForm.tsx delete mode 100644 src/pages/supplier/register/supplier/ForeignForm.tsx diff --git a/src/pages/register/register.less b/src/pages/register/register.less index cc83ba1..25ff5b3 100644 --- a/src/pages/register/register.less +++ b/src/pages/register/register.less @@ -13,6 +13,23 @@ position: relative; } +.register-page.on { + background: none; + min-height: auto; +} + +.register-page.on .register-container { + padding: 0; + margin: 0; + box-shadow: none; + &.large-width{ + width: 100%; + position: relative; + top: 0; + } + +} + // 注册容器 .register-container { width: 600px; diff --git a/src/pages/register/supplier.tsx b/src/pages/register/supplier.tsx index da39383..1d03ac2 100644 --- a/src/pages/register/supplier.tsx +++ b/src/pages/register/supplier.tsx @@ -5,10 +5,17 @@ import { Form, Button, message, Radio, Checkbox, Modal, Spin } from 'antd'; import { HomeOutlined } from '@ant-design/icons'; import DomesticForm from './supplier/DomesticForm'; import ForeignForm from './supplier/ForeignForm'; -import { coscoSupplierBaseAdd, fetchSurveyQuestions } from '@/servers/api/register'; +import { addAgent, coscoSupplierBaseAdd, fetchSurveyQuestions } from '@/servers/api/register'; import './register.less'; -const SupplierRegister: React.FC = () => { +interface supplierWithInputProps { + supplierWithInput?: Boolean; + exitId?: string; + onOk?: () => void; +} + +const SupplierRegister: React.FC = (props) => { + const { supplierWithInput = false, exitId = '', onOk } = props; const [form] = Form.useForm(); const intl = useIntl(); const [supplierType, setSupplierType] = useState('dvs'); @@ -20,6 +27,10 @@ const SupplierRegister: React.FC = () => { // 获取问卷列表 useEffect(() => { + //供应商带录入 + if (supplierWithInput) { + + } const fetchQuestions = async () => { setFetchingQuestions(true); try { @@ -71,12 +82,17 @@ const SupplierRegister: React.FC = () => { console.log('供应商注册信息:', values); - // 直接调用API - const response = await coscoSupplierBaseAdd(values); + // 直接调用API supplierWithInput === true 供应商注册代录 否则 注册 + const response = await (supplierWithInput? addAgent(values) : coscoSupplierBaseAdd(values)); if (response.success) { - message.success('注册成功,请登录'); - history.push('/login'); + if(!supplierWithInput) { + message.success('注册成功,请登录'); + history.push('/login'); + } else { + message.success(`${exitId? '修改成功': '注册成功'}`); + onOk; + } } else { message.error(response.message || '注册失败,请重试'); } @@ -94,17 +110,22 @@ const SupplierRegister: React.FC = () => { }; return ( -
+
- + {!supplierWithInput && ( + <> + + +
+ {intl.formatMessage({ id: 'register.supplier.title' })} +
+ + )} -
- {intl.formatMessage({ id: 'register.supplier.title' })} -
{ okText="我知道了" cancelButtonProps={{ style: { display: 'none' } }} destroyOnClose - // maskClosable={false} + // maskClosable={false} >

尊敬的用户:

diff --git a/src/pages/supplier/informationManagement/SupplierRegisterAgent/components/SupplierExitModal.tsx b/src/pages/supplier/informationManagement/SupplierRegisterAgent/components/SupplierExitModal.tsx new file mode 100644 index 0000000..25a1dce --- /dev/null +++ b/src/pages/supplier/informationManagement/SupplierRegisterAgent/components/SupplierExitModal.tsx @@ -0,0 +1,30 @@ +// components/SupplierExitModal.tsx +import React from 'react'; +import { Modal } from 'antd'; +import Register from '@/pages/register/supplier' +interface SupplierExitModalProps { + visible: boolean; + exitId: string; + onOk: () => void; +} + +const SupplierExitModal: React.FC = ({ visible, exitId, onOk }) => { + return ( + + + + ); +}; + +export default SupplierExitModal; diff --git a/src/pages/supplier/informationManagement/SupplierRegisterAgent/index.tsx b/src/pages/supplier/informationManagement/SupplierRegisterAgent/index.tsx index e5f2fb0..416ac3b 100644 --- a/src/pages/supplier/informationManagement/SupplierRegisterAgent/index.tsx +++ b/src/pages/supplier/informationManagement/SupplierRegisterAgent/index.tsx @@ -4,6 +4,9 @@ import { SearchOutlined, ReloadOutlined, PlusOutlined } from '@ant-design/icons' import { getPageAgent } from './services'; import type { ColumnsType } from 'antd/es/table'; import SupplierViewModal from './components/SupplierViewModal'; +import SupplierExitModal from './components/SupplierExitModal'; + + const { RangePicker } = DatePicker; const { TabPane } = Tabs; interface Columns { @@ -24,6 +27,10 @@ const SupplierRegisterAgent: React.FC = () => { const [viewVisible, setViewVisible] = useState(false); //查看 参数传递 const [currentRecord, setCurrentRecord] = useState(''); + // 新增与修改 + const [exitModalVisible, setExitModalVisible] = useState(false); + const [exitId, setExitId] = useState(''); + // 查询数据 const fetchData = async (page = 1, pageSize = 10) => { setLoading(true); @@ -120,7 +127,10 @@ const SupplierRegisterAgent: React.FC = () => { render: (_: any, record: any) => ( { setCurrentRecord(record.id); setViewVisible(true); }}>查看 - message.info(`编辑:${record.name}`)}>编辑 + {/* { + setExitId(record.id); + setExitModalVisible(true); + }}>编辑 */} ), }, @@ -155,7 +165,7 @@ const SupplierRegisterAgent: React.FC = () => { - + {/* 表格 */} @@ -179,6 +189,11 @@ const SupplierRegisterAgent: React.FC = () => { record={currentRecord} onCancel={() => setViewVisible(false)} /> + setExitModalVisible(false)} + />
); }; diff --git a/src/pages/supplier/register/expert.tsx b/src/pages/supplier/register/expert.tsx deleted file mode 100644 index f581335..0000000 --- a/src/pages/supplier/register/expert.tsx +++ /dev/null @@ -1,241 +0,0 @@ -// 专家注册 -import React, { useState } from 'react'; -import { useIntl, history } from 'umi'; -import { Form, Input, Button, message, Card, Select, Row, Col } from 'antd'; -import { - UserOutlined, - LockOutlined, - MobileOutlined, - IdcardOutlined, - HomeOutlined, -} from '@ant-design/icons'; -import './register.less'; - -const { Option } = Select; - -const ExpertRegister: React.FC = () => { - const [form] = Form.useForm(); - const intl = useIntl(); - const [loading, setLoading] = useState(false); - const [countdown, setCountdown] = useState(0); - - // 获取短信验证码 - const handleGetCaptcha = () => { - form - .validateFields(['phone']) - .then((values) => { - message.success(`验证码已发送至 ${values.phone}`); - let count = 60; - setCountdown(count); - - const timer = setInterval(() => { - count--; - setCountdown(count); - if (count === 0) { - clearInterval(timer); - } - }, 1000); - }) - .catch((errorInfo) => { - message.error('请先输入正确的手机号'); - }); - }; - - const onFinish = (values: any) => { - setLoading(true); - console.log('专家注册信息:', values); - // 这里添加注册逻辑 - setTimeout(() => { - setLoading(false); - message.success('注册成功,请登录'); - history.push('/login'); - }, 1000); - }; - - return ( -
-
- - -
{intl.formatMessage({ id: 'register.expert.title' })}
- - - - } - placeholder={intl.formatMessage({ id: 'register.username.placeholder' })} - /> - - - - } - placeholder={intl.formatMessage({ id: 'register.phone.placeholder' })} - /> - - - - - - - - } - placeholder={intl.formatMessage({ id: 'register.expert.idCard.placeholder' })} - /> - - - - } - placeholder={intl.formatMessage({ id: 'register.password.placeholder' })} - /> - - - ({ - validator(_, value) { - if (!value || getFieldValue('password') === value) { - return Promise.resolve(); - } - return Promise.reject( - new Error(intl.formatMessage({ id: 'register.confirmPassword.notMatch' })), - ); - }, - }), - ]} - > - } - placeholder={intl.formatMessage({ id: 'register.confirmPassword.placeholder' })} - /> - - - - - - - - - - - - - - - - - - -
-
- ); -}; - -export default ExpertRegister; diff --git a/src/pages/supplier/register/register.less b/src/pages/supplier/register/register.less deleted file mode 100644 index 4a038b7..0000000 --- a/src/pages/supplier/register/register.less +++ /dev/null @@ -1,108 +0,0 @@ -// @import '~@/baseStyle.less'; - -// 注册页面整体布局 -.register-page { - // display: flex; - // justify-content: center; - // align-items: center; - // min-height: 100vh; - // background: #f0f2f5; - // // background-image: url('~@/assets/img/loginBg.jpg'); - // background-size: cover; - // background-position: center; - // position: relative; -} - -// 注册容器 -.register-container { - &.large-width{ - width: 100%; - - } -} - -// 标题样式 -.register-title { - margin-bottom: 20px; - // color: @main-color; - font-weight: bold; - font-size: 24px; - text-align: center; -} - -// 返回首页链接 -.back-home { - position: absolute; - top: 10px; - left: 10px; - - a { - display: flex; - align-items: center; - // color: @main-color; - font-size: 14px; - - &:hover { - // color: lighten(@main-color, 10%); - } - - .anticon { - margin-right: 4px; - } - } -} -.form-section-title { - font-size: 16px; - font-weight: 600; - margin: 20px 0 16px 0; - padding-left: 12px; - border-left: 4px solid #1890ff; -} - -.questionnaire-header, -.questionnaire-questions { - font-weight: 500; - margin: 10px 0; - padding: 5px 0; -} - -.question-text { - margin-bottom: 10px; - color: #333; -} - -.commitment-upload { - padding: 15px; - background-color: #f9f9f9; - border-radius: 4px; -} - -.qualification-table { - .ant-table-thead > tr > th { - background-color: #f0f5ff; - font-weight: 500; - } - - .ant-form-item { - margin-bottom: 0; - } - - .ant-table-cell { - padding: 8px; - } -} - -.questionnaire-header { - font-size: 15px; - font-weight: 500; - margin: 15px 0 10px 0; - color: rgba(0, 0, 0, 0.85); -} - - -.register-form{ - height: 75vh; - overflow-x: hidden; - overflow-y: auto; - padding-right: 31px; -} \ No newline at end of file diff --git a/src/pages/supplier/register/supplier.tsx b/src/pages/supplier/register/supplier.tsx deleted file mode 100644 index 9d52efd..0000000 --- a/src/pages/supplier/register/supplier.tsx +++ /dev/null @@ -1,226 +0,0 @@ -// 供应商注册 -import React, { useState, useEffect } from 'react'; -import { useIntl, history } from 'umi'; -import { Form, Button, message, Radio, Checkbox, Modal, Spin } from 'antd'; -import { HomeOutlined } from '@ant-design/icons'; -import DomesticForm from './supplier/DomesticForm'; -import ForeignForm from './supplier/ForeignForm'; -// import { coscoSupplierBaseAdd, fetchSurveyQuestions } from '@/servers/api/register'; -import './register.less'; - -const SupplierRegister: React.FC = () => { - const [form] = Form.useForm(); - const intl = useIntl(); - const [supplierType, setSupplierType] = useState('dvs'); - const [loading, setLoading] = useState(false); - const [countdown, setCountdown] = useState(0); - const [modalVisible, setModalVisible] = useState(false); - const [surveyQuestions, setSurveyQuestions] = useState([]); - const [fetchingQuestions, setFetchingQuestions] = useState(false); - - // 获取问卷列表 - useEffect(() => { - // const fetchQuestions = async () => { - // setFetchingQuestions(true); - // try { - // const response = await fetchSurveyQuestions(); - // if (response.success) { - // setSurveyQuestions(response.data || []); - // } else { - // message.error(response.message || '获取问卷列表失败'); - // } - // } catch (error) { - // console.error('获取问卷列表出错:', error); - // message.error('获取问卷列表出错'); - // } finally { - // setFetchingQuestions(false); - // } - // }; - - // fetchQuestions(); - }, []); - - // 获取短信验证码 - const handleGetCaptcha = () => { - form - .validateFields(['contactPhone']) - .then((values) => { - message.success(`验证码已发送至 ${values.contactPhone}`); - let count = 60; - setCountdown(count); - - const timer = setInterval(() => { - count--; - setCountdown(count); - if (count === 0) { - clearInterval(timer); - } - }, 1000); - }) - .catch((errorInfo) => { - message.error('请先输入正确的手机号'); - }); - }; - - const onFinish = async (values: any) => { - setLoading(true); - try { - // 确保供应商类型添加到表单值中 - values.coscoSupplierBase = values.coscoSupplierBase || {}; - values.coscoSupplierBase.supplierType = supplierType; - - console.log('供应商注册信息:', values); - - // // 直接调用API - // const response = await coscoSupplierBaseAdd(values); - - // if (response.success) { - // message.success('注册成功,请登录'); - // history.push('/login'); - // } else { - // message.error(response.message || '注册失败,请重试'); - // } - } catch (error) { - console.error('注册出错:', error); - message.error('注册失败,请稍后重试'); - } finally { - setLoading(false); - } - }; - - const handleSupplierTypeChange = (e: any) => { - form.resetFields(); - setSupplierType(e.target.value); - }; - - return ( -
-
- {/* */} - - {/*
- {intl.formatMessage({ id: 'register.supplier.title' })} -
*/} - - -
- {/* - - 境内企业/机构 - 境外企业 - - */} - - {supplierType === 'dvs' ? ( - - ) : ( - - )} - {/* - value - ? Promise.resolve() - : Promise.reject(new Error('请阅读并同意注册信息承诺书')), - }, - ]} - > - - 我已阅读并同意 - - - */} - -
- -
-
- -
-
- - {/* 注册信息承诺书弹窗 */} - { - console.log('点击了确定按钮'); - setModalVisible(false); - }} - onCancel={() => { - console.log('点击了取消按钮'); - setModalVisible(false); - }} - width={700} - okText="我知道了" - cancelButtonProps={{ style: { display: 'none' } }} - destroyOnClose - // maskClosable={false} - > -
-

尊敬的用户:

-

感谢您注册使用我们的平台。请您仔细阅读以下承诺内容:

-
    -
  1. - 本人/单位承诺所提供的注册信息真实、准确、完整,不存在虚假记载、误导性陈述或重大遗漏。 -
  2. -
  3. 本人/单位承诺遵守平台的各项规则和要求,不从事任何违法违规活动。
  4. -
  5. - 本人/单位了解并同意,如提供虚假信息或违反平台规则,平台有权终止服务并追究相关责任。 -
  6. -
  7. 本人/单位承诺妥善保管账号和密码,对账号下的所有操作和行为负责。
  8. -
  9. 本人/单位同意平台在必要范围内合法使用所提供的信息,用于提供服务和改善用户体验。
  10. -
  11. - 本人/单位承诺遵守国家法律法规和行业规范,恪守商业道德,不从事任何损害平台或其他用户利益的行为。 -
  12. -
  13. 本人/单位承诺所上传的资质文件和证明材料真实有效,并对其真实性和合法性负责。
  14. -
  15. 本人/单位了解并同意,平台有权根据业务需要对用户资料进行审核,并保留最终解释权。
  16. -
-

特此承诺!

-
-
-
- ); -}; - -export default SupplierRegister; diff --git a/src/pages/supplier/register/supplier/CommonFormSections.tsx b/src/pages/supplier/register/supplier/CommonFormSections.tsx deleted file mode 100644 index 66f8b98..0000000 --- a/src/pages/supplier/register/supplier/CommonFormSections.tsx +++ /dev/null @@ -1,770 +0,0 @@ -/** - * 供应商注册表单通用部分 - * 封装了国内企业和境外企业注册表单相同的部分 - */ -import React from 'react'; -import { - Form, - Input, - Button, - Select, - Upload, - DatePicker, - Row, - Col, - Table, - Radio, - Cascader, - Empty, -} from 'antd'; -import { UploadOutlined, PlusOutlined, DeleteOutlined } from '@ant-design/icons'; -import { message } from 'antd'; -import { validateFileSize } from '@/utils/utils'; - -const { Option } = Select; - -// 中国省市区级联数据 -export const addressOptions = [ - { - value: '330000', - label: '浙江省', - children: [ - { - value: '330100', - label: '杭州市', - children: [ - { value: '330102', label: '上城区' }, - { value: '330103', label: '下城区' }, - { value: '330104', label: '江干区' }, - { value: '330105', label: '拱墅区' }, - { value: '330106', label: '西湖区' }, - { value: '330108', label: '滨江区' }, - ], - }, - ], - }, - { - value: '310000', - label: '上海市', - children: [ - { - value: '310100', - label: '上海市', - children: [ - { value: '310101', label: '黄浦区' }, - { value: '310104', label: '徐汇区' }, - { value: '310105', label: '长宁区' }, - ], - }, - ], - }, -]; - -interface CommonFormSectionsProps { - form: any; -} - -// 扩展问卷部分的属性接口 -interface SurveySectionProps extends CommonFormSectionsProps { - surveyQuestions?: API.SurveyQuestionResponse; -} - -/** - * 资质信息表单部分 - * 包含资质证书类型、名称、编号、等级、发证机构、发证日期、有效期等 - */ -export const QualificationSection: React.FC = ({ form }) => { - return ( - <> -
资质信息
- - - {(fields, { add, remove }) => ( - <> - ({ - ...field, - key: field.key, - fieldKey: field.name, - }))} - pagination={false} - bordered - size="middle" - rowKey="key" - columns={[ - { - title: '序号', - dataIndex: 'name', - width: 60, - render: (_, __, index) => index + 1, - }, - { - title: '资质证书类型', - dataIndex: 'certType', - render: (_, record) => ( - - - - ), - }, - { - title: '资质名称', - dataIndex: 'certName', - render: (_, record) => ( - - - - ), - }, - { - title: '资质证书编号', - dataIndex: 'certNumber', - render: (_, record) => ( - - - - ), - }, - { - title: '资质类别和等级', - dataIndex: 'certLevel', - render: (_, record) => ( - - - - ), - }, - { - title: '发证机构', - dataIndex: 'issuingAuthority', - render: (_, record) => ( - - - - ), - }, - { - title: '发证日期', - dataIndex: 'issueDate', - render: (_, record) => ( - - - - ), - }, - { - title: '资质有效期至', - dataIndex: 'expiryDate', - render: (_, record) => ( - - - - ), - }, - { - title: '附件', - dataIndex: 'certFile', - render: (_, record) => ( - - - - - - ), - }, - { - title: '操作', - width: 70, - render: (_, record) => ( - - ), - }, - ]} - /> - - - - - )} - - - ); -}; - -/** - * 开票信息表单部分 - * 包含纳税人类型、开票抬头、纳税人识别号、开票地址等 - */ -export const InvoiceSection: React.FC = ({ form }) => { - return ( - <> -
开票信息
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - validateFileSize(file, 10, ['pdf', 'jpg', 'jpeg', 'png'])} - > - - - - - - - ); -}; - -/** - * 银行账户表单部分 - * 包含开户银行、账户名称、账号、所在地区等 - */ -export const BankAccountSection: React.FC = ({ form }) => { - return ( - <> -
银行账户
- - - {(fields, { add, remove }) => ( - <> -
({ - ...field, - key: field.key, - fieldKey: field.name, - }))} - pagination={false} - bordered - size="middle" - rowKey="key" - columns={[ - { - title: '序号', - dataIndex: 'name', - width: 60, - render: (_, __, index) => index + 1, - }, - { - title: '开户银行', - dataIndex: 'bankName', - render: (_, record) => ( - - - - ), - }, - { - title: '账户名称', - dataIndex: 'accountName', - render: (_, record) => ( - - - - ), - }, - { - title: '账号', - dataIndex: 'accountNumber', - render: (_, record) => ( - - - - ), - }, - { - title: '国家、省、市', - dataIndex: 'location', - render: (_, record) => ( - - { - return path.some((option) => { - if (typeof option.label === 'string') { - return ( - option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1 - ); - } - return false; - }); - }, - }} - /> - - ), - }, - { - title: '操作', - width: 70, - render: (_, record) => ( - - ), - }, - ]} - /> - - - - - )} - - - ); -}; - -/** - * 社会准则符合性自查问卷部分 - * 包含填写人信息和问卷内容 - */ -export const SurveySection: React.FC = ({ form, surveyQuestions }) => { - // 使用API获取的问卷数据,如果没有则显示无数据状态 - const hasQuestions = surveyQuestions && surveyQuestions.length > 0; - - return ( - <> -
社会准则符合性自查问卷
- -
填写人信息:
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- 问卷: -
- - {hasQuestions ? ( - - {(fields, { add, remove }) => { - // 确保有足够的表单项对应每个问题 - if (fields.length < surveyQuestions.length) { - const diff = surveyQuestions.length - fields.length; - for (let i = 0; i < diff; i++) { - add(); - } - } - - return ( -
index + 1, - }, - { - title: '问题', - dataIndex: 'questionName', - render: (text) =>
{text}
, - }, - { - title: '回复', - width: 650, - render: (_, record, index) => ( - <> - - - - {record.coscoSurveyQuestionOptionList?.map((option: any) => ( - - {option.optionName} - - ))} - - - - ), - }, - ]} - /> - ); - }} - - ) : ( -
- -
- )} - - ); -}; - -/** - * 供应商反商业贿赂承诺书和其他附件部分 - */ -export const AttachmentSection: React.FC = ({ form }) => { - return ( - <> -
供应商反商业贿赂承诺书
- -
-
- 请加盖公司公章后上传 - -
- - - {(fields, { add, remove }) => { - // 确保至少有一项用于反商业贿赂承诺书 - if (fields.length === 0) { - add({ attachmentsType: 'commitment' }); - } - - return ( -
- {fields.map((field, index) => ( -
- - - - - 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(), - filePath: response.filePath || response.url, - }, - ], - }); - message.success(`${info.file.name} 上传成功`); - } else { - message.error(`${info.file.name} 上传失败`); - } - } - }} - > - - - -
- ))} -
- ); - }} -
- - - -
其他附件
- - - - {(fields, { add, remove }) => ( - <> -
其他附件(非必须上传)
- {fields.map((field, index) => ( -
0 || fields.length === 1 ? 'block' : 'none', - marginBottom: 8, - }} - > - {index > 0 && ( - - )} - - {index > 0 && ( - - 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(), - filePath: response.filePath || response.url, - }, - ], - }); - message.success(`${info.file.name} 上传成功`); - } else { - message.error(`${info.file.name} 上传失败`); - } - } - }} - > - - - - )} -
- ))} - - - - )} -
- - - - ); -}; diff --git a/src/pages/supplier/register/supplier/DomesticForm.tsx b/src/pages/supplier/register/supplier/DomesticForm.tsx deleted file mode 100644 index 0748663..0000000 --- a/src/pages/supplier/register/supplier/DomesticForm.tsx +++ /dev/null @@ -1,282 +0,0 @@ -/* 境内企业/机构 表单项 */ -import React from 'react'; -import { Form, Input, Button, Select, Upload, DatePicker, Row, Col, message } from 'antd'; -import { - MobileOutlined, - MailOutlined, - EnvironmentOutlined, - UploadOutlined, -} from '@ant-design/icons'; - -/** - * 引入通用表单组件 - */ -import { - QualificationSection, - InvoiceSection, - BankAccountSection, - SurveySection, - AttachmentSection, -} from './CommonFormSections'; -import { validateFileSize } from '@/utils/utils'; - -const { Option } = Select; -const { TextArea } = Input; - -// 移除不再需要的addressOptions - -interface DomesticFormProps { - form: any; - countdown: number; - handleGetCaptcha: () => void; - surveyQuestions?: any; // 本身就是数组类型 -} - -/** - * 境内企业注册表单 - * 基本信息部分为境内企业特有 - * 其他部分使用通用表单组件 - */ -const DomesticForm: React.FC = ({ - form, - countdown, - handleGetCaptcha, - surveyQuestions, -}) => { - return ( - <> -
基本信息
- - {/* 营业执照附件和有效期 */} - -
- - validateFileSize(file, 10, ['pdf', 'jpg', 'jpeg', 'png'])} - > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } placeholder="上海市普陀区XX路1888号" /> - - - - - } - placeholder="请具体注明省、市、区、路、门牌号" - /> - - - - - - - - - - } placeholder="请输入11位手机号码" /> - - - { false && ( - - - - - - - - - - - - - )} - - - - - - - - - - - - - - } placeholder="请输入企业联系电话" /> - - - - - - - - - -