个人信息修改
This commit is contained in:
@ -1,9 +1,13 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
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 type { UploadProps } from 'antd';
|
||||||
import { UploadOutlined } from '@ant-design/icons';
|
import { UploadOutlined } from '@ant-design/icons';
|
||||||
|
import { getDictList } from '@/servers/api/dicts';
|
||||||
import { uploadFile, bankView, bankAdd, bankEdit, coscoSupplierBase } from '../services';
|
import { uploadFile, bankView, bankAdd, bankEdit, coscoSupplierBase } from '../services';
|
||||||
import { getRegionTree, getregionInternational } from '@/servers/api/register';
|
import { getRegionTree, getregionInternational } from '@/servers/api/register';
|
||||||
|
import type { DictItem } from '@/servers/api/dicts';
|
||||||
|
|
||||||
|
// 地区字段转换
|
||||||
function convertToCascaderOptions(data: any[]): any[] {
|
function convertToCascaderOptions(data: any[]): any[] {
|
||||||
return data.map(item => ({
|
return data.map(item => ({
|
||||||
label: item.name,
|
label: item.name,
|
||||||
@ -52,6 +56,8 @@ const InvoiceFormModal: React.FC<props> = ({
|
|||||||
// 地区
|
// 地区
|
||||||
const [addressOptions, setAddressOptions] = useState<API.RegionOption[]>([]);
|
const [addressOptions, setAddressOptions] = useState<API.RegionOption[]>([]);
|
||||||
|
|
||||||
|
const [currency, setCurrency] = useState<DictItem[]>([]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
if (initialValues) {
|
if (initialValues) {
|
||||||
@ -61,6 +67,11 @@ const InvoiceFormModal: React.FC<props> = ({
|
|||||||
const fields = {
|
const fields = {
|
||||||
...data,
|
...data,
|
||||||
id: data.id ? data.id : null,
|
id: data.id ? data.id : null,
|
||||||
|
address: [
|
||||||
|
Number(data.province),
|
||||||
|
Number(data.city),
|
||||||
|
Number(data.nation)
|
||||||
|
]
|
||||||
};
|
};
|
||||||
console.log(fields);
|
console.log(fields);
|
||||||
|
|
||||||
@ -76,6 +87,15 @@ const InvoiceFormModal: React.FC<props> = ({
|
|||||||
setAddressOptions(convertToCascaderOptions(res.data));
|
setAddressOptions(convertToCascaderOptions(res.data));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
getDictList('currency').then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
setCurrency(res.data);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}, [visible, initialValues]);
|
}, [visible, initialValues]);
|
||||||
|
|
||||||
@ -87,10 +107,10 @@ const InvoiceFormModal: React.FC<props> = ({
|
|||||||
...values,
|
...values,
|
||||||
supplierId: userId,
|
supplierId: userId,
|
||||||
};
|
};
|
||||||
payload.province = payload.address[0];
|
payload.province = payload.address[1];
|
||||||
payload.city = payload.address[1];
|
payload.city = payload.address[2];
|
||||||
payload.nation = payload.address[2];
|
payload.nation = payload.address[0];
|
||||||
|
|
||||||
if (!values.id) {
|
if (!values.id) {
|
||||||
bankAdd(payload).then((res) => {
|
bankAdd(payload).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
@ -230,7 +250,13 @@ const InvoiceFormModal: React.FC<props> = ({
|
|||||||
</Col> */}
|
</Col> */}
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Form.Item name="currency" label="币种" rules={[{ required: true }]}>
|
<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>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Form.Item name="id" noStyle>
|
<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 { Form, Input, Select, Row, Col, message, Upload, Button } from 'antd';
|
||||||
import type { UploadProps } from 'antd';
|
import type { UploadProps } from 'antd';
|
||||||
import { UploadOutlined } from '@ant-design/icons';
|
import { UploadOutlined } from '@ant-design/icons';
|
||||||
import { uploadFile } from '../services';
|
import { uploadFile } from '../services';
|
||||||
|
|
||||||
|
import { getDictList } from '@/servers/api/dicts';
|
||||||
|
import type { DictItem } from '@/servers/api/dicts';
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
interface ForeignFormProps {
|
interface ForeignFormProps {
|
||||||
form: any;
|
form: any;
|
||||||
@ -18,6 +20,21 @@ interface ForeignFormProps {
|
|||||||
* 其他部分使用通用表单组件
|
* 其他部分使用通用表单组件
|
||||||
*/
|
*/
|
||||||
const DomesticForm: React.FC<ForeignFormProps> = ({ form, countdown, handleGetCaptcha }) => {
|
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 = {
|
const uploadProps: UploadProps = {
|
||||||
name: 'file',
|
name: 'file',
|
||||||
@ -60,9 +77,11 @@ const DomesticForm: React.FC<ForeignFormProps> = ({ form, countdown, handleGetCa
|
|||||||
rules={[{ required: true, message: '请选择供应商分类' }]}
|
rules={[{ required: true, message: '请选择供应商分类' }]}
|
||||||
>
|
>
|
||||||
<Select placeholder="请选择">
|
<Select placeholder="请选择">
|
||||||
<Option value="dvs">境内企业/机构</Option>
|
{enterpriseType.map((item) => (
|
||||||
<Option value="ovs">境外企业</Option>
|
<Select.Option key={item.code} value={item.code}>
|
||||||
<Option value="pe">个人</Option>
|
{item.dicName}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
@ -150,15 +169,7 @@ const DomesticForm: React.FC<ForeignFormProps> = ({ form, countdown, handleGetCa
|
|||||||
<Input placeholder="请输入企业法定代表人/负责人" />
|
<Input placeholder="请输入企业法定代表人/负责人" />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
|
||||||
<Form.Item
|
|
||||||
name={['coscoSupplierBase', 'idCard']}
|
|
||||||
label="身份证号"
|
|
||||||
rules={[{ required: true, message: '请输入身份证号' }]}
|
|
||||||
>
|
|
||||||
<Input placeholder="请输入身份证号" />
|
|
||||||
</Form.Item>
|
|
||||||
</Col>
|
|
||||||
|
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@ -188,11 +199,46 @@ const DomesticForm: React.FC<ForeignFormProps> = ({ form, countdown, handleGetCa
|
|||||||
rules={[{ required: true, message: '请选择联系人身份类别' }]}
|
rules={[{ required: true, message: '请选择联系人身份类别' }]}
|
||||||
>
|
>
|
||||||
<Select placeholder="请选择">
|
<Select placeholder="请选择">
|
||||||
<Option value="internal">境内人士</Option>
|
{contactsType.map((item) => (
|
||||||
<Option value="external">境外人士</Option>
|
<Select.Option key={item.code} value={item.code}>
|
||||||
|
{item.dicName}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Col>
|
</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}>
|
<Col span={12}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={['coscoSupplierBase', 'contactsEmail']}
|
name={['coscoSupplierBase', 'contactsEmail']}
|
||||||
|
@ -8,25 +8,55 @@ const AccessCategoryTable = ({id}:{id:string}) => {
|
|||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: intl.formatMessage({id: 'component.globalModal.CategoryLibraryName'}),
|
title: '准入单位',
|
||||||
dataIndex: 'name',
|
dataIndex: 'deptId',
|
||||||
key: 'name',
|
key: 'deptId',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: intl.formatMessage({id: 'component.globalModal.periodOfValidity'}),
|
title: '准入品类',
|
||||||
dataIndex: 'termOfValidity',
|
dataIndex: 'categoryNames',
|
||||||
key: 'termOfValidity',
|
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'}),
|
title: '准入时间',
|
||||||
dataIndex: 'deptName',
|
dataIndex: 'updateTime',
|
||||||
key: 'deptName',
|
key: 'updateTime',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: intl.formatMessage({id: 'component.globalModal.RegionalSelection'}),
|
title: '退出时间',
|
||||||
dataIndex: 'area',
|
dataIndex: 'exitTime',
|
||||||
key: 'area',
|
key: 'exitTime',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '退出原因',
|
||||||
|
dataIndex: 'exitReason',
|
||||||
|
key: 'exitReason',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120,
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
//Tabs切换key
|
//Tabs切换key
|
||||||
|
@ -159,7 +159,7 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
|
|||||||
width: 180,
|
width: 180,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '准入状态',
|
||||||
dataIndex: 'accessStatusCn',
|
dataIndex: 'accessStatusCn',
|
||||||
key: 'accessStatusCn',
|
key: 'accessStatusCn',
|
||||||
width: 160,
|
width: 160,
|
||||||
@ -208,7 +208,7 @@ const RegistrationQuery: React.FC<RegistrationQueryProps> = ({ dispatch }) => {
|
|||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="accessStatus" label="状态">
|
<Form.Item name="accessStatus" label="准入状态">
|
||||||
<Select style={{ width: 160 }} placeholder="请选择状态" allowClear>
|
<Select style={{ width: 160 }} placeholder="请选择状态" allowClear>
|
||||||
{statusOptions.map(opt => (
|
{statusOptions.map(opt => (
|
||||||
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
|
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
|
||||||
|
Reference in New Issue
Block a user