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

fix: 处理非在线评标提交评标报告异常问题

parent 69b76582
......@@ -145,7 +145,7 @@ const BidConfirm: React.FC<BidConfirmProps> = ({cardTitle}) => {
<div className={style['card-list']}>
<Row>
<Col span={8}><p className={style['card-list_title']}>物料编号:</p></Col>
<Col><p>{item[dataIndex]['code']}</p></Col>
<Col><p>{item[dataIndex]['code'] || null}</p></Col>
</Row>
</div>
<div className={style['card-list']}>
......
......@@ -23,7 +23,8 @@ const ParticipateInfo: React.FC<ParticipateInfoProps> = ({cardTitle}) => {
const [participateList, setParticipateList] = useState<any>(() => {
return data.memberList.map(item => ({
company: item.memberName,
amount: item.submitTender.submitTenderMateriel.reduce((a, b) => a + b.price * b.inviteTenderMateriel.count, 0),
// 判断可能存在没投标的参标会员
amount: item.submitTender ? item.submitTender.submitTenderMateriel.reduce((a, b) => a + b.price * b.inviteTenderMateriel.count, 0) : 0,
// @todo 多物料下有问题,一个含税一个不含税,如何显示? 先写死
isTax: true,
status: item.tenderOutStatus,
......
......@@ -85,9 +85,8 @@ const ReadyQualifityCheckedDetail: React.FC = () => {
}
})
const result = await PublicApi.postPurchaseInviteTenderSubmitCheckFinishTender(params)
if (result.code === 1000) {
const { code } = await PublicApi.postPurchaseInviteTenderSubmitCheckFinishTender(params)
if (code === 1000) {
currentRef.current.setVisible(false)
history.goBack()
}
......
......@@ -44,11 +44,15 @@ const ReadyExpertRemarkDetail: React.FC = () => {
const onConfirm = async (value) => {
const {evaluationTenderList: _value, templateContentList} = value
console.log(_value, templateContentList)
const evaluationTenderRecommendList = _value.map(item => ({
isRecommend: item.isRecommend,
memberName: item.memberName,
reason: item.reason,
}))
const evaluationTenderRecommendList = _value.map(item => {
if(item?.isRecommend) {
return {
isRecommend: item.isRecommend,
memberName: item.memberName,
reason: item.reason,
}
}
}).filter(_ => Boolean(_))
let evaluationList = []
for(let i = 0; i < _value.length; i++) {
......@@ -91,7 +95,7 @@ const ReadyExpertRemarkDetail: React.FC = () => {
anchorList={anchorTitleList}
extraRight={
<Button type='primary' onClick={()=>addSchemaAction.submit()} icon={<SendOutlined rotate={-45} />}>
提交报告
提交评标
</Button>
}
/>
......
......@@ -56,14 +56,19 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle}) => {
tempObject.id = item.id
tempObject.memberId = item.memberId
tempObject.memberName = item.memberName
for(let j = 0; j < item.evaluationTenderList.length; j++) {
let _item = item['evaluationTenderList'][j]
tempObject.expertExtractRecordId = _item['expertExtractRecord']['id']
tempObject.score = _item['score']
tempObject.sort = _item['sort']
tempObject.standard = _item['standard']
tempObject.standardScore = _item['standardScore']
tempObject.term = _item['term']
if(item.evaluationTenderList){
// 处理没有手动进行评标操作的流程
for(let j = 0; j < item.evaluationTenderList.length; j++) {
let _item = item['evaluationTenderList'][j]
tempObject.expertExtractRecordId = _item['expertExtractRecord']['id']
tempObject.score = _item['score']
tempObject.sort = _item['sort']
tempObject.standard = _item['standard']
tempObject.standardScore = _item['standardScore']
tempObject.term = _item['term']
dataSource.push({...tempObject})
}
} else {
dataSource.push({...tempObject})
}
}
......@@ -72,18 +77,20 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle}) => {
const computedData = groupBy(dataSource, 'memberName')
const computedScore = Object.keys(computedData).map((item, index) => {
let expertNumber = Object.keys(groupBy(computedData[item], 'expertExtractRecordId')).length
let total = computedData[item].reduce((a, b) => a + b.score, 0)
let total = computedData[item].reduce((a, b) => a + b.score, 0) || null
return {
memberName: item,
total,
average: total/expertNumber,
average: total/expertNumber || null,
expertNumber,
}
})
console.log(dataSource, computedScore, 'computedScore')
const dataBySort = groupBy(dataSource, 'sort')
console.log(dataSource, computedScore, dataBySort, 'computedScore')
setEvaluationRecord(dataBySort)
// 根据评标sort分类后的数据 遍历 分子表格
let childrenTableDataSource = [] // table data
......@@ -115,12 +122,15 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle}) => {
}
let columns: any = []
childDataSource[_item].forEach((__item, __index) => {
columns.push({
title: <><UserOutlined />{__item['expertExtractRecordId']}</>,
dataIndex: __item['expertExtractRecordId'],
key: __item['expertExtractRecordId'],
})
objectItem[__item['expertExtractRecordId']] = __item['score']
// 没有手动评标就不存在抽取id
if(__item['expertExtractRecordId']) {
columns.push({
title: <><UserOutlined />{__item['expertExtractRecordId']}</>,
dataIndex: __item['expertExtractRecordId'],
key: __item['expertExtractRecordId'],
})
objectItem[__item['expertExtractRecordId']] = __item['score']
}
})
childTableData.push(objectItem)
childTableColumnResult = childTableColumns.concat(columns)
......@@ -235,7 +245,7 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle}) => {
const handleSubmit = (values) => {
currentRef.current.setVisible(false)
setRecommandList(() => {
let _t = [...recommandList]
let _t = recommandList ? [...recommandList] : []
_t.push({...values})
return _t
})
......@@ -319,7 +329,7 @@ const RemarkBidReport: React.FC<RemarkBidReportProps> = ({cardTitle}) => {
<h3 className="commonPanelTitle">评标记录</h3>
<Radio.Group value={transferRadio} buttonStyle="solid" size="small" onChange={handleChangeType}>
{
Object.keys(evaluationRecord).map((item, index) => (<Radio.Button key={index} value={index}>{item}</Radio.Button>))
Object.keys(evaluationRecord).map((item, index) => (typeof item === "undefined" ? <Radio.Button key={index} value={index}>{item}</Radio.Button> : null))
}
</Radio.Group>
</div>
......
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