Commit 5b53736f authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 取消招投标提交评标报告修正总分与总分的联动,处理采购规则配置支付配置项显示隐藏异常问题

parent bb9144f8
import React, { useRef, useState, useEffect, useCallback } from 'react'
import React, { useRef, useState, useEffect } from 'react'
import { history } from 'umi'
import { PageHeaderWrapper } from '@ant-design/pro-layout'
import ReutrnEle from '@/components/ReturnEle'
......@@ -101,7 +101,6 @@ const AddNewBid:React.FC<AddNewBidProps> = (props) => {
const handleSubmit = async (value) => {
setBtnLoading(true)
const params = paramsConversionFn(value)
console.log(params, value, 'ppp')
if(!params.isQualificationCheck) {
delete params.preCheckStartTime
delete params.preCheckEndTime
......@@ -147,7 +146,6 @@ const AddNewBid:React.FC<AddNewBidProps> = (props) => {
// // 新增或复制 剔除id操作
// omitID(params)
// }
// console.log(params, 'after')
try {
addSchemaAction.getFieldState('deliverAddressId', state => {
if(params?.deliverAddressId) {
......@@ -223,7 +221,6 @@ const AddNewBid:React.FC<AddNewBidProps> = (props) => {
const clickAddMember = () => {
memberRef.current.setVisible(true)
// if (id) {
// console.log(hadMembers.current, 'hadMembers')
// memberRef.current.rowSelectionCtl.setSelectedRowKeys(hadMembers.current.map(item => item.memberId))
// memberRef.current.rowSelectionCtl.setSelectRow(hadMembers.current)
// }
......
......@@ -5,10 +5,9 @@ import { BidDetailContext } from '@/pages/procurement/_public/bid/context';
import { useBidDetail } from '@/pages/procurement/_public/bid/effects/useBidDetail';
import BidDetailHeader from '@/pages/procurement/components/bidDetailHeader';
import BidDetailSection from '@/pages/procurement/components/bidDetailSection';
import { BidOuterWorkState } from '@/constants/procurement';
const CallForBidsSearchDetail: React.FC = () => {
const { formContext, id } = useBidDetail({ type: 'callForBid' })
const { formContext } = useBidDetail({ type: 'callForBid' })
const { data } = formContext
// type? 用于区分DescriptionsInfo组件的内容
......@@ -30,28 +29,6 @@ const CallForBidsSearchDetail: React.FC = () => {
{ title: '流转记录', id: 'transferRecord', componentName: "BidTransformRecord" },
]
// // 已经报名 才有报名信息 @注释原因:无法通过状态判断
// if(data?.inviteTenderOutStatus < BidOuterWorkState.Not_Submitted_Qualifications_Check) {
// anchorTitleList.splice(5, 1)
// }
// // 已经资格预审 才有资格预审信息
// if(data?.inviteTenderOutStatus < BidOuterWorkState.Not_Submit_Tender && !data?.isQualificationCheck) {
// // anchorTitleList.splice(7, 1)
// anchorTitleList.forEach((ele, index) => ele['title'] === '资格预审信息' && anchorTitleList.splice(index, 1))
// }
// // 已经评标 才有评标报告
// if(data?.inviteTenderOutStatus < BidOuterWorkState.Not_Finish_Notice) {
// // anchorTitleList.splice(9, 1)
// anchorTitleList.forEach((ele, index) => ele['title'] === '评标报告' && anchorTitleList.splice(index, 1))
// }
// // 已经完成招标 才有招标结果
// if(data?.inviteTenderOutStatus < BidOuterWorkState.Finish_Invite_Tender) {
// anchorTitleList.splice(-2, 1)
// }
// 勾选资格预审 才有资格预审信息
if(!data?.isQualificationCheck) {
anchorTitleList.forEach((ele, index) => ele['title'] === '资格预审要求' && anchorTitleList.splice(index, 1))
......
......@@ -51,7 +51,8 @@ export const RemarkTableCell:React.FC<TableCellProps> = ({
try {
const values = await form.validateFields()
console.log(values, e, 'vvv')
values.totalScore = Object.values(values).reduce((a, b) => Number(a) + Number(b), 0)
const score = Object.values(values).reduce((a, b) => Number(a) + Number(b), 0)
values.totalScore = Number(score).toFixed(2)
handleSave({ ...record, ...values })
} catch (errInfo) {
console.log('Save failed:', errInfo)
......
......@@ -82,7 +82,7 @@ const ReadyExpertRemarkDetail: React.FC = () => {
return item
})
const res = await PublicApi.postPurchaseExpertExtractRecordEvaluationTender({id, evaluationTenderList: evaluationList.filter(Boolean), evaluationTenderRecommendList})
const res = await PublicApi.postPurchaseExpertExtractRecordEvaluationTender({id: Number(id), evaluationTenderList: evaluationList.filter(Boolean), evaluationTenderRecommendList})
if(res.code === 1000) {
history.goBack()
......
......@@ -31,7 +31,7 @@ export interface RemarkBidReportProps {
editable?: Boolean,
}
const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle, editable}) => {
const RemarkBidReport: React.FC<RemarkBidReportProps> = ({editable}) => {
const { token } = getAuth() || {}
const { data, submitData, submitCtl } = useContext(ReportDetailContext)
const currentRef = useRef<any>({})
......@@ -292,11 +292,11 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle, editable})
beforeUpload(file) {
if(file.name.length > 100) {
message.warning('文件名过长');
return Promise.reject();
return Promise.reject('文件名过长');
}
if (file.size / 1024 / 1024 > 20) {
message.warning('附件大小超过20M');
return Promise.reject();
return Promise.reject('附件大小超过20M');
}
},
}
......@@ -332,7 +332,7 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle, editable})
},
}
const handleSave = (row, index) => {
const handleSave = (row) => {
// 双重遍历childTableData数据 改变total和average
setChildrenTableData(() => {
return childTableData.map(element => {
......@@ -340,8 +340,9 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle, editable})
if(_e.memberName === row.memberName) {
return {
..._e,
total: Number(row.total),
average: (Number(row.total) / row.expertNumber).toFixed(2),
// @reason:修正总分和总分不需要联动
// total: Number(row.total),
// average: (Number(row.total) / row.expertNumber).toFixed(2),
}
} else {
return _e
......@@ -436,7 +437,7 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle, editable})
editable: col.editable,
dataIndex: col.dataIndex,
title: col.title,
handleSave: (row) => handleSave(row, index),
handleSave: (row) => handleSave(row),
}),
};
});
......
......@@ -44,7 +44,6 @@ const readySubmitReportDetail: React.FC = () => {
const handleSubmit = () => {
setLoading(true)
console.log(submitData)
const {fileList, recommandList, childTableData, offlineData} = submitData
let params: any = { id }
if(recommandList && recommandList.length) {
......@@ -66,7 +65,6 @@ const readySubmitReportDetail: React.FC = () => {
:
[]
}
console.log(params)
PublicApi.postPurchaseExpertExtractReportSubmitEvaluationTenderReport(params).then(res => {
setLoading(true)
if(res.code === 1000) {
......
import React, { useEffect } from 'react'
import { findLastIndexFlowState } from '@/utils'
import { Skeleton } from 'antd';
import style from './index.less'
import TransferProcess from '../transferProcess'
import DescriptionsInfo from '../descriptionsInfo'
......@@ -23,7 +22,6 @@ export interface BidDetailSectionProps {
const BidDetailSection:React.FC<BidDetailSectionProps> = ({
formContext,
type = 'callForBid',
anchorList = [],
}) => {
......@@ -74,7 +72,7 @@ const BidDetailSection:React.FC<BidDetailSectionProps> = ({
}
}
const RenderCertainContent = ({ id, title, type = null, componentName = null }) => {
const RenderCertainContent = ({ title, type = null, componentName = null }) => {
let RcDom: any = null;
switch(componentName) {
//@todo 需另外调用接口获取数据
......@@ -138,11 +136,9 @@ const BidDetailSection:React.FC<BidDetailSectionProps> = ({
return (
formContext.data &&
// <Skeleton active loading={!(formContext.externalWorkflowFlowRecordLogResponses || formContext.interiorWorkflowFlowRecordLogResponses)}>
<div className={[style.anchorContentWrap, "anchorContent"].join(' ')}>
<RenderDetailSection componentList={anchorList} />
</div>
// </Skeleton>
)
}
......
......@@ -46,9 +46,9 @@ const BidParticulars: React.FC<BidParticularsProps> = ({cardTitle}) => {
const [tableColumn, setTableColumn] = useState<any>(() => {
let totalMoney = 0;
data.submitTender ?data.submitTender.submitTenderMateriel.forEach(item => {
data.submitTender ? data.submitTender.submitTenderMateriel.forEach(item => {
if(cardTitle === '中标明细') {
totalMoney += item.price * item.inviteTenderMateriel.count * Number(item.awardTenderRatio)/100
totalMoney += (item.isAwardTender ? item.price * item.inviteTenderMateriel.count * Number(item.awardTenderRatio)/100 : 0)
} else {
totalMoney += item.price * item.inviteTenderMateriel.count
}
......
......@@ -58,7 +58,7 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle}) => {
// 计算总分 计算平均分
const computedData = groupBy(dataSource, 'memberName')
const computedScore = Object.keys(computedData).map((item, index) => {
const computedScore = Object.keys(computedData).map((item) => {
let expertNumber = Object.keys(groupBy(computedData[item], 'expertExtractRecordId')).length
let total = computedData[item].reduce((a, b) => a + b.score, 0)
......@@ -75,7 +75,7 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle}) => {
// 根据评标sort分类后的数据 遍历 分子表格
let childrenTableDataSource = [] // table data
let childTableDataColumns = [] // table columns
Object.keys(dataBySort).forEach((item, index) => {
Object.keys(dataBySort).forEach((item) => {
let childTableData = []
let childTableColumns = [{
title: '会员', dataIndex: 'memberName', key: 'memberName',
......@@ -192,7 +192,7 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle}) => {
},
}
const handleSave = (row, index) => {
const handleSave = (row) => {
// 双重遍历childTableData数据 改变total和average
setChildrenTableData(() => {
return childTableData.map(element => {
......@@ -242,7 +242,7 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle}) => {
editable: col.editable,
dataIndex: col.dataIndex,
title: col.title,
handleSave: (row) => handleSave(row, index),
handleSave: (row) => handleSave(row),
}),
};
});
......
import { paymentInformationColumns } from '../constant'
import { PayInfoCell, EditableRow } from '../components/payInfoTableCell'
import { ISchemaFormActions, ISchemaFormAsyncActions } from '@formily/antd'
import { useEffect, useState, useRef, useContext } from 'react'
import { useEffect, useState, useRef } from 'react'
import { PublicApi } from '@/services/api'
export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions, memberId: any, memberRoleId: any, orderProducts: any): any => {
......@@ -36,7 +36,7 @@ export const usePaymentInfo = (ctx: ISchemaFormActions | ISchemaFormAsyncActions
shopId: ctx.getFieldValue('shopId'),
orderMode: ctx.getFieldValue('orderMode'),
products: ctx.getFieldValue('products').map(item => ({ productId: item.commodityId, skuId: item.productId }))
}).then(res => {
}, { ctlType: 'none' }).then(res => {
const { code, data } = res
if (code === 1000) {
const newColumns = [...columns]
......
......@@ -337,9 +337,10 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
})
fatchSetedProducts(parentState.value[0])
})
// 此项隐藏操作在编辑下能无效
$('onFieldValueChange', 'baseProcessId').subscribe(parentState => {
const selectedObject = parentState.dataSource.filter(item => item.baseProcessid === parentState.value)[0]
// 不是下单交易类型 隐藏电子合同
// 不是下单交易类型 隐藏取消时间
if(selectedObject && selectedObject["processType"] !== 1) {
setFieldState("MEGA_LAYOUT1_1", state => {
state.visible = false
......@@ -360,7 +361,7 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
setFieldState("payments", state => {
state.visible = true
})
if(pageStatus === PageStatus.ADD) {
// if(pageStatus === PageStatus.ADD) {
let initPayments: any[] = [];
for(let i = 1; i <= selectedObject['payTimes']; i++) {
initPayments.push({
......@@ -370,13 +371,43 @@ const RuleSetting:React.FC<RuleSettingProps> = (props) => {
})
}
setFieldValue("payments", initPayments)
}
// }
} else {
setFieldState("payments", state => {
state.visible = false
})
}
})
// 处理编辑下支付配置的显示隐藏
$('onFieldValueChange', 'payments').subscribe(parentState => {
if(pageStatus === PageStatus.EDIT) {
if(parentState.value.length) {
setFieldState("payments", state => {
state.visible = true
})
}
}
})
// 处理编辑下电子的显示隐藏
$('onFieldValueChange', 'processType').subscribe(parentState => {
if(pageStatus === PageStatus.EDIT) {
if(parentState.value === 1) {
setFieldState("MEGA_LAYOUT1_1", state => {
state.visible = true
})
setFieldState("expireHours", state => {
state.visible = true
})
} else {
setFieldState("MEGA_LAYOUT1_1", state => {
state.visible = false
})
setFieldState("expireHours", state => {
state.visible = false
})
}
}
})
}}
onSubmit={handleSubmit}
actions={addSchemaAction}
......
......@@ -129,6 +129,11 @@ export const ruleDetailSchema: ISchema = padRequiredMessage({
},
visible: false
},
"processType": {
type: 'number',
title: '流程类型',
visible: false
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment