diff --git a/src/military/expert/expertUser/reviewTasks/index.jsx b/src/military/expert/expertUser/reviewTasks/index.jsx
index 7996fd72..f85109c5 100644
--- a/src/military/expert/expertUser/reviewTasks/index.jsx
+++ b/src/military/expert/expertUser/reviewTasks/index.jsx
@@ -42,7 +42,7 @@ function ReviewTasks({ form, showNotification, match, history }) {
dataIndex: 'containerName',
key: 'containerName',
render: (text, record) => {
- return
{text}
}
},
{
@@ -115,7 +115,6 @@ function ReviewTasks({ form, showNotification, match, history }) {
), []);
- console.log(dataList)
return (
diff --git a/src/military/expert/expertUser/taskDetail/index.jsx b/src/military/expert/expertUser/taskDetail/index.jsx
index 8424f14f..7a92b948 100644
--- a/src/military/expert/expertUser/taskDetail/index.jsx
+++ b/src/military/expert/expertUser/taskDetail/index.jsx
@@ -1,120 +1,163 @@
import React, { useState, useCallback, useMemo, useEffect } from "react";
-import { Tabs, Input, Select, Button, Form, DatePicker, InputNumber, Table, Pagination, Upload, Modal } from 'antd';
+import { Tabs, Button, Form, InputNumber, Modal } from 'antd';
import { Link } from "react-router-dom";
import Paginationtable from "../../../components/paginationTable";
-import { getScoringDetails, initScoringDetails } from "../../api";
+import { Info, Confirm } from '../../../components/ModalFun';
+import WordsInput from 'military/expert/components/wordsInput';
+import { getScoringDetails, initScoringDetails, getRules, updateScoringDetails } from "../../api";
import { readyCheckPapers } from "../../../task/api";
-import { taskType } from "../../static";
import { httpUrl } from '../../fetch';
import './index.scss';
import '../../index.scss';
-const Option = Select.Option;
const { TabPane } = Tabs;
-
-function ReviewTasks({ form, showNotification, match, history, current_user }) {
+function ReviewTasks({ showNotification, match, history, current_user }) {
const containerId = match.params.containerId;
const containerType = match.params.containerType;
- const { getFieldDecorator, setFieldsValue, getFieldsValue } = form;
-
// 主table参数
const [reload, setReload] = useState();
const [loading, setLoading] = useState(false);
const [curPage, setCurPage] = useState(1);
const [pageSize, setPageSize] = useState(10);
const [dataList, setDataList] = useState([]);
- const [total, setTotal] = useState(0);
- const [taskId, setTaskId] = useState(461);
+ const [taskId, setTaskId] = useState();
const [competitionId, setCompetitionId] = useState(461);
+ // 评分规则
+ const [rules, setRules] = useState({});
+
//tab栏
const [activeKey, setActiveKey] = useState(0);
+ // 模态框
+ const [visible, setVisible] = useState(false);
+ const [activeIndex, setActiveIndex] = useState(false);
+ const [comments, setComments] = useState();
- const columns = useMemo(() => {
- return [
- {
- title: '序号',
- dataIndex: 'index',
- render: (text, record, index) => {
- return index + 1
- }
- },
- {
- title: '投稿详情',
- dataIndex: 'opsContent',
- key: 'opsContent',
- },
- {
- title: '附件下载',
- dataIndex: 'opsFilesAttachments',
- key: 'opsFilesAttachments',
- render: (text, record) => {
- return text && text.map(item => {
- return { downFile(item.id) }}>{item.fileName}
- })
- }
- },
- {
- title: '评分一',
- dataIndex: 'gradesOne',
- key: 'gradesOne',
- render: (text, record, index) => {
- return
- }
- },
- {
- title: '评分二',
- dataIndex: 'gradesTwo',
- key: 'gradesTwo',
- render: (text, record, index) => {
- return
- }
- },
- {
- title: '评分三',
- dataIndex: 'gradesThree',
- key: 'gradesThree',
- render: (text, record, index) => {
- return
- }
- },
- {
- title: '评分四',
- dataIndex: 'gradesFour',
- key: 'gradesFour',
- render: (text, record, index) => {
- return
- }
- },
- {
- title: '评分五',
- dataIndex: 'gradesFive',
- key: 'gradesFive',
- render: (text, record, index) => {
- return
- }
- },
- {
- title: '平均分',
- dataIndex: 'gradesAverage',
- key: 'gradesAverage',
- },
- {
- title: '评审意见',
- dataIndex: 'comments',
- key: 'comments',
- },
- ];
- }, []);
+ // 按钮禁止提交
+ const [disabled, setDisabled] = useState(false);
+
+ // 通用列
+ const columns = [
+ {
+ title: '序号',
+ dataIndex: 'index',
+ render: (text, record, index) => {
+ return index + 1
+ }
+ },
+ {
+ title: '投稿详情',
+ dataIndex: 'opsContent',
+ key: 'opsContent',
+ },
+ {
+ title: '附件下载',
+ dataIndex: 'opsFilesAttachments',
+ key: 'opsFilesAttachments',
+ render: (text, record) => {
+ return text && text.map(item => {
+ return { downFile(item.id) }}>{item.fileName}
+ })
+ }
+ },
+
+ {
+ title: '平均分',
+ dataIndex: 'gradesAverage',
+ key: 'gradesAverage',
+ },
+ {
+ title: '评审意见',
+ dataIndex: 'comments',
+ key: 'comments',
+ render: (text, record, index) => {
+ return { writeComments(text, index, 'comments') }}>{record.status === 2 ? '填写' : '查看'}意见
+ }
+ },
+ ];
+
+ // 评分列
+ const gradesColumns = [{
+ title: '评分一',
+ dataIndex: 'gradesOne',
+ key: 'gradesOne',
+ render: (text, record, index) => {
+ return { editGrade(value, index, 'gradesOne') }}
+ />
+ }
+ },
+ {
+ title: '评分二',
+ dataIndex: 'gradesTwo',
+ key: 'gradesTwo',
+ render: (text, record, index) => {
+ return { editGrade(value, index, 'gradesTwo') }}
+ />
+ }
+ },
+ {
+ title: '评分三',
+ dataIndex: 'gradesThree',
+ key: 'gradesThree',
+ render: (text, record, index) => {
+ return { editGrade(value, index, 'gradesThree') }}
+ />
+ }
+ },
+ {
+ title: '评分四',
+ dataIndex: 'gradesFour',
+ key: 'gradesFour',
+ render: (text, record, index) => {
+ return { editGrade(value, index, 'gradesFour') }}
+ />
+ }
+ },
+ {
+ title: '评分五',
+ dataIndex: 'gradesFive',
+ key: 'gradesFive',
+ render: (text, record, index) => {
+ return { editGrade(value, index, 'gradesFive') }}
+ />
+ }
+ }];
+
+ let gradesNum = rules.criterias && rules.criterias.length;
+
+ if (gradesNum) {
+ let thisGradesColumns = gradesColumns.slice(0, gradesNum);
+ columns.splice(3, 0, ...thisGradesColumns);
+ }
+
+ useEffect(() => {
+ let rules = undefined;
+ getRules({ containerId, containerType, statusString: -1 }).then(response => {
+ if (response && response.message === "success") {
+ let criterias = [];
+ response.data.criteriaOne && (criterias[criterias.length] = (criterias.length + 1) + "、" + response.data.criteriaOne);
+ response.data.criteriaTwo && (criterias[criterias.length] = (criterias.length + 1) + "、" + response.data.criteriaTwo);
+ response.data.criteriaThree && (criterias[criterias.length] = (criterias.length + 1) + "、" + response.data.criteriaThree);
+ response.data.criteriaFour && (criterias[criterias.length] = (criterias.length + 1) + "、" + response.data.criteriaFour);
+ response.data.criteriaFive && (criterias[criterias.length] = (criterias.length + 1) + "、" + response.data.criteriaFive);
+ response.data.criterias = criterias;
+ rules = response.data;
+ setRules(rules);
+ }
+ });
+ }, [])
// 获取成果列表
useEffect(() => {
- console.log('current_user.expertId');
- console.log(current_user);
let params = {
taskId,
checkStatus: '1',
@@ -141,6 +184,7 @@ function ReviewTasks({ form, showNotification, match, history, current_user }) {
opsFilesAttachments: item.paperDetail && item.paperDetail.busiAttachments,
opsId: item.id,
opsParentId: containerId,
+ opsParentType: containerType,
opsType: containerType,
status: 2
});
@@ -150,17 +194,39 @@ function ReviewTasks({ form, showNotification, match, history, current_user }) {
}
setDataList(dataArr);
setLoading(false);
- initScoringDetails(dataArr).then(res => {
+ dataArr.length && initScoringDetails(dataArr).then(res => {
console.log(res);
});
});
- }, [taskId,current_user.expertId]);
+ }, [taskId, current_user.expertId]);
function downFile(id) {
let url = httpUrl + '/busiAttachments/download/' + id;
window.open(url);
}
+ function editGrade(value, index, dataIndex) {
+ let dataListNew = dataList.slice();
+
+ // 计算平均分
+ if (gradesNum) {
+ let gradesArr = [];
+ let item = dataListNew[index];
+ typeof item.gradesOne === 'number' && gradesArr.push(item.gradesOne);
+ typeof item.gradesTwo === 'number' && gradesArr.push(item.gradesTwo);
+ typeof item.gradesThree === 'number' && gradesArr.push(item.gradesThree);
+ typeof item.gradesFour === 'number' && gradesArr.push(item.gradesFour);
+ typeof item.gradesFive === 'number' && gradesArr.push(item.gradesFive);
+ if (gradesArr.length === gradesNum) {
+ let sum = gradesArr.reduce((previousValue, currentValue) => { return previousValue + currentValue }, 0);
+ dataListNew[index].gradesAverage = (sum / gradesNum).toFixed(2);
+ }
+ }
+
+ dataListNew[index][dataIndex] = value;
+ setDataList(dataListNew);
+ }
+
// 获取评分列表
useEffect(() => {
setLoading(true);
@@ -168,52 +234,160 @@ function ReviewTasks({ form, showNotification, match, history, current_user }) {
containerId,
containerType,
isDistinct: false,
+ expertId: current_user.expertId,
};
- getScoringDetails(params).then(res => {
- if (res.data && res.data.rows && res.data.rows.length) {
- setDataList(res.data.rows);
+ current_user.expertId && getScoringDetails(params).then(res => {
+ if (res.data && res.data.length) {
+ setDataList(res.data);
setLoading(false);
+ if (res.data[0].status === 1) {
+ setDisabled(true);
+ }
} else {
containerType == 1 ? setTaskId(containerId) : setCompetitionId(containerId);
}
});
- }, [curPage, reload, pageSize]);
-
-
-
- const helper = useCallback(
- (label, name, rules, widget, initialValue) => (
-
- {getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)}
-
- ), []);
+ }, [curPage, reload, pageSize, current_user.expertId, reload]);
function cancel() {
history.go(-1);
}
+ function writeComments(text, index) {
+ setVisible(true);
+ setActiveIndex(index);
+ setComments(text);
+ }
+
+ // 修改意见
+ function commit() {
+ if (comments) {
+ let data = dataList[activeIndex];
+ data.comments = comments;
+ updateScoringDetails([data]).then(res => dealCommitRes(res))
+ }
+ }
+
+ // 提交草稿
+ function draft() {
+ updateScoringDetails(dataList).then(res => dealCommitRes(res));
+ }
+
+ // 提交评审结果
+ function commitGrades() {
+ if (verify()) {
+ Confirm({
+ title: '提醒',
+ okText: '确定提交',
+ content:
+
提交后将完成此次评审,无法继续修改评分与评审意见
+
确定提交此次评审结果?
+
,
+ onOk: () => {
+ let dataArr = dataList.slice();
+ for (const item of dataArr) {
+ item.status = 1;
+ }
+ updateScoringDetails(dataArr).then(res => dealCommitRes(res));
+ }
+ });
+ }
+ }
+
+ // 提交前校验
+ function verify() {
+ let errorArr = [];
+ let scoringArr = [];
+ for (const [index, item] of dataList.entries()) {
+ let gradesArr = [];
+ typeof item.gradesOne === 'number' && gradesArr.push(item.gradesOne);
+ typeof item.gradesTwo === 'number' && gradesArr.push(item.gradesTwo);
+ typeof item.gradesThree === 'number' && gradesArr.push(item.gradesThree);
+ typeof item.gradesFour === 'number' && gradesArr.push(item.gradesFour);
+ typeof item.gradesFive === 'number' && gradesArr.push(item.gradesFive);
+ if (gradesArr.length < gradesNum && gradesArr.length) {
+ errorArr.push(index);
+ } else if (gradesArr.length) {
+ scoringArr.push(index);
+ }
+ }
+
+ if (errorArr.length) {
+ let content = '';
+ for (const item of errorArr) {
+ content += `第${item + 1}行数据请填写完整 `;
+ }
+ Info({
+ title: '提醒',
+ content: content,
+ });
+ }
+
+ if (!scoringArr.length) {
+ Info({
+ title: '提醒',
+ content: '请至少填写一行分数',
+ });
+ }
+
+ return !errorArr.length
+ }
+
+ function dealCommitRes(res) {
+ if (res && res.message) {
+ if (res.message.indexOf("成功")) {
+ showNotification("保存成功");
+ setReload(Math.random());
+ } else {
+ showNotification(res.message);
+ }
+ }
+ }
+
return (
创客成果评审
+
-
{ setActiveKey(activeKey) }}>
+ { setActiveKey(activeKey) }}>
-
-
-
任务信息
- {/*
任务信息
*/}
- {/*
任务名称{taskRecord.name}
*/}
- {/*
任务链接{`/task/taskDetail/${taskRecord.id}`}
*/}
+
+
+
任务信息
+
+
任务名称{rules.containerName}
+
任务链接{`/task/taskDetail/${rules.containerId}`}
+
+
+
+
+
+
+
+
评分标准
+
+ {rules.criterias && rules.criterias.map((item, index) => { return
{item}
})}
+
+
+
+
+
评审时间
+
{rules.reviewStartOn}~{rules.reviewEndOn}
+
+
对单个作品评分时,需填写完整每个评分项,请勿少填、漏填
-
-
-
-
+
+
+
@@ -233,7 +406,26 @@ function ReviewTasks({ form, showNotification, match, history, current_user }) {
+
{ setVisible(false) }}
+ className="form-edit-modal"
+ >
+
+
+
+
)
}
-export default Form.create()(ReviewTasks);
\ No newline at end of file
+export default ReviewTasks;
\ No newline at end of file
diff --git a/src/military/expert/expertUser/taskDetail/index.scss b/src/military/expert/expertUser/taskDetail/index.scss
index 93c3c089..8851facb 100644
--- a/src/military/expert/expertUser/taskDetail/index.scss
+++ b/src/military/expert/expertUser/taskDetail/index.scss
@@ -1,48 +1,86 @@
.register_right.task_detail {
background: #fff;
padding-bottom: 1rem;
-
- .ant-tabs{
+
+ .ant-tabs {
background: #f5f5f5;
- .ant-tabs-content{
+ .ant-tabs-content {
background: #fff;
}
- .ant-tabs-bar{
+ .ant-tabs-bar {
background: #fff;
+ margin-bottom: 1.25rem;
}
- .ant-tabs-tab{
- &:hover{
+ .ant-tabs-tab {
+ margin: 0;
+ padding: 19px 32px;
+ font-size: 1rem;
+ &:hover {
color: #4154f1;
}
}
- .ant-tabs-ink-bar{
+ .ant-tabs-ink-bar {
background-color: #4154f1;
}
}
-
- .ant-tabs-nav .ant-tabs-tab-active{
+ .ant-tabs-nav .ant-tabs-tab-active {
color: #4154f1;
}
-
.task-head {
+ position: relative;
border-bottom: 1px solid #eeeeee;
padding: 0.5em 2em;
color: #181818;
background: #fff;
font-size: 0.8em;
font-weight: bold;
+ .back-button{
+ position: absolute;
+ z-index: 1;
+ right: 1rem;
+ bottom: -108%;
+ }
}
+
+
+
.button-div {
line-height: 1.5;
}
- .pagination-table{
- margin:1.25rem 1.75rem;
+ .pagination-table {
+ margin: .75rem 1.75rem 1.25rem;
+ }
+
+ .task-rules {
+ background: #f5f5f5;
+ .rules-box{
+ margin-bottom: 1.25rem;
+ background: #fff;
+ }
+ .rules-head {
+ font-size: 16px;
+ color: rgba(51, 51, 51, 1);
+ border-bottom: 1px solid #eeeeee;
+ padding: 10px 20px;
+ }
+ .rules-content{
+ padding: 10px 20px 30px;
+ }
+ .rules-content-last{
+ padding: 10px 20px;
+ }
+ .rules-content-item{
+ line-height: 2rem;
+ }
+ }
+
+ .warning{
+ color: #DE0000;
+ font-size: .7rem;
+ margin: .75rem 1.75rem;
}
- // .ant-input-number{
- // width: 60px;
- // }
}
diff --git a/src/military/expert/index.scss b/src/military/expert/index.scss
index 7c6af858..a845859f 100644
--- a/src/military/expert/index.scss
+++ b/src/military/expert/index.scss
@@ -31,10 +31,10 @@
}
.butE3_border {
color: #404660;
- border: 1px solid #E3E7ED;
- &:hover{
- background-color: #F8F8F8;
- border: 1px solid #E3E7ED;
+ border: 1px solid #e3e7ed;
+ &:hover {
+ background-color: #f8f8f8;
+ border: 1px solid #e3e7ed;
}
&:active {
background-color: #f3f3f3;
@@ -45,80 +45,108 @@
.ant-btn-primary {
background-color: #4154f1;
border-color: #4154f1;
- &:hover,&:active,&:focus {
+ &:hover,
+ &:active,
+ &:focus {
background-color: #5d6eff;
border-color: #5d6eff;
}
}
//弹出确认框样式
-.expert_modal .ant-modal-content{
+.expert_modal .ant-modal-content {
width: 550px;
height: 318px;
- & .ant-modal-header{
+ & .ant-modal-header {
padding: 0.6em 2.1em;
- background: #F2F2FF;
+ background: #f2f2ff;
& .ant-modal-title {
text-align: left;
}
}
- & .ant-modal-body{
+ & .ant-modal-body {
padding-left: 120px;
- & p{
+ & p {
font-size: 16px;
color: #666666;
font-family: PingFangSC-Regular, PingFang SC;
line-height: 2.9em;
}
- & .weight_bold{
+ & .weight_bold {
font-weight: bold;
}
- & .warning::before{
- content: url('./image/warning.svg');
+ & .warning::before {
+ content: url("./image/warning.svg");
width: 32px;
position: relative;
top: 11px;
left: -15px;
}
}
- & .ant-btn{
+ & .ant-btn {
padding: 0 1.3em;
height: 2.55em;
border-radius: 4px;
cursor: pointer;
color: #404660;
- border: 1px solid #E3E7ED;
+ border: 1px solid #e3e7ed;
width: 7em;
- &:hover{
- background-color: #F8F8F8;
- border: 1px solid #E3E7ED;
+ &:hover {
+ background-color: #f8f8f8;
+ border: 1px solid #e3e7ed;
}
- &:active{
- background-color: #F3F3F3;
- border: 1px solid #E3E7ED;
+ &:active {
+ background-color: #f3f3f3;
+ border: 1px solid #e3e7ed;
}
}
- & .ant-btn.ant-btn-primary{
+ & .ant-btn.ant-btn-primary {
color: white;
- background-color: #4154F1;
+ background-color: #4154f1;
margin-left: 2.5em;
- &:hover{
- background-color: #5D6EFF;
+ &:hover {
+ background-color: #5d6eff;
}
- &:active{
- background-color: #374BF2;
+ &:active {
+ background-color: #374bf2;
}
}
- & .ant-modal-footer {margin-top: 15px; }
+ & .ant-modal-footer {
+ margin-top: 15px;
+ }
}
-.expert_modal.submit .ant-modal-body{
+.expert_modal.submit .ant-modal-body {
padding-left: 0;
text-align: center;
}
-.ant-form-explain, .ant-form-split {
+.ant-form-explain,
+.ant-form-split {
position: absolute;
margin-top: -5px;
font-size: 12px;
color: #f5222d;
-}
\ No newline at end of file
+}
+
+.form-edit-modal {
+ .ant-modal-header {
+ background: #f2f2ff;
+ padding: 9px 24px;
+ .ant-modal-title {
+ text-align: left;
+ }
+
+
+ }
+
+ .ant-modal-close {
+ top: 0px !important;
+ }
+
+ .ant-modal-body{
+ padding-bottom: 0;
+ }
+ .ant-modal-footer{
+ padding-bottom: 1.5rem;
+ }
+}
diff --git a/src/military/javaFetch.js b/src/military/javaFetch.js
index 90c2ec3f..e9a383a3 100644
--- a/src/military/javaFetch.js
+++ b/src/military/javaFetch.js
@@ -97,14 +97,9 @@ service.interceptors.response.use(
message: "提示",
description: res.data.message || '无权限!',
});
- window.location.href="/403";
- return Promise.reject('error');
- }
- if (res.status === 500) {
- notification.open({
- message: "提示",
- description: res.data.message,
- });
+ if(window.location.port !== "3007"){
+ window.location.href="/403";
+ }
return Promise.reject('error');
}
diff --git a/src/military/task.js b/src/military/task.js
index 7aa3f4ea..2cd35a11 100644
--- a/src/military/task.js
+++ b/src/military/task.js
@@ -51,7 +51,7 @@ const Index = (propsTransmit) => {
})
}, [])
let propsF = { ...propsTransmit };
- propsF.current_user = currentUser;
+ propsF.current_user = {...propsF.current_user,...currentUser};
return (
diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js
index 15aebb9f..f8a1449b 100644
--- a/src/modules/tpm/TPMIndexHOC.js
+++ b/src/modules/tpm/TPMIndexHOC.js
@@ -169,24 +169,28 @@ export function TPMIndexHOC(WrappedComponent, headFoot) {
// 考虑到以后部分系统不会用到专家评审系统,所以这里没有使用Promise.All
getCurrentExpert().then(res => {
- let isExpert = false;
- let expertId = '';
- let expertDraft = false;
- if (res && res.data && res.data.length) {
- for (const item of res.data) {
- if (item.status === 1) {
- isExpert = true;
- expertId = item.id;
- } else {
- expertDraft = true;
+ if(res){
+ let isExpert = false;
+ let expertId = '';
+ let expertDraft = false;
+ if (res && res.data && res.data.length) {
+ for (const item of res.data) {
+ if (item.status === 1) {
+ isExpert = true;
+ expertId = item.id;
+ } else {
+ expertDraft = true;
+ }
}
}
+ const newUser = { ...this.state.current_user, isExpert, expertId, expertDraft };
+ this.setState({
+ user: newUser,
+ current_user: newUser
+ });
}
- const newUser = { ...this.state.current_user, isExpert, expertId, expertDraft };
- this.setState({
- user: newUser,
- current_user: newUser
- });
+ }).catch((error) => {
+ console.log(error)
});
}
}).catch((error) => {