From c6a5a8d372825822156dce04c05e2f35a12d2eff 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: Tue, 15 Jul 2025 17:04:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CompanyInfo/component/BankFormModal.tsx | 38 ++++++++-- .../CompanyInfo/component/DomesticForm.tsx | 76 +++++++++++++++---- .../components/AccessCategoryTable.tsx | 54 ++++++++++--- .../registrationQuery/index.tsx | 4 +- 4 files changed, 137 insertions(+), 35 deletions(-) diff --git a/src/components/CompanyInfo/component/BankFormModal.tsx b/src/components/CompanyInfo/component/BankFormModal.tsx index 269cc74..e1acf8f 100644 --- a/src/components/CompanyInfo/component/BankFormModal.tsx +++ b/src/components/CompanyInfo/component/BankFormModal.tsx @@ -1,9 +1,13 @@ import React, { useEffect, useState } from 'react'; -import { Modal, Form, Input, Button, Upload, message, Row, Col, Descriptions, Cascader } from 'antd'; +import { Modal, Form, Input, Button, Upload, message, Row, Col, Descriptions, Cascader, Select } from 'antd'; import type { UploadProps } from 'antd'; import { UploadOutlined } from '@ant-design/icons'; +import { getDictList } from '@/servers/api/dicts'; import { uploadFile, bankView, bankAdd, bankEdit, coscoSupplierBase } from '../services'; import { getRegionTree, getregionInternational } from '@/servers/api/register'; +import type { DictItem } from '@/servers/api/dicts'; + +// 地区字段转换 function convertToCascaderOptions(data: any[]): any[] { return data.map(item => ({ label: item.name, @@ -52,6 +56,8 @@ const InvoiceFormModal: React.FC = ({ // 地区 const [addressOptions, setAddressOptions] = useState([]); + const [currency, setCurrency] = useState([]); + useEffect(() => { if (visible) { if (initialValues) { @@ -61,6 +67,11 @@ const InvoiceFormModal: React.FC = ({ const fields = { ...data, id: data.id ? data.id : null, + address: [ + Number(data.province), + Number(data.city), + Number(data.nation) + ] }; console.log(fields); @@ -76,6 +87,15 @@ const InvoiceFormModal: React.FC = ({ setAddressOptions(convertToCascaderOptions(res.data)); } }); + + + getDictList('currency').then((res) => { + if (res.code === 200) { + setCurrency(res.data); + } + }); + + } }, [visible, initialValues]); @@ -87,10 +107,10 @@ const InvoiceFormModal: React.FC = ({ ...values, supplierId: userId, }; - payload.province = payload.address[0]; - payload.city = payload.address[1]; - payload.nation = payload.address[2]; - + payload.province = payload.address[1]; + payload.city = payload.address[2]; + payload.nation = payload.address[0]; + if (!values.id) { bankAdd(payload).then((res) => { if (res.code == 200) { @@ -230,7 +250,13 @@ const InvoiceFormModal: React.FC = ({ */} - + diff --git a/src/components/CompanyInfo/component/DomesticForm.tsx b/src/components/CompanyInfo/component/DomesticForm.tsx index 19876b2..0b41133 100644 --- a/src/components/CompanyInfo/component/DomesticForm.tsx +++ b/src/components/CompanyInfo/component/DomesticForm.tsx @@ -1,10 +1,12 @@ /* 境外企业 表单项 */ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { Form, Input, Select, Row, Col, message, Upload, Button } from 'antd'; import type { UploadProps } from 'antd'; import { UploadOutlined } from '@ant-design/icons'; import { uploadFile } from '../services'; +import { getDictList } from '@/servers/api/dicts'; +import type { DictItem } from '@/servers/api/dicts'; const { Option } = Select; interface ForeignFormProps { form: any; @@ -18,6 +20,21 @@ interface ForeignFormProps { * 其他部分使用通用表单组件 */ const DomesticForm: React.FC = ({ form, countdown, handleGetCaptcha }) => { + const [contactsType, setContactsType] = useState([]); + const [enterpriseType, setEnterpriseType] = useState([]); + useEffect(() => { + getDictList('contacts_type').then((res) => { + if (res.code === 200) { + setContactsType(res.data); + } + }); + getDictList('enterprise_type').then((res) => { + if (res.code === 200) { + setEnterpriseType(res.data); + } + }); + + }, []) //上传接口 const uploadProps: UploadProps = { name: 'file', @@ -60,9 +77,11 @@ const DomesticForm: React.FC = ({ form, countdown, handleGetCa rules={[{ required: true, message: '请选择供应商分类' }]} > @@ -150,15 +169,7 @@ const DomesticForm: React.FC = ({ form, countdown, handleGetCa - - - - - + = ({ form, countdown, handleGetCa rules={[{ required: true, message: '请选择联系人身份类别' }]} > + + + prev.coscoSupplierBase?.contactsType !== curr.coscoSupplierBase?.contactsType + } + noStyle + > + {({ getFieldValue }) => { + const contactsType = getFieldValue(['coscoSupplierBase', 'contactsType']); + let label = '身份证号'; + // 可自定义规则 + if (contactsType === '1') { + label = '身份证号'; + } else if (contactsType === '0') { + label = '护照号'; + } else { + label = '证件号码'; + } + return ( + + + + ); + }} + + { const intl = useIntl(); const columns = [ { - title: intl.formatMessage({id: 'component.globalModal.CategoryLibraryName'}), - dataIndex: 'name', - key: 'name', + title: '准入单位', + dataIndex: 'deptId', + key: 'deptId', }, { - title: intl.formatMessage({id: 'component.globalModal.periodOfValidity'}), - dataIndex: 'termOfValidity', - key: 'termOfValidity', + title: '准入品类', + dataIndex: 'categoryNames', + key: 'categoryNames', + render: (_: any, record: any) => { + console.log(record.categoryNames); + const arr = record.categoryNames ? record.categoryNames.split(',') : []; + + return arr.length + ? arr.map((item: string, idx: number) => ( +
+ {item} +
+ )) + : ''; + }, }, { - title: intl.formatMessage({id: 'component.globalModal.ResponsibleDepartmentID'}), - dataIndex: 'deptName', - key: 'deptName', + title: '准入时间', + dataIndex: 'updateTime', + key: 'updateTime', }, { - title: intl.formatMessage({id: 'component.globalModal.RegionalSelection'}), - dataIndex: 'area', - key: 'area', + title: '退出时间', + dataIndex: 'exitTime', + key: 'exitTime', }, + { + title: '退出原因', + dataIndex: 'exitReason', + key: 'exitReason', + ellipsis: true, + width: 120, + }, + + + + + + + + + + + ] //Tabs切换key diff --git a/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx b/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx index 75721a5..dbef18f 100644 --- a/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx +++ b/src/pages/supplier/informationRetrieval/registrationQuery/index.tsx @@ -159,7 +159,7 @@ const RegistrationQuery: React.FC = ({ dispatch }) => { width: 180, }, { - title: '状态', + title: '准入状态', dataIndex: 'accessStatusCn', key: 'accessStatusCn', width: 160, @@ -208,7 +208,7 @@ const RegistrationQuery: React.FC = ({ dispatch }) => { ))}
- +