单一来源软控显示确认按钮

This commit is contained in:
yss
2022-08-25 10:42:14 +08:00
parent d3eaf5b20c
commit c74d22f413
4 changed files with 78 additions and 14 deletions

View File

@ -26,7 +26,7 @@ import {
creatNotice,
getChooseRoom,
getPackageAndSupplierList,
chooseSupplier, deleteSupplier, updateSupplierUser, checkConflict
chooseSupplier, deleteSupplier, updateSupplierUser, saveAnno
} from '../service'
import moment from "moment";
import TabPane from "@ant-design/pro-card/lib/components/TabPane";
@ -467,10 +467,11 @@ const BiddingInvitation: React.FC<BiddingInvitation> = (props) => {
"reasonMemo": form.getFieldValue("reasonMemo")
}
creatNotice(type, fromData).then(res => {
// creatNotice(type, fromData).then(res => {
if (res?.code == 4004 && res?.success == false) { //2021.9.7 zhoujianlong 新增和修改邀请函增加风控
const data = res?.data?.result == undefined ? [] : res?.data?.result
setRiskData(data)
const data = res?.data== undefined ? [] : res?.data
let thisData = [];
thisData.push(data);
setRiskData(thisData)
setRiskVisible(true)
}
if (res.code == 200) {
@ -481,6 +482,48 @@ const BiddingInvitation: React.FC<BiddingInvitation> = (props) => {
setTimeout(() => setSping(false), 1000)
});
}
const saveAfterRisk = () => {
const packageMsg = [];
for (const item of TpPackageId) {//包数据
for (const item1 of form.getFieldValue("sectionIds")) {
if (item.value == item1) {
packageMsg.push({ "bsId": item.value, "bsName": item.label })
}
}
}
setSping(true);
const fromData = {
"id": pkId,
"annoNature": 101,//邀请函
"tpId": tpId,
"csAnnoId": pkId,
"attDatasetId": form.getFieldValue("attDatasetId"),
"openhallTitle": form.getFieldValue("openhallIdTime"),//开标大厅 时间段
"source": 21,//来源1预审公告2预审公示11资审公告12资审公示21邀请函
"annoTitle": form.getFieldValue("annoTitle"),
"contentWithStyle": braftRef.current.getHtml().replace(/<table border="0"/, '<table border="1"'),//富文本正文
"docStartTime": form.getFieldValue("docStartTime").format("yyyy-MM-DD HH:mm:ss"),
"replyEndTime": form.getFieldValue("replyEndTime").format("yyyy-MM-DD HH:mm:ss"),
"openingTime": form.getFieldValue("openingTime").format("yyyy-MM-DD HH:mm:ss"),
"docEndTime": form.getFieldValue("docEndTime").format("yyyy-MM-DD HH:mm:ss"),
"openhallId": form.getFieldValue("openhallId"),
// "contentFileId": WebofficeRef.current!.DocfileCode,//office id
// "contentHtmlId": WebofficeRef.current!.HTMLfileCode,//html id
"sections": packageMsg,
"medias": "9",
"roomType": "2",
"reasonMemoAttrId": form.getFieldValue("reasonMemoAttrId"),
"reasonMemo": form.getFieldValue("reasonMemo")
}
saveAnno(fromData).then(res => {
if (res.code == 200) {
setAnnoId(res?.data);
message.success("成功");
setTabsKeys("2");
}
setTimeout(() => setSping(false), 1000)
});
}
const columns1: ProColumns<{}>[] = [
@ -954,7 +997,7 @@ const BiddingInvitation: React.FC<BiddingInvitation> = (props) => {
setRiskData([])
}}
data={riskData}
onSubmit={() => submit()}
onSubmit={() => saveAfterRisk()}
/>}
</Spin>

View File

@ -61,7 +61,7 @@ const Index: React.FC<Props> = (props) => {
"reasonMemoAttrId": form.getFieldValue("reasonMemoAttrId"),
"reasonMemo": form.getFieldValue("reasonMemo")
}
updateMemo(type, fromData).then(res => {
updateMemo(fromData).then(res => {
if (res.code == 200) {
message.success("成功");
onCancel();

View File

@ -22,8 +22,8 @@ export async function GetNoticeMsg(params?: any) {
/*创建公告*/
export async function creatNotice(type: any, params?: any) {
let method = "post";
if (type == "edit" || type == "change")
method = "put";
if (type == "edit" || type == "change")
method = "put";
return request('/api/biz-service-ebtp-bid/v1/anno', {
method: method,
data: {
@ -224,7 +224,7 @@ export async function savePublicData(params: any) {
});
}
/*修改说明*/
export async function updateMemo(type: any, params?: any) {
export async function updateMemo(params?: any) {
return request("/api/biz-service-ebtp-bid/v1/anno/updateMemo", {
method: "post",
data: {
@ -232,3 +232,12 @@ export async function updateMemo(type: any, params?: any) {
},
})
}
/*风控后的保存公告*/
export async function saveAnno(params?: any) {
return request("/api/biz-service-ebtp-bid/v1/anno/saveAnno", {
method: "post",
data: {
...params
},
})
}

View File

@ -21,7 +21,7 @@ const modalHeight = window.innerHeight * 96 / 100;
*/
const RiskPreventionSoft: React.FC<RiskPreventionSoftProps> = (props) => {
const { modalVisible, onCancel, onSubmit, data } = props;
const [spinning, setSping] = useState<boolean>(false);//加载遮罩
const [confirmButtonVisible, setConfirmButtonVisible] = useState<boolean>(true);//是否显示确定按钮
const columns: ProColumns<any[]>[] = [
{
@ -55,11 +55,23 @@ const RiskPreventionSoft: React.FC<RiskPreventionSoftProps> = (props) => {
},
];
useEffect(()=>{
for (const iterator of data) {
}
setConfirmButtonVisible(getButtonVisible());
},[])
const getButtonVisible = () => {
console.log(data);
for (const risk of data) {
for (const result of risk.result) {
for (const regulationData of result.regulationData) {
if(regulationData.regulationStrategy=="hard"){
return true;
}
}
}
}
return false;
}
return (
<Modal
destroyOnClose
@ -70,7 +82,7 @@ const RiskPreventionSoft: React.FC<RiskPreventionSoftProps> = (props) => {
bodyStyle={{ maxHeight: modalHeight - 107, overflowY: 'auto', padding: '8px 24px 16px' }}
centered
onCancel={() => onCancel()}
okButtonProps={{hidden: true}}
okButtonProps={{hidden: confirmButtonVisible}}
onOk={() => {
onSubmit();
onCancel();