7.25 单一简化 确认评审结果修改

This commit is contained in:
jl-zhoujl2
2022-07-25 08:49:41 +08:00
parent b3c9913791
commit 178eba6ff8

View File

@ -11,12 +11,14 @@ import { isEmpty } from '@/utils/CommonUtils';
const BidAssessmentResults: React.FC<{}> = (props) => {
const [Refresh, setRefresh] = useState<number>(0);
const { Panel } = Collapse;
const [ListData, setListData] = useState<any>();
const [ListData, setListData] = useState<any[]>([]);
const [assessRoomId, setAssessRoomId] = useState<any>();
const [currentTable, setCurrentTable] = useState<boolean>(false);
const [spintype, setSpintype] = useState<boolean>(false);
//查询条件-包件名称
const [name, setName] = useState<string>('');
//折叠面板
const [collapseActiveKeys, setCollapseActiveKeys] = useState<any[]>(['0']);
const FormItem = Form.Item;
const { Option } = Select;
@ -101,9 +103,14 @@ const BidAssessmentResults: React.FC<{}> = (props) => {
setCurrentTable(true);
}
//折叠面板change
const onCollapseChange = (key: any) => {
setCollapseActiveKeys(key);
};
//确认评审结果ListRender封装
const ResultListRender = (props: { item: any, index: any, setSpintype: (value: boolean) => void, getResultList: (record: any) => void, ListData: any, pushResult: (record: any) => void }) => {
const { item, index, setSpintype, getResultList, ListData, pushResult } = props;
const ResultListRender = (props: { item: any, setSpintype: (value: boolean) => void, getResultList: (record: any) => void, ListData: any, pushResult: (record: any) => void }) => {
const { item, setSpintype, getResultList, ListData, pushResult } = props;
//单一来源简化
const [form] = Form.useForm();
//综合得分展开关闭
@ -166,283 +173,6 @@ const BidAssessmentResults: React.FC<{}> = (props) => {
</span>)
}
return (
<Collapse defaultActiveKey={index == 0 ? item.sectionId : ""} className="calibration-panel">
<Panel
header={item.sectionName} key={item.sectionId}>
<List
grid={{
gutter: 16,
xs: 1,
sm: 1,
md: 1,
lg: 1,
xl: 1,
xxl: 1,
}}
itemLayout="vertical"
rowKey="assesRoomId"
dataSource={item.assesList}
renderItem={(item1: any, index: any) => {
//标段上的报价类型确认 1-% 0-元
let sectionQuot = item?.quotationMethodDict == 'quotation_method_2' || item?.quotationMethodDict == 'quotation_method_3' ? '1' : '0'
const columns: any = [
{
title: '排名',
dataIndex: 'sort',
valueType: 'text',
width: 50,
},
{
title: '供应商名称',
dataIndex: 'companyName',
valueType: 'text',
width: 120,
},
{
hideInTable: type1,
title: proDict == 'procurement_mode_7' ? '报价总金额净价(元)' : sectionQuot == '1' ? '报价(%' : '报价(元)',
dataIndex: 'price',
width: 100,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('price', '报价', record.price, true, true)
} else {
return record.price
}
}
},
{
hideInTable: type2,
title: proDict == 'procurement_mode_7' ? '报价总金额含税价(元)' : sectionQuot == '1' ? '评审价(%' : '评审价(元)',
dataIndex: 'priceReview',
width: 100,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('priceReview', '评审价', record.priceReview, true, true)
} else {
return record.priceReview
}
}
},
{
title: '商务分',
dataIndex: 'businessScore',
width: 60,
hideInTable: expandTotalScore,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('businessScore', '商务分', record.businessScore, false, true)
} else {
return record.businessScore
}
}
},
{
title: '技术分',
width: 60,
dataIndex: 'technicalScore',
hideInTable: expandTotalScore,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('technicalScore', '技术分', record.technicalScore, false, true)
} else {
return record.technicalScore
}
}
},
{
title: '服务分',
width: 60,
dataIndex: 'serviceScore',
hideInTable: expandTotalScore,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('serviceScore', '服务分', record.serviceScore, false, true)
} else {
return record.serviceScore
}
}
},
{
title: '价格分',
width: 60,
dataIndex: 'priceScore',
hideInTable: expandTotalScore,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('priceScore', '价格分', record.priceScore, false, true)
} else {
return record.priceScore
}
}
},
{
title: (
<span>
<Text keyboard onClick={() => setExpandTotalScore(!expandTotalScore)} style={{ cursor: 'pointer', color: '#1890ff' }}>{expandTotalScore ? "展开" : "收起"}</Text>
</span>
),
dataIndex: 'totalScore',
width: 120,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('totalScore', '综合得分', record.totalScore, false, true)
} else {
return record.totalScore
}
}
},
{
hideInTable: defId === 'negotiation_single_simple',
title: '是否通过初步评审',
dataIndex: 'firstRvwResult',
width: 100,
render: (_: any, record: any) => rvwResultRender(_, record.firstRvwReason)
},
{
hideInTable: type5 || defId === 'negotiation_single_simple',
title: '是否通过详审',
dataIndex: 'detailRvwResult',
width: 100,
render: (_: any, record: any) => rvwResultRender(_, record.detailRvwReason)
},
{
hideInTable: type5 || defId === 'negotiation_single_simple',
title: '应答是否有效',
width: 80,
dataIndex: 'answerValid',
render: (_: any, record: any) => {
return record.answerValid === 1 ? '是' : record.answerValid === 0 ? '否' : '-'
}
},
{
title: '是否' + name1 + '候选人',
dataIndex: 'winnerCandidate',
width: 100,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnSelect('winnerCandidate', record.winnerCandidate)
} else {
return record.winnerCandidate === 1 ? '是' : '否'
}
}
},
{
hideInTable: type5 || defId === 'negotiation_single_simple',
title: '是否拟' + name1 + '人',
width: 80,
dataIndex: 'winnerBidder',
render: (_: any, record: any) => {
return record.winnerBidder === 1 ? '是' : record.winnerBidder === 0 ? '否' : '-'
}
},
{
hideInTable: type3,
title: '拟签约金额(不含增值税)(元)',
width: 150,
dataIndex: 'contractedMoney',
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return (
<>
{returnInput('contractedMoney', '拟签约金额', record.contractedMoney, false, true)}
{returnInput('id', '供应商id', record.id, false, false, true)}
{returnInput('resultId', '结果id', record.resultId, false, false, true)}
{returnInput('companyId', '公司id', record.companyId, false, false, true)}
{returnInput('companyName', '公司名称', record.companyName, false, false, true)}
</>
)
} else {
return record.contractedMoney
}
}
},
{
hideInTable: type4,
title: '增值税金额(元)',
width: 150,
dataIndex: 'taxRatePrice',
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('taxRatePrice', '增值税金额', record.taxRatePrice, false, true)
} else {
return record.taxRatePrice
}
}
},
]
return (
<ProTable
size={"small"}
key={index}
scroll={{ x: true }}
search={false}
options={false}
columns={columns}
dataSource={item1.reviewList}
toolbar={{
title: item1.againEvaluationSort == 'null' || isEmpty(item1.againEvaluationSort) ? null : `${item1.againEvaluationSort}次重审`,
}}
rowKey="id"
toolBarRender={(record: any) => [
<>
<Button
hidden={btnAuthority(['ebtp-agency-project-manager', 'ebtp-purchase']) || defId != 'negotiation_single_simple' || item1.pushStatus == "1"}
type="primary"
onClick={async () => {
setSpintype(true);
await form.validateFields().then(async () => {
await saveResult({
id: form.getFieldValue("resultId"),
suppliers: [
{
...form.getFieldsValue(),
"winnerCandidate": form.getFieldValue("winnerCandidate") == '是' ? '1' : '0',
"firstRvwResult": form.getFieldValue("firstRvwResult") == '是' ? '1' : '0',
"detailRvwResult": form.getFieldValue("detailRvwResult") == '是' ? '1' : '0',
"answerValid": form.getFieldValue("answerValid") == '是' ? '1' : '0',
"winnerBidder": form.getFieldValue("winnerBidder") == '是' ? '1' : '0',
}
]
}).then((res) => {
if (res.success) { message.success('保存成功!') }
})
}).finally(() => setSpintype(false));
}}
></Button>
{
defId === 'negotiation_single_simple' ?
<Button
hidden={
btnAuthority(['ebtp-agency-project-manager', 'ebtp-purchase']) ||
!item1.reviewList[0].price ||
!item1.reviewList[0].priceReview
}
disabled={item1.pushStatus == "1" ? true : false} key={"1"}
onClick={() => pushResult(item1)} type="primary">{name2}</Button>
:
<Button hidden={btnAuthority(['ebtp-agency-project-manager', 'ebtp-purchase'])} disabled={item1.pushStatus == "1" ? true : false} key={"1"} onClick={() => pushResult(item1)} type="primary"> {name2} </Button>
}
<Button key={"2"} onClick={() => getResultList(item1)}></Button>
</>
]}
pagination={{
defaultPageSize: 10,
showSizeChanger: false,
}}
/>
)
}}
>
</List>
</Panel>
</Collapse>
)
}
const list = useMemo(() => {
return (
<List
grid={{
@ -454,16 +184,266 @@ const BidAssessmentResults: React.FC<{}> = (props) => {
xl: 1,
xxl: 1,
}}
style={{ paddingTop: "24px;" }}
itemLayout="vertical"
rowKey="sectionId"
dataSource={ListData}
renderItem={(item: any, index: any) => (
<ResultListRender item={item} index={index} key={index} setSpintype={(value) => { setSpintype(value); }} getResultList={getResultList} ListData={ListData} pushResult={pushResult} />
)}
/>
rowKey="assesRoomId"
dataSource={item.assesList}
renderItem={(item1: any, index: any) => {
//标段上的报价类型确认 1-% 0-元
let sectionQuot = item?.quotationMethodDict == 'quotation_method_2' || item?.quotationMethodDict == 'quotation_method_3' ? '1' : '0'
const columns: any = [
{
title: '排名',
dataIndex: 'sort',
valueType: 'text',
width: 50,
},
{
title: '供应商名称',
dataIndex: 'companyName',
valueType: 'text',
width: 120,
},
{
hideInTable: type1,
title: proDict == 'procurement_mode_7' ? '报价总金额净价(元)' : sectionQuot == '1' ? '报价(%' : '报价(元)',
dataIndex: 'price',
width: 100,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('price', '报价', record.price, true, true)
} else {
return record.price
}
}
},
{
hideInTable: type2,
title: proDict == 'procurement_mode_7' ? '报价总金额含税价(元)' : sectionQuot == '1' ? '评审价(%' : '评审价(元)',
dataIndex: 'priceReview',
width: 100,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('priceReview', '评审价', record.priceReview, true, true)
} else {
return record.priceReview
}
}
},
{
title: '商务分',
dataIndex: 'businessScore',
width: 60,
hideInTable: expandTotalScore,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('businessScore', '商务分', record.businessScore, false, true)
} else {
return record.businessScore
}
}
},
{
title: '技术分',
width: 60,
dataIndex: 'technicalScore',
hideInTable: expandTotalScore,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('technicalScore', '技术分', record.technicalScore, false, true)
} else {
return record.technicalScore
}
}
},
{
title: '服务分',
width: 60,
dataIndex: 'serviceScore',
hideInTable: expandTotalScore,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('serviceScore', '服务分', record.serviceScore, false, true)
} else {
return record.serviceScore
}
}
},
{
title: '价格分',
width: 60,
dataIndex: 'priceScore',
hideInTable: expandTotalScore,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('priceScore', '价格分', record.priceScore, false, true)
} else {
return record.priceScore
}
}
},
{
title: (
<span>
<Text keyboard onClick={() => setExpandTotalScore(!expandTotalScore)} style={{ cursor: 'pointer', color: '#1890ff' }}>{expandTotalScore ? "展开" : "收起"}</Text>
</span>
),
dataIndex: 'totalScore',
width: 120,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('totalScore', '综合得分', record.totalScore, false, true)
} else {
return record.totalScore
}
}
},
{
hideInTable: defId === 'negotiation_single_simple',
title: '是否通过初步评审',
dataIndex: 'firstRvwResult',
width: 100,
render: (_: any, record: any) => rvwResultRender(_, record.firstRvwReason)
},
{
hideInTable: type5 || defId === 'negotiation_single_simple',
title: '是否通过详审',
dataIndex: 'detailRvwResult',
width: 100,
render: (_: any, record: any) => rvwResultRender(_, record.detailRvwReason)
},
{
hideInTable: type5 || defId === 'negotiation_single_simple',
title: '应答是否有效',
width: 80,
dataIndex: 'answerValid',
render: (_: any, record: any) => {
return record.answerValid === 1 ? '是' : record.answerValid === 0 ? '否' : '-'
}
},
{
title: '是否' + name1 + '候选人',
dataIndex: 'winnerCandidate',
width: 100,
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnSelect('winnerCandidate', record.winnerCandidate)
} else {
return record.winnerCandidate === 1 ? '是' : '否'
}
}
},
{
hideInTable: type5 || defId === 'negotiation_single_simple',
title: '是否拟' + name1 + '人',
width: 80,
dataIndex: 'winnerBidder',
render: (_: any, record: any) => {
return record.winnerBidder === 1 ? '是' : record.winnerBidder === 0 ? '否' : '-'
}
},
{
hideInTable: type3,
title: '拟签约金额(不含增值税)(元)',
width: 150,
dataIndex: 'contractedMoney',
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return (
<>
{returnInput('contractedMoney', '拟签约金额', record.contractedMoney, false, true)}
{returnInput('id', '供应商id', record.id, false, false, true)}
{returnInput('resultId', '结果id', record.resultId, false, false, true)}
{returnInput('companyId', '公司id', record.companyId, false, false, true)}
{returnInput('companyName', '公司名称', record.companyName, false, false, true)}
</>
)
} else {
return record.contractedMoney
}
}
},
{
hideInTable: type4,
title: '增值税金额(元)',
width: 150,
dataIndex: 'taxRatePrice',
render: (_: any, record: any) => {
if (defId === 'negotiation_single_simple' && record.pushStatus == "0") {
return returnInput('taxRatePrice', '增值税金额', record.taxRatePrice, false, true)
} else {
return record.taxRatePrice
}
}
},
]
return (
<ProTable
size={"small"}
key={index}
scroll={{ x: true }}
search={false}
options={false}
columns={columns}
dataSource={item1.reviewList}
toolbar={{
title: item1.againEvaluationSort == 'null' || isEmpty(item1.againEvaluationSort) ? null : `${item1.againEvaluationSort}次重审`,
}}
rowKey="id"
toolBarRender={(record: any) => [
<>
<Button
hidden={btnAuthority(['ebtp-agency-project-manager', 'ebtp-purchase']) || defId != 'negotiation_single_simple' || item1.pushStatus == "1"}
type="primary"
onClick={async () => {
setSpintype(true);
await form.validateFields().then(async () => {
await saveResult({
id: form.getFieldValue("resultId"),
suppliers: [
{
...form.getFieldsValue(),
"winnerCandidate": form.getFieldValue("winnerCandidate") == '是' ? '1' : '0',
"firstRvwResult": form.getFieldValue("firstRvwResult") == '是' ? '1' : '0',
"detailRvwResult": form.getFieldValue("detailRvwResult") == '是' ? '1' : '0',
"answerValid": form.getFieldValue("answerValid") == '是' ? '1' : '0',
"winnerBidder": form.getFieldValue("winnerBidder") == '是' ? '1' : '0',
}
]
}).then((res) => {
if (res.success) { message.success('保存成功!') }
})
}).finally(() => setSpintype(false));
}}
></Button>
{
defId === 'negotiation_single_simple' ?
<Button
hidden={
btnAuthority(['ebtp-agency-project-manager', 'ebtp-purchase']) ||
!item1.reviewList[0].price ||
!item1.reviewList[0].priceReview
}
disabled={item1.pushStatus == "1" ? true : false} key={"1"}
onClick={() => pushResult(item1)} type="primary">{name2}</Button>
:
<Button hidden={btnAuthority(['ebtp-agency-project-manager', 'ebtp-purchase'])} disabled={item1.pushStatus == "1" ? true : false} key={"1"} onClick={() => pushResult(item1)} type="primary"> {name2} </Button>
}
<Button key={"2"} onClick={() => getResultList(item1)}></Button>
</>
]}
pagination={{
defaultPageSize: 10,
showSizeChanger: false,
}}
/>
)
}}
>
</List>
)
}, [ListData])
}
return (
<>
<Spin spinning={spintype}>
@ -480,7 +460,13 @@ const BidAssessmentResults: React.FC<{}> = (props) => {
}}></Button>
</Space>
</div>
{list}
<Collapse activeKey={collapseActiveKeys} onChange={onCollapseChange} className="calibration-panel">
{ListData.map((item, index) => (
<Panel header={item.sectionName} key={index}>
<ResultListRender item={item} setSpintype={(value) => { setSpintype(value); }} getResultList={getResultList} ListData={ListData} pushResult={pushResult} />
</Panel>
))}
</Collapse>
<CurrentTable assessRoomId={assessRoomId} ChangeNoticeListVisible={currentTable}
onCancel={() => setCurrentTable(false)} />
</Card>