字典转换问题修改
This commit is contained in:
@ -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<props> = ({
|
||||
onCancel,
|
||||
initialValues,
|
||||
readOnly = false,
|
||||
supplierType
|
||||
}) => {
|
||||
const userId = sessionStorage.getItem('userId') || '';
|
||||
// 新增与修改
|
||||
@ -140,11 +142,11 @@ const InvoiceFormModal: React.FC<props> = ({
|
||||
}
|
||||
};
|
||||
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 (
|
||||
<Modal
|
||||
@ -166,7 +168,12 @@ const InvoiceFormModal: React.FC<props> = ({
|
||||
<Descriptions.Item label="开户账号">{viewData.account}</Descriptions.Item>
|
||||
<Descriptions.Item label="账户名称">{viewData.accountName}</Descriptions.Item>
|
||||
<Descriptions.Item label="开户银行">{viewData.bank}</Descriptions.Item>
|
||||
<Descriptions.Item label="联行号">{viewData.interbankNumber}</Descriptions.Item>
|
||||
{supplierType === 'ovs' ? (
|
||||
<Descriptions.Item label="SWIFT CODE">{viewData.swiftCode}</Descriptions.Item>
|
||||
) : (
|
||||
<Descriptions.Item label="联行号">{viewData.interbankNumber}</Descriptions.Item>
|
||||
)}
|
||||
|
||||
<Descriptions.Item label="国家/地区">{nationName || viewData.nation}</Descriptions.Item>
|
||||
<Descriptions.Item label="省份">{provinceName || viewData.province}</Descriptions.Item>
|
||||
<Descriptions.Item label="城市">{cityName || viewData.city}</Descriptions.Item>
|
||||
@ -190,11 +197,20 @@ const InvoiceFormModal: React.FC<props> = ({
|
||||
<Input placeholder='请输入开户银行' />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Form.Item name="interbankNumber" label="联行号" rules={[{ required: true }]}>
|
||||
<Input placeholder='请输入联行号' />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
{supplierType === 'ovs' ? (
|
||||
<Col span={24}>
|
||||
<Form.Item name="swiftCode" label="SWIFT CODE" rules={[{ required: true }]}>
|
||||
<Input placeholder='请输入SWIFT CODE' />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
) : (
|
||||
<Col span={24}>
|
||||
<Form.Item name="interbankNumber" label="联行号" rules={[{ required: true }]}>
|
||||
<Input placeholder='请输入联行号' />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
)}
|
||||
|
||||
|
||||
<Col span={24}>
|
||||
<Form.Item name="address" label="地址" rules={[{ required: true }]}>
|
||||
|
@ -24,6 +24,7 @@ interface BankInfo {
|
||||
interface Props {
|
||||
viewType?: boolean;
|
||||
record?: string;
|
||||
supplierType?: string;
|
||||
}
|
||||
|
||||
const codeNameCache = new Map<string, string>();
|
||||
@ -45,7 +46,7 @@ const fetchRegionNames = async (codes: string[]) => {
|
||||
|
||||
const BankInfoTab: React.FC<Props> = (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> = (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> = (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> = (props) => {
|
||||
/>
|
||||
<BankFormModal
|
||||
visible={formVisible}
|
||||
supplierType={supplierType}
|
||||
onOk={handleFormSubmit}
|
||||
onCancel={() => setFormVisible(false)}
|
||||
initialValues={editingRecord || undefined}
|
||||
|
@ -192,9 +192,16 @@ const BaseInfoTab: React.FC<BaseInfoTabProps> = (props) => {
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactEmail' })}>
|
||||
{registerInfo.coscoSupplierBase.contactsEmail}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactPhone' })}>
|
||||
{registerInfo.coscoSupplierBase.telephone}
|
||||
</Descriptions.Item>
|
||||
{registerInfo.coscoSupplierBase.supplierType === 'dvs' && (
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactPhone' })}>
|
||||
{registerInfo.coscoSupplierBase.telephone}
|
||||
</Descriptions.Item>
|
||||
)}
|
||||
{registerInfo.coscoSupplierBase.supplierType !== 'dvs' && (
|
||||
<Descriptions.Item label='联系电话'>
|
||||
{registerInfo.coscoSupplierBase.contactsPhone}
|
||||
</Descriptions.Item>
|
||||
)}
|
||||
</Descriptions>
|
||||
<BaseInfoFormModal
|
||||
visible={formVisible}
|
||||
|
@ -26,7 +26,7 @@ const ForeignForm: React.FC<ForeignFormProps> = ({ form, countdown, handleGetCap
|
||||
// 全球
|
||||
const [regionOptions, setRegionOptions] = useState<API.RegionOption[]>([]);
|
||||
useEffect(() => {
|
||||
getregionInternational().then(res => {
|
||||
getregionInternational({pId: 0}).then(res => {
|
||||
if (res.code === 200) {
|
||||
setRegionOptions(res.data);
|
||||
}
|
||||
@ -151,7 +151,7 @@ const ForeignForm: React.FC<ForeignFormProps> = ({ form, countdown, handleGetCap
|
||||
</Col>
|
||||
|
||||
<Col span={12}>
|
||||
<Form.Item name={['coscoSupplierBase', 'telephone']} label="联系电话">
|
||||
<Form.Item name={['coscoSupplierBase', 'contactsPhone']} label="联系电话">
|
||||
<Input placeholder="请输入企业联系电话" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
@ -24,11 +24,13 @@ const CompanyInfo: React.FC<CompanyInfoProps> = (props) => {
|
||||
const intl = useIntl();
|
||||
// 切换tab
|
||||
const [subTab, setSubTab] = useState<string>('');
|
||||
const [supplierType, setSupplierType] = useState<string>('');
|
||||
|
||||
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<CompanyInfoProps> = (props) => {
|
||||
<InvoiceTab viewType={viewType} record={record} />
|
||||
</TabPane>
|
||||
<TabPane tab={intl.formatMessage({ id: 'page.workbench.bank' })} key="bank">
|
||||
<BankInfoTab viewType={viewType} record={record} />
|
||||
<BankInfoTab viewType={viewType} record={record} supplierType={supplierType} />
|
||||
</TabPane>
|
||||
<TabPane tab={intl.formatMessage({ id: 'page.workbench.attachments' })} key="attachments">
|
||||
<AttachmentsTab viewType={viewType} record={record} />
|
||||
|
@ -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: '准入品类',
|
||||
|
@ -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 <div>{intl.formatMessage({ id: 'component.globalModal.loading' })}...</div>;
|
||||
|
||||
@ -186,13 +218,13 @@ const SupplierRegisterInfo = ({ registerInfo }: { registerInfo: any }) => {
|
||||
{registerInfo.coscoSupplierBase.regAddress}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactIdType' })}>
|
||||
{registerInfo.coscoSupplierBase.contactsTypeName}
|
||||
{contactsTypeMap[registerInfo.coscoSupplierBase.contactsType] || registerInfo.coscoSupplierBase.contactsType}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.idCardNumber' })}>
|
||||
{registerInfo.coscoSupplierBase.idCard}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.supplierType' })}>
|
||||
{registerInfo.coscoSupplierBase.enterpriseTypeCn}
|
||||
{enterpriseTypeMap[registerInfo.coscoSupplierBase.enterpriseType] || registerInfo.coscoSupplierBase.enterpriseType}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.contactMobile' })}>
|
||||
{registerInfo.coscoSupplierBase.contactsPhone}
|
||||
@ -226,7 +258,7 @@ const SupplierRegisterInfo = ({ registerInfo }: { registerInfo: any }) => {
|
||||
style={{ background: '#fff', padding: '16px 0 0' }}
|
||||
>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.taxpayerType' })}>
|
||||
{registerInfo.coscoSupplierInvoice.taxpayerTypeCn}
|
||||
{ taxpayerTypeMap[registerInfo.coscoSupplierInvoice.taxpayerType] || registerInfo.coscoSupplierInvoice.taxpayerType }
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label={intl.formatMessage({ id: 'component.globalModal.invoiceTitle' })}>
|
||||
{registerInfo.coscoSupplierInvoice.head}
|
||||
|
@ -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(
|
||||
<Tooltip placement="topLeft" title={name}>
|
||||
{name}
|
||||
<a onClick={() => supplierDetailModal?.(record.id)}>{name}</a>
|
||||
</Tooltip>)
|
||||
} },
|
||||
{ title: '统一社会信用代码/税号', ellipsis: true, dataIndex: 'unifiedCode' },
|
||||
|
@ -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: '准入时间',
|
||||
|
@ -172,12 +172,12 @@ const SupplierSelectModal: React.FC<SupplierSelectModalProps> = ({
|
||||
bodyStyle={{ padding: 24 }}
|
||||
>
|
||||
<Form layout="inline" form={form} style={{ marginBottom: 16 }}>
|
||||
<Form.Item name="name" label="供应商名称">
|
||||
<Form.Item name="supplierName" label="供应商名称">
|
||||
<Input style={{ width: 140 }} allowClear maxLength={50} placeholder="请输入供应商名称" />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name="categoryId" label="准入品类">
|
||||
<CategorySelector multiple={false} style={{ width: 140 }} />
|
||||
<CategorySelector multiple={false} style={{ width: 200 }} />
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Space>
|
||||
|
@ -177,7 +177,7 @@ const SupplierMessage: React.FC = () => {
|
||||
{viewRecord && (
|
||||
<Descriptions bordered column={1} size="small">
|
||||
<Descriptions.Item labelStyle={{ width: '120px' }} label="消息内容">{viewRecord.content}</Descriptions.Item>
|
||||
<Descriptions.Item label="业务类型">{viewRecord.typeCn}</Descriptions.Item>
|
||||
<Descriptions.Item label="业务类型">{typeMap[viewRecord.type] || viewRecord.type }</Descriptions.Item>
|
||||
<Descriptions.Item label="接收时间">{viewRecord.createTime}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user