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