Merge branch '20220727-风控中心增加风控规则' into 'release_20220812'
8.12 风控中心3条新增规则 最低价法,中选供应商非有效应答最低价 综合评分法,中选供应商非有效应答最高分 See merge request eshop/fe_service_ebtp_frontend!224
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { Button, Card, Col, Collapse, Divider, Form, Input, message, Modal, Popover, Row, Space, Spin, Tooltip, Typography } from 'antd';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import '@/utils/lq.style.less';
|
||||
import { getReviewResult, saveToExpertConfirm, submitReviewResult, submitToExpertConfirm, unlockResult } from '../service';
|
||||
import { beforeRiskControl, getReviewResult, saveToExpertConfirm, submitReviewResult, submitToExpertConfirm, unlockResult } from '../service';
|
||||
import { commonMessage } from '@/utils/MessageUtils';
|
||||
import { getDictName, isEmpty, isNotEmpty } from '@/utils/CommonUtils';
|
||||
import ProTable, { EditableProTable } from '@ant-design/pro-table';
|
||||
@ -16,10 +16,12 @@ import ReviewReportUpload from '@/utils/ReviewReportUpload';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
||||
import { getFileListByBid } from '@/utils/DownloadUtils';
|
||||
import MACAddressPrompt from '@/pages/Evaluation/BidControl/BidControlManager/components/MACAddressPrompt';
|
||||
import RiskPreventionSoft from '@/utils/RiskPreventionSoft';
|
||||
|
||||
const { Panel } = Collapse;
|
||||
const { TextArea } = Input;
|
||||
const { Paragraph, Text } = Typography;
|
||||
const { confirm, warning } = Modal;
|
||||
|
||||
const firstRvwResult = ['否', '是'];
|
||||
//是否中标候选人
|
||||
@ -125,6 +127,10 @@ const GroupLeader: React.FC = () => {
|
||||
const [reportUploadId, setReportUploadId] = useState<string>('');
|
||||
//评审报告附件列表
|
||||
const [reportFileList, setReportFileList] = useState<any[]>([]);
|
||||
//风控弹窗 2022.7.27 zhoujianlong
|
||||
const [riskVisible, setRiskVisible] = useState<boolean>(false);
|
||||
//风控数据 2022.7.27 zhoujianlong
|
||||
const [riskData, setRiskData] = useState<any[]>([]);
|
||||
useEffect(() => {
|
||||
init();
|
||||
}, []);
|
||||
@ -1194,7 +1200,8 @@ const GroupLeader: React.FC = () => {
|
||||
// }
|
||||
verificationMoneyIsEdit(data);
|
||||
}
|
||||
function submit(data: any) {
|
||||
//提交接口调用
|
||||
function submit() {
|
||||
setSpinning(true);
|
||||
let suppliers = JSON.parse(JSON.stringify(supplierTableData))//2021.10.14 zhoujianlong 改为深拷贝,解决保存字段闪烁问题
|
||||
suppliers.forEach((item: any) => {
|
||||
@ -1202,11 +1209,23 @@ const GroupLeader: React.FC = () => {
|
||||
item.detailRvwResult = isEmpty(item?.detailRvwResult) ? null : parseInt(item?.detailRvwResult)
|
||||
item.winnerBidder = isEmpty(item?.winnerBidder) ? null : parseInt(item?.winnerBidder)
|
||||
});
|
||||
data.suppliers = suppliers
|
||||
let data: any = {
|
||||
id: resultReviewForm.getFieldValue('id'),
|
||||
remarks: resultReviewForm.getFieldValue('remarks'),
|
||||
suppliers: [...suppliers]
|
||||
}
|
||||
// 提交专家确认
|
||||
submitToExpertConfirm(data).then(res => {
|
||||
if (res?.code == 200) {
|
||||
commonMessage(res);
|
||||
init();
|
||||
} else {
|
||||
message.destroy();
|
||||
warning({
|
||||
title: res?.message,
|
||||
centered: true,
|
||||
});
|
||||
}
|
||||
}).finally(() => {
|
||||
setSpinning(false);
|
||||
})
|
||||
@ -1239,10 +1258,9 @@ const GroupLeader: React.FC = () => {
|
||||
let res = false;
|
||||
let gys: any = [];
|
||||
if (roomType === '1' || bidMethodDict === 'procurement_mode_7' || bidMethodDict === 'procurement_mode_4') {//预审 询价 招募不需要金额
|
||||
submit(params);
|
||||
verificationRiskControl(params);
|
||||
return;
|
||||
}
|
||||
const { confirm } = Modal;
|
||||
function showConfirm() {
|
||||
confirm({
|
||||
title: `您有供应商未填写【拟签约金额】或【增值税金额】,请确认是否提交`,
|
||||
@ -1257,7 +1275,7 @@ const GroupLeader: React.FC = () => {
|
||||
}
|
||||
</>,
|
||||
onOk() {
|
||||
submit(params)
|
||||
verificationRiskControl(params);
|
||||
},
|
||||
});
|
||||
}
|
||||
@ -1269,11 +1287,35 @@ const GroupLeader: React.FC = () => {
|
||||
}
|
||||
})
|
||||
if (res) {
|
||||
showConfirm()
|
||||
showConfirm();
|
||||
} else {
|
||||
submit(params);
|
||||
verificationRiskControl(params);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 风控中心校验
|
||||
* @param params
|
||||
*/
|
||||
const verificationRiskControl = (params: any) => {
|
||||
let suppliers = JSON.parse(JSON.stringify(supplierTableData))//2021.10.14 zhoujianlong 改为深拷贝,解决保存字段闪烁问题
|
||||
suppliers.forEach((item: any) => {
|
||||
item.winnerCandidate = saveWinnerCandidate(item.winnerCandidate)
|
||||
item.detailRvwResult = isEmpty(item?.detailRvwResult) ? null : parseInt(item?.detailRvwResult)
|
||||
item.winnerBidder = isEmpty(item?.winnerBidder) ? null : parseInt(item?.winnerBidder)
|
||||
});
|
||||
params.suppliers = suppliers
|
||||
params["evalMethodDict"] = evalMethodDict;
|
||||
beforeRiskControl(params).then(res => {
|
||||
if (res?.code == 200) {
|
||||
if (res?.data.length > 0) {
|
||||
setRiskData(res?.data);
|
||||
setRiskVisible(true);
|
||||
} else {
|
||||
submit();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证增值税金额是否能高于拟签约的金额
|
||||
@ -1604,6 +1646,16 @@ const GroupLeader: React.FC = () => {
|
||||
fileId={reportUploadId}
|
||||
readOnly={true}
|
||||
/>}
|
||||
{/**风控组件 */}
|
||||
{riskVisible && <RiskPreventionSoft
|
||||
modalVisible={riskVisible}
|
||||
onCancel={() => {
|
||||
setRiskVisible(false);
|
||||
setRiskData([]);
|
||||
}}
|
||||
onSubmit={() => submit()}
|
||||
data={riskData}
|
||||
/>}
|
||||
</Card>
|
||||
</Spin>
|
||||
</>
|
||||
|
@ -53,7 +53,7 @@ export function submitReviewResult(id: any) {
|
||||
* 评审结果解锁
|
||||
* @param id
|
||||
*/
|
||||
export function unlockResult(id: any) {
|
||||
export function unlockResult(id: any) {
|
||||
return request(`/api/biz-service-ebtp-rsms/v1/reviewresult/unlock/result/${id}`, {
|
||||
method: 'post',
|
||||
});
|
||||
@ -62,8 +62,18 @@ export function submitReviewResult(id: any) {
|
||||
* 评审报告解锁
|
||||
* @param id
|
||||
*/
|
||||
export function unlockReportIF(id: any) {
|
||||
export function unlockReportIF(id: any) {
|
||||
return request(`/api/biz-service-ebtp-evaluation/v1/review/report/unlock/${id}`, {
|
||||
method: 'post',
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 提交前风险防控校验接口
|
||||
* @param data
|
||||
*/
|
||||
export function beforeRiskControl(data: any) {
|
||||
return request("/api/biz-service-ebtp-rsms/v1/riskcenter/getRemindResult", {
|
||||
method: 'post',
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
99
src/utils/RiskPreventionSoft/index.tsx
Normal file
99
src/utils/RiskPreventionSoft/index.tsx
Normal file
@ -0,0 +1,99 @@
|
||||
import React from 'react';
|
||||
import { Modal, Tag } from 'antd';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
||||
import type { ProColumns } from '@ant-design/pro-table';
|
||||
import ProTable from '@ant-design/pro-table';
|
||||
import './riskStyle.less'
|
||||
|
||||
interface RiskPreventionSoftProps {
|
||||
modalVisible: boolean;
|
||||
onCancel: () => void;
|
||||
onSubmit: () => void;
|
||||
data: Array<any>;
|
||||
}
|
||||
|
||||
const modalHeight = window.innerHeight * 96 / 100;
|
||||
|
||||
/**
|
||||
* 风险防控通用(软控)
|
||||
* @param props
|
||||
* @returns
|
||||
*/
|
||||
const RiskPreventionSoft: React.FC<RiskPreventionSoftProps> = (props) => {
|
||||
const { modalVisible, onCancel, onSubmit, data } = props;
|
||||
|
||||
const columns: ProColumns<any[]>[] = [
|
||||
{
|
||||
dataIndex: 'regulationStrategy',
|
||||
title: '规则响应策略',
|
||||
width: '13%',
|
||||
valueEnum: {
|
||||
hard: { text: '强控', status: 'Error' },
|
||||
soft: { text: '软控', status: 'Warning' },
|
||||
alarm: { text: '预警', status: 'Processing' }
|
||||
},
|
||||
},
|
||||
{
|
||||
dataIndex: 'regulationName',
|
||||
title: '规则模型名称',
|
||||
width: '13%',
|
||||
},
|
||||
{
|
||||
dataIndex: 'regulationRank',
|
||||
title: '风险响应等级',
|
||||
width: '13%',
|
||||
valueEnum: {
|
||||
first: { text: '风险一级' },
|
||||
second: { text: '风险二级' },
|
||||
third: { text: '风险三级' }
|
||||
},
|
||||
},
|
||||
{
|
||||
dataIndex: 'message',
|
||||
title: '规则相应内容',
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<Modal
|
||||
destroyOnClose
|
||||
title="风控中心校验结果"
|
||||
visible={modalVisible}
|
||||
width={'60%'}
|
||||
style={{ maxHeight: modalHeight }}
|
||||
bodyStyle={{ maxHeight: modalHeight - 107, overflowY: 'auto', padding: '8px 24px 16px' }}
|
||||
centered
|
||||
onCancel={() => onCancel()}
|
||||
onOk={() => {
|
||||
onSubmit();
|
||||
onCancel();
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<Tag icon={<ExclamationCircleOutlined />} color="warning" className="risk-top-tag">
|
||||
当前业务操作受以下风控规则限制
|
||||
</Tag>
|
||||
{data.map(ite => ite?.result.map((item: any) => (
|
||||
<div>
|
||||
<div className="risk-table-title">
|
||||
<span className="table-scene-name">场景名称:<span>{item.sceneName}</span></span>
|
||||
<span>{item.publishDepartName}</span>
|
||||
</div>
|
||||
<ProTable<any>
|
||||
columns={columns}
|
||||
dataSource={item.regulationData}
|
||||
rowKey="regulationId"
|
||||
size='small'
|
||||
pagination={false}
|
||||
toolBarRender={false}
|
||||
search={false}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
))}
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default RiskPreventionSoft;
|
19
src/utils/RiskPreventionSoft/riskStyle.less
Normal file
19
src/utils/RiskPreventionSoft/riskStyle.less
Normal file
@ -0,0 +1,19 @@
|
||||
.risk-top-tag {
|
||||
font-size: 14px;
|
||||
width: 100%;
|
||||
padding: 8px 16px;
|
||||
}
|
||||
|
||||
.risk-table-title {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-weight: bold;
|
||||
.table-scene-name {
|
||||
color: #7c7c7c;
|
||||
}
|
||||
:last-child {
|
||||
color: #000;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user