From cae733dc4ae66a20c0296d144da28cab6c035608 Mon Sep 17 00:00:00 2001 From: jlzhangyx5 Date: Wed, 28 May 2025 17:47:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E8=AF=A6=E5=AE=A1=E7=BB=86?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Config/components/detailedMain.tsx | 113 +++++++++++++++++- 1 file changed, 107 insertions(+), 6 deletions(-) diff --git a/src/pages/Bid/ReviewConfig/Config/components/detailedMain.tsx b/src/pages/Bid/ReviewConfig/Config/components/detailedMain.tsx index 76fac40..26333ab 100644 --- a/src/pages/Bid/ReviewConfig/Config/components/detailedMain.tsx +++ b/src/pages/Bid/ReviewConfig/Config/components/detailedMain.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useMemo, useRef, useState, } from 'react'; -import { Button, Radio, Input, Modal, Form, Row, Col, Select, Collapse, Checkbox, message, Spin, Popconfirm } from 'antd'; +import { Button, Radio, Input, Modal, Form, Row, Col, Select, Collapse, Checkbox, message, Spin, Popconfirm, InputNumber } from 'antd'; import ProTable, { EditableProTable, ProColumns } from '@ant-design/pro-table'; import { PlusOutlined, EditOutlined, DeleteOutlined, CloseOutlined, ExclamationCircleOutlined, } from '@ant-design/icons'; import styles from './detailedStyles.less'; @@ -683,6 +683,73 @@ const DetailedMain: React.FC = (props) => { + prevValues.type !== currentValues.type}> + {({ getFieldValue }) => { + const selectedType = getFieldValue('type'); + return ( + selectedType !== '报价' && ( + + + + + + ) + ); + }} + + prevValues.calculationMethod !== currentValues.calculationMethod}> + {({ getFieldValue }) => { + const calculationMethod = getFieldValue('calculationMethod'); + return ( + calculationMethod === '2' && ( + <> + + + + + + + + + + + + + + + + + ) + ); + }} + { radioWeight == 1 && @@ -761,8 +828,27 @@ const DetailedMain: React.FC = (props) => { ) }; + const renderCategoryTitle = (subData: any) => { + const baseText = radioWeight === 1 + ? `所占权重:${subData.weights}% ; ` + : ''; + + let calcText = ''; + if (subData.calculationMethod === '1') { + calcText = '计算方式:打分专家平均分; '; + } else if (subData.calculationMethod === '2') { + calcText = `计算方式:去掉最高最低分的平均分,去掉最高数量:${subData.removeMaxQuantity}人,去掉最低数量:${subData.removeMinQuantity}人; `; + } + + const scoreText = radioWeight === 1 + ? `本表格内所有评分项计算后所得最高分:${(subData.weights * subCountScore(subData)) / 100} 分)` + : `本表格内所有评分项计算后所得最高分:${subCountScore(subData)} 分)`; + + return `${subData.name}(${baseText}${calcText}${scoreText}`; + }; //返回子类表格 function returnTable(subData: any, mapindex: number, isBaojia?: boolean) { + console.log("subData", subData); const confirm = async () => { const categoryName = subData.categoryName; setSpin(true); @@ -773,7 +859,7 @@ const DetailedMain: React.FC = (props) => { await queryDetData(); } } else { - categoryName == '商务' && setData1(data1.filter((item: any) => item.key != subData.key)); + categoryName == '商务' && setData1(data1.filter((item: any) => { console.log("商务item", item); item.key != subData.key })); categoryName == '技术' && setData2(data2.filter((item: any) => item.key != subData.key)); categoryName == '服务' && setData3(data3.filter((item: any) => item.key != subData.key)); categoryName == '报价' && setData4(data4.filter((item: any) => item.key != subData.key)); @@ -806,11 +892,12 @@ const DetailedMain: React.FC = (props) => {

- { + {renderCategoryTitle(subData)} + {/* { radioWeight == 1 ? subData.name + `( 所占权重:${subData.weights}% , 本表格内所有评分项计算后所得最高分:${(subData.weights * subCountScore(subData)) / 100} 分)` : subData.name + `( 本表格内所有评分项计算后所得最高分:${subCountScore(subData)} 分)` - } + } */}

{ !dis && @@ -825,7 +912,14 @@ const DetailedMain: React.FC = (props) => { isUpdateCateSet(true); updataSet(subData); onRowCateNameSet(subData.categoryName); - formModal.setFieldsValue({ name: subData.name, type: subData.categoryName, weights: subData.weights }); + formModal.setFieldsValue({ + name: subData.name, + type: subData.categoryName, + weights: subData.weights, + calculationMethod: subData.calculationMethod, + removeMaxQuantity: subData.removeMaxQuantity, + removeMinQuantity: subData.removeMinQuantity, + }); }} > {`修改`} @@ -1130,13 +1224,17 @@ const DetailedMain: React.FC = (props) => { } //新增、修改类别 const typeControl = async (values: any) => { - const { name, type, weights } = values; + console.log("values", values) + const { name, type, weights, calculationMethod, removeMaxQuantity, removeMinQuantity } = values; let tableId = Date.now(); let subCate = { categoryName: type,//大类别名称 weights: weights == undefined ? 100 : weights, name: name,//字类名 tableId: tableId, + calculationMethod: calculationMethod, + removeMaxQuantity: removeMaxQuantity, + removeMinQuantity: removeMinQuantity, key: 0, detailList: [{//初始值---新增用 key: 0, @@ -1191,6 +1289,9 @@ const DetailedMain: React.FC = (props) => { upData.name = name; upData.categoryName = type; upData.weights = weights == undefined ? 100 : weights; + upData.calculationMethod = calculationMethod; + upData.removeMaxQuantity = removeMaxQuantity; + upData.removeMinQuantity = removeMinQuantity; //删原数据 if (oldCategoryName == '商务') { if (oldCategoryName != type) {