更新部分功能

This commit is contained in:
孙景学
2025-07-03 10:24:33 +08:00
parent cf8e9d0820
commit e15c97d741
26 changed files with 199 additions and 114 deletions

View File

@ -19,9 +19,10 @@ interface attachmentsAdd {
interface Props {
viewType?: boolean;
record?: string;
}
const OtherAttachmentsTab: React.FC<Props> = (props) => {
const { viewType = false } = props;
const { viewType = false, record = '' } = props;
//语言切换
const intl = useIntl();
//列表渲染数据
@ -35,7 +36,7 @@ const OtherAttachmentsTab: React.FC<Props> = (props) => {
const getList = async (pageNo = 1, pageSize = 10) => {
setLoading(true);
try {
const { code, data } = await battachmentsGetPage({ pageNo, pageSize });
const { code, data } = await battachmentsGetPage({ pageNo, pageSize, supplierId: record });
if (code === 200) {
setData(data.records);
setPagination({ current: pageNo, pageSize, total: data.total });

View File

@ -20,9 +20,10 @@ interface BankInfo {
}
interface Props {
viewType?: boolean;
record?: string;
}
const BankInfoTab: React.FC<Props> = (props) => {
const { viewType = false } = props;
const { viewType = false, record = '' } = props;
//双语
const intl = useIntl();
//列表渲染数据
@ -35,7 +36,7 @@ const BankInfoTab: React.FC<Props> = (props) => {
const getList = async (pageNo: number = 1, pageSize: number = 10) => {
setLoading(true);
try {
const { code, data } = await bankGetPage({ pageNo, pageSize });
const { code, data } = await bankGetPage({ pageNo, pageSize, supplierId: record });
if (code === 200) {
setData(data.records);
setPagination({ current: pageNo, pageSize, total: data.total });

View File

@ -44,16 +44,17 @@ interface coscoSupplierSurveyAttachments {
interface BaseInfoTabProps {
viewType?:boolean;
record?:string;
}
const BaseInfoTab: React.FC<BaseInfoTabProps> = (props) => {
const { viewType = false } = props;
const { viewType = false, record = '' } = props;
const intl = useIntl();
const [registerInfo, setRegisterInfo] = useState<Request>();
//变更说明与附件
const [changeDataValue, setChangeDataValue] = useState<changeDataValueProps>();
const fetchData = async () => {
const res = await coscoSupplierBase();
const res = await coscoSupplierBase(record);
if (res.code === 200) {
setRegisterInfo(res.data);
setChangeDataValue({

View File

@ -15,8 +15,12 @@ interface Contact {
email: string;
updateTime: string;
}
const ContactsInfoTab: React.FC = () => {
interface Props {
viewType?: boolean;
record?: string;
}
const ContactsInfoTab: React.FC<Props> = (props) => {
const { viewType = false, record = '' } = props;
const intl = useIntl();
const [data, setData] = useState<Contact[]>([]);
const [pagination, setPagination] = useState<TablePaginationConfig>({
@ -28,28 +32,11 @@ const ContactsInfoTab: React.FC = () => {
const fetchContacts = async (page: number = 1, pageSize: number = 10) => {
coscoSupplierBase().then((res) => {
coscoSupplierBase(record).then((res) => {
if(res.code == 200) {
setData([res.data.coscoSupplierBase])
}
})
// setLoading(true);
// try {
// const res = await coscoSupplier(page);
// if (res.code === 200) {
// setData(res.contacts || []);
// setPagination({
// current: page,
// pageSize,
// total: res.totalContacts || (res.contacts?.length || 0),
// });
// }
// } finally {
// setLoading(false);
// }
};
useEffect(() => {

View File

@ -20,10 +20,11 @@ interface InvoiceInfo {
interface InvoiceTabProps {
viewType?: boolean;
record?: string;
}
const InvoiceTab: React.FC<InvoiceTabProps> = (props) => {
const { viewType = false } = props;
const { viewType = false, record = '' } = props;
//语言切换
const intl = useIntl();
//列表渲染数据
@ -37,7 +38,7 @@ const InvoiceTab: React.FC<InvoiceTabProps> = (props) => {
const getList = async (pageNo = 1, pageSize = 10) => {
setLoading(true);
try {
const { code, data } = await invoiceGetPage({ pageNo, pageSize });
const { code, data } = await invoiceGetPage({ pageNo, pageSize, supplierId: record });
if (code === 200) {
setData(data.records);
setPagination({ current: pageNo, pageSize, total: data.total });

View File

@ -19,10 +19,11 @@ interface Qualification {
interface QualificationTabProps {
viewType?: boolean;
record?: string;
}
const QualificationTab: React.FC<QualificationTabProps> = (props) => {
const { viewType = false } = props;
const { viewType = false, record = '' } = props;
const intl = useIntl();
const [data, setData] = useState<Qualification[]>([]);
const [loading, setLoading] = useState(false);
@ -35,7 +36,7 @@ const QualificationTab: React.FC<QualificationTabProps> = (props) => {
const getList = async (pageNo = 1, pageSize = 10) => {
setLoading(true);
try {
const { code, data } = await qualificationsGetPage({ pageNo, pageSize });
const { code, data } = await qualificationsGetPage({ pageNo, pageSize, supplierId: record });
if (code === 200) {
setData(data.records);
setPagination({ current: pageNo, pageSize, total: data.total });

View File

@ -10,12 +10,13 @@ import BankInfoTab from './component/BankInfoTab';
interface CompanyInfoProps {
viewType?: boolean;
record?: string;
}
const { TabPane } = Tabs;
const CompanyInfo: React.FC<CompanyInfoProps> = (props) => {
const { viewType = false } = props;
const { viewType = false, record = '' } = props;
const intl = useIntl();
// 切换tab
const [subTab, setSubTab] = useState<string>('base');
@ -23,22 +24,22 @@ const CompanyInfo: React.FC<CompanyInfoProps> = (props) => {
return (
<Tabs activeKey={subTab} onChange={setSubTab}>
<TabPane tab={intl.formatMessage({ id: 'page.workbench.base' })} key="base">
<BaseInfoTab viewType={viewType} />
<BaseInfoTab viewType={viewType} record={record} />
</TabPane>
<TabPane tab={intl.formatMessage({ id: 'page.workbench.qualification' })} key="qualification">
<QualificationTab viewType={viewType} />
<QualificationTab viewType={viewType} record={record} />
</TabPane>
<TabPane tab={intl.formatMessage({ id: 'page.workbench.invoice' })} key="invoice">
<InvoiceTab viewType={viewType} />
<InvoiceTab viewType={viewType} record={record} />
</TabPane>
<TabPane tab={intl.formatMessage({ id: 'page.workbench.bank' })} key="bank">
<BankInfoTab viewType={viewType} />
<BankInfoTab viewType={viewType} record={record} />
</TabPane>
<TabPane tab={intl.formatMessage({ id: 'page.workbench.attachments' })} key="attachments">
<AttachmentsTab viewType={viewType} />
<AttachmentsTab viewType={viewType} record={record} />
</TabPane>
<TabPane tab={intl.formatMessage({ id: 'page.workbench.contacts' })} key="contacts">
<ContactsInfoTab />
<ContactsInfoTab viewType={viewType} record={record} />
</TabPane>
</Tabs>
);

View File

@ -5,7 +5,7 @@ import request from '@/utils/request';
/**
* 供应商基本信息
*/
export const coscoSupplierBase = () => request.get(`/coscoSupplierBase/1935265782606135296`);
export const coscoSupplierBase = (id: string) => request.get(`/coscoSupplierBase/${id}`);
/**
* 资质分页列表