消息通知与公司信息tab调查问卷及反贿赂承诺书
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Tabs } from 'antd';
|
import { Tabs, Descriptions, Table } from 'antd';
|
||||||
import { useIntl } from 'umi';
|
import { useIntl } from 'umi';
|
||||||
import BaseInfoTab from './component/BaseInfoTab';
|
import BaseInfoTab from './component/BaseInfoTab';
|
||||||
import QualificationTab from './component/QualificationTab';
|
import QualificationTab from './component/QualificationTab';
|
||||||
@ -25,11 +25,13 @@ const CompanyInfo: React.FC<CompanyInfoProps> = (props) => {
|
|||||||
// 切换tab
|
// 切换tab
|
||||||
const [subTab, setSubTab] = useState<string>('');
|
const [subTab, setSubTab] = useState<string>('');
|
||||||
const [supplierType, setSupplierType] = useState<string>('');
|
const [supplierType, setSupplierType] = useState<string>('');
|
||||||
|
//供应商信息数据
|
||||||
|
const [registerInfo, setRegisterInfo] = useState<any>(null);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if(record) {
|
if (record) {
|
||||||
coscoSupplierBase(record).then((res) => {
|
coscoSupplierBase(record).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
setRegisterInfo(res.data)
|
||||||
setSupplierType(res.data.coscoSupplierBase.supplierType)
|
setSupplierType(res.data.coscoSupplierBase.supplierType)
|
||||||
if (res.data.coscoSupplierBase.supplierType === 'pe') {
|
if (res.data.coscoSupplierBase.supplierType === 'pe') {
|
||||||
setSubTab('pe')
|
setSubTab('pe')
|
||||||
@ -47,7 +49,7 @@ const CompanyInfo: React.FC<CompanyInfoProps> = (props) => {
|
|||||||
<TabPane tab={intl.formatMessage({ id: 'page.workbench.base' })} key="pe">
|
<TabPane tab={intl.formatMessage({ id: 'page.workbench.base' })} key="pe">
|
||||||
<PeBaseInfoTab viewType={viewType} record={record} />
|
<PeBaseInfoTab viewType={viewType} record={record} />
|
||||||
</TabPane>
|
</TabPane>
|
||||||
) : subTab ?(
|
) : subTab ? (
|
||||||
<>
|
<>
|
||||||
<TabPane tab={intl.formatMessage({ id: 'page.workbench.base' })} key="base">
|
<TabPane tab={intl.formatMessage({ id: 'page.workbench.base' })} key="base">
|
||||||
<BaseInfoTab viewType={viewType} record={record} />
|
<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">
|
<TabPane tab={intl.formatMessage({ id: 'page.workbench.contacts' })} key="contacts">
|
||||||
<ContactsInfoTab viewType={viewType} record={record} />
|
<ContactsInfoTab viewType={viewType} record={record} />
|
||||||
</TabPane>
|
</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>
|
<div></div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ export default {
|
|||||||
'page.workbench.invoice.account': 'Invoice Bank Account',
|
'page.workbench.invoice.account': 'Invoice Bank Account',
|
||||||
'page.workbench.invoice.updateTime': 'Update Time',
|
'page.workbench.invoice.updateTime': 'Update Time',
|
||||||
'page.workbench.invoice.qualificationCertificate': 'General Taxpayer Qualification Certificate',
|
'page.workbench.invoice.qualificationCertificate': 'General Taxpayer Qualification Certificate',
|
||||||
|
'page.workbench.SABAC': 'Questionnaire and Anti-Bribery Undertaking',
|
||||||
|
|
||||||
|
|
||||||
'page.workbench.bank.index': 'Index',
|
'page.workbench.bank.index': 'Index',
|
||||||
'page.workbench.bank.interbankNumber': 'Bank Code',
|
'page.workbench.bank.interbankNumber': 'Bank Code',
|
||||||
|
@ -28,6 +28,7 @@ export default {
|
|||||||
'page.workbench.invoice.account': '开票户行账号',
|
'page.workbench.invoice.account': '开票户行账号',
|
||||||
'page.workbench.invoice.updateTime': '更新时间',
|
'page.workbench.invoice.updateTime': '更新时间',
|
||||||
'page.workbench.invoice.qualificationCertificate': '一般纳税人资质证明',
|
'page.workbench.invoice.qualificationCertificate': '一般纳税人资质证明',
|
||||||
|
'page.workbench.SABAC': '调查问卷及反贿赂承诺书',
|
||||||
|
|
||||||
'page.workbench.bank.index': '序号',
|
'page.workbench.bank.index': '序号',
|
||||||
'page.workbench.bank.interbankNumber': '银行代码',
|
'page.workbench.bank.interbankNumber': '银行代码',
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useIntl } from 'umi';
|
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 type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
|
||||||
import { SearchOutlined, DeleteOutlined } from '@ant-design/icons';
|
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 { getDictList } from '@/servers/api/dicts'
|
||||||
//统一列表分页
|
//统一列表分页
|
||||||
import tableProps from '@/utils/tableProps'
|
import tableProps from '@/utils/tableProps'
|
||||||
|
const readTypeOptions = [
|
||||||
|
{ dicName: '是', code: '1' },
|
||||||
|
{ dicName: '否', code: '0' },
|
||||||
|
];
|
||||||
interface Data {
|
interface Data {
|
||||||
deptName: string;
|
deptName: string;
|
||||||
categoryName: string;
|
categoryName: string;
|
||||||
@ -35,11 +38,15 @@ const supplierNews: React.FC = () => {
|
|||||||
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
|
const [pagination, setPagination] = useState<TablePaginationConfig>({ current: 1, pageSize: 10, total: 0 });
|
||||||
//下拉数据
|
//下拉数据
|
||||||
const [categoryOptions, setCategoryOptions] = useState<CategoryOption[]>([]);
|
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);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const response = await page(params);
|
const value = searchForm.getFieldsValue();
|
||||||
|
const response = await page({...params, ...value});
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
setData(response.data.records);
|
setData(response.data.records);
|
||||||
setPagination({ current: params.pageNo, pageSize: params.pageSize, total: response.data.total });
|
setPagination({ current: params.pageNo, pageSize: params.pageSize, total: response.data.total });
|
||||||
@ -53,16 +60,13 @@ const supplierNews: React.FC = () => {
|
|||||||
//搜索重置
|
//搜索重置
|
||||||
const handleReset = () => {
|
const handleReset = () => {
|
||||||
searchForm.resetFields();
|
searchForm.resetFields();
|
||||||
getList({ pageNo: 1, pageSize: pagination.pageSize ?? 10, content: '', type: '' });
|
getList({ pageNo: 1, pageSize: pagination.pageSize ?? 10});
|
||||||
};
|
};
|
||||||
//搜索
|
//搜索
|
||||||
const handleSearch = (values: any) => {
|
const handleSearch = () => {
|
||||||
const { content, type } = values;
|
|
||||||
getList({
|
getList({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: pagination.pageSize ?? 10,
|
pageSize: pagination.pageSize ?? 10,
|
||||||
content,
|
|
||||||
type,
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -87,7 +91,7 @@ const supplierNews: React.FC = () => {
|
|||||||
dataIndex: 'type',
|
dataIndex: 'type',
|
||||||
key: 'type',
|
key: 'type',
|
||||||
width: 160,
|
width: 160,
|
||||||
render: (code: string) => typeMap[code] || code
|
render: (code: string) => typeMap[code] || code
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '发送时间',
|
title: '发送时间',
|
||||||
@ -95,6 +99,28 @@ const supplierNews: React.FC = () => {
|
|||||||
key: 'createTime',
|
key: 'createTime',
|
||||||
width: 200,
|
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 }>({});
|
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 (
|
return (
|
||||||
@ -151,7 +177,7 @@ const supplierNews: React.FC = () => {
|
|||||||
<Input placeholder="请输入消息内容" allowClear maxLength={50} />
|
<Input placeholder="请输入消息内容" allowClear maxLength={50} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="type" label="业务类型">
|
<Form.Item name="type" label="业务类型">
|
||||||
<Select placeholder="请选择业务类型" allowClear>
|
<Select style={{ width: 140 }} placeholder="请选择业务类型" allowClear>
|
||||||
{categoryOptions.map((option) => (
|
{categoryOptions.map((option) => (
|
||||||
<Select.Option key={option.code} value={option.code}>
|
<Select.Option key={option.code} value={option.code}>
|
||||||
{option.dicName}
|
{option.dicName}
|
||||||
@ -159,6 +185,13 @@ const supplierNews: React.FC = () => {
|
|||||||
))}
|
))}
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</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>
|
<Form.Item>
|
||||||
<Button className="buttonSubmit" type="primary" htmlType="submit" icon={<SearchOutlined />}>
|
<Button className="buttonSubmit" type="primary" htmlType="submit" icon={<SearchOutlined />}>
|
||||||
搜索
|
搜索
|
||||||
@ -176,11 +209,29 @@ const supplierNews: React.FC = () => {
|
|||||||
dataSource={data}
|
dataSource={data}
|
||||||
pagination={{ ...tableProps.pagination, total: pagination.total }}
|
pagination={{ ...tableProps.pagination, total: pagination.total }}
|
||||||
loading={loading}
|
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 }}
|
style={{ flex: 1, minHeight: 0 }}
|
||||||
scroll={{ y: 'calc(100vh - 350px)' }}
|
scroll={{ y: 'calc(100vh - 350px)' }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</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>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -15,3 +15,11 @@ export const page = (data: page) => request.post('/supplierMessage/page', { data
|
|||||||
* 消息弹出
|
* 消息弹出
|
||||||
*/
|
*/
|
||||||
export const getExitMge = () => request.get('/supplierMessage/getExitMge');
|
export const getExitMge = () => request.get('/supplierMessage/getExitMge');
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
interface update {
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
export const update = (data: update) => request.post('/supplierMessage/update', { data });
|
||||||
|
@ -182,7 +182,10 @@ const SupplierMessage: React.FC = () => {
|
|||||||
<Modal
|
<Modal
|
||||||
title="消息详情"
|
title="消息详情"
|
||||||
visible={viewVisible}
|
visible={viewVisible}
|
||||||
onCancel={() => setViewVisible(false)}
|
onCancel={() => {
|
||||||
|
setViewVisible(false)
|
||||||
|
handleSearch()
|
||||||
|
}}
|
||||||
footer={null}
|
footer={null}
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user