3.24 黑名单等级逻辑
This commit is contained in:
@ -1,19 +1,19 @@
|
||||
import React, { useEffect,useState } from 'react';
|
||||
import { Tabs,Collapse,Form, Input, Modal,Col,Row,Divider, Table, Button } from 'antd';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Tabs, Collapse, Form, Input, Modal, Col, Row, Divider, Table, Button } from 'antd';
|
||||
import ProTable, { ProColumns } from "@ant-design/pro-table";
|
||||
import ExtendUpload from "@/utils/ExtendUpload";
|
||||
import { getBlackList,getBlackListOld} from '../service';
|
||||
import {} from '@/utils/CommonUtils'
|
||||
import { getBlackList } from '../service';
|
||||
import { isEmpty } from '@/utils/CommonUtils'
|
||||
import { getRoomId, getSessionProjectData, getSessionRoleData, getSessionUserData } from '@/utils/session';
|
||||
import ViewInvoiceFormModal from './ViewInvoiceFormModal';
|
||||
|
||||
interface ViewBlacklistFormModalProps {
|
||||
modalVisible: boolean;
|
||||
values: any;
|
||||
onCancel:any;
|
||||
onCancel: any;
|
||||
}
|
||||
|
||||
const ret = {"code":200,"success":true,"message":"success","data":[{"providerCode":"00100066991","provinceName":"供应商1","isBlack":"1","ouName":null,"startTime":"2020-01-01","endTime":"2022-01-01","term":"2年","oldList":[{"id":"1","providerCode":"00100066991","provinceName":"供应商1","ou":"JL","ouName":"吉林","startTime":"2020-01-01","endTime":"2022-01-01","term":"2年","reserved1":"","reserved2":"","reserved3":"","reserved4":"","reserved5":"","reserved6":"","reserved7":"","reserved8":"","reserved9":"","reserved10":"","version":null,"isDel":0,"isEnable":0,"createBy":null,"createDate":null,"updateBy":null,"updateDate":null,"lastUpdateTime":null,"deleteFlag":"normal","versions":null,"tenantId":null,"tenantName":null,"providerCodes":null}]},{"providerCode":"00100066992","provinceName":"供应商2","isBlack":"0","ouName":null,"startTime":null,"endTime":null,"term":null,"oldList":[]},{"providerCode":"00100067003","provinceName":"供应商3","isBlack":"0","ouName":null,"startTime":null,"endTime":null,"term":null,"oldList":[]}]}
|
||||
const ret = { "code": 200, "success": true, "message": "success", "data": [{ "providerCode": "00100066991", "provinceName": "供应商1", "isBlack": "1", "ouName": null, "startTime": "2020-01-01", "endTime": "2022-01-01", "term": "2年", "oldList": [{ "id": "1", "providerCode": "00100066991", "provinceName": "供应商1", "ou": "JL", "ouName": "吉林", "startTime": "2020-01-01", "endTime": "2022-01-01", "term": "2年", "reserved1": "", "reserved2": "", "reserved3": "", "reserved4": "", "reserved5": "", "reserved6": "", "reserved7": "", "reserved8": "", "reserved9": "", "reserved10": "", "version": null, "isDel": 0, "isEnable": 0, "createBy": null, "createDate": null, "updateBy": null, "updateDate": null, "lastUpdateTime": null, "deleteFlag": "normal", "versions": null, "tenantId": null, "tenantName": null, "providerCodes": null }] }, { "providerCode": "00100066992", "provinceName": "供应商2", "isBlack": "0", "ouName": null, "startTime": null, "endTime": null, "term": null, "oldList": [] }, { "providerCode": "00100067003", "provinceName": "供应商3", "isBlack": "0", "ouName": null, "startTime": null, "endTime": null, "term": null, "oldList": [] }] }
|
||||
|
||||
const ViewBlacklistFormModal: React.FC<ViewBlacklistFormModalProps> = (props) => {
|
||||
|
||||
@ -30,71 +30,80 @@ const ViewBlacklistFormModal: React.FC<ViewBlacklistFormModalProps> = (props) =>
|
||||
|
||||
useEffect(() => {
|
||||
getWarningList();
|
||||
if(roleId==="ebtp-expert"){
|
||||
if (roleId === "ebtp-expert") {
|
||||
setJuryTableShow(false);
|
||||
}
|
||||
},[])
|
||||
}, [])
|
||||
|
||||
function callback(key: any) {
|
||||
//getSessionUserData.roleIds;
|
||||
}
|
||||
|
||||
//黑名单历史
|
||||
const blacklistViewDetail = (data:any) => {
|
||||
setViewInvoiceFormVisible(true);
|
||||
setViewInvoiceValues(data);
|
||||
const blacklistViewDetail = (data: any) => {
|
||||
setViewInvoiceFormVisible(true);
|
||||
setViewInvoiceValues(data);
|
||||
}
|
||||
|
||||
function isBlackValue(key:any){
|
||||
function isBlackValue(key: any) {
|
||||
let name = "";
|
||||
//1 是 0 否
|
||||
if(key==="1"){
|
||||
if (key === "1") {
|
||||
name = "是";
|
||||
}else if(key==="0"){
|
||||
} else if (key === "0") {
|
||||
name = "否";
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
const companyBlacklistColumns: ProColumns<any>[] = [
|
||||
{ title: '序号', dataIndex: 'num', width: 60, render: (text: any, record: any, index: any) => `${index + 1}`},
|
||||
{ title: '序号', dataIndex: 'num', width: 60, render: (text: any, record: any, index: any) => `${index + 1}` },
|
||||
{ title: '供应商名称', dataIndex: 'provinceName', },
|
||||
{ title: '是否被列入黑名单', dataIndex: 'isBlack',render: (_, record) => {
|
||||
{
|
||||
title: '是否被列入黑名单', dataIndex: 'isBlack', render: (_, record) => {
|
||||
let a = "";
|
||||
if(record!==null){
|
||||
if (record !== null) {
|
||||
a = isBlackValue(record.isBlack);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
},
|
||||
{ title: '黑名单等级', dataIndex: 'lv', },
|
||||
},
|
||||
{
|
||||
title: '黑名单等级', dataIndex: 'lv', render: (_, record) => {
|
||||
if (record.isBlack == "1") {
|
||||
return isEmpty(record.lv) || '1' ? '一级' : '二级';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{ title: '黑名单开始时间', dataIndex: 'startTime', },
|
||||
{ title: '黑名单结束时间', dataIndex: 'endTime', },
|
||||
{ title: '黑名单期限', dataIndex: 'term', },
|
||||
{ title: '历史黑名单记录', dataIndex: 'hmdjl',render: (_, record) => {
|
||||
return (
|
||||
<>
|
||||
{record.isBlack==="1"?
|
||||
<Button type="primary" onClick={() => { blacklistViewDetail(record.oldList) }}>查看黑名单历史</Button>
|
||||
:null}
|
||||
</>
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '历史黑名单记录', dataIndex: 'hmdjl', render: (_, record) => {
|
||||
return (
|
||||
<>
|
||||
{record.isBlack === "1" ?
|
||||
<Button type="primary" onClick={() => { blacklistViewDetail(record.oldList) }}>查看黑名单历史</Button>
|
||||
: null}
|
||||
</>
|
||||
)
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
const getWarningList = async() => {
|
||||
let roomId=getRoomId();//sessionStorage.getItem('roomId');//sessionStorage.getItem('roomId')
|
||||
let projectId =getSessionProjectData().id;
|
||||
const getWarningList = async () => {
|
||||
let roomId = getRoomId();//sessionStorage.getItem('roomId');//sessionStorage.getItem('roomId')
|
||||
let projectId = getSessionProjectData().id;
|
||||
let sf = "";
|
||||
let a =[];
|
||||
let a = [];
|
||||
//setQuoteWarningList(dataSource3)
|
||||
|
||||
|
||||
//黑名单
|
||||
await getBlackList(projectId,roomId).then((res) => {
|
||||
if (res.success ==true) {
|
||||
await getBlackList(projectId, roomId).then((res) => {
|
||||
if (res.success == true) {
|
||||
setQuoteWarningList(res.data)
|
||||
}else{
|
||||
} else {
|
||||
setQuoteWarningList(ret.data);
|
||||
setFeginState(true);
|
||||
}
|
||||
@ -103,19 +112,19 @@ const ViewBlacklistFormModal: React.FC<ViewBlacklistFormModalProps> = (props) =>
|
||||
|
||||
return (
|
||||
<>
|
||||
{juryTableShow?
|
||||
<Collapse onChange={callback}>
|
||||
<Collapse.Panel header="供应商的黑名单信息查看" key="3">
|
||||
{feginState?<span style={{color:'red'}}>供应商黑名单接口不通,显示假数据</span>:null}
|
||||
{
|
||||
|
||||
<Table
|
||||
columns={companyBlacklistColumns}
|
||||
dataSource={quoteWarningList}
|
||||
pagination={false}//分页
|
||||
></Table>
|
||||
|
||||
}
|
||||
{juryTableShow ?
|
||||
<Collapse onChange={callback}>
|
||||
<Collapse.Panel header="供应商的黑名单信息查看" key="3">
|
||||
{feginState ? <span style={{ color: 'red' }}>供应商黑名单接口不通,显示假数据</span> : null}
|
||||
{
|
||||
|
||||
<Table
|
||||
columns={companyBlacklistColumns}
|
||||
dataSource={quoteWarningList}
|
||||
pagination={false}//分页
|
||||
></Table>
|
||||
|
||||
}
|
||||
</Collapse.Panel>
|
||||
{
|
||||
viewInvoiceValues ? (
|
||||
@ -131,7 +140,7 @@ const ViewBlacklistFormModal: React.FC<ViewBlacklistFormModalProps> = (props) =>
|
||||
) : null
|
||||
}
|
||||
</Collapse>
|
||||
:null}
|
||||
: null}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
@ -1,17 +1,17 @@
|
||||
import React, { useEffect,useState } from 'react';
|
||||
import { Tabs,Collapse,Form, Input, Modal,Col,Row,Divider, Table } from 'antd';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Tabs, Collapse, Form, Input, Modal, Col, Row, Divider, Table } from 'antd';
|
||||
import ProTable from "@ant-design/pro-table";
|
||||
import ExtendUpload from "@/utils/ExtendUpload";
|
||||
import {} from '@/utils/CommonUtils'
|
||||
import { isEmpty } from '@/utils/CommonUtils'
|
||||
|
||||
|
||||
interface ViewInvoiceFormModalProps {
|
||||
modalVisible: boolean;
|
||||
values: any;
|
||||
onCancel:any;
|
||||
onCancel: any;
|
||||
}
|
||||
const ViewInvoiceFormModal: React.FC<ViewInvoiceFormModalProps> = (props) => {
|
||||
const {modalVisible, values,onCancel: handleUpdateModalVisible,} = props;
|
||||
const { modalVisible, values, onCancel: handleUpdateModalVisible, } = props;
|
||||
|
||||
const [ListData, setListData] = useState<any>([]);
|
||||
|
||||
@ -21,45 +21,48 @@ const ViewInvoiceFormModal: React.FC<ViewInvoiceFormModalProps> = (props) => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
},[])
|
||||
}, [])
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
title: '供应商名称',
|
||||
dataIndex: 'provinceName',
|
||||
},{
|
||||
}, {
|
||||
title: '省分',
|
||||
dataIndex: 'ouName',
|
||||
},{
|
||||
}, {
|
||||
title: '黑名单等级',
|
||||
dataIndex: 'lv',
|
||||
},{
|
||||
render: (_: any, record: any) => {
|
||||
return isEmpty(record.lv) || '1' ? '一级' : '二级';
|
||||
}
|
||||
}, {
|
||||
title: '黑名单开始时间',
|
||||
dataIndex: 'startTime',
|
||||
},{
|
||||
}, {
|
||||
title: '黑名单结束时间',
|
||||
dataIndex: 'endTime',
|
||||
},{
|
||||
}, {
|
||||
title: '黑名单年限',
|
||||
dataIndex: 'term',
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
destroyOnClose
|
||||
title="历史黑名单"
|
||||
visible={modalVisible}
|
||||
onCancel={() => handleUpdateModalVisible()}
|
||||
okText="确定"
|
||||
okButtonProps={{hidden: true}}
|
||||
cancelText="取消"
|
||||
width="80%"
|
||||
style={{top:"2%",height: "96%",overflowY:"auto"}}
|
||||
>
|
||||
<Table columns={columns} dataSource={values}></Table>
|
||||
</Modal>
|
||||
<Modal
|
||||
destroyOnClose
|
||||
title="历史黑名单"
|
||||
visible={modalVisible}
|
||||
onCancel={() => handleUpdateModalVisible()}
|
||||
okText="确定"
|
||||
okButtonProps={{ hidden: true }}
|
||||
cancelText="取消"
|
||||
width="80%"
|
||||
style={{ top: "2%", height: "96%", overflowY: "auto" }}
|
||||
>
|
||||
<Table columns={columns} dataSource={values}></Table>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user