9.26 偏离度提醒颜色错误

This commit is contained in:
jl-zhoujl2
2022-09-26 15:39:49 +08:00
parent 53940f64ce
commit a4c903da71

View File

@ -1,27 +1,27 @@
import React, { useEffect,useState } from 'react';
import { Tabs,Collapse,Form, Input, Modal,Col,Row,Divider, Table, message, Button, Empty } from 'antd';
import React, { useEffect, useState } from 'react';
import { Tabs, Collapse, Form, Input, Modal, Col, Row, Divider, Table, message, Button, Empty } from 'antd';
import ProTable, { ProColumns } from "@ant-design/pro-table";
import { deviatedAnalysisListToRR, deviatedAnalysisRRYes, getDeviatedAnalysisList, getList} from '../service';
import { deviatedAnalysisListToRR, deviatedAnalysisRRYes, getDeviatedAnalysisList, getList } from '../service';
import { getProMethod, getRoomId, getSessionRoleData, getSessionUserData } from '@/utils/session';
interface ViewJuryScoringAnalysisFormModalProps {
modalVisible: boolean;
values: any;
onCancel:any;
onCancel: any;
}
const ViewJuryScoringAnalysisFormModal: React.FC<ViewJuryScoringAnalysisFormModalProps> = (props) => {
const [juryScoringAnalysisList, setJuryScoringAnalysisList] = useState([]);
const [juryYesList, setJuryYesList] = useState([]);
const [juryYesVis, setJuryYesVisSet] = useState<boolean>(false);//专家确认页面
const [juryTableShow, setJuryTableShow] = useState<boolean>(false);//
var roleId = getSessionRoleData().roleCode;
let roomId=getRoomId();//sessionStorage.getItem('roomId');//sessionStorage.getItem('roomId')
var params={};
params["assessRoomId"]=roomId;
let roomId = getRoomId();//sessionStorage.getItem('roomId');//sessionStorage.getItem('roomId')
var params = {};
params["assessRoomId"] = roomId;
let name1 = "投标人";
let proDict = getProMethod();
@ -33,131 +33,135 @@ const ViewJuryScoringAnalysisFormModal: React.FC<ViewJuryScoringAnalysisFormModa
useEffect(() => {
getWarningList();
if(roleId==="ebtp-expert"){
params["createBy"]= getSessionUserData().userId;
if (roleId === "ebtp-expert") {
params["createBy"] = getSessionUserData().userId;
setJuryTableShow(false);
}else{
setJuryTableShow(true);
} else {
setJuryTableShow(true);
}
},[])
}, [])
function callback(list: any) {
//getSessionUserData.roleIds;
}
function categoryValue(key:any){
function categoryValue(key: any) {
let name = "";
//0报价1商务2技术5服务
if(key==="0"){
if (key === "0") {
name = "报价";
}else if(key==="1"){
} else if (key === "1") {
name = "商务";
}else if(key==="2"){
} else if (key === "2") {
name = "技术";
}else if(key==="5"){
} else if (key === "5") {
name = "服务";
}
return name;
}
const juryColumns: ProColumns<any>[] = [
{ title: '序号',render: (text: any, record: any, index: any) => `${index + 1}`},
{ title: '专家名称', dataIndex:"memberName"},
{ title: '确认时间',dataIndex:"updateDate"}
{ title: '序号', render: (text: any, record: any, index: any) => `${index + 1}` },
{ title: '专家名称', dataIndex: "memberName" },
{ title: '确认时间', dataIndex: "updateDate" }
];
function setDatZjList(dataZjList:any,
length:any,
confirmList:any,
reviewTurnId: any,
turnSort: any,
buttonStatus: undefined,
num:any){
function setDatZjList(dataZjList: any,
length: any,
confirmList: any,
reviewTurnId: any,
turnSort: any,
buttonStatus: undefined,
num: any) {
const juryTitle: { title: any; dataIndex: string; key: string; children: never[]; }[] = [];
dataZjList.map((item: any, index: any) => {
const tbpldzt = {title:item.name,dataIndex:'title',key:'title',children:[]};
item.categoryList.map((dfpld: any, index: any) => {
let value = categoryValue(dfpld);
tbpldzt.children.push({title:value,dataIndex:dfpld+item.userId,key:dfpld+item.userId,render: (text: any, record: any, index: any) => {
let a = "";
if(text>-30&&text<30){
a = <p style={{color:'blue'}}>{text}</p>
}else if(text>-50&&text<50){
a = <p style={{color:'#ff9900'}}>{text}</p>
}else if(text<=-50||text>=50){
a = <p style={{color:'red'}}>{text}</p>
}else{
a = text;
}
return a;
}
const tbpldzt = { title: item.name, dataIndex: 'title', key: 'title', children: [] };
item.categoryList.map((dfpld: any, index: any) => {
let value = categoryValue(dfpld);
tbpldzt.children.push({
title: value, dataIndex: dfpld + item.userId, key: dfpld + item.userId, render: (text: any, record: any, index: any) => {
let a = "";
if (text > -10 && text < 10) {
a = <p>{text}</p>
} else if (text > -30 && text < 30) {
a = <p style={{ color: 'blue' }}>{text}</p>
} else if (text > -50 && text < 50) {
a = <p style={{ color: '#ff9900' }}>{text}</p>
} else if (text <= -50 || text >= 50) {
a = <p style={{ color: 'red' }}>{text}</p>
} else {
a = text;
}
return a;
}
});
})
})
juryTitle.push(tbpldzt);
})
const columns: ProColumns<any>[] = [
{ title: name1, dataIndex: 'name', key:'name',className: 'column-money'},
{ title: '打分偏离度(%', children:juryTitle,className: 'column-money'
{ title: name1, dataIndex: 'name', key: 'name', className: 'column-money' },
{
title: '打分偏离度(%', children: juryTitle, className: 'column-money'
},
{ title: '操作',render: (text: any, record: any, index: any) => {
const obj = {
children: '',
props: {},
};
if(index===0){
let a = "";
if(!buttonStatus){
a = <Button type="primary" onClick={async () => {warningToRR(roomId,reviewTurnId,turnSort)}}></Button>
}else if(buttonStatus){
if(roleId==="ebtp-agency-project-manager"||roleId==="ebtp-purchase"){
a = <Button type="primary" onClick={ () => {setJuryYesVisSet(true);selectJuryYes(num)}}></Button>
}else if(roleId==="ebtp-expert"){
if(confirmList[0].confirmStatus===0){
a = <Button type="primary" onClick={ () => {deviatedRRYes(confirmList[0].id,1);}}></Button>
}else{
a = "已确认";
{
title: '操作', render: (text: any, record: any, index: any) => {
const obj = {
children: '',
props: {},
};
if (index === 0) {
let a = "";
if (!buttonStatus) {
a = <Button type="primary" onClick={async () => { warningToRR(roomId, reviewTurnId, turnSort) }}></Button>
} else if (buttonStatus) {
if (roleId === "ebtp-agency-project-manager" || roleId === "ebtp-purchase") {
a = <Button type="primary" onClick={() => { setJuryYesVisSet(true); selectJuryYes(num) }}></Button>
} else if (roleId === "ebtp-expert") {
if (confirmList[0].confirmStatus === 0) {
a = <Button type="primary" onClick={() => { deviatedRRYes(confirmList[0].id, 1); }}></Button>
} else {
a = "已确认";
}
}
}
obj.children = a;
obj.props.rowSpan = length;
}
obj.children=a;
obj.props.rowSpan = length;
}
return obj
}
},
}
},
];
return columns;
//setJuryScoringAnalysisColumns(columns);
}
const getWarningList = async() => {
const getWarningList = async () => {
await getDeviatedAnalysisList(params).then((res) => {
if (res.success ==true) {
if(res.data!==null&&res.data.length>0){
if (res.success == true) {
if (res.data !== null && res.data.length > 0) {
var list = res.data;
for(var i = 0 ; i < list.length ; i++){
for (var i = 0; i < list.length; i++) {
//获取表头
var zList = list[i].supplierlist;
var columnsZ = setDatZjList(list[i].title,
zList.length,
list[i].confirmList,
list[i].reviewTurnId,
list[i].turnSort,list[i].buttonStatus,i);
list[i]["columns"]=columnsZ;
list[i]["zjShow"] = true;
if(roleId==="ebtp-expert"&&!list[i].buttonStatus){
list[i]["zjShow"] = false;
}else if(roleId==="ebtp-expert"&&list[i].buttonStatus){
setJuryTableShow(true);
}
list[i].turnSort, list[i].buttonStatus, i);
list[i]["columns"] = columnsZ;
list[i]["zjShow"] = true;
if (roleId === "ebtp-expert" && !list[i].buttonStatus) {
list[i]["zjShow"] = false;
} else if (roleId === "ebtp-expert" && list[i].buttonStatus) {
setJuryTableShow(true);
}
}
setJuryScoringAnalysisList(list);
}
@ -165,26 +169,26 @@ const ViewJuryScoringAnalysisFormModal: React.FC<ViewJuryScoringAnalysisFormModa
})
}
const warningToRR = async(assessRoomId: any,reviewTurnId:any,reviewTurnSort:any) => {
await deviatedAnalysisListToRR(assessRoomId,reviewTurnId,reviewTurnSort).then((res) => {
if (res.success ==true) {
const warningToRR = async (assessRoomId: any, reviewTurnId: any, reviewTurnSort: any) => {
await deviatedAnalysisListToRR(assessRoomId, reviewTurnId, reviewTurnSort).then((res) => {
if (res.success == true) {
getWarningList();
}
})
}
const deviatedRRYes = async(id: any,confirmStatus:any) => {
await deviatedAnalysisRRYes(id,confirmStatus).then((res) => {
if (res.success ==true) {
const deviatedRRYes = async (id: any, confirmStatus: any) => {
await deviatedAnalysisRRYes(id, confirmStatus).then((res) => {
if (res.success == true) {
getWarningList();
}
})
}
const selectJuryYes = async(num: any) => {
const selectJuryYes = async (num: any) => {
await getDeviatedAnalysisList(params).then((res) => {
if (res.success ==true) {
if(res.data!==null&&res.data.length>0){
if (res.success == true) {
if (res.data !== null && res.data.length > 0) {
var juryYesList = res.data[num].confirmList;
setJuryYesList(juryYesList);
}
@ -195,78 +199,78 @@ const ViewJuryScoringAnalysisFormModal: React.FC<ViewJuryScoringAnalysisFormModa
const selectjuryYesButton = () => {//返回成员modal foot
return (
<>
<Button type="primary" onClick={()=>setJuryYesVisSet(false)}></Button>
<Button type="primary" onClick={() => setJuryYesVisSet(false)}></Button>
</>
)
}
//查看专家
const selectjuryYes = () => {
return (
<>
<Modal
title="查看专家确认信息"
width={'400px'}
destroyOnClose
centered
bodyStyle={{ overflowY: 'auto' }}
visible={juryYesVis}
onCancel={()=>setJuryYesVisSet(false)}
footer={selectjuryYesButton()}
//查看专家
const selectjuryYes = () => {
return (
<>
<Modal
title="查看专家确认信息"
width={'400px'}
destroyOnClose
centered
bodyStyle={{ overflowY: 'auto' }}
visible={juryYesVis}
onCancel={() => setJuryYesVisSet(false)}
footer={selectjuryYesButton()}
>
<Table
columns={juryColumns}
dataSource={juryYesList}
pagination={false}//分页
bordered={true}
>
<Table
columns={juryColumns}
dataSource={juryYesList}
pagination={false}//分页
bordered={true}
>
</Table>
</Modal>
</>
)
}
</Table>
</Modal>
</>
)
}
return (
<>
<>
{juryTableShow ?
<Collapse onChange={callback}>
<Collapse.Panel header="专家打分偏离度分析" key="6">
<Collapse onChange={callback}>
<Collapse.Panel header="专家打分偏离度分析" key="6">
{juryScoringAnalysisList?.length == 0
? <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
: (proDict == "procurement_mode_5" || proDict == "procurement_mode_6") ? juryScoringAnalysisList?.map((item: any, index: any)=>{
if(item.zjShow){
? <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
: (proDict == "procurement_mode_5" || proDict == "procurement_mode_6") ? juryScoringAnalysisList?.map((item: any, index: any) => {
if (item.zjShow) {
return (
<Collapse onChange={callback(item)} >
<Collapse.Panel header={item.turnName} key={"6"+index}>
<p>{item.turnName}{name1}{name1}-</p>
<Table
columns={item.columns}
dataSource={item.supplierlist}
pagination={false}//分页
bordered={true}
></Table>
</Collapse.Panel>
</Collapse>
<Collapse onChange={callback(item)} >
<Collapse.Panel header={item.turnName} key={"6" + index}>
<p>{item.turnName}{name1}{name1}-</p>
<Table
columns={item.columns}
dataSource={item.supplierlist}
pagination={false}//分页
bordered={true}
></Table>
</Collapse.Panel>
</Collapse>
);
}
}
}) : (
<>
<p>{juryScoringAnalysisList[0].turnName}{name1}{name1}-</p>
<Table
columns={juryScoringAnalysisList[0].columns}
dataSource={juryScoringAnalysisList[0].supplierlist}
pagination={false}//分页
bordered={true}
></Table>
<p>{juryScoringAnalysisList[0].turnName}{name1}{name1}-</p>
<Table
columns={juryScoringAnalysisList[0].columns}
dataSource={juryScoringAnalysisList[0].supplierlist}
pagination={false}//分页
bordered={true}
></Table>
</>
)
}
{selectjuryYes()}
</Collapse.Panel>
</Collapse>
:null}
</>
);
</Collapse.Panel>
</Collapse>
: null}
</>
);
};
export default ViewJuryScoringAnalysisFormModal;