个人信息修改
This commit is contained in:
@ -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<props> = ({
|
||||
// 地区
|
||||
const [addressOptions, setAddressOptions] = useState<API.RegionOption[]>([]);
|
||||
|
||||
const [currency, setCurrency] = useState<DictItem[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
if (initialValues) {
|
||||
@ -61,6 +67,11 @@ const InvoiceFormModal: React.FC<props> = ({
|
||||
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<props> = ({
|
||||
setAddressOptions(convertToCascaderOptions(res.data));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
getDictList('currency').then((res) => {
|
||||
if (res.code === 200) {
|
||||
setCurrency(res.data);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}, [visible, initialValues]);
|
||||
|
||||
@ -87,9 +107,9 @@ const InvoiceFormModal: React.FC<props> = ({
|
||||
...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) => {
|
||||
@ -230,7 +250,13 @@ const InvoiceFormModal: React.FC<props> = ({
|
||||
</Col> */}
|
||||
<Col span={24}>
|
||||
<Form.Item name="currency" label="币种" rules={[{ required: true }]}>
|
||||
<Input />
|
||||
<Select placeholder="请选择币种">
|
||||
{currency.map((item) => (
|
||||
<Select.Option key={item.code} value={item.code}>
|
||||
{item.dicName}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Form.Item name="id" noStyle>
|
||||
|
@ -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<ForeignFormProps> = ({ form, countdown, handleGetCaptcha }) => {
|
||||
const [contactsType, setContactsType] = useState<DictItem[]>([]);
|
||||
const [enterpriseType, setEnterpriseType] = useState<DictItem[]>([]);
|
||||
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<ForeignFormProps> = ({ form, countdown, handleGetCa
|
||||
rules={[{ required: true, message: '请选择供应商分类' }]}
|
||||
>
|
||||
<Select placeholder="请选择">
|
||||
<Option value="dvs">境内企业/机构</Option>
|
||||
<Option value="ovs">境外企业</Option>
|
||||
<Option value="pe">个人</Option>
|
||||
{enterpriseType.map((item) => (
|
||||
<Select.Option key={item.code} value={item.code}>
|
||||
{item.dicName}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
@ -150,15 +169,7 @@ const DomesticForm: React.FC<ForeignFormProps> = ({ form, countdown, handleGetCa
|
||||
<Input placeholder="请输入企业法定代表人/负责人" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
name={['coscoSupplierBase', 'idCard']}
|
||||
label="身份证号"
|
||||
rules={[{ required: true, message: '请输入身份证号' }]}
|
||||
>
|
||||
<Input placeholder="请输入身份证号" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
|
||||
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
@ -188,11 +199,46 @@ const DomesticForm: React.FC<ForeignFormProps> = ({ form, countdown, handleGetCa
|
||||
rules={[{ required: true, message: '请选择联系人身份类别' }]}
|
||||
>
|
||||
<Select placeholder="请选择">
|
||||
<Option value="internal">境内人士</Option>
|
||||
<Option value="external">境外人士</Option>
|
||||
{contactsType.map((item) => (
|
||||
<Select.Option key={item.code} value={item.code}>
|
||||
{item.dicName}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
// 用 dependencies 监听 contactsType
|
||||
dependencies={['coscoSupplierBase', 'contactsType']}
|
||||
shouldUpdate={(prev, curr) =>
|
||||
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 (
|
||||
<Form.Item
|
||||
name={['coscoSupplierBase', 'idCard']}
|
||||
label={label}
|
||||
rules={[{ required: true, message: `请输入${label}` }]}
|
||||
>
|
||||
<Input placeholder={`请输入${label}`} />
|
||||
</Form.Item>
|
||||
);
|
||||
}}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item
|
||||
name={['coscoSupplierBase', 'contactsEmail']}
|
||||
|
@ -8,25 +8,55 @@ const AccessCategoryTable = ({id}:{id:string}) => {
|
||||
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) => (
|
||||
<div key={idx} style={{ marginBottom: 4 }}>
|
||||
{item}
|
||||
</div>
|
||||
))
|
||||
: '';
|
||||
},
|
||||
},
|
||||
{
|
||||
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
|
||||
|
@ -159,7 +159,7 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
title: '准入状态',
|
||||
dataIndex: 'accessStatusCn',
|
||||
key: 'accessStatusCn',
|
||||
width: 160,
|
||||
@ -208,7 +208,7 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item name="accessStatus" label="状态">
|
||||
<Form.Item name="accessStatus" label="准入状态">
|
||||
<Select style={{ width: 160 }} placeholder="请选择状态" allowClear>
|
||||
{statusOptions.map(opt => (
|
||||
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
|
||||
|
Reference in New Issue
Block a user