From 6f4bbd0f8af6002e55e873749596f2ad7e03afaa Mon Sep 17 00:00:00 2001 From: jl-zhoujl2 Date: Wed, 22 Mar 2023 14:01:58 +0800 Subject: [PATCH] =?UTF-8?q?3.22=20=E4=BE=9B=E5=BA=94=E5=95=86=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=85=B3=E7=B3=BB3.15=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EquityRelation/index.tsx | 145 +++++++++-- .../BidControlManager/components/ZhiQiCha.tsx | 228 +++++++++++------- .../BidControl/BidControlManager/index.tsx | 2 +- .../GroupLeader/components/GroupLeader.tsx | 35 +++ 4 files changed, 299 insertions(+), 111 deletions(-) diff --git a/src/components/EquityRelation/index.tsx b/src/components/EquityRelation/index.tsx index d902ba4..4708e35 100644 --- a/src/components/EquityRelation/index.tsx +++ b/src/components/EquityRelation/index.tsx @@ -79,13 +79,93 @@ const EquityRelation: React.FC<{ result: any, suppCodeList: any[] }> = (props) = } //数据处理 function dataHandle(nodes: any[] | undefined, links: any[] | undefined) { + // //处理右侧数据 + // const valueList = nodes ? nodes : [] + // valueList.map((item) => { + // Object.assign(item, { + // name: item.name ? item.name : item.properties?.samevalue ? item.properties?.samevalue : '暂无信息', + // // category: item.isProvider == 1 ? 1 : 2, + // category: suppCodeList.findIndex(ite => ite.companyName == item.name) !== -1 ? 3 : (item.type == 1 ? 1 : 2),//从珊珊拿全部供应商 + // id: item.id, + // }) + // return item + // }) + // setSuppListTrans([...valueList]) + // let mapList = links ? links : [] + // let copeLink1 = JSON.parse(JSON.stringify(mapList)) + // if (copeLink1.length > 0) { + // for (let i = 0; i < copeLink1.length; i++) { + // if (copeLink1[i].type == 2) { + // copeLink1[i].type = copeLink1[i].properties.position_desc + // } else { + // if (copeLink1[i].type == 1) { + // copeLink1[i].type = '投资' + multiply(copeLink1[i].properties.conprop, 100) + '%' + // } else { + // copeLink1[i].type = doType(copeLink1[i].type) + // } + // } + // //手动去重 + // for (let j = i + 1; j < copeLink1.length; j++) { + // if (copeLink1[i].from == copeLink1[j].from && copeLink1[i].to == copeLink1[j].to && copeLink1[j].type) { + // //type=2 需提前处理 + // if (copeLink1[j].type == 1) { + // copeLink1[j].type = '投资' + multiply(copeLink1[j].properties.conprop, 100) + '%' + // } else if (copeLink1[j].type == 2) { + // copeLink1[i].type = copeLink1[i].type + ',' + copeLink1[j].properties.position_desc + // copeLink1[j].type = '' + // } else { + // if (copeLink1[j].type != 2) { + // copeLink1[j].type = doType(copeLink1[j].type) + // } + // } + // //拼接相同类型的type + // if (copeLink1[i].type.substring(copeLink1[i].type.length - 1, copeLink1[i].type.length) == ',') { + // copeLink1[i].type = copeLink1[i].type + copeLink1[j].type + // } else { + // copeLink1[i].type = copeLink1[i].type + ',' + copeLink1[j].type + // } + // copeLink1[j].type = '' + // } else { + // //type=1 需提前处理 + // if (copeLink1[j].type == 1) { + // copeLink1[j].type = '投资' + multiply(copeLink1[j].properties.conprop, 100) + '%,' + // } else if (copeLink1[j].type == 2) { + // copeLink1[j].type = copeLink1[j].properties.position_desc + // } else { + // if (copeLink1[j].type != 2) { + // copeLink1[j].type = doType(copeLink1[j].type) + // } + // } + // continue; + // } + // } + // } + // } + // copeLink1.map((item: any) => { + // Object.assign(item, { + // source: item.from, + // target: item.to, + // label: { + // show: true, + // fontSize: 12, + // verticalAlign: 'bottom', + // formatter: () => { + // return item.type + // }, + // }, + // id: item.id, + // flag: false + // }) + // return item + // }) + // setLinkData(copeLink1) //处理右侧数据 const valueList = nodes ? nodes : [] valueList.map((item) => { Object.assign(item, { - name: item.name ? item.name : item.properties?.samevalue ? item.properties?.samevalue : '暂无信息', + name: item.name ? item.name : item.properties.samevalue ? item.properties.samevalue : '暂无信息', // category: item.isProvider == 1 ? 1 : 2, - category: suppCodeList.findIndex(ite => ite.companyName == item.name) !== -1 ? 3 : (item.type == 1 ? 1 : 2),//从珊珊拿全部供应商 + category: suppCodeList.indexOf(item.name) !== -1 ? 3 : (item.type == 1 ? 1 : 2), id: item.id, }) return item @@ -99,24 +179,35 @@ const EquityRelation: React.FC<{ result: any, suppCodeList: any[] }> = (props) = copeLink1[i].type = copeLink1[i].properties.position_desc } else { if (copeLink1[i].type == 1) { - copeLink1[i].type = '投资' + multiply(copeLink1[i].properties.conprop, 100) + '%' + if (copeLink1[i].properties.conprop) { + copeLink1[i].type = '投资' + multiply(copeLink1[i].properties.conprop, 100) + '%' + } else if (copeLink1[i].properties.holderrto) { + copeLink1[i].type = '投资' + copeLink1[i].properties.holderrto + '%' + } } else { copeLink1[i].type = doType(copeLink1[i].type) } } - //手动去重 + + //手动拼接 + /* eslint-disable */ for (let j = i + 1; j < copeLink1.length; j++) { if (copeLink1[i].from == copeLink1[j].from && copeLink1[i].to == copeLink1[j].to && copeLink1[j].type) { //type=2 需提前处理 if (copeLink1[j].type == 1) { - copeLink1[j].type = '投资' + multiply(copeLink1[j].properties.conprop, 100) + '%' - } else if (copeLink1[j].type == 2) { - copeLink1[i].type = copeLink1[i].type + ',' + copeLink1[j].properties.position_desc - copeLink1[j].type = '' - } else { - if (copeLink1[j].type != 2) { - copeLink1[j].type = doType(copeLink1[j].type) + if (copeLink1[j].properties.conprop) { + copeLink1[j].type = '投资' + multiply(copeLink1[j].properties.conprop, 100) + '%' + } else if (copeLink1[j].properties.holderrto) { + copeLink1[j].type = '投资' + copeLink1[j].properties.holderrto + '%' } + } else if (copeLink1[j].type == 2) { + copeLink1[j].type = copeLink1[j].properties.position_desc + // copeLink1[i].type=copeLink1[i].type+','+copeLink1[j].properties.position_desc + // copeLink1[j].type='' + } else { + // if(copeLink1[j].type !=2){ + copeLink1[j].type = doType(copeLink1[j].type) + // } } //拼接相同类型的type if (copeLink1[i].type.substring(copeLink1[i].type.length - 1, copeLink1[i].type.length) == ',') { @@ -125,21 +216,29 @@ const EquityRelation: React.FC<{ result: any, suppCodeList: any[] }> = (props) = copeLink1[i].type = copeLink1[i].type + ',' + copeLink1[j].type } copeLink1[j].type = '' - } else { - //type=1 需提前处理 - if (copeLink1[j].type == 1) { - copeLink1[j].type = '投资' + multiply(copeLink1[j].properties.conprop, 100) + '%,' - } else if (copeLink1[j].type == 2) { - copeLink1[j].type = copeLink1[j].properties.position_desc - } else { - if (copeLink1[j].type != 2) { - copeLink1[j].type = doType(copeLink1[j].type) - } - } - continue; } + + // else{ + // // //type=1 需提前处理 + // // if(copeLink1[j].type==1){ + // // if(copeLink1[j].properties.conprop){ + // // copeLink1[j].type='投资'+ multiply(copeLink1[j].properties.conprop,100) +'%' + // // }else if(copeLink1[j].properties.holderrto){ + // // copeLink1[j].type='投资'+ copeLink1[j].properties.holderrto +'%' + // // } + // // }else if(copeLink1[j].type==2){ + // // copeLink1[j].type=copeLink1[j].properties.position_desc + // // }else{ + // // if(copeLink1[j].type !=2){ + // // copeLink1[j].type=doType(copeLink1[j].type) + // // } + // // } + + // // continue; + // } } } + } copeLink1.map((item: any) => { Object.assign(item, { diff --git a/src/pages/Evaluation/BidControl/BidControlManager/components/ZhiQiCha.tsx b/src/pages/Evaluation/BidControl/BidControlManager/components/ZhiQiCha.tsx index c955ef2..379b904 100644 --- a/src/pages/Evaluation/BidControl/BidControlManager/components/ZhiQiCha.tsx +++ b/src/pages/Evaluation/BidControl/BidControlManager/components/ZhiQiCha.tsx @@ -4,7 +4,7 @@ import { getURLInformation } from "@/utils/CommonUtils"; import { getRoomId, getSessionProjectData, getSessionRoleData } from "@/utils/session"; import { ExclamationCircleOutlined } from "@ant-design/icons"; import ProTable, { EditableProTable, ProColumns } from "@ant-design/pro-table"; -import { Button, Col, Collapse, Form, Input, message, Modal, Radio, RadioChangeEvent, Row, Spin, Typography } from "antd"; +import { Button, Collapse, message, Modal, Spin, Typography } from "antd"; import React, { Fragment, useEffect, useState } from "react"; import { getSuspectedViolation, leaderConfirm } from "../service"; @@ -15,16 +15,16 @@ import { getSuspectedViolation, leaderConfirm } from "../service"; */ const ZhiQiCha: React.FC<{}> = (props) => { const title_style = { color: "#b30000", fontWeight: 700 }; - const options = [ - { label: '确认无风险', value: 0 }, - { label: '确认有风险', value: 1 }, - ]; + // const options = [ + // { label: '确认无风险', value: 0 }, + // { label: '确认有风险', value: 1 }, + // ]; //是否展开智企查疑似关联关系 const defaultZQCKey = getURLInformation('n') == '1' ? ['zhiqicha'] : [] const { Paragraph, Text } = Typography; - const { TextArea } = Input; + // const { TextArea } = Input; const { confirm } = Modal; - const [form] = Form.useForm(); + // const [form] = Form.useForm(); //项目id 标段id 评审室id const projectId = getSessionProjectData()?.id; const sessionId = sessionStorage.getItem("sectionId"); @@ -40,21 +40,46 @@ const ZhiQiCha: React.FC<{}> = (props) => { //是否有风险 const [isRisk, setIsRisk] = useState(false);//true-有风险 false-无风险 //radio选择 - const [radioValue, setRadioValue] = useState(""); + // const [radioValue, setRadioValue] = useState(""); //loading const [loading, setLoading] = useState(true); const columns: ProColumns[] = [ { - title: 供应商, - dataIndex: 'companyName', - key: 'companyName', + title: 供应商A, editable: false, + render: (_: any, record: any) => ( + {record.supplierA.name} + ), }, { - title: 是否有风险, - dataIndex: 'isRisk', - key: 'isRisk', + title: 供应商B, + editable: false, + render: (_: any, record: any) => ( + {record.supplierB.name} + ), + }, + { + title: 关系类型, + editable: false, + render: (_: any, record: any) => ( + {record.typeDesc}关系 + ), + }, + { + title: 关联信息是否准确, + dataIndex: 'relationFlag', + key: 'relationFlag', + valueType: 'radio', + valueEnum: { + "0": { text: '否' }, + "1": { text: '是' }, + }, + }, + { + title: 是否被认定为风险, + dataIndex: 'riskFlag', + key: 'riskFlag', valueType: 'radio', valueEnum: { "0": { text: '否' }, @@ -65,7 +90,7 @@ const ZhiQiCha: React.FC<{}> = (props) => { title: 说明, dataIndex: 'memo', key: 'memo', - tooltip: "此项为选填", + tooltip: "一行中存在至少一项选择【否】,当前行的说明必须填写", fieldProps: { maxLength: 100, } @@ -73,16 +98,38 @@ const ZhiQiCha: React.FC<{}> = (props) => { ]; const readOnlyColumns: ProColumns[] = [ { - title: 供应商, - dataIndex: 'companyName', - key: 'companyName', + title: 供应商A, + render: (_: any, record: any) => ( + {record?.supplierA.name} + ), }, { - title: 是否有风险, - dataIndex: 'isRisk', - key: 'isRisk', + title: 供应商B, render: (_: any, record: any) => ( - {record.isRisk == 1 ? "是" : record.isRisk == 0 ? "否" : "-"} + {record?.supplierB.name} + ), + }, + { + title: 关系类型, + editable: false, + render: (_: any, record: any) => ( + {record.typeDesc}关系 + ), + }, + { + title: 关联信息是否准确, + dataIndex: 'relationFlag', + key: 'relationFlag', + render: (_: any, record: any) => ( + {record.relationFlag == 1 ? "是" : record.relationFlag == 0 ? "否" : "-"} + ), + }, + { + title: 是否被认定为风险, + dataIndex: 'riskFlag', + key: 'riskFlag', + render: (_: any, record: any) => ( + {record.riskFlag == 1 ? "是" : record.riskFlag == 0 ? "否" : "-"} ), }, { @@ -106,9 +153,9 @@ const ZhiQiCha: React.FC<{}> = (props) => { setIsLeader(resp?.data == "ReviewLeader"); } setWarningsData(res?.data); - setSupplierTableData(res?.data?.riskSupplier != null ? res?.data?.riskSupplier.supplist?.map((item: any) => { item.isRisk = String(item.isRisk); return item }) : []); + setSupplierTableData(res?.data?.riskSupplier != null ? res?.data?.riskSupplier?.map((item: any) => { item.riskFlag = String(item.riskFlag); item.relationFlag = String(item.relationFlag); return item }) : []); setIsRisk(res?.data?.riskSupplier != null); - form.setFieldsValue(res?.data); + // form.setFieldsValue(res?.data); } }).finally(() => { setLoading(false); @@ -116,8 +163,9 @@ const ZhiQiCha: React.FC<{}> = (props) => { } //专家组长保存 const handleSave = () => { - let values = form.getFieldsValue(); - values["riskSupplier"] = { supplist: supplierTableData }; + let values = {}; + values["id"] = warningsData?.id; + values["riskSupplier"] = [...supplierTableData]; values["headmanConfirmStatus"] = "0";//保存参数 setLoading(true); leaderConfirm(values).then(res => {//专家组长保存 @@ -131,54 +179,59 @@ const ZhiQiCha: React.FC<{}> = (props) => { } //专家组长提交 const handleSubmit = () => { - form.validateFields().then(values => { - let emptyItem = -1; - let yesLength = 0; - for (let i = 0, length = supplierTableData.length; i < length; i++) { - const item = supplierTableData[i]; - if (item.isRisk == null) { - emptyItem = i; - break; - } - if (item.isRisk == "1") { - yesLength += 1; - } + let values = {}; + let relationEmptyItem = -1; + let riskEmptyItem = -1; + let memoEmptyItem = -1; + for (let i = 0, length = supplierTableData.length; i < length; i++) { + const item = supplierTableData[i]; + if (item.relationFlag == null) { + relationEmptyItem = i; + break; + } else if (item.riskFlag == null) { + riskEmptyItem = i; + break; + } else if ((item.relationFlag == "0" || item.riskFlag == "0") && (item.memo == null || item.memo == "")) { + memoEmptyItem = i; + break; } - if (emptyItem != -1) { - message.warning(`供应商【${supplierTableData[emptyItem].companyName}】的【是否有风险】项未填写`); - return; - } - if ((values.headmanConfirm == 1) && (yesLength == 0)) { - message.warning("【确认有风险】情况下,需至少一家供应商的【是否有风险】项选择【是】"); - return; - } - values["riskSupplier"] = { supplist: supplierTableData }; - values["headmanConfirmStatus"] = "1";//确认参数 - confirm({ - title: '提交后不可修改,确认是否提交?', - icon: , - content: <>, - centered: true, - okText: "是", - cancelText: "否", - onOk() { - setLoading(true); - return leaderConfirm(values).then(res => {//专家组长提交 - if (res?.success) { - message.success("提交成功!"); - getZQCData(); - } - }).finally(() => { - setLoading(false); - }) - }, - onCancel() { }, - }); + } + if (relationEmptyItem != -1) { + message.warning(`供应商A【${supplierTableData[relationEmptyItem].supplierA.name}】与供应商B【${supplierTableData[relationEmptyItem].supplierB.name}】关联情况的【关联信息是否准确】项未填写`); + return; + } + if (riskEmptyItem != -1) { + message.warning(`供应商A【${supplierTableData[riskEmptyItem].supplierA.name}】与供应商B【${supplierTableData[riskEmptyItem].supplierB.name}】关联情况的【是否被认定为风险】项未填写`); + return; + } + if (memoEmptyItem != -1) { + message.warning(`供应商A【${supplierTableData[memoEmptyItem].supplierA.name}】与供应商B【${supplierTableData[memoEmptyItem].supplierB.name}】关联情况的【说明】项未填写`); + return; + } + values["id"] = warningsData?.id; + values["riskSupplier"] = [...supplierTableData]; + values["headmanConfirmStatus"] = "1";//确认参数 + confirm({ + title: '提交后不可修改,确认是否提交?', + icon: , + content: <>, + centered: true, + okText: "是", + cancelText: "否", + onOk() { + setLoading(true); + return leaderConfirm(values).then(res => {//专家组长提交 + if (res?.success) { + message.success("提交成功!"); + getZQCData(); + } + }).finally(() => { + setLoading(false); + }) + }, + onCancel() { }, }); } - const onRadioChange = (e: RadioChangeEvent) => { - setRadioValue(e.target.value); - } useEffect(() => { getZQCData(); }, []) @@ -187,10 +240,10 @@ const ZhiQiCha: React.FC<{}> = (props) => { -

供应商关联关系疑似违规行为

+

供应商疑似关联关系图

- +
@@ -202,10 +255,10 @@ const ZhiQiCha: React.FC<{}> = (props) => { 控股超过51%或股权关系分散的占股最大的股东都属于控股,请项目经理与评委给予注意! - {isRisk && ( + {/* {isRisk && ( 经智企查分析,{warningsData?.riskSupplier?.riskSuppInfoList?.map((item: any, index: any) => {index != 0 && }{item})}存在疑似关联关系,具体见左图。 - )} - {isRisk && isLeader && ( + )} */} + {/* {isRisk && isLeader && (