From 27d6d10d27047a777679203b2cb4f909ce4e8a3b Mon Sep 17 00:00:00 2001 From: linxd <544554903@qq.com> Date: Wed, 16 Jul 2025 10:16:46 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BD=E5=90=8D=E5=8D=95=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9B=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=EF=BC=9B=E6=B3=A8=E5=86=8C=E8=B5=84=E8=B4=A8?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=B8=8A=E4=BC=A0=E4=BD=BF=E7=94=A8=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=9B=E5=B9=B4=E5=AE=A1=E6=9F=A5=E8=AF=A2=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E6=AD=A5=E6=B7=BB=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?id=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.ts | 4 +- src/components/FileUpload/FileUpload.tsx | 2 +- .../register/supplier/CommonFormSections.tsx | 154 +++++++++++------- .../supplierAnnualResultQuery2.tsx | 1 + 4 files changed, 96 insertions(+), 65 deletions(-) diff --git a/src/app.ts b/src/app.ts index cdfe58c..305fc41 100644 --- a/src/app.ts +++ b/src/app.ts @@ -2,9 +2,9 @@ import { history } from 'umi'; export function onRouteChange({ location }: any) { 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)) { history.replace('/login'); } - + } diff --git a/src/components/FileUpload/FileUpload.tsx b/src/components/FileUpload/FileUpload.tsx index 3f29c1a..2cf13ec 100644 --- a/src/components/FileUpload/FileUpload.tsx +++ b/src/components/FileUpload/FileUpload.tsx @@ -203,7 +203,7 @@ const FileUpload: React.FC = ({ } return ( - ); diff --git a/src/pages/register/supplier/CommonFormSections.tsx b/src/pages/register/supplier/CommonFormSections.tsx index 6f5e51e..3aa2afd 100644 --- a/src/pages/register/supplier/CommonFormSections.tsx +++ b/src/pages/register/supplier/CommonFormSections.tsx @@ -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 = ({ 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 = ({ form } @@ -134,6 +153,7 @@ export const QualificationSection: React.FC = ({ form } name={[record.name, 'certName']} rules={[createConditionalRule('certName', '请输入资质名称')]} style={{ margin: 0 }} + wrapperCol={{ span: 24 }} > @@ -147,6 +167,7 @@ export const QualificationSection: React.FC = ({ form } name={[record.name, 'certNumber']} rules={[createConditionalRule('certNumber', '请输入资质证书编号')]} style={{ margin: 0 }} + wrapperCol={{ span: 24 }} > @@ -156,10 +177,7 @@ export const QualificationSection: React.FC = ({ form } title: createRequiredTitle('资质类别和等级'), dataIndex: 'certLevel', render: (_, record) => ( - + ), @@ -172,6 +190,7 @@ export const QualificationSection: React.FC = ({ form } name={[record.name, 'issuingAuthority']} rules={[createConditionalRule('issuingAuthority', '请输入发证机构')]} style={{ margin: 0 }} + wrapperCol={{ span: 24 }} > @@ -185,6 +204,7 @@ export const QualificationSection: React.FC = ({ form } name={[record.name, 'dateTime']} rules={[createConditionalRule('dateTime', '请选择发证日期')]} style={{ margin: 0 }} + wrapperCol={{ span: 24 }} > = ({ form } name={[record.name, 'termOfValidity']} rules={[createConditionalRule('termOfValidity', '请选择资质有效期')]} style={{ margin: 0 }} + wrapperCol={{ span: 24 }} > = ({ form } name={[record.name, 'certFile']} rules={[createConditionalRule('certFile', '请上传资质证书附件')]} style={{ margin: 0 }} + wrapperCol={{ span: 24 }} > - - - + ), }, @@ -263,7 +285,7 @@ export const QualificationSection: React.FC = ({ form } export const InvoiceSection: React.FC = ({ form }) => { const [taxpayerTypeOptions, setTaxpayerTypeOptions] = useState([]); 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 = ({ form }) => { label="纳税人类型" rules={[{ required: true, message: '请选择纳税人类型' }]} > - ({ + label: item.dicName, + value: item.code, + }))} + /> @@ -352,7 +377,7 @@ export const BankAccountSection: React.FC = ({ form, su const [addressOptions, setAddressOptions] = useState([]); const [currencyOptions, setCurrencyOptions] = useState([]); 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 = ({ 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 = ({ form, su dataIndex: 'name', width: 60, render: (text, record, index = 0) => index + 1, - } + }, ]; // 境内企业特有列 - const domesticColumns: ColumnType[] = supplierType === 'dvs' ? [ - { - title: '银联号', - dataIndex: 'interbankNumber', - render: (text, record) => ( - - - - ), - } - ] : []; + const domesticColumns: ColumnType[] = + supplierType === 'dvs' + ? [ + { + title: '银联号', + dataIndex: 'interbankNumber', + render: (text, record) => ( + + + + ), + }, + ] + : []; // 境外企业特有列 - const foreignColumns: ColumnType[] = supplierType === 'ovs' ? [ - { - title: 'SWIFT CODE', - dataIndex: 'swiftCode', - render: (text, record) => ( - - - - ), - } - ] : []; + const foreignColumns: ColumnType[] = + supplierType === 'ovs' + ? [ + { + title: 'SWIFT CODE', + dataIndex: 'swiftCode', + render: (text, record) => ( + + + + ), + }, + ] + : []; // 通用列 const commonColumns: ColumnType[] = [ @@ -491,7 +521,7 @@ export const BankAccountSection: React.FC = ({ form, su