From 15fd10746d39db2072b05532d36e1264f11408a5 Mon Sep 17 00:00:00 2001 From: jl-zhoujl2 Date: Thu, 24 Mar 2022 14:13:54 +0800 Subject: [PATCH] =?UTF-8?q?3.24=20=E9=BB=91=E5=90=8D=E5=8D=95=E7=AD=89?= =?UTF-8?q?=E7=BA=A7=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ViewBlacklistFormModal.tsx | 111 ++++++++++-------- .../components/ViewInvoiceFormModal.tsx | 53 +++++---- 2 files changed, 88 insertions(+), 76 deletions(-) diff --git a/src/pages/Evaluation/BidControl/BidControlManager/components/ViewBlacklistFormModal.tsx b/src/pages/Evaluation/BidControl/BidControlManager/components/ViewBlacklistFormModal.tsx index fbf56ea..ff40425 100644 --- a/src/pages/Evaluation/BidControl/BidControlManager/components/ViewBlacklistFormModal.tsx +++ b/src/pages/Evaluation/BidControl/BidControlManager/components/ViewBlacklistFormModal.tsx @@ -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 = (props) => { @@ -30,71 +30,80 @@ const ViewBlacklistFormModal: React.FC = (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[] = [ - { 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"? - - :null} - - ) - } - }, + { + title: '历史黑名单记录', dataIndex: 'hmdjl', render: (_, record) => { + return ( + <> + {record.isBlack === "1" ? + + : 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 = (props) => return ( <> - {juryTableShow? - - - {feginState?供应商黑名单接口不通,显示假数据:null} - { - -
- - } + {juryTableShow ? + + + {feginState ? 供应商黑名单接口不通,显示假数据 : null} + { + +
+ + }
{ viewInvoiceValues ? ( @@ -131,7 +140,7 @@ const ViewBlacklistFormModal: React.FC = (props) => ) : null }
- :null} + : null} ); }; diff --git a/src/pages/Evaluation/BidControl/BidControlManager/components/ViewInvoiceFormModal.tsx b/src/pages/Evaluation/BidControl/BidControlManager/components/ViewInvoiceFormModal.tsx index f50457b..e498ac5 100644 --- a/src/pages/Evaluation/BidControl/BidControlManager/components/ViewInvoiceFormModal.tsx +++ b/src/pages/Evaluation/BidControl/BidControlManager/components/ViewInvoiceFormModal.tsx @@ -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 = (props) => { - const {modalVisible, values,onCancel: handleUpdateModalVisible,} = props; + const { modalVisible, values, onCancel: handleUpdateModalVisible, } = props; const [ListData, setListData] = useState([]); @@ -21,45 +21,48 @@ const ViewInvoiceFormModal: React.FC = (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 ( <> - handleUpdateModalVisible()} - okText="确定" - okButtonProps={{hidden: true}} - cancelText="取消" - width="80%" - style={{top:"2%",height: "96%",overflowY:"auto"}} - > -
-
+ handleUpdateModalVisible()} + okText="确定" + okButtonProps={{ hidden: true }} + cancelText="取消" + width="80%" + style={{ top: "2%", height: "96%", overflowY: "auto" }} + > +
+
); };