forked from Gitlink/forgeplus-react
修改issue
This commit is contained in:
parent
bc3d15c506
commit
0c86f9281a
|
@ -45,6 +45,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
width:50,
|
||||
render: (text, record, index) => {
|
||||
return index + 1
|
||||
}
|
||||
|
@ -74,11 +75,13 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
title: '平均分',
|
||||
dataIndex: 'gradesAverage',
|
||||
key: 'gradesAverage',
|
||||
width:80,
|
||||
},
|
||||
{
|
||||
title: '评审意见',
|
||||
dataIndex: 'comments',
|
||||
key: 'comments',
|
||||
width:90,
|
||||
render: (text, record, index) => {
|
||||
return <a className="link" onClick={() => { writeComments(text, index, 'comments') }}>{record.status === 2 ? '填写' : '查看'}意见</a>
|
||||
}
|
||||
|
@ -209,7 +212,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
|
||||
function editGrade(value, index, dataIndex) {
|
||||
let dataListNew = dataList.slice();
|
||||
|
||||
dataListNew[index][dataIndex] = value;
|
||||
// 计算平均分
|
||||
if (gradesNum) {
|
||||
let gradesArr = [];
|
||||
|
@ -228,7 +231,6 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
}
|
||||
}
|
||||
|
||||
dataListNew[index][dataIndex] = value;
|
||||
setDataList(dataListNew);
|
||||
}
|
||||
|
||||
|
@ -268,6 +270,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
function commit() {
|
||||
if(disabled){
|
||||
setVisible(false);
|
||||
return;
|
||||
}
|
||||
if (comments) {
|
||||
let data = dataList[activeIndex];
|
||||
|
@ -317,6 +320,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
// 提交前校验
|
||||
function verify() {
|
||||
let errorArr = [];
|
||||
let commentsError=[];
|
||||
let scoringArr = [];
|
||||
for (const [index, item] of dataList.entries()) {
|
||||
let gradesArr = [];
|
||||
|
@ -327,7 +331,9 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
typeof item.gradesFive === 'number' && gradesArr.push(item.gradesFive);
|
||||
if (gradesArr.length < gradesNum && gradesArr.length) {
|
||||
errorArr.push(index);
|
||||
} else if (gradesArr.length) {
|
||||
}else if(!item.comments && gradesArr.length ){
|
||||
commentsError.push(index);
|
||||
} else if (gradesArr.length ) {
|
||||
scoringArr.push(index);
|
||||
}
|
||||
}
|
||||
|
@ -341,6 +347,19 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
title: '提醒',
|
||||
content: content,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if(commentsError.length){
|
||||
let content = '';
|
||||
for (const item of commentsError) {
|
||||
content += `第${item + 1}行数据请填写意见 `;
|
||||
}
|
||||
Info({
|
||||
title: '提醒',
|
||||
content: content,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!scoringArr.length) {
|
||||
|
@ -348,9 +367,10 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
title: '提醒',
|
||||
content: '请至少填写一行分数',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
return !errorArr.length
|
||||
return !errorArr.length && !commentsError.length;
|
||||
}
|
||||
|
||||
function dealCommitRes(res) {
|
||||
|
@ -406,7 +426,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
<TabPane tab="专家评分" key="1">
|
||||
<div>
|
||||
<div className="box"></div>
|
||||
<div className="warning">对单个作品评分时,需填写完整每个评分项,请勿少填、漏填</div>
|
||||
<div className="warning">对单个作品评分时,需填写完整每个评分项及评审意见,请勿少填、漏填</div>
|
||||
<Paginationtable
|
||||
loading={loading}
|
||||
dataSource={dataList}
|
||||
|
@ -415,7 +435,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
/>
|
||||
|
||||
<div className="text-center">
|
||||
<Button className="mr10" type="primary" disabled={disabled} onClick={commitGrades}>提交评审结果</Button>
|
||||
<Button className="mr10" type="primary" disabled={disabled} onClick={commitGrades}>提交评审结果</Button>
|
||||
<Button className="mr10" disabled={disabled} onClick={draft}>保存评审结果</Button>
|
||||
<Button className="butE3_border" onClick={cancel}>取消</Button>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue