forked from Gitlink/forgeplus-react
增加管理员统筹所有任务的列表
This commit is contained in:
parent
f18070da47
commit
9c3ecabf47
|
@ -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';
|
||||
|
|
|
@ -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) => (
|
||||
<Form.Item>
|
||||
{getFieldDecorator(name, { rules, validateFirst: true, })(widget)}
|
||||
{getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)}
|
||||
</Form.Item>
|
||||
), []);
|
||||
|
||||
|
@ -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 (
|
||||
<div className="centerbox task-manage">
|
||||
|
||||
<div className="center-screen" >
|
||||
<div className="center-left-but">
|
||||
{helper(
|
||||
"type",
|
||||
[],
|
||||
<Select
|
||||
showArrow
|
||||
placeholder="请选择协议"
|
||||
onChange={(type) => { setType(type) }}
|
||||
>
|
||||
<Option key={'1'}>任务协议</Option>
|
||||
<Option key={'2'}>成果协议</Option>
|
||||
</Select>,
|
||||
type
|
||||
)}
|
||||
<Button className="circle-button" type={approve === 1 ? 'primary' : ''} onClick={() => { changeApprove(1) }}>待审批</Button>
|
||||
<Button className="circle-button" type={approve === 2 ? 'primary' : ''} onClick={() => { changeApprove(2) }}>已审批</Button>
|
||||
</div>
|
||||
|
||||
<div className="center-right-but">
|
||||
{helper(
|
||||
"numberInput",
|
||||
"taskNumber",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="输入任务编号进行检索"
|
||||
|
@ -102,7 +120,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
)}
|
||||
|
||||
{helper(
|
||||
"nameInput",
|
||||
"taskName",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="输入任务名称进行检索"
|
||||
|
@ -110,10 +128,10 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
)}
|
||||
|
||||
{helper(
|
||||
"enterpriseNameInput",
|
||||
"userName",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="输入发布主体名称进行检索"
|
||||
placeholder="输入发布人名称进行检索"
|
||||
/>
|
||||
)}
|
||||
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -120,19 +120,37 @@ export default Form.create()((props) => {
|
|||
</span>
|
||||
</li>
|
||||
<div className="clearfix">
|
||||
|
||||
<div className="clearfix"></div>
|
||||
<div className="width100 lineh-35">
|
||||
<span className="color-grey-9 fl">成果编号:</span>
|
||||
<span className="color-grey-9 fl">任务名称:</span>
|
||||
<span className="fl lineh-35 ml5">
|
||||
<Link className="primary-link" to={`/task/taskDetail/${item.taskId}`}>{item.number}</Link>
|
||||
<Link className="primary-link" to={`/task/taskDetail/${item.taskId}`}>{item.taskName}</Link>
|
||||
</span>
|
||||
</div>
|
||||
<div className="clearfix"></div>
|
||||
<div className="width100 lineh-35">
|
||||
<span className="color-grey-9 fl">任务编号:</span>
|
||||
<span className="fl lineh-35 ml5">
|
||||
{item.taskNumber}
|
||||
</span>
|
||||
</div>
|
||||
<div className="clearfix"></div>
|
||||
|
||||
{
|
||||
item.paperNumber && <React.Fragment>
|
||||
<div className="width100 lineh-35">
|
||||
<span className="color-grey-9 fl">成果编号:</span>
|
||||
<span className="fl lineh-35 ml5">
|
||||
{item.paperNumber}
|
||||
</span>
|
||||
</div>
|
||||
<div className="clearfix"></div>
|
||||
</React.Fragment>
|
||||
}
|
||||
|
||||
<div className="width100 lineh-35 clearfix">
|
||||
<span className="color-grey-9 fl">协议文件:</span>
|
||||
{
|
||||
item.materials && item.materials.map(fileItem => {
|
||||
item.busiAttachments && item.busiAttachments.map(fileItem => {
|
||||
return <span className="file-list-prof " key={fileItem.id}>
|
||||
<a onClick={() => { downFile(fileItem) }}><i className="iconfont icon-fujian color-green font-14 mr3"></i>
|
||||
{fileItem.fileName} </a>
|
||||
|
|
|
@ -218,7 +218,7 @@ export default Form.create()((props) => {
|
|||
max={150}
|
||||
min={0}
|
||||
/>,
|
||||
'天'
|
||||
' 天'
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -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) => (
|
||||
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.id}`}>{text}</Link>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '发布方式',
|
||||
title: <Select
|
||||
className="column-select"
|
||||
showArrow
|
||||
defaultValue={'0,1'}
|
||||
onChange={setPublishMode}
|
||||
>
|
||||
<Option key={'0,1'} >发布方式</Option>
|
||||
<Option key={'0'} >自主提交</Option>
|
||||
<Option key={'1'} >统筹任务</Option>
|
||||
</Select>,
|
||||
dataIndex: 'publishMode',
|
||||
render: (text, record) => {
|
||||
return publishModeArr[text]
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '任务状态',
|
||||
title: <Select
|
||||
className="column-select"
|
||||
showArrow
|
||||
defaultValue={'0,1,2,3,4,5,6,7,8,9'}
|
||||
onChange={setStatusString}
|
||||
>
|
||||
<Option key={'0,1,2,3,4,5,6,7,8,9'} >任务状态</Option>
|
||||
{
|
||||
taskStatusAllArr.map(item => {
|
||||
return <Option key={item.dicItemCode} >{item.dicItemName}</Option>
|
||||
})
|
||||
}
|
||||
</Select>,
|
||||
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: <Select
|
||||
className="column-select"
|
||||
showArrow
|
||||
placeholder="请选择审核状态"
|
||||
defaultValue={'0,1,2'}
|
||||
onChange={setShowUserMode}
|
||||
>
|
||||
<Option key={'0,1,2'}>应征者名单公示</Option>
|
||||
{
|
||||
showUserModeArr.map(item => {
|
||||
return <Option key={item.dicItemCode}>{item.dicItemName}</Option>
|
||||
})
|
||||
}
|
||||
</Select>,
|
||||
dataIndex: 'showUserMode',
|
||||
render: (text, record) => {
|
||||
return <Select
|
||||
className="column-select"
|
||||
showArrow
|
||||
placeholder="请选择审核状态"
|
||||
defaultValue={text}
|
||||
|
@ -154,13 +207,15 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
changeShowUserMode({
|
||||
taskId,
|
||||
showUserMode
|
||||
}).then(res=>{
|
||||
console.log(res);
|
||||
}).then(res => {
|
||||
if (res && res.message === 'success') {
|
||||
showNotification('修改成功!');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="centerbox task-manage">
|
||||
<div className="centerbox task-manage-all ">
|
||||
<div className="search-screen" >
|
||||
{helper(
|
||||
"任务名称",
|
||||
|
@ -184,7 +239,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
|
||||
{helper(
|
||||
"发布时间:",
|
||||
"startCreatedAt",
|
||||
"startTime",
|
||||
[],
|
||||
<DatePicker
|
||||
showTime
|
||||
|
@ -195,7 +250,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
|
||||
{helper(
|
||||
"",
|
||||
"endCreatedAt",
|
||||
"endTime",
|
||||
[],
|
||||
<DatePicker
|
||||
showTime
|
||||
|
@ -203,11 +258,11 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
placeholder="请选择结束时间"
|
||||
/>
|
||||
)}
|
||||
|
||||
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
||||
<Button className="mr10" type="" onClick={clearSearch}>清除</Button>
|
||||
|
||||
</div>
|
||||
<div className="button-div">
|
||||
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
||||
<Button className="mr10" type="" onClick={clearSearch}>清除</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -3,23 +3,45 @@
|
|||
flex-flow: row wrap;
|
||||
justify-content: space-between;
|
||||
margin: 1.25rem 0;
|
||||
padding:1.25rem;
|
||||
padding: 1.25rem;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #dedede;
|
||||
|
||||
>.ant-row{
|
||||
min-width: 40%;
|
||||
.ant-form-item-control-wrapper{
|
||||
min-width: 60%;
|
||||
> .ant-row {
|
||||
min-width: 41%;
|
||||
margin-right: 2rem;
|
||||
.ant-form-item-label{
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
.ant-form-item-control-wrapper{
|
||||
display: inline-block;
|
||||
}
|
||||
.center-right-but{
|
||||
.ant-form-item{
|
||||
margin: 0 1rem 0 0;;
|
||||
.ant-form-item-control-wrapper {
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.center-right-but {
|
||||
.ant-form-item {
|
||||
margin: 0 1rem 0 0;
|
||||
}
|
||||
.ant-form-item-control-wrapper {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.button-div{
|
||||
margin-right: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
.task-manage-all {
|
||||
.column-select {
|
||||
min-width: 100px;
|
||||
.ant-select-selection {
|
||||
background: #fafafa;
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
.ant-table-thead > tr > th,
|
||||
.ant-table-tbody > tr > td {
|
||||
padding: 1rem 0.2rem;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Input, Button, Form } from 'antd';
|
|||
import ItemTaskManage from '../components/itemTaskManage';
|
||||
import StatusNav from '../../components/statusNav';
|
||||
import { approveArr } from '../static';
|
||||
import { manageTaskList, getTaskCategory } from '../api';
|
||||
import { getTaskAdminList, getTaskCategory } from '../api';
|
||||
import '../index.scss';
|
||||
|
||||
export default Form.create()(({ current_user, form, showNotification, match, history }) => {
|
||||
|
@ -39,9 +39,10 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
orderBy: 'createdAtDesc',
|
||||
curPage,
|
||||
pageSize: 10,
|
||||
publishMode: 1
|
||||
};
|
||||
setLoading(true);
|
||||
manageTaskList(params).then(data => {
|
||||
getTaskAdminList(params).then(data => {
|
||||
if (data) {
|
||||
setTaskList(data.rows);
|
||||
setTotal(data.total);
|
||||
|
|
Loading…
Reference in New Issue