消息通知与公司信息tab调查问卷及反贿赂承诺书

This commit is contained in:
孙景学
2025-08-11 15:44:35 +08:00
parent 1645cb26d8
commit c0006963db
6 changed files with 122 additions and 20 deletions

View File

@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { Tabs } from 'antd';
import { Tabs, Descriptions, Table } from 'antd';
import { useIntl } from 'umi';
import BaseInfoTab from './component/BaseInfoTab';
import QualificationTab from './component/QualificationTab';
@ -25,11 +25,13 @@ const CompanyInfo: React.FC<CompanyInfoProps> = (props) => {
// 切换tab
const [subTab, setSubTab] = useState<string>('');
const [supplierType, setSupplierType] = useState<string>('');
//供应商信息数据
const [registerInfo, setRegisterInfo] = useState<any>(null);
useEffect(() => {
if(record) {
if (record) {
coscoSupplierBase(record).then((res) => {
if (res.code === 200) {
setRegisterInfo(res.data)
setSupplierType(res.data.coscoSupplierBase.supplierType)
if (res.data.coscoSupplierBase.supplierType === 'pe') {
setSubTab('pe')
@ -47,7 +49,7 @@ const CompanyInfo: React.FC<CompanyInfoProps> = (props) => {
<TabPane tab={intl.formatMessage({ id: 'page.workbench.base' })} key="pe">
<PeBaseInfoTab viewType={viewType} record={record} />
</TabPane>
) : subTab ?(
) : subTab ? (
<>
<TabPane tab={intl.formatMessage({ id: 'page.workbench.base' })} key="base">
<BaseInfoTab viewType={viewType} record={record} />
@ -67,8 +69,43 @@ const CompanyInfo: React.FC<CompanyInfoProps> = (props) => {
<TabPane tab={intl.formatMessage({ id: 'page.workbench.contacts' })} key="contacts">
<ContactsInfoTab viewType={viewType} record={record} />
</TabPane>
<TabPane tab={intl.formatMessage({ id: 'page.workbench.SABAC' })} key="SABAC">
<>
<div style={{ padding: '0 16px' }}>
<Table
dataSource={registerInfo.coscoSupplierSurveyQuestionReply}
columns={[
{ title: intl.formatMessage({ id: 'component.globalModal.index' }), dataIndex: 'index', key: 'index', width: 60, align: 'center', render: (_: any, __: any, index: number) => index + 1 },
{ title: intl.formatMessage({ id: 'component.globalModal.question' }), dataIndex: 'questionName', key: 'questionName' },
{ title: intl.formatMessage({ id: 'component.globalModal.answer' }), dataIndex: 'replyValue', key: 'replyValue', width: 120 },
]}
pagination={false}
title={() => <div style={{ fontWeight: 'bold', fontSize: 16, textIndent: '-16px' }}>{intl.formatMessage({ id: 'component.globalModal.questionnaire' })}</div>}
/>
</div>
<Descriptions
title={intl.formatMessage({ id: 'component.globalModal.antiBriberyTitle' })}
bordered
column={1}
size="middle"
style={{ background: '#fff', padding: '16px 16px 0' }}
>
<Descriptions.Item
label={intl.formatMessage({ id: 'component.globalModal.antiBriberyLabel' })}
labelStyle={{ width: '200px' }}
>
{registerInfo.coscoSupplierSurveyAttachments.map((item: any) => {
const { attachmentsType, fileUrl, fileName } = item;
return attachmentsType === 'commitment' ? (
<a href={fileUrl} target="_blank" rel="noreferrer">{fileName}</a>
) : null
})}
</Descriptions.Item>
</Descriptions>
</>
</TabPane>
</>
):(
) : (
<div></div>
)}

View File

@ -28,6 +28,8 @@ export default {
'page.workbench.invoice.account': 'Invoice Bank Account',
'page.workbench.invoice.updateTime': 'Update Time',
'page.workbench.invoice.qualificationCertificate': 'General Taxpayer Qualification Certificate',
'page.workbench.SABAC': 'Questionnaire and Anti-Bribery Undertaking',
'page.workbench.bank.index': 'Index',
'page.workbench.bank.interbankNumber': 'Bank Code',

View File

@ -28,6 +28,7 @@ export default {
'page.workbench.invoice.account': '开票户行账号',
'page.workbench.invoice.updateTime': '更新时间',
'page.workbench.invoice.qualificationCertificate': '一般纳税人资质证明',
'page.workbench.SABAC': '调查问卷及反贿赂承诺书',
'page.workbench.bank.index': '序号',
'page.workbench.bank.interbankNumber': '银行代码',

View File

@ -1,14 +1,17 @@
import React, { useEffect, useState } from "react";
import { useIntl } from 'umi';
import { Form, Button, Table, Select, Input, Modal } from 'antd';
import { Form, Button, Table, Select, Input, Modal, Descriptions } from 'antd';
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
//字典与接口
import { page, getExitMge } from './services';
import { page, getExitMge, update } from './services';
import { getDictList } from '@/servers/api/dicts'
//统一列表分页
import tableProps from '@/utils/tableProps'
const readTypeOptions = [
{ dicName: '是', code: '1' },
{ dicName: '否', code: '0' },
];
interface Data {
deptName: string;
categoryName: string;
@ -35,11 +38,15 @@ const supplierNews: React.FC = () => {
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
//下拉数据
const [categoryOptions, setCategoryOptions] = useState<CategoryOption[]>([]);
//查看信息与组件
const [viewRecord, setViewRecord] = useState<any>(null); // 当前查看的消息
const [viewVisible, setViewVisible] = useState(false); // 弹窗显隐
//列表数据方法
const getList = async (params: { pageNo: number; pageSize: number; content: string; type: string; }) => {
const getList = async (params: { pageNo: number; pageSize: number;}) => {
setLoading(true);
try {
const response = await page(params);
const value = searchForm.getFieldsValue();
const response = await page({...params, ...value});
if (response.code === 200) {
setData(response.data.records);
setPagination({ current: params.pageNo, pageSize: params.pageSize, total: response.data.total });
@ -53,16 +60,13 @@ const supplierNews: React.FC = () => {
//搜索重置
const handleReset = () => {
searchForm.resetFields();
getList({ pageNo: 1, pageSize: pagination.pageSize ?? 10, content: '', type: '' });
getList({ pageNo: 1, pageSize: pagination.pageSize ?? 10});
};
//搜索
const handleSearch = (values: any) => {
const { content, type } = values;
const handleSearch = () => {
getList({
pageNo: 1,
pageSize: pagination.pageSize ?? 10,
content,
type,
});
};
@ -87,7 +91,7 @@ const supplierNews: React.FC = () => {
dataIndex: 'type',
key: 'type',
width: 160,
render: (code: string) => typeMap[code] || code
render: (code: string) => typeMap[code] || code
},
{
title: '发送时间',
@ -95,6 +99,28 @@ const supplierNews: React.FC = () => {
key: 'createTime',
width: 200,
},
{
title: '是否已读',
dataIndex: 'read',
key: 'read',
align: 'center',
width: 120,
render: (_, record: any) => (<span>{record.read === '0' ? '否' : '是'}</span>)
},
{
title: '操作',
key: 'option',
align: 'center',
width: 80,
render: (_, record: any) => (
<a onClick={() => {
setViewRecord(record);
setViewVisible(true);
update({ id: record.id })
handleSearch()
}}></a>
),
}
];
const [typeMap, setTypeMap] = useState<{ [code: string]: string }>({});
//初始化
@ -134,7 +160,7 @@ const supplierNews: React.FC = () => {
}
}
})
getList({ pageNo: 1, pageSize: 10, content: '', type: '' });
getList({ pageNo: 1, pageSize: 10 });
}, []);
return (
@ -151,7 +177,7 @@ const supplierNews: React.FC = () => {
<Input placeholder="请输入消息内容" allowClear maxLength={50} />
</Form.Item>
<Form.Item name="type" label="业务类型">
<Select placeholder="请选择业务类型" allowClear>
<Select style={{ width: 140 }} placeholder="请选择业务类型" allowClear>
{categoryOptions.map((option) => (
<Select.Option key={option.code} value={option.code}>
{option.dicName}
@ -159,6 +185,13 @@ const supplierNews: React.FC = () => {
))}
</Select>
</Form.Item>
<Form.Item name="read" label="是否已读">
<Select style={{ width: 140 }} placeholder="请选择是否已读" allowClear>
{readTypeOptions.map(opt => (
<Select.Option key={opt.code} value={opt.code}>{opt.dicName}</Select.Option>
))}
</Select>
</Form.Item>
<Form.Item>
<Button className="buttonSubmit" type="primary" htmlType="submit" icon={<SearchOutlined />}>
@ -176,11 +209,29 @@ const supplierNews: React.FC = () => {
dataSource={data}
pagination={{ ...tableProps.pagination, total: pagination.total }}
loading={loading}
onChange={(pagination) => getList({ pageNo: pagination.current!, pageSize: pagination.pageSize!, content: '', type: '' })}
onChange={(pagination) => getList({ pageNo: pagination.current!, pageSize: pagination.pageSize! })}
style={{ flex: 1, minHeight: 0 }}
scroll={{ y: 'calc(100vh - 350px)' }}
/>
</div>
<Modal
title="消息详情"
visible={viewVisible}
onCancel={() => {
setViewVisible(false)
handleSearch()
}}
footer={null}
destroyOnClose
>
{viewRecord && (
<Descriptions bordered column={1} size="small">
<Descriptions.Item labelStyle={{ width: '120px' }} label="消息内容">{viewRecord.content}</Descriptions.Item>
<Descriptions.Item label="业务类型">{typeMap[viewRecord.type] || viewRecord.type}</Descriptions.Item>
<Descriptions.Item label="发送时间">{viewRecord.createTime}</Descriptions.Item>
</Descriptions>
)}
</Modal>
</>
);
};

View File

@ -15,3 +15,11 @@ export const page = (data: page) => request.post('/supplierMessage/page', { data
* 消息弹出
*/
export const getExitMge = () => request.get('/supplierMessage/getExitMge');
/**
*
*/
interface update {
id: string;
}
export const update = (data: update) => request.post('/supplierMessage/update', { data });

View File

@ -182,7 +182,10 @@ const SupplierMessage: React.FC = () => {
<Modal
title="消息详情"
visible={viewVisible}
onCancel={() => setViewVisible(false)}
onCancel={() => {
setViewVisible(false)
handleSearch()
}}
footer={null}
destroyOnClose
>