供应商准入管理除了品类
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Modal, Descriptions, Table, Button } from 'antd';
|
||||
|
||||
import { startApprove } from '../services'
|
||||
|
||||
const ApproveModal: React.FC<{
|
||||
visible: boolean;
|
||||
|
@ -3,12 +3,29 @@ import { Modal, Descriptions } from 'antd';
|
||||
|
||||
import { coscoAccessWork } from '../services'
|
||||
|
||||
|
||||
//数据接口
|
||||
interface Data {
|
||||
accessWorkName: string;
|
||||
coscoAccessWork: coscoAccessWorks;
|
||||
coscoAccessSupplierList: coscoAccessSupplierLists[];
|
||||
coscoAccessCategoryList: coscoAccessCategoryLists[];
|
||||
coscoAccessUserls: coscoAccessUserl[];
|
||||
}
|
||||
interface coscoAccessUserl {
|
||||
deptId: string;
|
||||
accessTypeText: string;
|
||||
createTime: string;
|
||||
userId: string;
|
||||
}
|
||||
interface coscoAccessCategoryLists {
|
||||
categoryName: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
interface coscoAccessSupplierLists {
|
||||
supplierName: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
interface coscoAccessWorks {
|
||||
deptId: string;
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
reviewStatusText: string;
|
||||
}
|
||||
|
||||
@ -17,35 +34,51 @@ const ViewModal: React.FC<{
|
||||
record?: any;
|
||||
onCancel: () => void;
|
||||
}> = ({ visible, record = {}, onCancel }) => {
|
||||
|
||||
//渲染数据
|
||||
const [data, setData] = useState<Data | null>(null);
|
||||
|
||||
//初始化
|
||||
useEffect(() => {
|
||||
if(record.id) {
|
||||
if (record.id) {
|
||||
coscoAccessWork(record.id).then((res) => {
|
||||
const { code, data } = res;
|
||||
if (code == 200) {
|
||||
setData(data.coscoAccessWork)
|
||||
setData(data)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}, [record])
|
||||
|
||||
return (
|
||||
<Modal title="查看详情" visible={visible} footer={null} onCancel={onCancel}>
|
||||
{data && (
|
||||
<Descriptions bordered column={1}>
|
||||
<Descriptions.Item label="准入工作">{data.accessWorkName}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入单位">{data.deptId}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入部门">{data.deptId}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入方式">{data.accessTypeText}</Descriptions.Item>
|
||||
<Descriptions.Item label="申请时间">{data.createTime}</Descriptions.Item>
|
||||
<Descriptions.Item label="状态">{data.reviewStatusText}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入部门">{data.coscoAccessWork.deptId}</Descriptions.Item>
|
||||
<Descriptions.Item label="准入供应商">
|
||||
{data.coscoAccessSupplierList.map((item) => {
|
||||
return (
|
||||
<div style={{ margin: '5px' }}>{item.supplierName}</div>
|
||||
)
|
||||
})}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="申请准入品类">
|
||||
{data.coscoAccessCategoryList.map((item) => {
|
||||
return (
|
||||
<div style={{ margin: '5px' }}>{item.categoryName}</div>
|
||||
)
|
||||
})}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="评审开始时间">{data.coscoAccessWork.startTime}</Descriptions.Item>
|
||||
<Descriptions.Item label="评审结束时间">{data.coscoAccessWork.endTime}</Descriptions.Item>
|
||||
<Descriptions.Item label="评审专家">
|
||||
{data.coscoAccessUserls.map((item) => {
|
||||
return (
|
||||
<div style={{ margin: '5px' }}>{item.deptId} - {item.userId}</div>
|
||||
)
|
||||
})}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="审批结果">{data.coscoAccessWork.reviewStatusText}</Descriptions.Item>
|
||||
</Descriptions>
|
||||
)}
|
||||
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
@ -73,14 +73,13 @@ const AccessManagement: React.FC = () => {
|
||||
{ title: '准入部门', dataIndex: 'deptId' },
|
||||
{ title: '准入方式', dataIndex: 'accessTypeText' },
|
||||
{ title: '申请时间', dataIndex: 'createTime' },
|
||||
{ title: '状态', dataIndex: 'approveStatus' },
|
||||
{ title: '状态', dataIndex: 'reviewStatusText' },
|
||||
{
|
||||
title: '操作',
|
||||
render: (_: any, record: any) => (
|
||||
<Space>
|
||||
<a onClick={() => openModal('view', record)}>查看</a>
|
||||
<a onClick={() => openModal('approve', record)}>发起审批</a>
|
||||
<a onClick={() => openModal('record', record)}>审批记录</a>
|
||||
{/* <a onClick={() => openModal('approve', record)}>发起审批</a> */}
|
||||
<a onClick={() => openModal('result', record)}>查看评审结果</a>
|
||||
</Space>
|
||||
),
|
||||
@ -137,8 +136,8 @@ const AccessManagement: React.FC = () => {
|
||||
/>
|
||||
{/* 弹窗区 */}
|
||||
<ViewModal visible={modalInfo.type === 'view' && modalInfo.visible} record={modalInfo.record} onCancel={closeModal} />
|
||||
<ApproveModal visible={modalInfo.type === 'approve' && modalInfo.visible} record={modalInfo.record} onCancel={closeModal} />
|
||||
<RecordModal visible={modalInfo.type === 'record' && modalInfo.visible} record={modalInfo.record} onCancel={closeModal} />
|
||||
{/* <ApproveModal visible={modalInfo.type === 'approve' && modalInfo.visible} record={modalInfo.record} onCancel={closeModal} /> */}
|
||||
{/* <RecordModal visible={modalInfo.type === 'record' && modalInfo.visible} record={modalInfo.record} onCancel={closeModal} /> */}
|
||||
<ResultModal visible={modalInfo.type === 'result' && modalInfo.visible} record={modalInfo.record} onCancel={closeModal} />
|
||||
<CreateModal visible={modalInfo.type === 'create' && modalInfo.visible} onCancel={closeModal} />
|
||||
</>
|
||||
|
@ -82,6 +82,17 @@ export const uploadFile = async (file: File) => {
|
||||
return request('/fileConfig/files/upload', {
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
|
||||
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* 发起审批
|
||||
*/
|
||||
interface startApproveData {
|
||||
id: string;
|
||||
}
|
||||
export const startApprove = (params: startApproveData) => request.get(`/coscoAccessWork/`, { params });
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user