修改bug

This commit is contained in:
何童崇 2021-07-13 10:53:19 +08:00
parent b6c2c66321
commit 507976bf10
15 changed files with 150 additions and 46 deletions

View File

@ -12,6 +12,7 @@ export function getImageUrl(path) {
// https://testbdweb.trustie.net
// const local = 'http://localhost:3000'
const local = 'http://39.105.176.215:49999';
if (isDev) {
return `${local}/${path}`
}

View File

@ -162,6 +162,35 @@
text-align: left;
}
.ant-modal-footer{
text-align: center;
border: 0;
}
// 头像
.head-log-big{
width: 4rem;
height: 4rem;
margin-right: .5rem;
border-radius: 50%;
}
.head-log-middle{
width: 3rem;
height: 3rem;
margin-right: .35rem;
border-radius: 50%;
}
.head-log-small{
width: 1.25rem;
height: 1.25rem;
margin-right: .35rem;
border-radius: 50%;
}
// 富文本样式
.w-e-text table td, .w-e-text table th{
height: 30px;

View File

@ -54,6 +54,7 @@ export default Form.create()(props => {
className="form-edit-modal"
>
<div className="task-popup-content">
<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" target="_blank">协议样板</a>
<Form.Item className="upload-form" label="附件上传" required={true}>
<Upload
className="commentStyle"

View File

@ -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 { adminCheckAgreement } from '../../api';
import { httpUrl } from 'military/fetch';
import './index.scss';
import winpng from '../../image/win.png';
const { TextArea } = Input;
export default Form.create()((props) => {
@ -102,7 +101,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>

View File

@ -21,6 +21,7 @@ export default Form.create()((props) => {
const [page, setPage] = useState(1);
const [visibleProofs, setVisibleProofs] = useState(false);
const [taskId, setTaskId] = useState();
const [taskModeId, setTaskModeId] = useState('');
const pageSize = props.pageSize || 10;
const [visibleMethod, setVisibleMethod] = useState(false);
@ -35,6 +36,7 @@ export default Form.create()((props) => {
function uploadProofs(item) {
setVisibleProofs(true);
setTaskId(item.id);
setTaskModeId(item.taskModeId);
}
function adviceModal(advice) {
@ -138,7 +140,8 @@ export default Form.create()((props) => {
<ul className="df">
<li key={1} className="with35 edu-txt-left font-16 font-bd" style={{ justifyContent: "left" }}>
<Link className="color-grey3 font-16 font-bd" to={`/task/taskDetail/${item.id}`}>{item.name}</Link>
{item.status == 4 && <span className="list_status ml10">待确认</span>}
{item.status === 4 && <span className="list_status ml10">待确认</span>}
{item.status === 6 && <span className="list_status s_orange ml10">待签订协议</span>}
</li>
<li key={2} className="with15 flex-column">
<span className="line_1">{taskCategoryValueArr[item.categoryId]}</span>
@ -161,7 +164,7 @@ export default Form.create()((props) => {
}
{
(item.status === 3 || item.status === 4) && item.papersCount > 0 && (!item.isProofBoolean) &&
item.status === 4 && item.papersCount > 0 && (!item.isProofBoolean) &&
<a onClick={() => { uploadProofs(item) }} className="line_1 color-blue">上传佐证材料</a>
}
@ -200,6 +203,7 @@ export default Form.create()((props) => {
{visibleProofs && <ProofModal
taskId={taskId}
taskModeId={taskModeId}
visible={visibleProofs}
changeVisible={setVisibleProofs}
showNotification={showNotification}

View File

@ -6,6 +6,7 @@
color: #656565;
text-align: center;
margin-bottom: 10px;
}
.needs_condition_content {
@ -37,6 +38,11 @@
margin-left: 0.625rem;
font-size: 0.8rem;
}
.s_orange {
background: #FFB121;
}
.needs_condition_content_t {
height: 40px;
padding: 0px 20px;
@ -76,4 +82,5 @@
word-break: break-all;
}
}
}
}

View File

@ -1,7 +1,7 @@
import React, { useEffect, useState, useCallback } from 'react';
import { Pagination, Modal, Form, Input, Button } from 'antd';
import ReactWEditor from 'wangeditor-for-react';
import { timeAgo } from 'educoder';
import { timeAgo, getImageUrl } from 'educoder';
import Nodata from 'forge/Nodata';
import Loading from "src/Loading";
import { editorConfig } from 'military/components/config';
@ -11,7 +11,6 @@ import { reportPaper, thumbUpPaper, commentAdd, confirmReceipt } from '../../api
import { paperCheckStatusArr } from '../../static';
import { httpUrl } from '../../../fetch';
import winpng from '../../image/winner.png';
import headpng from '../../image/head.png';
import './index.scss';
const { TextArea } = Input;
@ -33,10 +32,11 @@ export default Form.create()((props) => {
const [commentId, setCommentId] = useState(undefined);
const [complainVisible, setComplainVisible] = useState(false);
const [agreeVisible, setAgreeVisible] = useState(false);
const [loadingChild, setLoadingChild] = useState(false);
const [agreeVisible, setAgreeVisible] = useState(false);
useEffect(() => {
changePage(page);
@ -146,7 +146,7 @@ export default Form.create()((props) => {
return (
<div className="fileComments df" key={item.id}>
<img alt="头像加载失败" src={headpng} width="50" height="50" className="bor-radius-all mr20" />
<img alt="头像加载失败" src={item.user && getImageUrl(item.user.logo)} width="50" height="50" className="bor-radius-all mr20" />
<div className="flex1">
<ul>
<li className="fl pr">
@ -154,7 +154,7 @@ 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 === 5) && (current_user.login === item.user.login) &&

View File

@ -1,10 +1,9 @@
import React, { useEffect, useState } from 'react';
import { Icon, Pagination } from 'antd';
import { formatDuring } from 'educoder';
import { formatDuring, getImageUrl } from 'educoder';
import Nodata from 'forge/Nodata';
import { taskStatusAllArr } from '../../static';
import Loading from "src/Loading";
import winpng from '../../image/win.png';
import './index.scss';
const statusArr = [];
@ -46,8 +45,8 @@ export default (props) => {
</div>
<div className="list-other">
<span className="user-box mr30" onClick={() => { goUser(item.user.login) }}>
<img alt="头像加载失败" className="radius mr5" src={winpng} />
{item.user.nickname || item.user.login}
<img alt="" className="head-log-small" src={getImageUrl(item.user.logo)} />
<span>{item.user.nickname || item.user.login}</span>
</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>

View File

@ -12,6 +12,10 @@
&:hover{
color: #409eff;
}
.head-log-small{
position: relative;
top:-2px;
}
}
.price {
font-weight: 500;

View File

@ -3,11 +3,10 @@ import { Pagination, Modal, Input } 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 { checkProof } from '../../api';
import { httpUrl } from 'military/fetch';
import './index.scss';
import winpng from '../../image/win.png';
const { TextArea } = Input;
export default (props) => {
@ -80,7 +79,7 @@ export default (props) => {
window.open(url);
}
return (
loading ? <Loading /> :
@ -90,7 +89,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>

View File

@ -9,7 +9,7 @@ import './index.scss';
export default Form.create()(props => {
const { changeVisible, taskId, visible, form, showNotification, reloadList } = props;
const { changeVisible, taskId, taskModeId, visible, form, showNotification, reloadList } = props;
const { getFieldDecorator, validateFields, setFieldsValue, getFieldsValue } = form;
const pageSize = props.pageSize || 10;
@ -97,16 +97,20 @@ export default Form.create()(props => {
title: '操作',
dataIndex: 'action',
render: (text, record) => {
return <Link className="line_1 color-grey3" to={`/task/taskDetail/${taskId}`}>查看详情</Link>
return <Link className="line_1 color-grey3" to={`/task/taskDetail/${record.task.id}`}>查看详情</Link>
}
}];
}, [taskId]);
const rowSelection = {
onChange: (selectedRowKeys, selectedRows) => {
setSelectedRows(selectedRows);
},
};
const rowSelection = useMemo(() => {
return {
type: taskModeId === 1 ? 'radio' : 'checkbox',
onChange: (selectedRowKeys, selectedRows) => {
setSelectedRows(selectedRows);
},
}
}, [taskModeId]);
const handleRow = record => {
return {
@ -188,10 +192,7 @@ export default Form.create()(props => {
dataSource={dataList}
columns={columns}
pagination={false}
rowSelection={{
type: 'checkbox',
...rowSelection,
}}
rowSelection={rowSelection}
onRow={handleRow}
/>
{total > 10 &&

View File

@ -177,6 +177,7 @@ export default ({ location, history, current_user,showNotification }) => {
<JoinTask
taskCategoryValueArr={taskCategoryValueArr}
showNotification={showNotification}
/>
</TabPane>

View File

@ -1,22 +1,29 @@
import React, { useCallback, useEffect, useState, useMemo } from 'react';
import { Tabs, Input, Table, Pagination } from 'antd';
import { Tabs, Input, Table, Pagination, Modal } from 'antd';
import { Link } from "react-router-dom";
import ChooseNav from '../../components/chooseNav';
import ItemListMyTask from '../components/itemListMyTask';
import { applyStatusAllArr, applyStatusArr, publishModeArr } from '../static';
import { getJoinTaskList, myPapers } from '../api';
import AgreementModal from '../components/agreementModal';
import ComplainModal from '../components/complainModal';
import { applyStatusAllArr, paperCheckStatusArr, applyStatusArr, publishModeArr, taskStatusAllArr } from '../static';
import { getJoinTaskList, myPapers, confirmReceipt } from '../api';
import './index.scss';
const Search = Input.Search;
const { TabPane } = Tabs;
const publishStatusArr = applyStatusAllArr.slice(3, 9);
const publishStatusArr = taskStatusAllArr.slice(3, 9);
const statusArr = [];
for (const item of applyStatusAllArr) {
statusArr[item.dicItemCode] = item.dicItemName;
}
export default ({ taskCategoryValueArr }) => {
const paperCheckStatus = [];
for (const item of paperCheckStatusArr) {
paperCheckStatus[item.dicItemCode] = item.dicItemName;
}
export default ({ taskCategoryValueArr, showNotification }) => {
const [paperStatusString, setPaperStatusString] = useState('0,1,2,3,4');
const [taskStatusString, setTaskStatusString] = useState('3,4,5,6,7,8');
@ -32,6 +39,12 @@ export default ({ taskCategoryValueArr }) => {
const [totalPaper, setTotalPaper] = useState(0);
const [paperList, setPaperList] = useState([]);
const [checkedItem, setCheckedItem] = useState({});
const [complainVisible, setComplainVisible] = useState(false);
const [agreeVisible, setAgreeVisible] = useState(false);
const [reload, setReload] = useState(0);
useEffect(() => {
if (requirePaper === '1') {
const params = {
@ -69,7 +82,7 @@ export default ({ taskCategoryValueArr }) => {
setLoading(false);
})
}
}, [requirePaper, paperStatusString, searchInput, curPagePaper]);
}, [requirePaper, paperStatusString, searchInput, curPagePaper, reload]);
const columns = useMemo(() => {
@ -77,8 +90,9 @@ export default ({ taskCategoryValueArr }) => {
{
title: '任务/编号名称',
dataIndex: 'name',
width: '30%',
render: (text, record) => {
return <Link className="color-grey3 font-16 font-bd" to={`/task/taskDetail/${record.task.id}`}>{record.task.number +" "+ record.task.name}</Link>
return <Link className="color-grey3 font-16 font-bd" to={`/task/taskDetail/${record.task.id}`}>{record.task.number + " " + record.task.name}</Link>
}
},
{
@ -100,7 +114,7 @@ export default ({ taskCategoryValueArr }) => {
title: '应征状态',
dataIndex: 'status',
render: (text, record) => {
return statusArr[text]
return record.checkStatus != 1 ? paperCheckStatus[record.checkStatus] : statusArr[text]
}
},
{
@ -108,7 +122,15 @@ export default ({ taskCategoryValueArr }) => {
key: 'action',
render: (text, record) => (
<span>
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.id}`}>查看详情</Link>
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.task.id}`}>查看详情</Link>
{(record.needComplain || record.task.status === 5) &&
<a className="base_smallBtn blue_line_btn fl" onClick={() => { setComplainVisible(true); setCheckedItem(record) }}>申诉</a>}
{record.status === 2 && record.task.status === 6 &&
<a className="base_smallBtn blue_line_btn fl" onClick={() => { setAgreeVisible(true); setCheckedItem(record) }}>签订协议</a>}
{record.status === 2 && record.task.status === 7 &&
<a className="base_smallBtn blue_line_btn fl" onClick={() => { confirmReceiptModal(record.id) }}>确认收款</a>}
</span >
),
},
@ -116,6 +138,21 @@ export default ({ taskCategoryValueArr }) => {
}, [taskCategoryValueArr, publishModeArr, statusArr]);
function confirmReceiptModal(paperId) {
Modal.confirm({
title: '确认收款',
content: '确认已经收到任务报酬',
onOk: () => {
confirmReceipt(paperId).then(res => {
if (res && res.message === "success") {
showNotification("您已确认收款!");
}
})
}
})
}
const changeOptionId = useCallback((option, type) => {
if (type === 'taskStatus') {
setTaskStatusString(option.dicItemCode.toString() || '3,4,5,6,7,8');
@ -136,6 +173,10 @@ export default ({ taskCategoryValueArr }) => {
setRequirePaper(key);
}
const reloadList = useCallback(() => {
setReload(reload + 1);
}, [])
return (
<Tabs className="childTab"
@ -200,6 +241,23 @@ export default ({ taskCategoryValueArr }) => {
current={curPage}
total={totalPaper}
/>}
<ComplainModal
visible={complainVisible}
setVisible={setComplainVisible}
checkedItem={checkedItem}
detailStatus={checkedItem.task && checkedItem.task.status}
showNotification={showNotification}
/>
{agreeVisible && <AgreementModal
paperId={checkedItem.id}
visible={agreeVisible}
setVisible={setAgreeVisible}
showNotification={showNotification}
reloadList={reloadList}
/>}
</TabPane>
</Tabs>

View File

@ -112,7 +112,7 @@ export default Form.create()(({ current_user, form, showNotification, match, })
render: (text, record) => {
return <div>
{
record.materials && record.materials.map(item => {
Array.isArray(record.materials) && record.materials.map(item => {
return <div className="file-list-box" key={item.id}>
<a onClick={() => { downFile(item) }}><i className="iconfont icon-fujian color-green font-14 mr3"></i>
{item.fileName} </a>

View File

@ -2,7 +2,7 @@ import React, { forwardRef, useEffect, useState, useCallback, useMemo } from 're
import { Form, Input, Button, Modal, Table, Pagination, Checkbox, Tooltip } from 'antd';
import classNames from 'classnames';
import { Link } from "react-router-dom";
import { formatDuring } from 'educoder';
import { formatDuring, getImageUrl } from 'educoder';
import Upload from '../../components/Upload';
import StatusNav from '../../components/statusNav';
import ItemListPaper from '../components/itemListPaper';
@ -11,7 +11,6 @@ import { getTaskDetail, getTaskCategory, getTaskPaper, updateTask, addPaper, get
import { taskModeIdArr, applyStatusArr, applyStatusAllArr, agreementContent } from '../static';
import { httpUrl } from '../../fetch';
import winpng from '../image/win.png';
import headpng from '../image/head.png';
import './index.scss';
const { TextArea } = Input;
@ -137,7 +136,7 @@ export default Form.create()(
}, [id, status, curPage, reload, relaodChildList]);
//
//
const process = useCallback((title, status, days) => {
let surplusTimetext = '';
if (detailData.status === status) {
@ -163,7 +162,8 @@ export default Form.create()(
{detailData.status === status && detailData.delayTime && <p className="color-grey-6 font-12">{detailData.delayTime}</p>}
{detailData.status === status && (!detailData.delayTime) && <p className="color-grey-6 font-12">剩余{surplusTimetext}</p>}
{/* 因为有时只延期几秒或者几分钟时后端没有返回延期,所以这里加一个判断 */}
{detailData.status === status && (!detailData.delayTime) && <p className="color-grey-6 font-12">{surplusTimetext.indexOf('-') > 0 ? ('延期' + surplusTimetext.replaceAll('-', '')) : ('剩余' + surplusTimetext)}</p>}
</li>
)
}, [detailData]);
@ -364,7 +364,7 @@ export default Form.create()(
<div className="df mb20">
<div className="mr30">
<a onClick={() => { goUser(detailData.user.login) }} alt="用户头像">
<img alt="头像加载失败" className="bor-radius-all" height="60" src={headpng} width="60" />
<img alt="头像加载失败" className="bor-radius-all" height="60" src={detailData.user && getImageUrl(detailData.user.logo)} width="60" />
</a>
<p className="lineh-20 mt10 edu-txt-center">{detailData && detailData.user && (detailData.user.nickname || detailData.user.login)}</p>
</div>
@ -451,7 +451,7 @@ export default Form.create()(
{!detailData.showUserStatus && <Tooltip placement="top" title={"不公示应征者姓名"}>
<i data-tip-down="不公示应征者姓名" className="iconfont icon-yincang1 color-grey9 font-20"></i>
</Tooltip>}
{(detailData.status === 3 || detailData.status === 4) && dataList.length && (!detailData.isProofBoolean) && detailData.user && (current_user.admin || current_user.login === detailData.user.login) ?
{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=&quot;Loading&quot; className=&quot;download-loading&quot; src=&quot;/images/loading.gif?1564989000&quot; ></a>下载中..." target="_blank">一键导出成果物</a> */}
{dataList.length > 0 && taskLimit && <a className="line_1 color-blue fr ml20" onClick={exportPaper}>一键导出成果物 &gt;&gt;</a>}
@ -515,6 +515,7 @@ export default Form.create()(
{
visibleProofs && <ProofModal
taskId={id}
taskModeId={detailData.taskModeId}
visible={visibleProofs}
changeVisible={setVisibleProofs}
showNotification={showNotification}