This commit is contained in:
孙景学
2025-08-05 16:54:10 +08:00
7 changed files with 76 additions and 71 deletions

View File

@ -16,7 +16,7 @@ import {
Radio,
Cascader,
Empty,
Descriptions
Descriptions,
} from 'antd';
import { UploadOutlined, PlusOutlined, DeleteOutlined } from '@ant-design/icons';
import { message } from 'antd';
@ -25,7 +25,7 @@ import { getRegionTree, getregionInternational } from '@/servers/api/register';
import { getDictList } from '@/servers/api/dicts';
import type { DictItem } from '@/servers/api/dicts';
import FileUpload from '@/components/FileUpload/FileUpload';
import DictRegionSelect from '@/components/CommonSelect/DictRegionSelect'
import DictRegionSelect from '@/components/CommonSelect/DictRegionSelect';
const { Option } = Select;
@ -474,40 +474,40 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
const domesticColumns: ColumnType[] =
supplierType === 'dvs'
? [
{
title: '银联号',
dataIndex: 'interbankNumber',
render: (text, record) => (
<Form.Item
name={[record.name, 'interbankNumber']}
noStyle
rules={[{ required: true, message: '请输入银联号' }]}
>
<Input placeholder="请输入银联号" />
</Form.Item>
),
},
]
{
title: '银联号',
dataIndex: 'interbankNumber',
render: (text, record) => (
<Form.Item
name={[record.name, 'interbankNumber']}
noStyle
rules={[{ required: true, message: '请输入银联号' }]}
>
<Input placeholder="请输入银联号" />
</Form.Item>
),
},
]
: [];
// 境外企业特有列
const foreignColumns: ColumnType[] =
supplierType === 'ovs'
? [
{
title: 'SWIFT CODE',
dataIndex: 'swiftCode',
render: (text, record) => (
<Form.Item
name={[record.name, 'swiftCode']}
noStyle
rules={[{ required: true, message: '请输入SWIFT CODE' }]}
>
<Input placeholder="请输入SWIFT CODE" />
</Form.Item>
),
},
]
{
title: 'SWIFT CODE',
dataIndex: 'swiftCode',
render: (text, record) => (
<Form.Item
name={[record.name, 'swiftCode']}
noStyle
rules={[{ required: true, message: '请输入SWIFT CODE' }]}
>
<Input placeholder="请输入SWIFT CODE" />
</Form.Item>
),
},
]
: [];
// 通用列
@ -589,11 +589,10 @@ export const BankAccountSection: React.FC<CommonFormSectionsProps> = ({ form, su
</Form.Item>
{/* 级联选择器用于用户选择 */}
<Form.Item
noStyle
rules={[{ required: true, message: '请选择地址' }]}
>
<DictRegionSelect onChange={(value:any) => handleAddressChange(value as string[], record)} />
<Form.Item noStyle rules={[{ required: true, message: '请选择地址' }]}>
<DictRegionSelect
onChange={(value: any) => handleAddressChange(value as string[], record)}
/>
{/* <Cascader
options={addressOptions}
placeholder="请选择地址"
@ -834,7 +833,6 @@ export const AttachmentSection: React.FC<CommonFormSectionsProps> = ({ form }) =
>
</Button>
</Descriptions.Item>
<Descriptions.Item label="请加盖公司公章后上传">
<Form.List name="coscoSupplierSurveyAttachments">
@ -868,11 +866,10 @@ export const AttachmentSection: React.FC<CommonFormSectionsProps> = ({ form }) =
<Input />
</Form.Item>
<Form.Item
name={[field.name, 'fileUrl']}
rules={[{ required: true, message: '请上传已盖章的反商业贿赂承诺书' }]}
style={{marginBottom: 0}}
style={{ marginBottom: 0 }}
getValueFromEvent={(value) => {
if (value && value.length > 0) {
const file = value[0];
@ -884,8 +881,8 @@ export const AttachmentSection: React.FC<CommonFormSectionsProps> = ({ form }) =
fileSize: file.size.toString(),
fileUrl: file.url,
filePath: file.filePath,
}
}
},
},
});
return file.url;
}
@ -902,6 +899,7 @@ export const AttachmentSection: React.FC<CommonFormSectionsProps> = ({ form }) =
maxCount={1}
allowedTypes={['pdf', 'doc', 'docx', 'jpg', 'jpeg', 'png']}
maxSize={10}
tip="pdf,doc,docx,jpg,jpeg,png类型的文件,大小不超过10MB"
/>
</Form.Item>
</div>
@ -910,9 +908,7 @@ export const AttachmentSection: React.FC<CommonFormSectionsProps> = ({ form }) =
);
}}
</Form.List>
</Descriptions.Item>
</Descriptions>
<div className="form-section-title"></div>
@ -924,7 +920,7 @@ export const AttachmentSection: React.FC<CommonFormSectionsProps> = ({ form }) =
style={{ background: '#fff' }}
>
<Descriptions.Item label="其他附件(非必须上传)">
<Form.List name="coscoSupplierSurveyAttachments">
<Form.List name="coscoSupplierSurveyAttachments">
{(fields, { add, remove }) => (
<>
{fields.map((field, index) => (
@ -970,8 +966,8 @@ export const AttachmentSection: React.FC<CommonFormSectionsProps> = ({ form }) =
fileSize: file.size.toString(),
fileUrl: file.url,
filePath: file.filePath,
}
}
},
},
});
return file.url;
}

View File

@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { history, useIntl } from 'umi';
import { useIntl, history, useLocation } from 'umi';
import { Button, Card, Descriptions, Divider, Spin, message, Typography, Empty } from 'antd';
import { ArrowLeftOutlined } from '@ant-design/icons';
import { getTemplateDetail } from '@/servers/api/supplierEvaluate';
@ -12,12 +12,11 @@ const { Title } = Typography;
const SupplierTemplateManageDetail: React.FC = () => {
const intl = useIntl();
const [loading, setLoading] = useState<boolean>(false);
const [templateDetail, setTemplateDetail] = useState<SupplierTemplateManage.TemplateDetailResponse['data'] | null>(null);
const [templateDetail, setTemplateDetail] = useState<
SupplierTemplateManage.TemplateDetailResponse['data'] | null
>(null);
const [templateData, setTemplateData] = useState<SupplierTemplateManage.IndicatorSt[]>([]);
// 从路由获取ID
const { id } = history.location.state as { id: string };
const location = useLocation<{ id: string }>();
// 获取模板详情
const fetchTemplateDetail = async (templateId: string) => {
try {
@ -43,16 +42,13 @@ const SupplierTemplateManageDetail: React.FC = () => {
setLoading(false);
}
};
// 首次加载获取数据
useEffect(() => {
if (id) {
if (location.state?.id) {
const id = location.state.id;
fetchTemplateDetail(id);
} else {
message.error(intl.formatMessage({ id: 'supplierTemplateManage.detail.idNotExist' }));
history.goBack();
}
}, [id]);
}, [location]);
// 返回列表页
const handleBack = () => {
@ -87,7 +83,7 @@ const SupplierTemplateManageDetail: React.FC = () => {
bordered={false}
className={styles.innerCard}
>
<Descriptions column={2} bordered style={{marginTop: 16}}>
<Descriptions column={2} bordered style={{ marginTop: 16 }}>
<Descriptions.Item
label={intl.formatMessage({
id: 'supplierTemplateManage.detail.label.templateName',