forked from Gitlink/forgeplus-react
修改bug,优化代码
This commit is contained in:
parent
cb7170a87c
commit
6c95ff98f4
|
@ -5,8 +5,8 @@ import cookie from 'react-cookies';
|
|||
|
||||
let actionUrl = '';
|
||||
if (window.location.href.indexOf('localhost') > -1) {
|
||||
// actionUrl = 'http://117.50.100.12:8008';
|
||||
actionUrl='http://192.168.31.72:8081';
|
||||
actionUrl = 'http://117.50.100.12:8008';
|
||||
// actionUrl='http://192.168.31.73:8081';
|
||||
} else if (window.location.href.indexOf('117.50.100.12') > -1) {
|
||||
actionUrl = "http://117.50.100.12:8008";
|
||||
axios.defaults.withCredentials = true;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useCallback, forwardRef, useEffect, useState } from 'react';
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { Input, Button, Form, Select } from 'antd';
|
||||
import AdminRouter from '../components/adminRouter';
|
||||
import ItemAgreementManage from '../components/itemAgreementManage';
|
||||
|
@ -9,10 +9,10 @@ import '../index.scss';
|
|||
const Option = Select.Option;
|
||||
|
||||
const agreementOptionArr = agreementArr.slice(0, 2);
|
||||
export default Form.create()(({ current_user, form, showNotification, match, history }) => {
|
||||
export default Form.create()(({ form, showNotification, match, history }) => {
|
||||
|
||||
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, getFieldsValue } = form;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
|
||||
|
||||
const [approve, setApprove] = useState(1);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
@ -25,6 +25,9 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
|
||||
const [reload, setReload] = useState(0);
|
||||
|
||||
const [loadPaper, setLoadPaper] = useState(0);
|
||||
|
||||
// 加载审核协议列表
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
...searchObj,
|
||||
|
@ -36,14 +39,41 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
setLoading(true);
|
||||
agreementList(params).then(data => {
|
||||
if (data) {
|
||||
if (loadPaper === 0 && data.rows.length === 0) {
|
||||
setLoadPaper(1);
|
||||
} else {
|
||||
setLoadPaper(2);
|
||||
}
|
||||
setTaskList(data.rows);
|
||||
setTotal(data.total);
|
||||
}
|
||||
setLoading(false);
|
||||
})
|
||||
});
|
||||
}, [reload, status, curPage, searchObj, type]);
|
||||
|
||||
// 如果第一次加载任务协议审核发现没有数据,那么切换成审核成果协议列表
|
||||
useEffect(() => {
|
||||
if (loadPaper === 1) {
|
||||
const params = {
|
||||
status: '2',
|
||||
type: '2',
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
setLoading(true);
|
||||
agreementList(params).then(data => {
|
||||
if (data && data.rows.length > 0) {
|
||||
setTaskList(data.rows);
|
||||
setTotal(data.total);
|
||||
setType('2');
|
||||
setLoadPaper(2);
|
||||
}
|
||||
setLoading(false);
|
||||
});
|
||||
}
|
||||
}, [loadPaper]);
|
||||
|
||||
// form表单公共处理函数
|
||||
const helper = useCallback(
|
||||
(name, rules, widget, initialValue) => (
|
||||
<Form.Item>
|
||||
|
@ -60,11 +90,13 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
});
|
||||
}
|
||||
|
||||
// 修改选项
|
||||
const changeOptionId = useCallback((option) => {
|
||||
setStatus(option.dicItemCode.toString() || '0,1');
|
||||
setCurPage(1);
|
||||
}, []);
|
||||
|
||||
// 修改状态
|
||||
function changeApprove(approve) {
|
||||
setApprove(approve);
|
||||
setCurPage(1);
|
||||
|
@ -75,6 +107,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
}
|
||||
}
|
||||
|
||||
// 清除查询内容
|
||||
function clearSearch() {
|
||||
setFieldsValue({
|
||||
taskNumber: '',
|
||||
|
@ -84,8 +117,9 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
setSearchObj({});
|
||||
}
|
||||
|
||||
// 刷新数据
|
||||
const reloadList = useCallback(() => {
|
||||
setReload(reload + 1);
|
||||
setReload(Math.random());
|
||||
}, []);
|
||||
|
||||
|
||||
|
|
|
@ -518,6 +518,15 @@ export function confirmReceipt(paperId) {
|
|||
}
|
||||
|
||||
|
||||
// 下载协议签订凭证
|
||||
export function downAgreement(params) {
|
||||
return fetch({
|
||||
url: `/api/myTasks/getWinnersContractsByTaskId`,
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 管理员修改任务公示方式
|
||||
export function changeShowUserMode(data) {
|
||||
return fetch({
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
||||
import { Menu, Dropdown, Button } from 'antd';
|
||||
import React, { useMemo } from 'react';
|
||||
import { Menu, Dropdown, } from 'antd';
|
||||
import { current_main_site_url,main_web_site_url} from '../../static';
|
||||
|
||||
import './index.scss';
|
||||
|
||||
const { SubMenu } = Menu;
|
||||
|
||||
export default props => {
|
||||
const main_web_site_url = useMemo(() => {
|
||||
return JSON.parse(localStorage.chromesetting).main_web_site_url;
|
||||
});
|
||||
const current_main_site_url = useMemo(() => {
|
||||
return JSON.parse(localStorage.chromesetting).current_main_site_url;
|
||||
});
|
||||
|
||||
const projectMenu = useMemo(() => {
|
||||
return <Menu>
|
||||
|
@ -71,6 +67,8 @@ export default props => {
|
|||
<Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/managements/enterprise_authentication`}>企业认证</a></Menu.Item>
|
||||
<Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/admin/reviews/projects_list`}>开源项目</a></Menu.Item>
|
||||
<Menu.Item><a href="/task/taskManage">统筹任务发布审批</a></Menu.Item>
|
||||
<Menu.Item><a href="/task/paperComplain">成果上传申诉审批</a></Menu.Item>
|
||||
<Menu.Item><a href="/task/publicityComplain">公示期成果申诉审批</a></Menu.Item>
|
||||
<Menu.Item><a href="/task/agreementManage">协议审批</a></Menu.Item>
|
||||
<Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/admin/tasks/report_result_tasks`}>成果举报申诉</a></Menu.Item>
|
||||
<Menu.Item><a href="/task/proofManage">评选佐证材料</a></Menu.Item>
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
||||
import React, { useState, } from 'react';
|
||||
import { Modal, Form, Input, } from 'antd';
|
||||
import Upload from 'military/components/Upload';
|
||||
import { uploadAgreePaper } from "../../api";
|
||||
import { httpUrl } from 'military/fetch';
|
||||
import '../../index.scss';
|
||||
// import './index.scss';
|
||||
|
||||
|
||||
export default Form.create()(props => {
|
||||
const { visible, setVisible, paperId, form, showNotification, reloadList } = props;
|
||||
const { visible, setVisible, checkedItem, form, showNotification } = props;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
|
||||
|
||||
const [fileList, setFileList] = useState([]);
|
||||
|
@ -26,7 +24,7 @@ export default Form.create()(props => {
|
|||
validateFields((err, values) => {
|
||||
if (!err) {
|
||||
uploadAgreePaper({
|
||||
paperId,
|
||||
paperId: checkedItem.id,
|
||||
params: {
|
||||
files: values.files,
|
||||
}
|
||||
|
@ -54,6 +52,8 @@ export default Form.create()(props => {
|
|||
className="form-edit-modal"
|
||||
>
|
||||
<div className="task-popup-content">
|
||||
{/* paperAuditing */}
|
||||
{checkedItem.paperAuditing && <p className=" mb10 color-orange task_tip">审核意见:{checkedItem.paperAuditing.message}</p>}
|
||||
<a href="http://117.50.100.12:8000/attachments/download/523/%E5%88%9B%E5%AE%A2%E4%BB%BB%E5%8A%A1%E5%88%97%E8%A1%A8_2019-07-26_20-53.xlsx" className="icon icon-attachment font-13 color-blue" length="32">协议样板.word</a>
|
||||
<Form.Item className="upload-form" label="附件上传" required={true}>
|
||||
<Upload
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
||||
import React, { useState, useCallback, useMemo} from 'react';
|
||||
import { Modal, Form, Input, } from 'antd';
|
||||
import Upload from 'military/components/Upload';
|
||||
import { complainPaper, publicityComplain, } from "../../api";
|
||||
|
@ -12,7 +12,6 @@ export default Form.create()(props => {
|
|||
|
||||
const [fileList, setFileList] = useState([]);
|
||||
|
||||
|
||||
// 上传附件后得到的文件数组
|
||||
function uploadFunc(fileList, files) {
|
||||
setFileList(fileList);
|
||||
|
@ -64,6 +63,7 @@ export default Form.create()(props => {
|
|||
setFieldsValue({
|
||||
files: ''
|
||||
});
|
||||
reloadList();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ export default Form.create()(props => {
|
|||
onCancel={() => { setVisible(false) }}
|
||||
className="form-edit-modal"
|
||||
>
|
||||
{checkedItem.checkStatus === 2 && detailStatus === 3 && <p className=" mb10 color-orange task_tip">审核意见:{checkedItem.auditing.message}</p>}
|
||||
{checkedItem.checkStatus == 2 && detailStatus === 3 && <p className=" mb10 color-orange task_tip">审核意见:{checkedItem.auditing.message}</p>}
|
||||
<p className="edu-txt-center lineh-20 mb10">你的申诉信息将发送给平台管理员</p>
|
||||
<p className="edu-txt-center lineh-20">请如实填写有效的申诉原由,我们将尽快完成审核</p>
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { Pagination, Modal, Input, Radio, Form, InputNumber } from 'antd';
|
||||
import { Pagination, Modal, Input, Form, } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import Nodata from 'forge/Nodata';
|
||||
import Loading from "src/Loading";
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { Form, Modal, Input, Pagination, Radio, } from 'antd';
|
||||
import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
||||
import { Form, Modal, Input, Pagination, Radio, Table } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import Nodata from 'forge/Nodata';
|
||||
import Loading from "src/Loading";
|
||||
import Upload from 'military/components/Upload';
|
||||
import ProofModal from '../proofModal';
|
||||
import { publishModeArr, taskStatusAllArr } from '../../static';
|
||||
import { signMethod, uploadAgreeRequire } from "../../api";
|
||||
import { signMethod, uploadAgreeRequire, downAgreement } from "../../api";
|
||||
import { httpUrl } from 'military/fetch';
|
||||
import '../../index.scss';
|
||||
import './index.scss';
|
||||
|
||||
|
@ -29,11 +30,23 @@ export default Form.create()((props) => {
|
|||
const [visibleAgree, setVisibleAgree] = useState(false);
|
||||
const [fileList, setFileList] = useState(null);
|
||||
|
||||
const [dowloadTaskId, setDowloadTaskId] = useState('');
|
||||
const [visibleDownload, setVisibleDownload] = useState(false);
|
||||
const [uploadList, setUploadList] = useState([]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
changePage(page);
|
||||
}, [page]);
|
||||
|
||||
useEffect(() => {
|
||||
visibleDownload && downAgreement({ taskId: dowloadTaskId }).then(res => {
|
||||
if (res && res.message === "success") {
|
||||
setUploadList(res.data);
|
||||
}
|
||||
})
|
||||
}, [visibleDownload])
|
||||
|
||||
function uploadProofs(item) {
|
||||
setVisibleProofs(true);
|
||||
setTaskId(item.id);
|
||||
|
@ -101,6 +114,7 @@ export default Form.create()((props) => {
|
|||
setFieldsValue({
|
||||
files: ''
|
||||
});
|
||||
reloadList();
|
||||
setVisibleAgree(false);
|
||||
showNotification('上传协议成功');
|
||||
} else {
|
||||
|
@ -118,6 +132,34 @@ export default Form.create()((props) => {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
const columns = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
title: '成果物编号',
|
||||
dataIndex: 'paperNumber',
|
||||
},
|
||||
{
|
||||
title: '凭证文件',
|
||||
dataIndex: 'fileName',
|
||||
render: (text, record) => {
|
||||
return <a className="line_1 color-grey3" onClick={() => { download(record.winnerContracts[0].id) }}> {record.winnerContracts && record.winnerContracts[0].fileName}</a >
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
render: (text, record) => {
|
||||
return <a className="line_1 color-grey3" onClick={(e) => { download(record.winnerContracts[0].id) }}> 下载凭证</a >
|
||||
}
|
||||
}
|
||||
];
|
||||
}, []);
|
||||
|
||||
function download(id) {
|
||||
window.open(httpUrl + '/busiAttachments/download/' + id);
|
||||
}
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<ul className="df mt10 needs_condition_content_nav">
|
||||
|
@ -147,8 +189,7 @@ export default Form.create()((props) => {
|
|||
{item.status === 4 && <span className="list_status ml10">待确认</span>}
|
||||
{item.status === 6 && <span className="list_status s_orange ml10">待签订协议</span>}
|
||||
</React.Fragment> : <React.Fragment>
|
||||
{item.status === 4 && <span className="list_status ml10">待确认</span>}
|
||||
{item.status === 6 && <span className="list_status s_orange ml10">待签订协议</span>}
|
||||
{item.status === 6 && (item.agreementSigning === 1 || (item.agreementSigning === 2 && item.auditing && item.auditing.pass === 1)) && <span className="list_status s_orange ml10">待签订协议</span>}
|
||||
</React.Fragment>
|
||||
}
|
||||
</li>
|
||||
|
@ -192,6 +233,15 @@ export default Form.create()((props) => {
|
|||
|
||||
{item.status === 6 && item.agreementSigning === 2 && <a className="line_1 color-blue" onClick={() => { uploadAgree(item) }}>上传委托协议</a>}
|
||||
|
||||
{item.status === 6 && item.agreementSigning === 1 && <span className="line_1 color-grey-9">已选择自主签订协议</span>}
|
||||
|
||||
{item.status === 7 && <span className="line_1 color-grey-9">{item.agreementSigning === 1 ? '待胜出者确认收款' : '待平台上传支付凭证'}</span>}
|
||||
|
||||
{item.status === 7 && <a className="line_1 color-blue" onClick={() => { setDowloadTaskId(item.id); setVisibleDownload(true); }}>下载协议签订凭证</a>}
|
||||
|
||||
|
||||
{/* {item.status === 8 && <a className="line_1 color-blue" onClick={() => { uploadAgree(item) }}>上传委托协议</a>} */}
|
||||
|
||||
{/* <a href="javascript:void(0)" className="line_1 color-blue" onClick="paying_register_popup()">支付登记</a> */}
|
||||
{/* <a href="javascript:void(0)" className="color-blue line_1">上传支付凭证</a> */}
|
||||
</React.Fragment>
|
||||
|
@ -260,7 +310,7 @@ export default Form.create()((props) => {
|
|||
className="form-edit-modal"
|
||||
>
|
||||
{checkItem.auditing && <p className="color-orange mb10 task_tip">
|
||||
<i className="iconfont icon-laba mr5 color-orange font-15"></i>{checkItem.auditing.message}
|
||||
审核意见:{checkItem.auditing.message}
|
||||
</p>}
|
||||
<Form.Item className="upload-form" label="协议上传" required={true}>
|
||||
<Upload
|
||||
|
@ -277,6 +327,23 @@ export default Form.create()((props) => {
|
|||
</Form.Item>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
title="下载协议签订凭证"
|
||||
visible={visibleDownload}
|
||||
onOk={() => { setVisibleDownload(false) }}
|
||||
onCancel={() => { setVisibleDownload(false) }}
|
||||
className="form-edit-modal"
|
||||
>
|
||||
<Table
|
||||
loading={loading}
|
||||
rowKey={(row) => row.id}
|
||||
dataSource={uploadList}
|
||||
columns={columns}
|
||||
pagination={false}
|
||||
/>
|
||||
|
||||
</Modal>
|
||||
|
||||
</React.Fragment>
|
||||
|
||||
)
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
|
||||
.mytask-title {
|
||||
justify-content: left;
|
||||
a{
|
||||
word-break: break-all;
|
||||
}
|
||||
span{
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ for (const item of paperCheckStatusArr) {
|
|||
}
|
||||
|
||||
export default Form.create()((props) => {
|
||||
const { list, curPage, total, changePage, loading, applyStatusAllNameArr, reloadList, showNotification, current_user, form, detailStatus, agreementSigning } = props;
|
||||
const { list, curPage, total, changePage, loading, applyStatusAllNameArr, reloadList, showNotification, current_user, form, detailStatus } = props;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue } = form;
|
||||
const [page, setPage] = useState(1);
|
||||
const pageSize = props.pageSize || 10;
|
||||
|
@ -137,12 +137,14 @@ export default Form.create()((props) => {
|
|||
[]
|
||||
);
|
||||
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
{loading || loadingChild ? <Loading /> :
|
||||
<React.Fragment>
|
||||
{
|
||||
list.map(item => {
|
||||
|
||||
return (
|
||||
|
||||
<div className="fileComments df" key={item.id}>
|
||||
|
@ -154,16 +156,16 @@ export default Form.create()((props) => {
|
|||
{item.user.nickname || item.user.login}
|
||||
</span>
|
||||
<span className="color-grey9">{timeAgo(item.createdAt)}</span>
|
||||
{item.status === 2 ? <img alt="胜出" className="mr5" src={winpng} /> : <span className="color-blue ml10">{item.checkStatus != 1 ? paperCheckStatus[item.checkStatus] : applyStatusAllNameArr[item.status]}</span>}
|
||||
{item.status === 2 ? <img alt="胜出" className="mr5" src={winpng} /> : <span className="color-blue ml10">{item.checkStatus !== 1 ? paperCheckStatus[item.checkStatus] : applyStatusAllNameArr[item.status]}</span>}
|
||||
</li>
|
||||
<li className="fr">
|
||||
{((item.needComplain && detailStatus === 3) || (detailStatus === 5 && item.status !== 2)) && (current_user.login === item.user.login) &&
|
||||
{((item.needComplain && detailStatus === 3) || (detailStatus === 5 && item.publicTaskComplain && item.checkStatus === 1 && item.status !== 2)) && (current_user.login === item.user.login) &&
|
||||
<a className="base_smallBtn blue_line_btn fl" onClick={() => { setComplainVisible(true); setCheckedItem(item) }}>申诉</a>}
|
||||
|
||||
{item.status === 2 && detailStatus === 6 && (current_user.login === item.user.login) && (!item.sign) &&
|
||||
{item.status === 2 && detailStatus === 6 && (current_user.login === item.user.login) && (!item.sign) && (item.canApplicantSign||item.canApplicantSignByPlatform) &&
|
||||
<a className="base_smallBtn blue_line_btn fl" onClick={() => { setAgreeVisible(true); setCheckedItem(item) }}>签订协议</a>}
|
||||
|
||||
{item.status === 2 && detailStatus === 7 && (current_user.login === item.user.login) && (item.agreementSigning === 1) && (!item.isPay) &&
|
||||
{item.status === 2 && detailStatus === 7 && (current_user.login === item.user.login) && (item.task && item.task.agreementSigning === 1) && (!item.isPay) &&
|
||||
<a className="base_smallBtn blue_line_btn fl" onClick={() => { confirmReceiptModal(item.id) }}>确认收款</a>}
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -188,6 +190,7 @@ export default Form.create()((props) => {
|
|||
<div className="comments-author">
|
||||
<span className="color-grey3 font-bd mr20">{commentsItem.user.nickname || commentsItem.user.login}</span>
|
||||
<span className="color-grey9">{timeAgo(commentsItem.createdAt)}</span>
|
||||
|
||||
</div>
|
||||
<div className="editor-w-text comments-content" dangerouslySetInnerHTML={{ __html: commentsItem.details && commentsItem.details.content }}>
|
||||
</div>
|
||||
|
@ -275,10 +278,12 @@ export default Form.create()((props) => {
|
|||
checkedItem={checkedItem}
|
||||
detailStatus={detailStatus}
|
||||
showNotification={showNotification}
|
||||
reloadList={reloadList}
|
||||
/>
|
||||
|
||||
{agreeVisible && <AgreementModal
|
||||
paperId={checkedItem.id}
|
||||
checkedItem={checkedItem}
|
||||
visible={agreeVisible}
|
||||
setVisible={setAgreeVisible}
|
||||
showNotification={showNotification}
|
||||
|
|
|
@ -25,10 +25,6 @@ export default (props) => {
|
|||
window.location.href = `/users/${login}`;
|
||||
}
|
||||
|
||||
function surplusTime(item) {
|
||||
let surplus = item.collectingDays * 24 * 3600 * 1000 - (new Date() - new Date(item.publishedAt || item.createdAt));
|
||||
return formatDuring(surplus)
|
||||
}
|
||||
|
||||
return (
|
||||
loading ? <Loading /> :
|
||||
|
@ -41,7 +37,7 @@ export default (props) => {
|
|||
<div className="list-title mb10" onClick={() => { itemClick(item.id) }}>
|
||||
<div className="title-content text-ellipsis">{item.name}</div>
|
||||
{item.status && <span className={classArr[item.status]}>{statusArr[item.status]}</span>}
|
||||
{(item.status !== 8) && item.delayTime && <span className="list-yellow">延期中</span>}
|
||||
{(item.status !== 8) && item.delayTime.indexOf('延期') > -1 && <span className="list-yellow">延期中</span>}
|
||||
</div>
|
||||
<div className="list-other">
|
||||
<span className="user-box mr30" onClick={() => { goUser(item.user.login) }}>
|
||||
|
@ -50,8 +46,7 @@ export default (props) => {
|
|||
</span>
|
||||
<span className="font-14 mr30"><i className="iconfont icon-dianjiliang mr3 font-12" />{item.visits || 0}</span>
|
||||
<span className="font-14 mr30"><Icon type="user" /><span className="color-orange">{item.papersCount || 0}</span>人参与</span>
|
||||
{(item.status !== 8) && item.delayTime && <span className="color-orange mr30 font-14"><i className="mr5 iconfont icon-shijian color-grey9 font-14"></i>{item.delayTime}</span>}
|
||||
{(item.status === 3) && (!item.delayTime) && <span className="color-orange mr30 font-14"><i className="mr5 iconfont icon-shijian color-grey9 font-14"></i>剩余{surplusTime(item)}</span>}
|
||||
{(item.status !== 8) && <span className="color-orange mr30 font-14"><i className="mr5 iconfont icon-shijian color-grey9 font-14"></i>{item.delayTime}</span>}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -106,9 +106,9 @@ export default Form.create()((props) => {
|
|||
|
||||
|
||||
<div className="clearfix"></div>
|
||||
<div className="width100 lineh-35 clearfix">
|
||||
{!item.isPay && <div className="width100 lineh-35 clearfix">
|
||||
<Button type="primary" onClick={() => { setVisible(true); setCheckedItem(item) }}>上传支付报酬凭证</Button>
|
||||
</div>
|
||||
</div>}
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -3,11 +3,10 @@ import { Pagination, Modal, Input, Radio, Form, InputNumber } from 'antd';
|
|||
import { Link } from "react-router-dom";
|
||||
import Nodata from 'forge/Nodata';
|
||||
import Loading from "src/Loading";
|
||||
import { timeAgo } from 'educoder';
|
||||
import { timeAgo, getImageUrl } from 'educoder';
|
||||
import { checkPublicity } from '../../api';
|
||||
import { httpUrl } from 'military/fetch';
|
||||
import './index.scss';
|
||||
import winpng from '../../image/win.png';
|
||||
|
||||
const { TextArea } = Input;
|
||||
export default Form.create()((props) => {
|
||||
|
@ -86,7 +85,7 @@ export default Form.create()((props) => {
|
|||
return (
|
||||
<div className="list-box" key={item.id}>
|
||||
|
||||
<img alt="头像加载失败" className="radius mr15" height="50px" src={winpng} width="50px" />
|
||||
<img alt="头像加载失败" className="radius mr15" height="50px" src={item.user && getImageUrl(item.user.logo)} width="50px" />
|
||||
<div className="flex1">
|
||||
<li className="clearfix mb20">
|
||||
<a className="user-box fl mr15 color-grey-3 font-16" onClick={() => { goUser(item.user.login) }}>{item.user && (item.user.nickname || item.user.login)}</a>
|
||||
|
@ -94,22 +93,10 @@ export default Form.create()((props) => {
|
|||
<span className="fr">
|
||||
<a className="edu-default-btn edu-orangeline-btn ml20 fl" onClick={() => { goUserMes(item.user.login) }}>私信</a>
|
||||
{item.status === 2 && <a className="edu-default-btn edu-blueline-btn ml20 fl" onClick={() => { deal(item) }}>处理</a>}
|
||||
|
||||
{/* {item.taskResultProof.status === 1 && <span className="spanTitle color-grey-6 fl ml20">已同意</span>}
|
||||
{item.taskResultProof.status === 0 && <span className="spanTitle color-red fl ml20">已拒绝</span>}
|
||||
|
||||
{
|
||||
item.taskResultProof.status === 2 && <React.Fragment>
|
||||
<a className="edu-default-btn edu-orangeline-btn ml20 fl" onClick={() => { goUserMes(item.user.login) }}>私信</a>
|
||||
<a className="edu-default-btn edu-blueline-btn ml20 fl" onClick={() => { agreeClick(item) }}>同意</a>
|
||||
<a className="edu-default-btn edu-greyline-btn ml20 fl" onClick={() => { deal(item) }}>拒绝</a>
|
||||
</React.Fragment>
|
||||
} */}
|
||||
</span>
|
||||
</li>
|
||||
<div className="clearfix">
|
||||
|
||||
|
||||
{/* <div className="width100">
|
||||
<span className="with40 fl lineh-35">
|
||||
<span className="color-grey-9 fl">联系手机:</span>
|
||||
|
@ -178,7 +165,7 @@ export default Form.create()((props) => {
|
|||
helper('是否受理', 'isAccepted', [{ required: true, message: "请选择是否受理" }],
|
||||
<Radio.Group
|
||||
className="mb10"
|
||||
onChange={(e) => { setIsAccepted(e.target.value) }}
|
||||
onChange={(e) => { setIsAccepted(e.target.value); setIsReconsidered(''); setIsChanged(''); }}
|
||||
>
|
||||
<Radio value={'1'}>受理</Radio>
|
||||
<Radio value={'0'}>不受理</Radio>
|
||||
|
@ -190,7 +177,7 @@ export default Form.create()((props) => {
|
|||
isAccepted === '1' && helper('复议评审', 'isReconsidered', [{ required: true, message: "请选择是否启动复议评审" }],
|
||||
<Radio.Group
|
||||
className="mb10"
|
||||
onChange={(e) => { setIsReconsidered(e.target.value) }}
|
||||
onChange={(e) => { setIsReconsidered(e.target.value); setIsChanged(''); }}
|
||||
>
|
||||
<Radio value={'1'}>启动</Radio>
|
||||
<Radio value={'0'}>不启动</Radio>
|
||||
|
@ -199,7 +186,7 @@ export default Form.create()((props) => {
|
|||
}
|
||||
|
||||
{
|
||||
isReconsidered === '0' && helper('公示结果', 'isChanged', [{ required: true, message: "请选择是否更改公示结果" }],
|
||||
isAccepted === '1' && isReconsidered === '0' && helper('公示结果', 'isChanged', [{ required: true, message: "请选择是否更改公示结果" }],
|
||||
<Radio.Group
|
||||
className="mb10"
|
||||
onChange={(e) => { setIsChanged(e.target.value) }}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { Pagination, Modal, Input, Radio } from 'antd';
|
||||
import { Pagination, Modal, Input, Radio, Button } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import Nodata from 'forge/Nodata';
|
||||
import Loading from "src/Loading";
|
||||
import { timeAgo } from 'educoder';
|
||||
import { timeAgo, getImageUrl } from 'educoder';
|
||||
import { main_web_site_url } from '../../static';
|
||||
import { checkTask } from '../../api';
|
||||
import './index.scss';
|
||||
import winpng from '../../image/win.png';
|
||||
|
||||
const { TextArea } = Input;
|
||||
export default (props) => {
|
||||
|
@ -82,7 +82,7 @@ export default (props) => {
|
|||
return (
|
||||
<div className="list-box" key={item.id}>
|
||||
|
||||
<img alt="头像加载失败" className="radius mr15" height="50px" src={winpng} width="50px" />
|
||||
<img alt="头像加载失败" className="radius mr15" height="50px" src={item.user && getImageUrl(item.user.logo)} width="50px" />
|
||||
<div className="flex1">
|
||||
<li className="clearfix mb20">
|
||||
<a className="user-box fl mr15 color-grey-3 font-16" onClick={() => { goUser(item.user.login) }}>{item.user.nickname || item.user.login}</a>
|
||||
|
@ -113,6 +113,9 @@ export default (props) => {
|
|||
<span className="infos_item">123456789123456789</span>
|
||||
</span>
|
||||
</div>
|
||||
{item.status === 1 && <div class="fr text-center">
|
||||
<Button type="primary" onClick={() => { window.open(`${main_web_site_url}/admin/tasks/export_task_files.zip?task_id=${item.id}`) }} class="edu-default-btn edu-blueback-btn">导出任务需求材料</Button>
|
||||
</div>}
|
||||
</div>
|
||||
<div className="clearfix"></div>
|
||||
<div className="width100">
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
||||
import { Modal, Table, Form, Input, Button, Pagination } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import Upload from 'military/components/Upload';
|
||||
import { readyCheckPapers, proofAdd } from "../../api";
|
||||
import { httpUrl } from 'military/fetch';
|
||||
import '../../index.scss';
|
||||
import './index.scss';
|
||||
import { func } from 'prop-types';
|
||||
|
||||
|
||||
export default Form.create()(props => {
|
||||
const { changeVisible, taskId, taskModeId, visible, form, showNotification, reloadList } = props;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { Tabs, Input, } from 'antd';
|
||||
import { Tabs, Input, } from 'antd';
|
||||
import StatusNav from '../../components/statusNav';
|
||||
import ItemListMyTask from '../components/itemListMyTask';
|
||||
import JoinTask from './joinTask';
|
||||
|
@ -9,7 +9,7 @@ import './index.scss';
|
|||
const Search = Input.Search;
|
||||
const { TabPane } = Tabs;
|
||||
|
||||
const publishStatusArr = taskStatusAllArr.slice(3,9);
|
||||
const publishStatusArr = taskStatusAllArr.slice(3, 9);
|
||||
const unpublishStatusArr = taskStatusAllArr.slice(0, 3);
|
||||
unpublishStatusArr.push({ dicItemCode: '9', name: "待修缮", dicItemName: "待修缮" });
|
||||
|
||||
|
@ -18,7 +18,7 @@ for (const item of taskStatusAllArr) {
|
|||
statusArr[item.dicItemCode] = item.dicItemName;
|
||||
}
|
||||
|
||||
export default ({ location, history, current_user,showNotification }) => {
|
||||
export default ({ location, history, current_user, showNotification }) => {
|
||||
console.log(current_user);
|
||||
let defaultValue = decodeURI(location.search.split("=")[1] || "");
|
||||
|
||||
|
@ -33,12 +33,11 @@ export default ({ location, history, current_user,showNotification }) => {
|
|||
});
|
||||
|
||||
const [searchInput, setSearchInput] = useState('');
|
||||
const [orderBy, setOrderBy] = useState('createdAtDesc');
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [myTaskList, setMyTaskList] = useState([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [reload,setReload]=useState(0);
|
||||
const [reload, setReload] = useState(0);
|
||||
|
||||
// 获取任务领域数组
|
||||
useEffect(() => {
|
||||
|
@ -57,7 +56,7 @@ export default ({ location, history, current_user,showNotification }) => {
|
|||
const params = {
|
||||
statusString,
|
||||
searchInput,
|
||||
orderBy,
|
||||
orderBy: 'createdAtDesc',
|
||||
curPage,
|
||||
pageSize: 10,
|
||||
};
|
||||
|
@ -69,7 +68,7 @@ export default ({ location, history, current_user,showNotification }) => {
|
|||
}
|
||||
setLoading(false);
|
||||
})
|
||||
}, [statusString, searchInput, orderBy, curPage ,reload]);
|
||||
}, [statusString, searchInput, curPage, reload]);
|
||||
|
||||
function taskClick(id) {
|
||||
history.push(`/task/taskDetail/${id}`);
|
||||
|
@ -104,9 +103,9 @@ export default ({ location, history, current_user,showNotification }) => {
|
|||
setStatusType(key);
|
||||
}
|
||||
|
||||
const reloadList=useCallback(()=>{
|
||||
setReload(reload+1);
|
||||
},[]);
|
||||
const reloadList = useCallback(() => {
|
||||
setReload(Math.random());
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="centerbox my-task">
|
||||
|
@ -126,12 +125,14 @@ export default ({ location, history, current_user,showNotification }) => {
|
|||
}
|
||||
>
|
||||
<TabPane tab="我发布的任务" key="1">
|
||||
<StatusNav
|
||||
key={'publishStatus'}
|
||||
type={'publishStatus'}
|
||||
options={publishStatusArr}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
{
|
||||
identity === '1' && statusType === '1' && <StatusNav
|
||||
key={'publishStatus'}
|
||||
type={'publishStatus'}
|
||||
options={publishStatusArr}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
}
|
||||
|
||||
<ItemListMyTask
|
||||
list={myTaskList}
|
||||
|
@ -148,12 +149,14 @@ export default ({ location, history, current_user,showNotification }) => {
|
|||
</TabPane>
|
||||
|
||||
<TabPane tab="任务草稿" key="2">
|
||||
<StatusNav
|
||||
key={'unpublishStatus'}
|
||||
type={'unpublishStatus'}
|
||||
options={unpublishStatusArr}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
{
|
||||
identity === '1' && statusType === '2' && <StatusNav
|
||||
key={'unpublishStatus'}
|
||||
type={'unpublishStatus'}
|
||||
options={unpublishStatusArr}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
}
|
||||
|
||||
<ItemListMyTask
|
||||
list={myTaskList}
|
||||
|
@ -165,7 +168,7 @@ export default ({ location, history, current_user,showNotification }) => {
|
|||
loading={loading}
|
||||
showNotification={showNotification}
|
||||
reloadList={reloadList}
|
||||
|
||||
|
||||
/>
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
|
|
|
@ -114,7 +114,7 @@ export default ({ taskCategoryValueArr, showNotification }) => {
|
|||
title: '应征状态',
|
||||
dataIndex: 'status',
|
||||
render: (text, record) => {
|
||||
return record.checkStatus != 1 ? paperCheckStatus[record.checkStatus] : statusArr[text]
|
||||
return text === 0 ? paperCheckStatus[record.checkStatus] : statusArr[text]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -126,18 +126,19 @@ export default ({ taskCategoryValueArr, showNotification }) => {
|
|||
{/* <Link className="line_1 color-grey3" to={`/task/taskDetail/${record.task.id}`}>查看详情</Link> */}
|
||||
<Button size="small" onClick={() => { window.location.href = `/task/taskDetail/${record.task.id}` }}>查看详情</Button>
|
||||
|
||||
{((record.needComplain && record.task.status === 3) || (record.task.status === 5 && record.status !== 2)) &&
|
||||
{((record.needComplain && record.task.status === 3) || (record.task.status === 5 && record.publicTaskComplain && record.status !== 2)) &&
|
||||
<Button type="danger" size="small" onClick={() => { setComplainVisible(true); setCheckedItem(record) }}>申诉</Button>
|
||||
}
|
||||
|
||||
{record.status === 2 && record.task.status === 6 &&
|
||||
<Button type="primary" size="small" onClick={() => { setAgreeVisible(true); setCheckedItem(record) }}>签订协议</Button>
|
||||
{record.status === 2 && record.task.status === 6 && (record.task.agreementSigning === 1) &&
|
||||
< Button type="primary" size="small" onClick={() => { setAgreeVisible(true); setCheckedItem(record) }}>签订协议</Button>
|
||||
}
|
||||
|
||||
{record.status === 2 && record.task.status === 7 && record.task.agreementSigning === 1 &&
|
||||
<Button type="primary" size="small" onClick={() => { setAgreeVisible(true); setCheckedItem(record) }}>确认收款</Button>
|
||||
{
|
||||
record.status === 2 && (!record.pay) && record.task.status === 7 && record.task.agreementSigning === 1 &&
|
||||
<Button type="primary" size="small" onClick={() => { confirmReceiptModal(record.id) }}>确认收款</Button>
|
||||
}
|
||||
</React.Fragment>
|
||||
</React.Fragment >
|
||||
),
|
||||
},
|
||||
];
|
||||
|
@ -180,7 +181,7 @@ export default ({ taskCategoryValueArr, showNotification }) => {
|
|||
}
|
||||
|
||||
const reloadList = useCallback(() => {
|
||||
setReload(reload + 1);
|
||||
setReload(Math.random());
|
||||
}, [])
|
||||
|
||||
return (
|
||||
|
@ -198,21 +199,27 @@ export default ({ taskCategoryValueArr, showNotification }) => {
|
|||
}
|
||||
>
|
||||
<TabPane tab="我参加的任务" key="1">
|
||||
<ChooseNav
|
||||
key={'taskStatus'}
|
||||
type={'taskStatus'}
|
||||
title={'任务状态:'}
|
||||
options={publishStatusArr}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
|
||||
<ChooseNav
|
||||
key={'applyStatus'}
|
||||
type={'applyStatus'}
|
||||
title={'应征状态:'}
|
||||
options={applyStatusArr}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
{requirePaper === '1' &&
|
||||
<React.Fragment>
|
||||
<ChooseNav
|
||||
key={'taskStatus'}
|
||||
type={'taskStatus'}
|
||||
title={'任务状态:'}
|
||||
options={publishStatusArr}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
|
||||
<ChooseNav
|
||||
key={'applyStatus'}
|
||||
type={'applyStatus'}
|
||||
title={'应征状态:'}
|
||||
options={applyStatusArr}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
</React.Fragment>
|
||||
}
|
||||
|
||||
|
||||
<ItemListMyTask
|
||||
list={taskList}
|
||||
|
@ -226,13 +233,15 @@ export default ({ taskCategoryValueArr, showNotification }) => {
|
|||
</TabPane>
|
||||
|
||||
<TabPane tab="我的成果" key="2">
|
||||
<ChooseNav
|
||||
key={'applyStatus'}
|
||||
type={'applyStatus'}
|
||||
title={'应征状态:'}
|
||||
options={applyStatusArr}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
{
|
||||
requirePaper === '2' && <ChooseNav
|
||||
key={'applyStatus'}
|
||||
type={'applyStatus'}
|
||||
title={'应征状态:'}
|
||||
options={applyStatusArr}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
}
|
||||
|
||||
<Table
|
||||
loading={loading}
|
||||
|
@ -258,7 +267,7 @@ export default ({ taskCategoryValueArr, showNotification }) => {
|
|||
/>
|
||||
|
||||
{agreeVisible && <AgreementModal
|
||||
paperId={checkedItem.id}
|
||||
checkedItem={checkedItem}
|
||||
visible={agreeVisible}
|
||||
setVisible={setAgreeVisible}
|
||||
showNotification={showNotification}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useCallback, useMemo, useEffect, useState } from 'react';
|
||||
import { Input, Button, Radio, Form, Table, Pagination, Modal } from 'antd';
|
||||
import { Input, Button, Form, Table, Pagination, Modal } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import AdminRouter from '../components/adminRouter';
|
||||
import StatusNav from '../../components/statusNav';
|
||||
|
@ -17,13 +17,13 @@ for (const item of paperComplainStatusArr) {
|
|||
}
|
||||
const paperComplain = paperComplainStatusArr.slice(0, 2);
|
||||
|
||||
export default Form.create()(({ current_user, form, showNotification, match, history}) => {
|
||||
export default Form.create()(({ form, showNotification, history}) => {
|
||||
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, getFieldsValue } = form;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
|
||||
|
||||
const [approve, setApprove] = useState(1);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [searchObj, setSearchObj] = useState({});
|
||||
// const [searchObj, setSearchObj] = useState({});
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [taskList, setTaskList] = useState([]);
|
||||
|
@ -35,7 +35,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
...searchObj,
|
||||
// ...searchObj,
|
||||
status,
|
||||
curPage,
|
||||
pageSize: 10,
|
||||
|
@ -49,7 +49,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
setLoading(false);
|
||||
})
|
||||
|
||||
}, [reload, status, curPage, searchObj]);
|
||||
}, [reload, status, curPage]);
|
||||
|
||||
|
||||
|
||||
|
@ -61,20 +61,20 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
), []);
|
||||
|
||||
|
||||
function onSearch() {
|
||||
validateFields((err, values) => {
|
||||
if (!err) {
|
||||
setSearchObj({ numberInput: values.numberInput });
|
||||
}
|
||||
});
|
||||
}
|
||||
// function onSearch() {
|
||||
// validateFields((err, values) => {
|
||||
// if (!err) {
|
||||
// setSearchObj({ numberInput: values.numberInput });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
function clearSearch() {
|
||||
setFieldsValue({
|
||||
numberInput: '',
|
||||
});
|
||||
setSearchObj({});
|
||||
}
|
||||
// function clearSearch() {
|
||||
// setFieldsValue({
|
||||
// numberInput: '',
|
||||
// });
|
||||
// setSearchObj({});
|
||||
// }
|
||||
|
||||
|
||||
function changeApprove(approve) {
|
||||
|
@ -166,7 +166,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
}
|
||||
}).then(res => {
|
||||
if (res && res.message === 'success') {
|
||||
setReload(reload + 1);
|
||||
setReload(Math.random());
|
||||
setVisible(false);
|
||||
}
|
||||
setLoading(false);
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
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 DelModal from 'military/components/DelModal';
|
||||
import AdminRouter from '../components/adminRouter';
|
||||
import { paperCheckStatusArr } from '../static';
|
||||
import { readyCheckPapers, checkPaper, deletePaper } from '../api';
|
||||
import { readyCheckPapers, checkPaper, } from '../api';
|
||||
import '../index.scss';
|
||||
const format = "YYYY-MM-DD HH:mm:ss";
|
||||
const Option = Select.Option;
|
||||
|
@ -79,7 +78,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
function checkPaperItem(paperId, passStatus) {
|
||||
validateFields((err, values) => {
|
||||
if (!err) {
|
||||
setLoading(true);
|
||||
setLoading(true);
|
||||
checkPaper({
|
||||
paperId,
|
||||
auditingVo: {
|
||||
|
@ -100,7 +99,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const columns = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
|
@ -116,7 +115,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
width: "20%",
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.taskId}`}>{record.task.name}</Link>
|
||||
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.taskId}`}>{record.task && record.task.name}</Link>
|
||||
</span >
|
||||
),
|
||||
},
|
||||
|
@ -145,7 +144,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
render: (text, record) => {
|
||||
return text === 0 ? <React.Fragment>
|
||||
<Button className="mr5 font-12" type="primary" size="small" onClick={() => { checkPaperItem(record.id, true) }}>通过</Button>
|
||||
<Button className="mr5 font-12" type="info" size="small" onClick={() => { setActiveId(record.id); setVisible(true) }}>不通过</Button>
|
||||
<Button className="mr5 font-12" type="info" size="small" onClick={() => { disagree(record) }}>不通过</Button>
|
||||
</React.Fragment> : checkStatusArr[text]
|
||||
}
|
||||
},
|
||||
|
@ -154,7 +153,6 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<React.Fragment>
|
||||
{/* <Button className="mr5 font-12" type="danger" size="small" onClick={() => { deletItem(record.id) }}>删除</Button> */}
|
||||
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.taskId}`}>查看</Link>
|
||||
</React.Fragment>
|
||||
),
|
||||
|
@ -162,20 +160,32 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
]
|
||||
}, []);
|
||||
|
||||
function deletItem(id) {
|
||||
DelModal(() => {
|
||||
deletePaper(id).then(res => {
|
||||
if (res.message === 'success') {
|
||||
showNotification("删除成功");
|
||||
history.go(-1);
|
||||
} else {
|
||||
showNotification("删除失败");
|
||||
// 不通过评论或者成果
|
||||
function disagree(item) {
|
||||
if (!item.parentId) {
|
||||
setActiveId(item.id); setVisible(true);
|
||||
} else {
|
||||
Modal.confirm({
|
||||
title: '此条评论不通过?',
|
||||
onOk() {
|
||||
setLoading(true);
|
||||
checkPaper({
|
||||
paperId: item.id,
|
||||
auditingVo: {
|
||||
pass: 0,
|
||||
message: '不通过',
|
||||
}
|
||||
}).then(res => {
|
||||
setLoading(false);
|
||||
if (res && res.message === 'success') {
|
||||
setReload(Math.random());
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function changeStatus(e) {
|
||||
setSearchObj({
|
||||
|
@ -195,7 +205,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
|
||||
return (
|
||||
<div className="centerbox task-manage">
|
||||
<AdminRouter history={history}/>
|
||||
<AdminRouter history={history} />
|
||||
<div className="center-screen" >
|
||||
<div className="center-left-but">
|
||||
{helper(
|
||||
|
|
|
@ -11,7 +11,7 @@ agreementArr.splice(1,1);
|
|||
export default Form.create()(({ current_user, form, showNotification, match, history }) => {
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
|
||||
|
||||
const [approve, setApprove] = useState(2);
|
||||
const [approve, setApprove] = useState(1);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [searchObj, setSearchObj] = useState({});
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
|
@ -71,7 +71,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
}
|
||||
|
||||
const reloadList = useCallback(() => {
|
||||
setReload(reload + 1);
|
||||
setReload(Math.random());
|
||||
}, [])
|
||||
|
||||
return (
|
||||
|
@ -80,8 +80,8 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
|
||||
<div className="center-screen" >
|
||||
<div className="center-left-but">
|
||||
<Button className="circle-button" type={approve === 2 ? 'primary' : ''} onClick={() => { changeApprove(2) }}>待上传</Button>
|
||||
<Button className="circle-button" type={approve === 1 ? 'primary' : ''} onClick={() => { changeApprove(1) }}>已上传</Button>
|
||||
<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">
|
||||
|
|
|
@ -80,7 +80,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
}
|
||||
|
||||
const reloadList = useCallback(() => {
|
||||
setReload(reload + 1);
|
||||
setReload(Math.random());
|
||||
}, [])
|
||||
|
||||
return (
|
||||
|
|
|
@ -78,7 +78,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
}
|
||||
|
||||
const reloadList = useCallback(() => {
|
||||
setReload(reload + 1);
|
||||
setReload(Math.random());
|
||||
}, [])
|
||||
|
||||
return (
|
||||
|
|
|
@ -94,7 +94,9 @@ export const paperCheckStatusArr=[
|
|||
{ dicItemCode: '0', name: "待审核", dicItemName: '待审核' },
|
||||
{ dicItemCode: '1', name: "通过", dicItemName: '通过' },
|
||||
{ dicItemCode: '2', name: "未通过", dicItemName: '未通过' },
|
||||
]
|
||||
];
|
||||
|
||||
export const paperCheckTextArr=["您已成功提交,请等待审核!","您的成果已经审核通过!","您的成果审核未通过"];
|
||||
|
||||
export const paperComplainStatusArr=[
|
||||
{ dicItemCode: '0', name: "未通过", dicItemName: '未通过' },
|
||||
|
@ -121,6 +123,11 @@ export const formItemLayout = {
|
|||
},
|
||||
};
|
||||
|
||||
export const main_web_site_url = JSON.parse(localStorage.chromesetting).main_web_site_url;
|
||||
|
||||
export const current_main_site_url = JSON.parse(localStorage.chromesetting).current_main_site_url;
|
||||
|
||||
|
||||
export const formModalLayout = {
|
||||
labelCol: {
|
||||
xs: { span: 10 },
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Input, Select, Button, Form, DatePicker, Table, Pagination, } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import AdminRouter from '../components/adminRouter';
|
||||
import { paperCheckStatusArr, publishModeArr, taskStatusAllArr, showUserModeArr } from '../static';
|
||||
import { paperCheckStatusArr, publishModeArr, taskStatusAllArr, showUserModeArr ,main_web_site_url} from '../static';
|
||||
import { getTaskAdminList, changeShowUserMode } from '../api';
|
||||
import '../index.scss';
|
||||
import './index.scss';
|
||||
|
@ -17,16 +18,18 @@ const checkStatusArr = [];
|
|||
for (const item of paperCheckStatusArr) {
|
||||
checkStatusArr[item.dicItemCode] = item.dicItemName;
|
||||
}
|
||||
export default Form.create()(({ current_user, form, showNotification, match, history }) => {
|
||||
|
||||
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, getFieldsValue } = form;
|
||||
export default Form.create()(({ form, showNotification, match, history }) => {
|
||||
const { getFieldDecorator, setFieldsValue, getFieldsValue } = form;
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [statusString, setStatusString] = useState('');
|
||||
const [publishMode, setPublishMode] = useState('');
|
||||
const [showUserMode, setShowUserMode] = useState('');
|
||||
|
||||
const [sort, setSort] = useState('Desc');
|
||||
const [order, setOrder] = useState('createdAt');
|
||||
const [searchObj, setSearchObj] = useState({});
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [total, setTotal] = useState(0);
|
||||
|
@ -41,7 +44,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
showUserMode: showUserMode.length > 1 ? '' : showUserMode,
|
||||
curPage,
|
||||
pageSize: 10,
|
||||
orderBy:'createdAtDesc',
|
||||
orderBy: order + sort,
|
||||
};
|
||||
setLoading(true);
|
||||
getTaskAdminList(params).then(data => {
|
||||
|
@ -51,7 +54,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
}
|
||||
setLoading(false);
|
||||
})
|
||||
}, [statusString, publishMode, showUserMode, curPage, searchObj]);
|
||||
}, [statusString, order, sort, publishMode, showUserMode, curPage, searchObj]);
|
||||
|
||||
|
||||
const helper = useCallback(
|
||||
|
@ -146,8 +149,8 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
dataIndex: 'enterpriseName',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createdAt',
|
||||
title: '发布时间',
|
||||
dataIndex: 'publishedAt',
|
||||
render: (text, record) => {
|
||||
return text || '--'
|
||||
}
|
||||
|
@ -216,9 +219,26 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
// 改变排序字段
|
||||
const changeSortName = useCallback((sortType) => {
|
||||
setOrder(sortType);
|
||||
setCurPage(1);
|
||||
}, []);
|
||||
|
||||
// 改变排序
|
||||
const changeSort = useCallback((sort) => {
|
||||
setSort(sort);
|
||||
setCurPage(1);
|
||||
}, []);
|
||||
|
||||
function downloadFile() {
|
||||
window.open(main_web_site_url + '/admin/tasks.xlsx');
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="centerbox task-manage-all ">
|
||||
<AdminRouter history={history}/>
|
||||
<AdminRouter history={history} />
|
||||
<div className="search-screen" >
|
||||
{helper(
|
||||
"任务名称",
|
||||
|
@ -263,11 +283,35 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
)}
|
||||
</div>
|
||||
<div className="button-div">
|
||||
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
||||
<Button className="mr10" type="" onClick={clearSearch}>清除</Button>
|
||||
</div>
|
||||
{/* <a href="/admin/tasks.xlsx" class="fr edu-default-btn edu-blueback-btn plr30">导出</a> */}
|
||||
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
||||
<Button className="mr10" onClick={clearSearch}>清除</Button>
|
||||
<Button className="mr10" type="primary" onClick={downloadFile}>导出</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Form.Item className="inline-form" label="排序">
|
||||
<Select
|
||||
style={{ width: '200px' }}
|
||||
showArrow
|
||||
onChange={changeSortName}
|
||||
defaultValue='createdAt'
|
||||
>
|
||||
<Option key={'createdAt'} >创建时间</Option>
|
||||
<Option key={'publishedAt'} >发布时间</Option>
|
||||
</Select>
|
||||
|
||||
<span className={classNames({ "sort-active": sort === 'Desc', 'sort-icon': true, 'ml10': true })} onClick={() => { changeSort('Desc') }}>
|
||||
<i className="fa fa-long-arrow-down font-16 "></i>
|
||||
</span>
|
||||
<span className={classNames({ "sort-active": sort === 'Asc', 'sort-icon': true })} onClick={() => { changeSort('Asc') }}>
|
||||
<i className="fa fa-long-arrow-up font-16 "></i>
|
||||
</span>
|
||||
|
||||
</Form.Item>
|
||||
|
||||
|
||||
|
||||
|
||||
<div className="center-content">
|
||||
|
||||
|
|
|
@ -10,14 +10,14 @@
|
|||
> .ant-row {
|
||||
min-width: 41%;
|
||||
margin-right: 2rem;
|
||||
.ant-form-item-label{
|
||||
.ant-form-item-label {
|
||||
float: left;
|
||||
}
|
||||
.ant-form-item-control-wrapper {
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.center-right-but {
|
||||
.ant-form-item {
|
||||
margin: 0 1rem 0 0;
|
||||
|
@ -26,7 +26,7 @@
|
|||
display: inline-block;
|
||||
}
|
||||
}
|
||||
.button-div{
|
||||
.button-div {
|
||||
margin-right: 1.5rem;
|
||||
}
|
||||
}
|
||||
|
@ -45,3 +45,22 @@
|
|||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.inline-form {
|
||||
margin:-.35rem 0 .5rem 0;
|
||||
text-align: right;
|
||||
.ant-form-item-control-wrapper {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.sort-icon {
|
||||
color: #ccc;
|
||||
i {
|
||||
padding: 0.1rem 0.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.sort-active {
|
||||
color: #29bd8b;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React, { forwardRef, useEffect, useState, useCallback, useMemo } from 'react';
|
||||
import { Form, Input, Button, Modal, Table, Pagination, Checkbox, Tooltip } from 'antd';
|
||||
import { Form, Input, Button, Modal, Checkbox, Tooltip } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import moment from 'moment';
|
||||
import { Link } from "react-router-dom";
|
||||
import { formatDuring, getImageUrl } from 'educoder';
|
||||
import Upload from '../../components/Upload';
|
||||
|
@ -8,7 +9,7 @@ import StatusNav from '../../components/statusNav';
|
|||
import ItemListPaper from '../components/itemListPaper';
|
||||
import ProofModal from '../components/proofModal';
|
||||
import { getTaskDetail, getTaskCategory, getTaskPaper, makePublic, addPaper, getAgreement, agreement, checkAgreement, checkHavePaper } from '../api';
|
||||
import { taskModeIdArr, applyStatusArr, applyStatusAllArr, agreementContent } from '../static';
|
||||
import { taskModeIdArr, applyStatusArr, applyStatusAllArr, agreementContent, paperCheckTextArr } from '../static';
|
||||
import { httpUrl } from '../../fetch';
|
||||
import './index.scss';
|
||||
const { TextArea } = Input;
|
||||
|
@ -75,21 +76,21 @@ export default Form.create()(
|
|||
|
||||
// 检查用户是否同意协议
|
||||
useEffect(() => {
|
||||
id && checkAgreement(id).then(res => {
|
||||
current_user.user_id && id && checkAgreement(id).then(res => {
|
||||
if (res && res.data && res.data.status === 1) {
|
||||
setSignAgreement(true);
|
||||
}
|
||||
})
|
||||
}, []);
|
||||
}, [current_user.user_id]);
|
||||
|
||||
// 检查用户是否上传成果
|
||||
useEffect(() => {
|
||||
id && checkHavePaper(id).then(res => {
|
||||
current_user.user_id && id && checkHavePaper(id).then(res => {
|
||||
if (res && res.data && res.data.status === 1) {
|
||||
setIsPaper(true);
|
||||
}
|
||||
})
|
||||
}, []);
|
||||
}, [current_user.user_id]);
|
||||
|
||||
const taskLimit = useMemo(() => {
|
||||
if (current_user.admin) {
|
||||
|
@ -130,11 +131,7 @@ export default Form.create()(
|
|||
item.detail = item.paperDetail ? item.paperDetail.content : "";
|
||||
}
|
||||
data.rows.sort((a, b) => {
|
||||
if (b.status < a.status) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
return b.status - a.status
|
||||
});
|
||||
}
|
||||
setDataList(data.rows || []);
|
||||
|
@ -148,20 +145,21 @@ export default Form.create()(
|
|||
// 流程步骤显示,返回剩余时间
|
||||
const process = useCallback((title, status, days) => {
|
||||
let surplusTimetext = '';
|
||||
let surplus = detailData.collectingDays * 24 * 3600 - (new Date() - new Date(detailData.publishedAt || detailData.createdAt)) / 1000;
|
||||
if (detailData.status === status) {
|
||||
let surplus = detailData.collectingDays * 24 * 3600 * 1000 - (new Date() - new Date(detailData.publishedAt || detailData.createdAt));
|
||||
if (status === 4) {
|
||||
if (status >= 4) {
|
||||
surplus += detailData.choosingDays * 24 * 3600;
|
||||
}
|
||||
if (status === 5) {
|
||||
surplus += detailData.makePublicDays * 24 * 3600;
|
||||
if (status >= 5) {
|
||||
surplus = detailData.makePublicDays * 24 * 3600 - (new Date() - new Date(detailData.makePublicAt)) / 1000;
|
||||
}
|
||||
if (status === 6) {
|
||||
if (status >= 6) {
|
||||
surplus += detailData.signingDays * 24 * 3600;
|
||||
}
|
||||
if (status === 7) {
|
||||
if (status >= 7) {
|
||||
surplus += detailData.payingDays * 24 * 3600;
|
||||
}
|
||||
|
||||
surplusTimetext = formatDuring(surplus);
|
||||
}
|
||||
return (
|
||||
|
@ -169,10 +167,10 @@ export default Form.create()(
|
|||
<span>{title}</span>
|
||||
{detailData.status !== status && days && <p className="color-grey-6 font-12">{days}天</p>}
|
||||
|
||||
{detailData.status === status && detailData.status !== 8 && detailData.delayTime && <p className="color-grey-6 font-12">{detailData.delayTime}</p>}
|
||||
{/* {detailData.status === status && detailData.status !== 8 && detailData.delayTime && <p className="color-grey-6 font-12">{detailData.delayTime}</p>} */}
|
||||
|
||||
{/* 因为有时只延期几秒或者几分钟时后端没有返回延期,所以这里加一个判断 */}
|
||||
{detailData.status === status && (!detailData.delayTime) && days && <p className="color-grey-6 font-12">{surplusTimetext.indexOf('-') > 0 ? ('延期' + surplusTimetext.replaceAll('-', '')) : ('剩余' + surplusTimetext)}</p>}
|
||||
{detailData.status === status && days && <p className="color-grey-6 font-12">{surplus < 0 ? ('延期' + surplusTimetext) : ('剩余' + surplusTimetext)}</p>}
|
||||
</li>
|
||||
)
|
||||
}, [detailData]);
|
||||
|
@ -218,7 +216,7 @@ export default Form.create()(
|
|||
if (res.message === 'success') {
|
||||
showNotification('成果提交成功');
|
||||
setIsPaper(true);
|
||||
setReload(reload + 1);
|
||||
setReload(Math.random());
|
||||
setCurPage(1);
|
||||
}
|
||||
});
|
||||
|
@ -261,7 +259,7 @@ export default Form.create()(
|
|||
onOk: () => {
|
||||
makePublic(id).then(res => {
|
||||
if (res && res.message === 'success') {
|
||||
setReload(reload + 1);
|
||||
setReload(Math.random());
|
||||
} else {
|
||||
showNotification('操作失败');
|
||||
}
|
||||
|
@ -276,13 +274,19 @@ export default Form.create()(
|
|||
});
|
||||
|
||||
const reloadDetail = useCallback(() => {
|
||||
setReload(reload + 1);
|
||||
setReload(Math.random());
|
||||
}, []);
|
||||
|
||||
const signContent = useCallback(() => {
|
||||
if (signAgreement && isPaper) {
|
||||
let checkStatustext = paperCheckTextArr[0];
|
||||
for (const item of dataList) {
|
||||
if (item.user.login === current_user.login) {
|
||||
checkStatustext = paperCheckTextArr[item.checkStatus];
|
||||
}
|
||||
}
|
||||
return <div className="edu-back-white padding30 mt20 font-16 color-orange text-center">
|
||||
您已成功提交,请等待审核!
|
||||
{checkStatustext}
|
||||
</div>
|
||||
} else if (signAgreement) {
|
||||
return (<div className="edu-back-white padding30 mt20">
|
||||
|
@ -319,15 +323,12 @@ export default Form.create()(
|
|||
<Button className="mr20" type={"primary"} onClick={() => { setApplyModal(true) }}>我要应征投稿</Button>
|
||||
</div>
|
||||
}
|
||||
}, [signAgreement, isPaper, current_user, detailData]);
|
||||
}, [signAgreement, isPaper, current_user, detailData, dataList]);
|
||||
|
||||
function goUser(login) {
|
||||
window.location.href = `/users/${login}`;
|
||||
}
|
||||
|
||||
function exportPaper() {
|
||||
Modal.info({ title: '暂未提供接口' });
|
||||
}
|
||||
|
||||
// 第二种数据展示方式,暂时注释
|
||||
// const columns = useMemo(() => {
|
||||
|
@ -361,6 +362,10 @@ export default Form.create()(
|
|||
window.open(`/users/${current_user.login}/profiles`);
|
||||
}
|
||||
|
||||
function backPublicEnd(makePublicAt, makePublicDays) {
|
||||
return moment(new Date(makePublicAt).getTime() + makePublicDays * 24 * 3600 * 1000).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="centerbox task-detail">
|
||||
<div className="head-navigation">
|
||||
|
@ -395,16 +400,17 @@ export default Form.create()(
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{detailData.status === 5 && <p className="color-orange mb10 task_tip fl">
|
||||
<i className="iconfont icon-laba fl mr5 color-orange font-15"></i>该需求已选稿,作品公示期为{detailData.makePublicDays}天接受监督和举报,于{detailData.makePublicAt}公示期满后支付赏金
|
||||
</p>}
|
||||
{
|
||||
detailData.status === 5 &&
|
||||
<p className="color-orange mb10 task_tip fl">
|
||||
<i className="iconfont icon-laba fl mr5 color-orange font-15"></i>该需求已选稿,作品公示期为{detailData.makePublicDays}天接受监督和举报,于{backPublicEnd(detailData.makePublicAt, detailData.makePublicDays)}公示期满后支付赏金
|
||||
</p>}
|
||||
|
||||
<div className="clearfix tasks_status_father mb30" style={{ background: "#FAFAFA" }}>
|
||||
|
||||
<ul className="tasks_status clearfix">
|
||||
<li className="active"><span>发布任务</span></li>
|
||||
|
||||
|
||||
{process('成果提交', 3, detailData.collectingDays)}
|
||||
|
||||
{process('成果评选', 4, detailData.choosingDays)}
|
||||
|
@ -462,11 +468,9 @@ export default Form.create()(
|
|||
</Tooltip>}
|
||||
{detailData.status === 4 && dataList.length && (!detailData.isProofBoolean) && detailData.user && (current_user.admin || current_user.login === detailData.user.login) ?
|
||||
<a className="line_1 color-blue fr ml20" onClick={() => { setVisibleProofs(true) }}>上传佐证材料</a> : ''}
|
||||
{/* <a href="/tasks/130/export_papers" className="line_1 color-blue fr ml20" data-disable-with="<img alt="Loading" className="download-loading" src="/images/loading.gif?1564989000" ></a>下载中..." target="_blank">一键导出成果物</a> */}
|
||||
{dataList.length > 0 && taskLimit && <a className="line_1 color-blue fr ml20" onClick={exportPaper}>一键导出成果物 >></a>}
|
||||
{dataList.length > 0 && taskLimit && <a className="line_1 color-blue fr ml20" onClick={() => { window.open(`${httpUrl}/api/paper/papers/download/${id}`) }}>一键导出成果物 >></a>}
|
||||
{(!detailData.showUserStatus) && taskLimit && <a className="fr color-orange ml20" onClick={showUser}>应征者名单公示 >></a>}
|
||||
</div>
|
||||
|
||||
<StatusNav
|
||||
key={'applyStatus'}
|
||||
type={'applyStatus'}
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
.task_tip {
|
||||
padding: 0px 20px;
|
||||
border-radius: 15px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background: #FFF8F5;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
|
|||
payingTime: getSomeDayAfter(30 + 15 + 7 + 15 + 15)
|
||||
}
|
||||
});
|
||||
// console.log(displayTime);
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [num, setNum] = useState(0) // 倒计时
|
||||
const [isSend, setIsSend] = useState(false) // 是否发送验证码
|
||||
|
@ -112,7 +111,8 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
|
|||
if (res && res.message === 'success') {
|
||||
setEnterpriseName(res.data.enterpriseName);
|
||||
setFieldsValue({
|
||||
contactPhone:res.data.phone
|
||||
contactPhone:res.data.phone,
|
||||
contactName:res.data.userName,
|
||||
})
|
||||
}else{
|
||||
showNotification(res.message);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { Input, Button, Modal } from 'antd';
|
||||
import moment from 'moment';
|
||||
import { formatDuring } from 'educoder';
|
||||
import ChooseNav from '../../components/chooseNav';
|
||||
import SortBox from '../../components/sortBox';
|
||||
import ItemListTask from '../components/itemListTask';
|
||||
|
@ -9,7 +10,7 @@ import { getTaskList, getTaskCategory, getCompanyInfo } from '../api';
|
|||
import '../index.scss';
|
||||
const Search = Input.Search;
|
||||
|
||||
export default ({ history, current_user }) => {
|
||||
export default ({ history, current_user, showLoginDialog }) => {
|
||||
console.log(current_user);
|
||||
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
@ -54,6 +55,9 @@ export default ({ history, current_user }) => {
|
|||
setLoading(true);
|
||||
getTaskList(params).then(data => {
|
||||
if (data) {
|
||||
for (const item of data.rows) {
|
||||
item.delayTime = surplusTime(item);
|
||||
}
|
||||
setTaskList(data.rows);
|
||||
setTotal(data.total);
|
||||
}
|
||||
|
@ -82,6 +86,26 @@ export default ({ history, current_user }) => {
|
|||
}
|
||||
}, []);
|
||||
|
||||
function surplusTime(item) {
|
||||
let status = item.status;
|
||||
let surplus = item.collectingDays * 24 * 3600 - (new Date() - new Date(item.publishedAt || item.createdAt)) / 1000;
|
||||
if (status >= 4) {
|
||||
surplus += item.choosingDays * 24 * 3600;
|
||||
}
|
||||
if (status >= 5) {
|
||||
surplus = item.makePublicDays * 24 * 3600 - (new Date() - new Date(item.makePublicAt)) / 1000;
|
||||
}
|
||||
if (status >= 6) {
|
||||
surplus += item.signingDays * 24 * 3600;
|
||||
}
|
||||
if (status >= 7) {
|
||||
surplus += item.payingDays * 24 * 3600;
|
||||
}
|
||||
|
||||
let surplusTimetext = formatDuring(surplus);
|
||||
return surplus > 0 ? '剩余' + surplusTimetext : '延期' + surplusTimetext;
|
||||
}
|
||||
|
||||
// 改变排序
|
||||
const changeSort = useCallback((sortType) => {
|
||||
let sortValue = '';
|
||||
|
@ -97,11 +121,19 @@ export default ({ history, current_user }) => {
|
|||
}, []);
|
||||
|
||||
function taskClick(id) {
|
||||
if (!current_user.user_id) {
|
||||
showLoginDialog();
|
||||
return;
|
||||
}
|
||||
history.push(`/task/taskDetail/${id}`);
|
||||
}
|
||||
|
||||
// 新增校验
|
||||
function goAdd() {
|
||||
if (!current_user.user_id) {
|
||||
showLoginDialog();
|
||||
return;
|
||||
}
|
||||
getCompanyInfo().then(res => {
|
||||
if (res) {
|
||||
if (res.message === 'success') {
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Input, Button, Form } from 'antd';
|
|||
import AdminRouter from "../components/adminRouter";
|
||||
import ItemTaskManage from '../components/itemTaskManage';
|
||||
import StatusNav from '../../components/statusNav';
|
||||
import { approveArr } from '../static';
|
||||
import { approveArr, main_web_site_url } from '../static';
|
||||
import { getTaskAdminList, getTaskCategory } from '../api';
|
||||
import '../index.scss';
|
||||
|
||||
|
@ -94,7 +94,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
}
|
||||
|
||||
const reloadList = useCallback(() => {
|
||||
setReload(reload + 1);
|
||||
setReload(Math.random());
|
||||
}, [])
|
||||
|
||||
return (
|
||||
|
@ -133,7 +133,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
|
||||
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
||||
<Button className="mr10" type="" onClick={clearSearch}>清除</Button>
|
||||
|
||||
<Button className="mr10" type="primary" onClick={() => { window.open(`${main_web_site_url}/admin/tasks/activity_managed_tasks.zip?review_status=reviewing&status_value=0`) }}>导出</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue