From 9c3ecabf475bfaa550f70ee4a6f7b3d383296c4d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <792998983@qq.com>
Date: Wed, 14 Jul 2021 20:19:43 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=AE=A1=E7=90=86=E5=91=98?=
=?UTF-8?q?=E7=BB=9F=E7=AD=B9=E6=89=80=E6=9C=89=E4=BB=BB=E5=8A=A1=E7=9A=84?=
=?UTF-8?q?=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/military/fetch.js | 4 +-
src/military/task/agreementManage/index.js | 48 +++++---
src/military/task/api.js | 17 ---
.../components/itemAgreementManage/index.jsx | 28 ++++-
.../itemPublicityComplain/index.jsx | 2 +-
src/military/task/taskAdmin/index.jsx | 113 +++++++++++++-----
src/military/task/taskAdmin/index.scss | 46 +++++--
src/military/task/taskManage/index.js | 5 +-
8 files changed, 180 insertions(+), 83 deletions(-)
diff --git a/src/military/fetch.js b/src/military/fetch.js
index 418d3fbf..768a11e9 100644
--- a/src/military/fetch.js
+++ b/src/military/fetch.js
@@ -3,12 +3,12 @@ import axios from 'axios';
import cookie from 'react-cookies';
// export const httpUrl='http://117.50.100.12:8001';
-// export const httpUrl='http://192.168.31.72:8081';
+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';
// export const httpUrl = 'http://192.168.31.104:8081';
-export const httpUrl = 'http://192.168.31.168:8081';
+// export const httpUrl = 'http://192.168.31.168:8081';
const TokenKey = 'autologin_forge_military';
diff --git a/src/military/task/agreementManage/index.js b/src/military/task/agreementManage/index.js
index 50eb9537..11401c11 100644
--- a/src/military/task/agreementManage/index.js
+++ b/src/military/task/agreementManage/index.js
@@ -1,13 +1,16 @@
import React, { useCallback, forwardRef, useEffect, useState } from 'react';
-import { Input, Button, Form } from 'antd';
+import { Input, Button, Form, Select } from 'antd';
import ItemAgreementManage from '../components/itemAgreementManage';
import StatusNav from '../../components/statusNav';
import { agreementArr } from '../static';
import { agreementList } from '../api';
import '../index.scss';
+const Option = Select.Option;
-const agreementOptionArr=agreementArr.slice(0,2);
+const agreementOptionArr = agreementArr.slice(0, 2);
export default Form.create()(({ current_user, form, showNotification, match, history }) => {
+
+
const { getFieldDecorator, validateFields, setFieldsValue, getFieldsValue } = form;
const [approve, setApprove] = useState(1);
@@ -17,6 +20,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
const [curPage, setCurPage] = useState(1);
const [total, setTotal] = useState(0);
const [taskList, setTaskList] = useState([]);
+ const [type, setType] = useState('1');
const [reload, setReload] = useState(0);
@@ -24,8 +28,8 @@ export default Form.create()(({ current_user, form, showNotification, match, his
const params = {
...searchObj,
status,
- type:'',
- currentPage:curPage,
+ type,
+ currentPage: curPage,
pageSize: 10,
};
setLoading(true);
@@ -36,13 +40,13 @@ export default Form.create()(({ current_user, form, showNotification, match, his
}
setLoading(false);
})
- }, [reload, status, curPage, searchObj]);
+ }, [reload, status, curPage, searchObj, type]);
const helper = useCallback(
- (name, rules, widget) => (
+ (name, rules, widget, initialValue) => (
- {getFieldDecorator(name, { rules, validateFirst: true, })(widget)}
+ {getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)}
), []);
@@ -72,29 +76,43 @@ export default Form.create()(({ current_user, form, showNotification, match, his
function clearSearch() {
setFieldsValue({
- numberInput: '',
- nameInput: '',
- enterpriseNameInput: ''
+ taskNumber: '',
+ taskName: '',
+ userName: ''
});
setSearchObj({});
}
const reloadList = useCallback(() => {
setReload(reload + 1);
- }, [])
+ }, []);
+
return (
+ {helper(
+ "type",
+ [],
+ ,
+ type
+ )}
{helper(
- "numberInput",
+ "taskNumber",
[{ max: 20, message: '长度不能超过20个字符' }],
)}
diff --git a/src/military/task/api.js b/src/military/task/api.js
index 1c62d087..fcb5e1a7 100644
--- a/src/military/task/api.js
+++ b/src/military/task/api.js
@@ -293,23 +293,6 @@ export function commentAdd(data) {
}
-// 审核任务列表查询
-export async function manageTaskList(params) {
- let res = await fetch({
- url: '/api/tasks/backend/list',
- method: 'get',
- params,
- });
- if (res.data) {
- return res.data;
- } else {
- notification.open({
- message: "提示",
- description: res.message || '请求错误',
- });
- }
-}
-
//管理员审核任务
export function checkTask(data) {
return fetch({
diff --git a/src/military/task/components/itemAgreementManage/index.jsx b/src/military/task/components/itemAgreementManage/index.jsx
index 59fdf53e..f21f6558 100644
--- a/src/military/task/components/itemAgreementManage/index.jsx
+++ b/src/military/task/components/itemAgreementManage/index.jsx
@@ -120,19 +120,37 @@ export default Form.create()((props) => {
-
-
- 成果编号:
+ 任务名称:
- {item.number}
+ {item.taskName}
+
+ 任务编号:
+
+ {item.taskNumber}
+
+
+
+
+ {
+ item.paperNumber &&
+
+ 成果编号:
+
+ {item.paperNumber}
+
+
+
+
+ }
+
协议文件:
{
- item.materials && item.materials.map(fileItem => {
+ item.busiAttachments && item.busiAttachments.map(fileItem => {
return
{ downFile(fileItem) }}>
{fileItem.fileName}
diff --git a/src/military/task/components/itemPublicityComplain/index.jsx b/src/military/task/components/itemPublicityComplain/index.jsx
index ee0777b6..bfa6be33 100644
--- a/src/military/task/components/itemPublicityComplain/index.jsx
+++ b/src/military/task/components/itemPublicityComplain/index.jsx
@@ -218,7 +218,7 @@ export default Form.create()((props) => {
max={150}
min={0}
/>,
- '天'
+ ' 天'
)
}
diff --git a/src/military/task/taskAdmin/index.jsx b/src/military/task/taskAdmin/index.jsx
index 4ba54c9a..6491baa6 100644
--- a/src/military/task/taskAdmin/index.jsx
+++ b/src/military/task/taskAdmin/index.jsx
@@ -22,21 +22,22 @@ export default Form.create()(({ current_user, form, showNotification, match, his
const { getFieldDecorator, validateFields, setFieldsValue, getFieldsValue } = form;
const [loading, setLoading] = useState(false);
- const [searchObj, setSearchObj] = useState({
- // checkStatus: '0'
- });
+ const [statusString, setStatusString] = useState('');
+ const [publishMode, setPublishMode] = useState('');
+ const [showUserMode, setShowUserMode] = useState('');
+
+ 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('');
-
useEffect(() => {
const params = {
...searchObj,
+ statusString,
+ publishMode: publishMode.length > 1 ? '' : publishMode,
+ showUserMode: showUserMode.length > 1 ? '' : showUserMode,
curPage,
pageSize: 10,
};
@@ -48,7 +49,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
}
setLoading(false);
})
- }, [reload, curPage, searchObj]);
+ }, [statusString, publishMode, showUserMode, curPage, searchObj]);
const helper = useCallback(
@@ -60,18 +61,19 @@ export default Form.create()(({ current_user, form, showNotification, match, his
function onSearch() {
- let values = getFieldsValue(['checkStatus', 'endCreatedAt', 'startCreatedAt']);
- if (values.startCreatedAt) values.startCreatedAt = values.startCreatedAt.format(format);
- if (values.endCreatedAt) values.endCreatedAt = values.endCreatedAt.format(format);
+ let values = getFieldsValue(['nameInput', 'endTime', 'startTime', 'enterpriseNameInput']);
+ if (values.startTime) values.startTime = values.startTime.format(format);
+ if (values.endTime) values.endTime = values.endTime.format(format);
if (values.checkStatus === '0,1,2') values.checkStatus = '';
setSearchObj(values);
}
function clearSearch() {
setFieldsValue({
- startCreatedAt: '',
- endCreatedAt: '',
- checkStatus: '0,1,2'
+ startTime: '',
+ endTime: '',
+ nameInput: '',
+ enterpriseNameInput: ''
});
setSearchObj({});
}
@@ -92,38 +94,89 @@ export default Form.create()(({ current_user, form, showNotification, match, his
{
title: '任务名称',
dataIndex: 'name',
- width: "20%",
+ width: "15%",
render: (text, record) => (
{text}
),
},
{
- title: '发布方式',
+ title: ,
dataIndex: 'publishMode',
render: (text, record) => {
return publishModeArr[text]
}
},
{
- title: '任务状态',
+ title: ,
+ width: '10%',
dataIndex: 'status',
render: (text, record) => {
return statusArr[text]
}
},
{
- title: '提交时间',
- dataIndex: 'createdAt',
+ title: '稿件数',
+ dataIndex: 'papersCount',
+ },
+ {
+ title: '任务主体',
+ dataIndex: 'enterpriseName',
+ },
+ {
+ title: '发布时间',
+ dataIndex: 'publishedAt',
+ render: (text, record) => {
+ return text || '--'
+ }
},
{
title: '截稿时间',
dataIndex: 'collectingEndTime',
+ render: (text, record) => {
+ return text || '--'
+ }
},
{
- title: '应征者名单公示',
+ // title: '应征者名单公示',
+ title: ,
dataIndex: 'showUserMode',
render: (text, record) => {
return