diff --git a/src/military/components/sortBox/index.jsx b/src/military/components/sortBox/index.jsx
index ebfcc7dc..4cb0f4f3 100644
--- a/src/military/components/sortBox/index.jsx
+++ b/src/military/components/sortBox/index.jsx
@@ -1,13 +1,18 @@
-import React, { useEffect, useState ,memo} from 'react';
+import React, { useEffect, useState, memo } from 'react';
import { Icon, } from 'antd';
import classNames from 'classnames';
import './index.scss';
export default memo((props) => {
- const { options, changeOptionId, type, defaultValue } = props;
+ const { options, changeOptionId, type } = props;
- const [myOptions, setMyOptions] = useState(options);
- const [option, setOption] = useState(defaultValue);
+ const [myOptions, setMyOptions] = useState(()=>{
+ return JSON.parse(JSON.stringify(options));
+ });
+ const [option, setOption] = useState({
+ name: '综合',
+ type: 'default',
+ });
useEffect(() => {
changeOptionId(option, type);
@@ -18,15 +23,16 @@ export default memo((props) => {
...activeItem,
desc: !activeItem.desc
};
- for(const item of myOptions){
- if(item.type===activeItem.type){
- item.desc=newOption.desc;
+ for (const item of myOptions) {
+ if (item.type === activeItem.type) {
+ item.desc = newOption.desc;
}
}
setOption(newOption);
setMyOptions(myOptions);
}
+ console.log('-----options----')
return (
diff --git a/src/military/fetch.js b/src/military/fetch.js
index 9ddf58ce..da73e6fd 100644
--- a/src/military/fetch.js
+++ b/src/military/fetch.js
@@ -2,28 +2,6 @@ import { notification } from 'antd';
import axios from 'axios';
import cookie from 'react-cookies';
-<<<<<<< HEAD
-=======
-// export const httpUrl='http://117.50.100.12:8001';
-// export const httpUrl='http://192.168.31.72:8081';
-// export const httpUrl = 'http://106.75.31.211:58088';
-// export const httpUrl = 'http://192.168.31.72:8089';
-<<<<<<< HEAD
-<<<<<<< HEAD
-<<<<<<< HEAD
-// export const httpUrl = 'http://192.168.31.104:8081';
->>>>>>> 09e81b9... 添加成果内容
-=======
-export const httpUrl = 'http://192.168.31.104:8081';
->>>>>>> 6b63cd2... 上传成果修改
-=======
-// export const httpUrl = 'http://192.168.31.104:8081';
-=======
-export const httpUrl = 'http://192.168.31.104:8081';
->>>>>>> 2aa8942... 增加成果审核页面
-
-// export const httpUrl = 'http://192.168.31.168:8081';
->>>>>>> 5131dac... 修复成果提交时的bug,联调我是创客
let actionUrl = '';
@@ -91,10 +69,6 @@ service.interceptors.response.use(
message: "提示",
description: '账户或密码错误!',
});
-<<<<<<< HEAD
-=======
- // window.location.href="/404";
->>>>>>> 09e81b9... 添加成果内容
return Promise.reject('error');
}
if (response.status !== 200 && res.status !== 200) {
diff --git a/src/military/index.scss b/src/military/index.scss
index fc49071c..7964b096 100644
--- a/src/military/index.scss
+++ b/src/military/index.scss
@@ -11,9 +11,6 @@
.color-deep-blue{
color:#1B8FFF;
}
-.text-center{
- text-align: center;
-}
.centerbox {
width: 1200px;
margin: 40px auto;
@@ -30,25 +27,23 @@
}
}
width: 80vw;
- max-width: 1200px;
+ max-width: 1280px;
margin: 40px auto;
position: relative;
}
.center-content {
- padding-top:5px;
background: #fff;
- box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.05);
- border-radius: 5px;
- overflow: auto;
+ border: 1px solid #dedede;
+ box-shadow: #eee 0px 1px 1px 3px;
}
.centerScreen {
display: flex;
justify-content: space-between;
- height: 60px;
+ height: 46px;
background-color: #fff;
border-bottom: 1px solid #dedede;
+}
-<<<<<<< HEAD
// 内容标题左侧样式
.center-left-but {
display: flex;
@@ -76,8 +71,6 @@
.center-left-butDACT {
background-color: #409eff;
color: #fff;
-=======
->>>>>>> 216e984... 上传我的成果静态页面
}
.head-navigation {
@@ -137,7 +130,6 @@
max-width: 500px;
}
-<<<<<<< HEAD
.link{
color: #0089ff;
cursor: pointer;
@@ -156,9 +148,6 @@
}
.none_panels{
-=======
-.none_panels {
->>>>>>> 2ed7e0d... 上传创客新增任务及列表代码
display: flex;
justify-content: center;
align-items: center;
@@ -173,7 +162,6 @@
text-align: left;
}
-<<<<<<< HEAD
// 富文本样式
.w-e-text table td, .w-e-text table th{
height: 30px;
@@ -217,69 +205,3 @@
width: 98%;
}
}
-=======
-
-.ant-modal-footer{
- text-align: center;
- border: 0;
-}
-<<<<<<< HEAD
->>>>>>> 92f3934... 上传我的需求及
-=======
-
-// 富文本样式
-.w-e-text table td, .w-e-text table th{
- height: 30px;
-}
-// 富文本生成的内容的样式
-.editor-w-text table td, .editor-w-text table th{
- border-bottom: 1px solid #ccc;
- border-right: 1px solid #ccc;
- padding: 3px 5px;
- height: 30px;
- min-height: 30px;
-}
-.editor-w-text table th {
- border-bottom: 2px solid #ccc;
- text-align: center;
- background-color: #f1f1f1;
-}
-.editor-w-text table {
- border-top: 1px solid #ccc;
- border-left: 1px solid #ccc;
-}
-.editor-w-text blockquote {
- display: block;
- border-left: 8px solid #d0e5f2;
- padding: 5px 10px;
- margin: 10px 0;
- line-height: 1.4;
- font-size: 100%;
- background-color: #f1f1f1;
-}
-.user-box{
- cursor: pointer;
- &:hover{
- color: #409eff;
- }
-}
-
-
-@media screen and (max-width: 1200px){
- .centerbox {
- width: 100vw;
- }
- .newHeaders{
- min-width: 325px;
- }
- .newContainers{
- min-width: 325px;
- .newMain{
- min-width: 325px;
- }
- }
- .newFooter{
- min-width: 325px;
- }
-}
->>>>>>> 216e984... 上传我的成果静态页面
diff --git a/src/military/task.js b/src/military/task.js
index aabb29b1..4eaaa264 100644
--- a/src/military/task.js
+++ b/src/military/task.js
@@ -1,4 +1,4 @@
-import React, { Component } from "react";
+import React, { Component, useEffect, useState } from "react";
import { Route, Switch } from "react-router-dom";
import { withRouter } from "react-router";
@@ -7,6 +7,7 @@ import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC";
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
import Loadable from "react-loadable";
import Loading from "../Loading";
+import { getUserInfo } from './task/api';
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
import './index.scss';
@@ -40,67 +41,93 @@ const PaperManage = Loadable({
loading: Loading,
});
-class Index extends Component {
- render() {
- return (
-
-
+const PaperComplain = Loadable({
+ loader: () => import("./task/paperComplain"),
+ loading: Loading,
+});
- (
-
- )}
- >
-
- (
-
- )}
- >
-
- (
-
- )}
- >
-
- (
-
- )}
- >
-
- (
-
- )}
- >
-
- (
-
- )}
- >
-
- (
-
- )}
- >
-
-
-
-
- );
+const Index = (propsTransmit) => {
+ // 开发时,从代理的位置获取用户信息
+ const [currentUser, setCurrentUser] = useState(null);
+ const isDev = window.location.href.indexOf('3007') > -1 ? true : false;
+ useEffect(() => {
+ isDev && getUserInfo().then(res => {
+ if (res && res.data) {
+ setCurrentUser(res.data);
+ }
+ })
+ }, [isDev])
+ let propsF = { ...propsTransmit };
+ if (isDev && currentUser) {
+ propsF.current_user = currentUser;
}
+
+ return (
+
+
+
+ (
+
+ )}
+ >
+
+ (
+
+ )}
+ >
+
+ (
+
+ )}
+ >
+
+ (
+
+ )}
+ >
+
+ (
+
+ )}
+ >
+
+ (
+
+ )}
+ >
+
+ (
+
+ )}
+ >
+
+ (
+
+ )}
+ >
+
+
+
+
+ );
}
+// }
export default withRouter(
ImageLayerOfCommentHOC({
imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
diff --git a/src/military/task/api.js b/src/military/task/api.js
index 9f3d4e3a..29d2df67 100644
--- a/src/military/task/api.js
+++ b/src/military/task/api.js
@@ -1,4 +1,4 @@
-import fetch from '../fetch';
+import fetch,{} from '../fetch';
import { notification } from 'antd';
// 获取字典分类列表
@@ -9,6 +9,14 @@ export function getDictionary(id) {
});
}
+// 获取用户信息
+export function getUserInfo() {
+ return fetch({
+ url: '/user/getUserInfo',
+ method: 'get'
+ });
+}
+
// 获取任务领域
export async function getTaskCategory() {
let res = await fetch({
@@ -250,6 +258,43 @@ export function checkPaper(data){
return fetch({
url: `/api/paper/admin/complainPaper/${data.paperId}`,
method: 'post',
- data: data
+ data: data.auditingVo
});
}
+
+// 成果申诉
+export function complainPaper(data){
+ return fetch({
+ url: `/api/paper/complainInfo/${data.paperId}`,
+ method: 'post',
+ data: data.params
+ });
+}
+
+// 审核申诉材料列表查询
+export async function complainPaperList(params) {
+ let res = await fetch({
+ url: '/api/paper/admin/readyComplaintPapers',
+ method: 'get',
+ params,
+ });
+ if (res.data) {
+ return res.data;
+ } else {
+ notification.open({
+ message: "提示",
+ description: res.message || '请求错误',
+ });
+ }
+}
+
+// 审核申诉材料
+export function checkComplain(data){
+ return fetch({
+ url: `/api/paper/admin/complainMaterial/${data.paperId}`,
+ method: 'post',
+ data: data.auditingVo
+ });
+}
+
+
diff --git a/src/military/task/components/itemListMyTask/index.jsx b/src/military/task/components/itemListMyTask/index.jsx
index e0466394..f1f1cc7e 100644
--- a/src/military/task/components/itemListMyTask/index.jsx
+++ b/src/military/task/components/itemListMyTask/index.jsx
@@ -1,9 +1,11 @@
-import React, { useEffect, useState } from 'react';
+import React, { useEffect, useState, useCallback } from 'react';
import { Modal, Pagination } from 'antd';
import { Link } from "react-router-dom";
import Nodata from 'forge/Nodata';
import Loading from "src/Loading";
+import ProofModal from '../proofModal';
import { publishModeArr, taskStatusAllArr } from '../../static';
+import '../../index.scss';
import './index.scss';
const statusArr = [];
@@ -11,11 +13,11 @@ for (const item of taskStatusAllArr) {
statusArr[item.dicItemCode] = item.dicItemName;
}
export default (props) => {
- const { list, curPage, total, changePage, taskCategoryValueArr, loading, publish } = props;
+ const { list, curPage, total, changePage, taskCategoryValueArr, loading, publish, } = props;
const [page, setPage] = useState(1);
const [visibleProofs, setVisibleProofs] = useState(false);
- const [activeItem, setActiveItem] = useState({});
+ const [taskId, setTaskId] = useState({});
const pageSize = props.pageSize || 10;
useEffect(() => {
@@ -24,13 +26,13 @@ export default (props) => {
function uploadProofs(item) {
setVisibleProofs(true);
- setActiveItem(item);
+ setTaskId(item.id);
}
- function repairAdvice(repairAdvice){
+ function repairAdvice(repairAdvice) {
Modal.info({
title: '审核意见',
- content:repairAdvice
+ content: repairAdvice
})
}
@@ -81,9 +83,11 @@ export default (props) => {
}
{item.status === 4 &&
成果评选}
- {item.status === 4 && item.papersCount && (!item.isProofBoolean) &&
{ uploadProofs(item) }} className="line_1 color-blue">上传佐证材料}
+ {
+ // item.status === 4 && item.papersCount && (!item.isProofBoolean) &&
+
{ uploadProofs(item) }} className="line_1 color-blue">上传佐证材料}
- {(item.status === 9 || item.status === 2) &&
{ repairAdvice(item.repairAdvice) }} className="line_1 color-blue">审核意见}
+ {(item.status === 9) &&
{ repairAdvice(item.repairAdvice) }} className="line_1 color-blue">审核意见}
{/*
支付登记 */}
{/*
上传支付凭证 */}
@@ -108,31 +112,12 @@ export default (props) => {
}
-
{ setVisibleProofs(false) }}
- className="form-edit-modal"
- >
- {/*
-
-
-
-
-
-
-
- */}
-
+ changeVisible={setVisibleProofs}
+ />
)
-}
\ No newline at end of file
+}
diff --git a/src/military/task/components/itemListPaper/index.jsx b/src/military/task/components/itemListPaper/index.jsx
index 3abad470..469f7d44 100644
--- a/src/military/task/components/itemListPaper/index.jsx
+++ b/src/military/task/components/itemListPaper/index.jsx
@@ -1,11 +1,12 @@
-import React, { useEffect, useState } from 'react';
-import { Pagination, Modal, Input, Button } from 'antd';
+import React, { useEffect, useState, useCallback } from 'react';
+import { Pagination, Modal, Form, Input, Button } from 'antd';
import ReactWEditor from 'wangeditor-for-react';
import { getImageUrl, timeAgo } from 'educoder';
import Nodata from 'forge/Nodata';
import Loading from "src/Loading";
import { editorConfig } from 'military/components/config';
-import { reportPaper, thumbUpPaper, commentAdd } from '../../api';
+import Upload from 'military/components/Upload';
+import { reportPaper, thumbUpPaper, commentAdd, complainPaper } from '../../api';
import { httpUrl } from '../../../fetch';
import winpng from '../../image/win.png';
@@ -13,12 +14,11 @@ import './index.scss';
const { TextArea } = Input;
-export default (props) => {
- const { list, curPage, total, changePage, loading, applyStatusAllNameArr, reloadList, showNotification } = props;
+export default Form.create()((props) => {
+ const { list, curPage, total, changePage, loading, applyStatusAllNameArr, reloadList, showNotification, current_user, form } = props;
+ const { getFieldDecorator, validateFields, } = form;
const [page, setPage] = useState(1);
- const [pageSize, setPageSize] = useState(() => {
- return props.pageSize || 10;
- });
+ const pageSize = props.pageSize || 10;
const [checkedItem, setCheckedItem] = useState({});
const [reportVisible, setReportVisible] = useState(false);
const [reportValue, setReportValue] = useState('');
@@ -26,6 +26,10 @@ export default (props) => {
const [commentId, setCommentId] = useState(undefined);
+ const [complainVisible, setComplainVisible] = useState(false);
+ const [complainValue, setComplainValue] = useState('');
+ const [fileList, setFileList] = useState(null);
+
useEffect(() => {
changePage(page);
}, [page]);
@@ -36,17 +40,18 @@ export default (props) => {
}
function report() {
- if (!reportValue) {
- return;
- }
- reportPaper({
- paperId: checkedItem.id,
- content: reportValue
- }).then(res => {
- if (res.message === 'success') {
- showNotification('举报成功');
- setReportVisible(false);
- setReportValue('');
+ validateFields((error, values) => {
+ if (!error) {
+ reportPaper({
+ paperId: checkedItem.id,
+ content: values.reportValue
+ }).then(res => {
+ if (res.message === 'success') {
+ showNotification('举报成功');
+ setReportVisible(false);
+ setReportValue('');
+ }
+ });
}
});
}
@@ -92,6 +97,49 @@ export default (props) => {
window.location.href = `/users/${login}`;
}
+ function complain() {
+ if (!fileList || !fileList.length) {
+ showNotification('请提交申诉文件!');
+ return;
+ }
+ validateFields((error, values) => {
+ if (!error) {
+ let files = [];
+ for (const item of fileList) {
+ files.push(item.id || item.response.data.id);
+ }
+ complainPaper({
+ paperId: checkedItem.id,
+ params: {
+ content: values.complainValue,
+ files: files.join()
+ }
+ }).then(res => {
+ if (res.message === 'success') {
+ showNotification('申诉提交成功');
+ setComplainVisible(false);
+ setComplainValue('');
+ setFileList(null);
+ }
+ });
+ }
+ });
+ }
+
+ // 上传附件后得到的文件数组
+ function UploadFunc(fileList) {
+ setFileList(fileList);
+ }
+
+ const helper = useCallback(
+ (name, rules, widget) => (
+
+ {getFieldDecorator(name, { rules, validateFirst: true })(widget)}
+
+ ),
+ []
+ );
+
return (
{loading ? :
@@ -110,13 +158,16 @@ export default (props) => {
{item.user.nickname || item.user.login}
{timeAgo(item.createdAt)}
- {!item.verifyStatus && "待审核"}
+ {item.verifyStatus ? applyStatusAllNameArr[item.status] : "待审核"}
-
+ {/*
{applyStatusAllNameArr[item.status]}
-
+ */}
+ {item.needComplain && (current_user.login === item.user.login) && { setComplainVisible(true); setCheckedItem(item) }}>
+ 申诉
+ }
@@ -203,17 +254,64 @@ export default (props) => {
onOk={report}
onCancel={() => { setReportVisible(false) }}
className="form-edit-modal"
+ >
+
+
你的举报信息将发送给平台管理员
+
请如实填写有效的举报原由,我们将尽快完成审核
+ {
+ helper('reportValue', [{ required: reportVisible, message: "(必填)请在此输入发起举报的原因,最大限制100个字符" },
+ { max: 100, message: '长度不能超过100个字符' }],
+
+
+
+
+ { setComplainVisible(false) }}
+ className="form-edit-modal"
>
你的申诉信息将发送给平台管理员
请如实填写有效的申诉原由,我们将尽快完成审核
-
@@ -222,4 +320,5 @@ export default (props) => {
)
}
+)
diff --git a/src/military/task/components/itemListTask/index.jsx b/src/military/task/components/itemListTask/index.jsx
index 36402d63..cd865d6a 100644
--- a/src/military/task/components/itemListTask/index.jsx
+++ b/src/military/task/components/itemListTask/index.jsx
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import { Icon, Pagination } from 'antd';
import { formatDuring } from 'educoder';
import Nodata from 'forge/Nodata';
-import { taskStatusAllArr} from '../../static';
+import { taskStatusAllArr } from '../../static';
import Loading from "src/Loading";
import winpng from '../../image/win.png';
import './index.scss';
@@ -27,7 +27,7 @@ export default (props) => {
}
function surplusTime(item) {
- let surplus = item.collectingDays * 24 * 3600 - (new Date() - new Date(item.publishedAt)) / 1000;
+ let surplus = item.collectingDays * 24 * 3600 * 1000 - (new Date() - new Date(item.publishedAt || item.createdAt));
return formatDuring(surplus)
}
diff --git a/src/military/task/components/itemTaskManage/index.jsx b/src/military/task/components/itemTaskManage/index.jsx
index 02359292..3ba8b804 100644
--- a/src/military/task/components/itemTaskManage/index.jsx
+++ b/src/military/task/components/itemTaskManage/index.jsx
@@ -3,7 +3,7 @@ import { Pagination, Modal, Input, Radio } from 'antd';
import { Link } from "react-router-dom";
import Nodata from 'forge/Nodata';
import Loading from "src/Loading";
-import { timeAgo } from 'educoder';
+import { timeAgo } from 'educoder';
import { checkTask } from '../../api';
import './index.scss';
import winpng from '../../image/win.png';
@@ -31,7 +31,7 @@ export default (props) => {
id,
isPassed: 1,
}).then(res => {
- if (res.message === 'success') {
+ if (res && res.message === 'success') {
showNotification('操作成功');
reloadList();
}
@@ -57,7 +57,7 @@ export default (props) => {
isRepairDocument,
repairAdvice: repairAdvice
}).then(res => {
- if (res.message === 'success') {
+ if (res && res.message === 'success') {
showNotification('操作成功');
reloadList();
setRepairAdvice('');
diff --git a/src/military/task/components/proofModal/index.jsx b/src/military/task/components/proofModal/index.jsx
new file mode 100644
index 00000000..5022c6a6
--- /dev/null
+++ b/src/military/task/components/proofModal/index.jsx
@@ -0,0 +1,104 @@
+import React, { useEffect, useState, useCallback } from 'react';
+import { Modal, Table, Radio, Form, Input, Button, Pagination } from 'antd';
+import { Link } from "react-router-dom";
+import Nodata from 'forge/Nodata';
+import Loading from "src/Loading";
+import { getTaskPaper } from "../../api";
+import '../../index.scss';
+import './index.scss';
+
+
+export default Form.create()((props) => {
+ const { changeVisible, taskId, visible, form } = props;
+ const { getFieldDecorator, validateFields, setFieldsValue, } = form;
+
+ const pageSize = props.pageSize || 10;
+ const [searchObj, setSearchObj] = useState({});
+ const [loading, setLoading] = useState(false);
+ const [curPage, setCurPage] = useState(1);
+ const [total, setTotal] = useState(0);
+ const [dataList, setDataList] = useState([]);
+
+ // 获取成果列表
+ useEffect(() => {
+ setLoading(true);
+ let params = {
+ taskId,
+ orderBy: '',
+ pageSize: 10,
+ curPage,
+ status: '',
+ }
+ taskId && getTaskPaper(params).then(data => {
+ if (data && Array.isArray(data.rows)) {
+ for (const item of data.rows) {
+ item.detail = item.paperDetail.content;
+ }
+ }
+ setDataList(data.rows || []);
+ setLoading(false);
+ setTotal(data.total);
+ });
+ }, [taskId, curPage,]);
+
+
+ const helper = useCallback(
+ (name, rules, widget) => (
+
+ {getFieldDecorator(name, { rules, validateFirst: true, })(widget)}
+
+ ), []);
+
+ function onSearch() {
+ validateFields((err, values) => {
+ if (!err) {
+ setSearchObj(values);
+ }
+ });
+ }
+
+ function clearSearch() {
+ setFieldsValue({
+ numberInput: '',
+ nameInput: '',
+ enterpriseNameInput: ''
+ });
+ setSearchObj({});
+ }
+
+ return (
+
+ { changeVisible(false) }}
+ className="task-manage proof-modal"
+ >
+ 选出胜出者*
+
+ {helper(
+ "numberInput",
+ [{ max: 20, message: '长度不能超过20个字符' }],
+
+ )}
+
+ {helper(
+ "author",
+ [{ max: 20, message: '长度不能超过20个字符' }],
+
+ )}
+
+
+
+
+
+
+
+ )
+}
+)
\ No newline at end of file
diff --git a/src/military/task/components/proofModal/index.scss b/src/military/task/components/proofModal/index.scss
new file mode 100644
index 00000000..e69de29b
diff --git a/src/military/task/index.scss b/src/military/task/index.scss
index 2480e54b..9aaefd11 100644
--- a/src/military/task/index.scss
+++ b/src/military/task/index.scss
@@ -17,11 +17,15 @@
border-radius: 1rem;
margin-right: 0.5rem;
}
+
}
- .ant-form-item {
- margin: 0 1rem 0 0;
+ .center-right-but{
+ .ant-form-item {
+ margin: 0 1rem 0 0;
+ }
}
+
.ant-form-item-control-wrapper {
display: inline-block;
}
@@ -43,4 +47,34 @@
font-size: 1rem;
}
}
+
+ .text-ellipsis {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ // white-space: nowrap;
+ word-break: break-all;
+ }
+
+ .text-ellipsis-2 {
+ text-overflow: -o-ellipsis-lastline;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ display: -webkit-box;
+ -webkit-line-clamp: 2;
+ line-clamp: 2;
+ -webkit-box-orient: vertical;
+ }
+}
+
+.ant-pagination{
+ margin:2rem auto;
+ text-align: center;
+}
+
+.proof-modal{
+ min-width: 800px;
+ width: 80vw;
+ .ant-form-item-control{
+ width: 200px;
+ }
}
diff --git a/src/military/task/myTask/joinTask.jsx b/src/military/task/myTask/joinTask.jsx
index f10fc35a..c635a2be 100644
--- a/src/military/task/myTask/joinTask.jsx
+++ b/src/military/task/myTask/joinTask.jsx
@@ -1,15 +1,15 @@
-import React, { useCallback, useEffect, useState } from 'react';
+import React, { useCallback, useEffect, useState, useMemo } from 'react';
import { Tabs, Input, Table, Pagination } from 'antd';
import { Link } from "react-router-dom";
import ChooseNav from '../../components/chooseNav';
import ItemListMyTask from '../components/itemListMyTask';
import { taskStatusAllArr, applyStatusArr, publishModeArr } from '../static';
-import { getJoinTaskList } from '../api';
+import { getJoinTaskList,getTaskPaper } from '../api';
import './index.scss';
const Search = Input.Search;
const { TabPane } = Tabs;
-const publishStatusArr = taskStatusAllArr.slice(3,9);
+const publishStatusArr = taskStatusAllArr.slice(3, 9);
const statusArr = [];
for (const item of taskStatusAllArr) {
@@ -51,55 +51,55 @@ export default ({ taskCategoryValueArr }) => {
}, [paperStatusString, taskStatusString, searchInput, orderBy, curPage]);
- // const columns = useCallback(()=>{
- const columns = [
- {
- title: '任务',
- dataIndex: 'name',
- },
- {
- title: '类型',
- dataIndex: 'createdAt',
- render: (text, record) => {
- return
- {taskCategoryValueArr[record.categoryId]}
- {publishModeArr[record.publishMode]}
-
- }
- },
- {
- title: '应征投稿',
- dataIndex: 'papersCount',
- render: (text) => {
- return text || 0
- }
- },
- {
- title: '金额',
- dataIndex: 'bounty',
- render: (text) => {
- return ¥{text}
- }
- },
- {
- title: '任务状态',
- dataIndex: 'status',
- render: (text, record) => {
- return statusArr[text]
- }
- },
+ const columns = useMemo(() => {
+ return [
+ {
+ title: '任务',
+ dataIndex: 'name',
+ },
+ {
+ title: '类型',
+ dataIndex: 'createdAt',
+ render: (text, record) => {
+ return
+ {taskCategoryValueArr[record.categoryId]}
+ {publishModeArr[record.publishMode]}
+
+ }
+ },
+ {
+ title: '应征投稿',
+ dataIndex: 'papersCount',
+ render: (text) => {
+ return text || 0
+ }
+ },
+ {
+ title: '金额',
+ dataIndex: 'bounty',
+ render: (text) => {
+ return ¥{text}
+ }
+ },
+ {
+ title: '任务状态',
+ dataIndex: 'status',
+ render: (text, record) => {
+ return statusArr[text]
+ }
+ },
- {
- title: '操作',
- key: 'action',
- render: (text, record) => (
-
- 查看详情
-
- ),
- },
- ];
- // },[taskCategoryValueArr,publishModeArr,statusArr]);
+ {
+ title: '操作',
+ key: 'action',
+ render: (text, record) => (
+
+ 查看详情
+
+ ),
+ },
+ ];
+ }, [taskCategoryValueArr, publishModeArr, statusArr]);
diff --git a/src/military/task/paperComplain/index.js b/src/military/task/paperComplain/index.js
new file mode 100644
index 00000000..691d0133
--- /dev/null
+++ b/src/military/task/paperComplain/index.js
@@ -0,0 +1,214 @@
+import React, { useCallback, useMemo, useEffect, useState } from 'react';
+import { Input, Button,Radio, Form,Table,Pagination,Modal } from 'antd';
+import { Link } from "react-router-dom";
+import ItemTaskManage from '../components/itemTaskManage';
+import StatusNav from '../../components/statusNav';
+import { approveArr } from '../static';
+import { complainPaperList ,checkComplain} from '../api';
+import '../index.scss';
+
+const TextArea = Input.TextArea;
+
+export default Form.create()(({ current_user, form, showNotification, match, history }) => {
+ const { getFieldDecorator, validateFields, setFieldsValue, getFieldsValue } = form;
+
+ const [approve,setApprove]=useState(1);
+ const [loading, setLoading] = useState(false);
+ const [searchObj, setSearchObj] = useState({});
+ const [curPage, setCurPage] = useState(1);
+ const [total, setTotal] = useState(0);
+ const [taskList, setTaskList] = useState([]);
+
+ const [reload, setReload] = useState(0);
+ const [visible, setVisible] = useState(false);
+ const [activeId, setActiveId] = useState('');
+ const [message, setMessage] = useState('');
+
+
+ useEffect(() => {
+ const params = {
+ ...searchObj,
+ curPage,
+ pageSize: 10,
+ };
+ setLoading(true);
+ complainPaperList(params).then(data => {
+ if (data) {
+ setTaskList(data.rows);
+ setTotal(data.total);
+ }
+ setLoading(false);
+ })
+ }, [reload, curPage, searchObj]);
+
+
+ const helper = useCallback(
+ (name, rules, widget) => (
+
+ {getFieldDecorator(name, { rules, validateFirst: true, })(widget)}
+
+ ), []);
+
+
+ function onSearch() {
+ validateFields((err, values) => {
+ if (!err) {
+ setSearchObj(values);
+ }
+ });
+ }
+
+ function clearSearch() {
+ setFieldsValue({
+ numberInput: '',
+ nameInput: '',
+ enterpriseNameInput: ''
+ });
+ setSearchObj({});
+ }
+
+
+ function changeApprove(approve) {
+ setApprove(approve);
+ setCurPage(1);
+ // if (approve === 1) {
+ // setStatusString('1');
+ // } else {
+ // setStatusString('2,3,4,5,6,7,8');
+ // }
+ }
+
+
+
+ const columns = useMemo(() => {
+ return [
+ {
+ title: '来源任务',
+ dataIndex: 'name',
+ width: "20%",
+ render: (text, record) => (
+
+ {text}
+
+ ),
+ },
+ {
+ title: '评论/成果内容',
+ dataIndex: 'content',
+ width: "30%",
+ render: (text, record) => {
+ return record.paperDetail ? : ''
+ }
+ },
+ {
+ title: '评论/提交者',
+ dataIndex: 'user',
+ render: (text, record) => {
+ return record.user.nickname || record.user.login
+ }
+ },
+ {
+ title: '评论/提交时间',
+ dataIndex: 'createdAt',
+ },
+ {
+ title: '审核状态',
+ dataIndex: 'verifyStatus',
+ render: (text, record) => {
+ return text ? '通过' : '未通过'
+ }
+ },
+ {
+ title: '操作',
+ key: 'action',
+ render: (text, record) => (
+
+
+
+ {/* 查看详情 */}
+
+ ),
+ },
+ ]
+ }, []);
+
+ function checkPaperItem(paperId, pass) {
+ setLoading(true);
+ checkComplain({
+ paperId,
+ auditingVo: {
+ pass,
+ message,
+ }
+ }).then(res => {
+ if (res && res.message === 'success') {
+ setReload(reload + 1);
+ setVisible(false);
+ }
+ setLoading(false);
+ });
+ }
+
+ return (
+
+
+
+
+
+
+
+
+
+ {helper(
+ "numberInput",
+ [{ max: 20, message: '长度不能超过20个字符' }],
+
+ )}
+
+
+
+
+
+
+
+
+
+
row.id}
+ dataSource={taskList}
+ columns={columns}
+ pagination={false}
+ className="mt10"
+ />
+ {total > 10 &&
+ { setCurPage(page) }}
+ current={curPage}
+ total={total}
+ />}
+
+
+
+ { checkPaperItem(activeId, 0) }}
+ onCancel={() => { setVisible(false) }}
+ className="form-edit-modal"
+ >
+
+
+ )
+}
+)
\ No newline at end of file
diff --git a/src/military/task/paperManage/index.jsx b/src/military/task/paperManage/index.jsx
index 43e71c71..3b27a8be 100644
--- a/src/military/task/paperManage/index.jsx
+++ b/src/military/task/paperManage/index.jsx
@@ -1,4 +1,4 @@
-import React, { useCallback, forwardRef, useEffect, useState, useMemo } from 'react';
+import React, { useCallback, useEffect, useState, useMemo } from 'react';
import { Input, Radio, Select, Button, Form, DatePicker, Table, Pagination, Modal } from 'antd';
import { Link } from "react-router-dom";
import { paperVerifyStatusArr } from '../static';
@@ -76,17 +76,19 @@ export default Form.create()(({ current_user, form, showNotification, match, his
{
title: '来源任务',
dataIndex: 'name',
+ width: "20%",
render: (text, record) => (
- {text}
+ {text}
),
},
{
title: '评论/成果内容',
dataIndex: 'content',
+ width: "30%",
render: (text, record) => {
- return record.paperDetail ? : ''
+ return record.paperDetail ? : ''
}
},
{
@@ -99,7 +101,6 @@ export default Form.create()(({ current_user, form, showNotification, match, his
{
title: '评论/提交时间',
dataIndex: 'createdAt',
-
},
{
title: '审核状态',
@@ -123,6 +124,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
}, []);
function checkPaperItem(paperId, passStatus) {
+ setLoading(true);
checkPaper({
paperId,
auditingVo: {
@@ -130,7 +132,14 @@ export default Form.create()(({ current_user, form, showNotification, match, his
message,
}
}).then(res => {
- console.log(res);
+ if (res && res.message === 'success') {
+ setReload(reload + 1);
+ setVisible(false);
+ // if (taskList.length === 1) {
+ // setCurPage(curPage - 1 || 1);
+ // }
+ }
+ setLoading(false);
});
}
@@ -199,7 +208,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
pagination={false}
className="mt10"
/>
- {taskList.length > 10 &&
+ {total > 10 &&
{ setCurPage(page) }}
current={curPage}
diff --git a/src/military/task/taskDetail/index.jsx b/src/military/task/taskDetail/index.jsx
index a63bc2c2..4bff220b 100644
--- a/src/military/task/taskDetail/index.jsx
+++ b/src/military/task/taskDetail/index.jsx
@@ -1,4 +1,4 @@
-import React, { forwardRef, useEffect, useState, useCallback } from 'react';
+import React, { forwardRef, useEffect, useState, useCallback, useMemo } from 'react';
import { Form, Input, Button, Modal, Table, Pagination, Checkbox, Tooltip } from 'antd';
import classNames from 'classnames';
import { Link } from "react-router-dom";
@@ -48,6 +48,7 @@ const columns = [
export default Form.create()(
forwardRef(({ match, current_user, form, history, showNotification }, ref) => {
+ console.log(current_user);
const id = match.params.taskId;
const { getFieldDecorator, validateFields, setFieldsValue } = form;
@@ -108,6 +109,15 @@ export default Form.create()(
})
}, []);
+ const taskLimit = useMemo(() => {
+ if (current_user.admin) {
+ return true;
+ }
+ if (detailData.user) {
+ return current_user.login === detailData.user.login
+ }
+ }, [detailData, current_user])
+
// 获取协议内容
useEffect(() => {
applyModal && getAgreement().then(res => {
@@ -142,13 +152,12 @@ export default Form.create()(
});
}, [id, status, curPage, reload, relaodChildList]);
- ;
// 流程步骤显示
const process = useCallback((title, status, days) => {
let surplusTimetext = '';
if (detailData.status === status) {
- let surplus = detailData.collectingDays * 24 * 3600 - (new Date() - new Date(detailData.publishedAt)) / 1000;
+ let surplus = detailData.collectingDays * 24 * 3600 * 1000 - (new Date() - new Date(detailData.publishedAt || detailData.createdAt));
if (status === 4) {
surplus += detailData.choosingDays * 24 * 3600;
}
@@ -166,7 +175,7 @@ export default Form.create()(
return (
= status) })} >
{title}
- {detailData.status !== status && {days}天
}
+ {detailData.status !== status && days && {days}天
}
{detailData.status === status && detailData.delayTime && {detailData.delayTime}
}
@@ -251,15 +260,21 @@ export default Form.create()(
content: '暂无应征者提交',
});
} else {
- updateTask({
- ...detailData,
- id,
- showUserStatus: 1,
- }).then(res => {
- if (res && res.message === 'success') {
- setDetailData(res.data || {});
- } else {
- showNotification('操作失败');
+ Modal.confirm({
+ title: '提示',
+ content: '确认公示应征者信息',
+ onOk: () => {
+ updateTask({
+ ...detailData,
+ id,
+ showUserStatus: true,
+ }).then(res => {
+ if (res && res.message === 'success') {
+ setDetailData(res.data || {});
+ } else {
+ showNotification('操作失败');
+ }
+ })
}
})
}
@@ -281,8 +296,8 @@ export default Form.create()(
{helper(
"",
"content",
- [{ required: true, message: "请根据具体要求提交有效的稿件,才能打动需求方哟!" },
- { max: 1000, message: '长度不能超过1000个字符' }],
+ [{ required: true, message: "请根据具体要求提交有效的稿件,才能打动需求方哟!成果描述不能超过250字哟!" },
+ { max: 250, message: '长度不能超过250个字符' }],