diff --git a/src/components/CompanyInfo/component/BankFormModal.tsx b/src/components/CompanyInfo/component/BankFormModal.tsx index ff06d84..e478b3c 100644 --- a/src/components/CompanyInfo/component/BankFormModal.tsx +++ b/src/components/CompanyInfo/component/BankFormModal.tsx @@ -11,6 +11,7 @@ interface props { onCancel: () => void; initialValues?: any; readOnly?: boolean; + supplierType: string; } interface viewDataData { id?: string | null; @@ -40,6 +41,7 @@ const InvoiceFormModal: React.FC = ({ onCancel, initialValues, readOnly = false, + supplierType }) => { const userId = sessionStorage.getItem('userId') || ''; // 新增与修改 @@ -140,11 +142,11 @@ const InvoiceFormModal: React.FC = ({ } }; const fetchRegionNames = async (codes: string) => { - console.log(codes,'codes'); - - const { data } = await dictRegion(codes); + console.log(codes, 'codes'); + + const { data } = await dictRegion(codes); console.log(data); - + }; return ( = ({ {viewData.account} {viewData.accountName} {viewData.bank} - {viewData.interbankNumber} + {supplierType === 'ovs' ? ( + {viewData.swiftCode} + ) : ( + {viewData.interbankNumber} + )} + {nationName || viewData.nation} {provinceName || viewData.province} {cityName || viewData.city} @@ -190,11 +197,20 @@ const InvoiceFormModal: React.FC = ({ - - - - - + {supplierType === 'ovs' ? ( + + + + + + ) : ( + + + + + + )} + diff --git a/src/components/CompanyInfo/component/BankInfoTab.tsx b/src/components/CompanyInfo/component/BankInfoTab.tsx index 3cc4c37..ad2e729 100644 --- a/src/components/CompanyInfo/component/BankInfoTab.tsx +++ b/src/components/CompanyInfo/component/BankInfoTab.tsx @@ -24,6 +24,7 @@ interface BankInfo { interface Props { viewType?: boolean; record?: string; + supplierType?: string; } const codeNameCache = new Map(); @@ -45,7 +46,7 @@ const fetchRegionNames = async (codes: string[]) => { const BankInfoTab: React.FC = (props) => { const userId = sessionStorage.getItem('userId') || ''; - const { viewType = false, record = userId } = props; + const { viewType = false, record = userId, supplierType = 'dvs' } = props; //双语 const intl = useIntl(); //列表渲染数据 @@ -111,6 +112,8 @@ const BankInfoTab: React.FC = (props) => { //初始化 useEffect(() => { if (record) { + console.log(supplierType,'supplierType'); + getDictList('currency').then((res) => { if (res.code === 200) { const map: { [code: string]: string } = {}; @@ -162,11 +165,23 @@ const BankInfoTab: React.FC = (props) => { align: 'center', render: (_: any, __: any, index: number) => index + 1 }, - { - title: 'page.workbench.bank.interbankNumber', - dataIndex: 'interbankNumber', - key: 'interbankNumber', ellipsis: true - }, + ...(supplierType === 'ovs' + ? [ + { + title: 'SWIFT CODE', + dataIndex: 'swiftCode', + key: 'swiftCode', + ellipsis: true, + } + ] + : [ + { + title: 'page.workbench.bank.interbankNumber', + dataIndex: 'interbankNumber', + key: 'interbankNumber', + ellipsis: true + } + ]), { title: 'page.workbench.bank.bank', dataIndex: 'bank', @@ -265,6 +280,7 @@ const BankInfoTab: React.FC = (props) => { /> setFormVisible(false)} initialValues={editingRecord || undefined} diff --git a/src/components/CompanyInfo/component/BaseInfoTab.tsx b/src/components/CompanyInfo/component/BaseInfoTab.tsx index 9f1d69a..a2e1248 100644 --- a/src/components/CompanyInfo/component/BaseInfoTab.tsx +++ b/src/components/CompanyInfo/component/BaseInfoTab.tsx @@ -192,9 +192,16 @@ const BaseInfoTab: React.FC = (props) => { {registerInfo.coscoSupplierBase.contactsEmail} - - {registerInfo.coscoSupplierBase.telephone} - + {registerInfo.coscoSupplierBase.supplierType === 'dvs' && ( + + {registerInfo.coscoSupplierBase.telephone} + + )} + {registerInfo.coscoSupplierBase.supplierType !== 'dvs' && ( + + {registerInfo.coscoSupplierBase.contactsPhone} + + )} = ({ form, countdown, handleGetCap // 全球 const [regionOptions, setRegionOptions] = useState([]); useEffect(() => { - getregionInternational().then(res => { + getregionInternational({pId: 0}).then(res => { if (res.code === 200) { setRegionOptions(res.data); } @@ -151,7 +151,7 @@ const ForeignForm: React.FC = ({ form, countdown, handleGetCap - + diff --git a/src/components/CompanyInfo/index.tsx b/src/components/CompanyInfo/index.tsx index b3672f9..5bc9bc5 100644 --- a/src/components/CompanyInfo/index.tsx +++ b/src/components/CompanyInfo/index.tsx @@ -24,11 +24,13 @@ const CompanyInfo: React.FC = (props) => { const intl = useIntl(); // 切换tab const [subTab, setSubTab] = useState(''); + const [supplierType, setSupplierType] = useState(''); useEffect(() => { if(record) { coscoSupplierBase(record).then((res) => { if (res.code === 200) { + setSupplierType(res.data.coscoSupplierBase.supplierType) if (res.data.coscoSupplierBase.supplierType === 'pe') { setSubTab('pe') } else { @@ -57,7 +59,7 @@ const CompanyInfo: React.FC = (props) => { - + diff --git a/src/components/GlobalModal/components/AccessCategoryTable.tsx b/src/components/GlobalModal/components/AccessCategoryTable.tsx index 16e1214..5da0bd8 100644 --- a/src/components/GlobalModal/components/AccessCategoryTable.tsx +++ b/src/components/GlobalModal/components/AccessCategoryTable.tsx @@ -23,8 +23,15 @@ const AccessCategoryTable = ({id}:{id:string}) => { const columns = [ { title: '准入单位', + dataIndex: 'orgName', + key: 'orgName', + ellipsis: true + }, + { + title: '准入部门', dataIndex: 'deptName', key: 'deptName', + ellipsis: true }, { title: '准入品类', diff --git a/src/components/GlobalModal/components/SupplierRegisterInfo.tsx b/src/components/GlobalModal/components/SupplierRegisterInfo.tsx index 062bb79..6c0f13b 100644 --- a/src/components/GlobalModal/components/SupplierRegisterInfo.tsx +++ b/src/components/GlobalModal/components/SupplierRegisterInfo.tsx @@ -43,6 +43,10 @@ const fetchRegionNames = async (codes: string[]) => { const SupplierRegisterInfo = ({ registerInfo }: { registerInfo: any }) => { //币种 const [currencyMap, setCurrencyMap] = useState<{ [code: string]: string }>({}); + const [enterpriseTypeMap, setEnterpriseTypeMap] = useState<{ [code: string]: string }>({}); + + const [contactsTypeMap, setContactsTypeMap] = useState<{ [code: string]: string }>({}); + const [taxpayerTypeMap, setTaxpayerTypeMap] = useState<{ [code: string]: string }>({}); const [regionLoading, setRegionLoading] = useState(false); const [, forceUpdate] = useState({}); // 用于触发重新渲染 @@ -56,6 +60,34 @@ const SupplierRegisterInfo = ({ registerInfo }: { registerInfo: any }) => { setCurrencyMap(map); } }); + getDictList('taxpayer_type').then((res) => { + if (res.code == 200) { + const map: { [code: string]: string } = {}; + res.data.forEach((item: { code: string, dicName: string }) => { + map[item.code] = item.dicName; + }); + setTaxpayerTypeMap(map); + } + }) + getDictList('contacts_type').then((res) => { + if (res.code === 200) { + const map: { [code: string]: string } = {}; + res.data.forEach((item: { code: string, dicName: string }) => { + map[item.code] = item.dicName; + }); + setContactsTypeMap(map); + } + }); + + getDictList('enterprise_type').then((res) => { + if (res.code === 200) { + const map: { [code: string]: string } = {}; + res.data.forEach((item: { code: string, dicName: string }) => { + map[item.code] = item.dicName; + }); + setEnterpriseTypeMap(map); + } + }); }, []); useEffect(() => { @@ -100,10 +132,10 @@ const SupplierRegisterInfo = ({ registerInfo }: { registerInfo: any }) => { { title: intl.formatMessage({ id: 'component.globalModal.openingBank' }), dataIndex: 'bank', key: 'bank' }, { title: intl.formatMessage({ id: 'component.globalModal.accountName' }), dataIndex: 'accountName', key: 'accountName' }, { title: intl.formatMessage({ id: 'component.globalModal.accountNumber' }), dataIndex: 'account', key: 'account' }, - { title: intl.formatMessage({ id: 'component.globalModal.currency' }), dataIndex: 'currency', key: 'currency', render: (code: string) => currencyMap[code] || code }, + { title: intl.formatMessage({ id: 'component.globalModal.currency' }), dataIndex: 'currency', key: 'currency', render: (code: string) => currencyMap[code] || code }, { title: intl.formatMessage({ id: 'component.globalModal.country' }), dataIndex: 'nation', key: 'nation', render: renderRegionName }, { title: intl.formatMessage({ id: 'component.globalModal.province' }), dataIndex: 'province', key: 'province', render: renderRegionName }, - { title: intl.formatMessage({ id: 'component.globalModal.city' }), dataIndex: 'city', key: 'city', render: renderRegionName}, + { title: intl.formatMessage({ id: 'component.globalModal.city' }), dataIndex: 'city', key: 'city', render: renderRegionName }, ]; if (!registerInfo) return
{intl.formatMessage({ id: 'component.globalModal.loading' })}...
; @@ -186,13 +218,13 @@ const SupplierRegisterInfo = ({ registerInfo }: { registerInfo: any }) => { {registerInfo.coscoSupplierBase.regAddress} - {registerInfo.coscoSupplierBase.contactsTypeName} + {contactsTypeMap[registerInfo.coscoSupplierBase.contactsType] || registerInfo.coscoSupplierBase.contactsType} {registerInfo.coscoSupplierBase.idCard} - {registerInfo.coscoSupplierBase.enterpriseTypeCn} + {enterpriseTypeMap[registerInfo.coscoSupplierBase.enterpriseType] || registerInfo.coscoSupplierBase.enterpriseType} {registerInfo.coscoSupplierBase.contactsPhone} @@ -226,7 +258,7 @@ const SupplierRegisterInfo = ({ registerInfo }: { registerInfo: any }) => { style={{ background: '#fff', padding: '16px 0 0' }} > - {registerInfo.coscoSupplierInvoice.taxpayerTypeCn} + { taxpayerTypeMap[registerInfo.coscoSupplierInvoice.taxpayerType] || registerInfo.coscoSupplierInvoice.taxpayerType } {registerInfo.coscoSupplierInvoice.head} diff --git a/src/pages/supplier/admission/admissionManagement/components/SupplierSelector.tsx b/src/pages/supplier/admission/admissionManagement/components/SupplierSelector.tsx index 17035e2..b34f7a7 100644 --- a/src/pages/supplier/admission/admissionManagement/components/SupplierSelector.tsx +++ b/src/pages/supplier/admission/admissionManagement/components/SupplierSelector.tsx @@ -3,6 +3,7 @@ import { Modal, Input, Row, Col, Table, Button, Form, Tooltip } from 'antd'; import { RightOutlined, LeftOutlined } from '@ant-design/icons'; import { coscoSupplierBase } from '../services'; import RegionTypeSelect from '@/components/CommonSelect/RegionTypeSelect' +import { useSupplierDetailModal } from '@/components/SupplierDetailModalContext/SupplierDetailModalContext'; const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSelect?: (selected: any[]) => void; }> = ({ visible, onCancel, onSelect }) => { // 查询 @@ -26,6 +27,8 @@ const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSel const newSelected = selected.filter((item:any) => !ids.has(item.id)); return [...chosenSuppliers, ...newSelected]; }; + const supplierDetailModal = useSupplierDetailModal(); + //获取已选供应商 const moveToRight = () => { const selected = tableListData.filter((item:any) => leftSelected.includes(item.id)); @@ -65,7 +68,7 @@ const SupplierSelector: React.FC<{ visible: boolean; onCancel: () => void; onSel const name = record.supplierType === "ovs"? record.nameEn : record.name; return( - {name} + supplierDetailModal?.(record.id)}>{name} ) } }, { title: '统一社会信用代码/税号', ellipsis: true, dataIndex: 'unifiedCode' }, diff --git a/src/pages/supplier/backend/cooperateEnterprise/index.tsx b/src/pages/supplier/backend/cooperateEnterprise/index.tsx index 6269a85..978da78 100644 --- a/src/pages/supplier/backend/cooperateEnterprise/index.tsx +++ b/src/pages/supplier/backend/cooperateEnterprise/index.tsx @@ -81,13 +81,21 @@ const CooperateEnterprise: React.FC = () => { }, { title: '准入单位', + dataIndex: 'orgName', + key: 'orgName', + ellipsis: true + }, + { + title: '准入部门', dataIndex: 'deptName', key: 'deptName', + ellipsis: true }, { title: '准入品类', dataIndex: 'categoryName', key: 'categoryName', + ellipsis: true }, { title: '准入时间', diff --git a/src/pages/supplier/supplierExit/supplierExitManage/components/SupplierSelectModal.tsx b/src/pages/supplier/supplierExit/supplierExitManage/components/SupplierSelectModal.tsx index 5565872..aa80a81 100644 --- a/src/pages/supplier/supplierExit/supplierExitManage/components/SupplierSelectModal.tsx +++ b/src/pages/supplier/supplierExit/supplierExitManage/components/SupplierSelectModal.tsx @@ -172,12 +172,12 @@ const SupplierSelectModal: React.FC = ({ bodyStyle={{ padding: 24 }} >
- + - + diff --git a/src/pages/supplier/supplierMessage/index.tsx b/src/pages/supplier/supplierMessage/index.tsx index 35779fb..feda637 100644 --- a/src/pages/supplier/supplierMessage/index.tsx +++ b/src/pages/supplier/supplierMessage/index.tsx @@ -177,7 +177,7 @@ const SupplierMessage: React.FC = () => { {viewRecord && ( {viewRecord.content} - {viewRecord.typeCn} + {typeMap[viewRecord.type] || viewRecord.type } {viewRecord.createTime} )}