Merge branch '20220926-偏离度提醒' into 'release_20221028'

10.28 专家打分偏离度分析,偏离度颜色

See merge request eshop/fe_service_ebtp_frontend!39
This commit is contained in:
jl-zhoujl2
2022-10-28 06:18:22 +00:00

View File

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