forked from Gitlink/forgeplus-react
修改bug
This commit is contained in:
parent
4bf4aa7c78
commit
e0b267bd6c
|
@ -38,7 +38,17 @@ function Uploads({ className, size, actionUrl, fileList, showNotification, load
|
|||
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
|
||||
let fileList = info.fileList;
|
||||
setFiles(appendFileSizeToUploadFileAll(fileList));
|
||||
if (info.file.status === 'done' || info.file.status === 'removed') load && load(fileList);
|
||||
if (info.file.response) {
|
||||
for (let i = 0; i < fileList.length; i++) {
|
||||
if (fileList[i].response && !fileList[i].response.data) {
|
||||
fileList.splice(i, 1);
|
||||
}
|
||||
}
|
||||
load && load(fileList);
|
||||
if (!info.file.response.data) {
|
||||
info.file.response && showNotification(info.file.response.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -400,4 +400,13 @@ export function checkPublicity(data){
|
|||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function signMethod(data){
|
||||
return fetch({
|
||||
url: `/api/sign/method/${data.taskId}/${data.method}`,
|
||||
method: 'post',
|
||||
// data,
|
||||
});
|
||||
}
|
|
@ -1,10 +1,11 @@
|
|||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { Modal, Pagination } from 'antd';
|
||||
import { Form, Modal, Pagination, Radio, } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import Nodata from 'forge/Nodata';
|
||||
import Loading from "src/Loading";
|
||||
import ProofModal from '../proofModal';
|
||||
import { publishModeArr, taskStatusAllArr } from '../../static';
|
||||
import { signMethod } from "../../api";
|
||||
import '../../index.scss';
|
||||
import './index.scss';
|
||||
|
||||
|
@ -12,15 +13,16 @@ const statusArr = [];
|
|||
for (const item of taskStatusAllArr) {
|
||||
statusArr[item.dicItemCode] = item.dicItemName;
|
||||
}
|
||||
export default (props) => {
|
||||
const { list, curPage, total, changePage, taskCategoryValueArr, loading, publish, showNotification, reloadList } = props;
|
||||
export default Form.create()((props) => {
|
||||
const { form, list, curPage, total, changePage, taskCategoryValueArr, loading, publish, showNotification, reloadList } = props;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
|
||||
|
||||
const [page, setPage] = useState(1);
|
||||
const [visibleProofs, setVisibleProofs] = useState(false);
|
||||
const [taskId, setTaskId] = useState();
|
||||
const pageSize = props.pageSize || 10;
|
||||
|
||||
const [visibleMethod,setVisibleMethod]=useState(false);
|
||||
const [visibleMethod, setVisibleMethod] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
changePage(page);
|
||||
|
@ -38,18 +40,45 @@ export default (props) => {
|
|||
})
|
||||
}
|
||||
|
||||
function proofAdvice(advice){
|
||||
function proofAdvice(advice) {
|
||||
Modal.info({
|
||||
title: '审核意见',
|
||||
content: advice
|
||||
})
|
||||
}
|
||||
|
||||
function signMethodModal(item){
|
||||
function signMethodModal(item) {
|
||||
setVisibleMethod(true);
|
||||
setTaskId(item.id);
|
||||
}
|
||||
|
||||
function chooseMethod() {
|
||||
validateFields((err, values) => {
|
||||
if (!err) {
|
||||
signMethod({
|
||||
taskId,
|
||||
...values,
|
||||
}).then(res => {
|
||||
if (res && res.message === 'success') {
|
||||
setVisibleMethod(false);
|
||||
setFieldsValue({
|
||||
method: ''
|
||||
});
|
||||
} else {
|
||||
showNotification(res.message || '提交失败');
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const helper = useCallback(
|
||||
(name, rules, widget) => (
|
||||
<Form.Item>
|
||||
{getFieldDecorator(name, { rules, validateFirst: true, })(widget)}
|
||||
</Form.Item>
|
||||
), []);
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<ul className="df mt10 needs_condition_content_nav">
|
||||
|
@ -106,7 +135,7 @@ export default (props) => {
|
|||
|
||||
{(item.status === 9) && <a onClick={() => { repairAdvice(item.advice) }} className="line_1 color-blue">审核意见</a>}
|
||||
|
||||
{<a class="line_1 color-blue" onClick={() => { signMethodModal(item.advice) }}>选择协议签订方式</a>}
|
||||
{item.status === 6 && <a className="line_1 color-blue" onClick={() => { signMethodModal(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> */}
|
||||
</li>
|
||||
|
@ -137,7 +166,32 @@ export default (props) => {
|
|||
showNotification={showNotification}
|
||||
reloadList={reloadList}
|
||||
/>
|
||||
|
||||
|
||||
<Modal
|
||||
title="选择签订协议方式"
|
||||
visible={visibleMethod}
|
||||
onOk={chooseMethod}
|
||||
onCancel={() => { setVisibleMethod(false) }}
|
||||
className="form-edit-modal"
|
||||
>
|
||||
{
|
||||
helper('method', [{ required: true, message: '请选择签订协议的方式' }],
|
||||
<Radio.Group className="vertical-radio">
|
||||
<Radio value={2}>
|
||||
<p>委托平台签订</p>
|
||||
<p className="color-grey-9">以平台名义与评选胜出者签订协议,需要经平台管理员审批需要发布方将奖励经费划归平台,在审核通过后平台自动发送电子协议</p>
|
||||
</Radio>
|
||||
<Radio value={1}>
|
||||
<p>自主签订</p>
|
||||
<p className="color-grey-9">通过线下的方式,以发布方名义与评选胜出者签订协议</p>
|
||||
</Radio>
|
||||
</Radio.Group>)
|
||||
}
|
||||
</Modal>
|
||||
|
||||
</React.Fragment>
|
||||
|
||||
)
|
||||
}
|
||||
)
|
|
@ -62,3 +62,18 @@
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.vertical-radio{
|
||||
.ant-radio-wrapper{
|
||||
display: flex;
|
||||
line-height: 2rem;
|
||||
align-items: flex-start;
|
||||
.ant-radio{
|
||||
margin-top:.5rem;
|
||||
}
|
||||
p{
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ import Loading from "src/Loading";
|
|||
import { editorConfig } from 'military/components/config';
|
||||
import Upload from 'military/components/Upload';
|
||||
import { reportPaper, thumbUpPaper, commentAdd, complainPaper, publicityComplain } from '../../api';
|
||||
import {paperCheckStatusArr} from '../../static';
|
||||
import { httpUrl } from '../../../fetch';
|
||||
import winpng from '../../image/winner.png';
|
||||
import headpng from '../../image/head.png';
|
||||
|
@ -14,6 +15,11 @@ import './index.scss';
|
|||
|
||||
const { TextArea } = Input;
|
||||
|
||||
const paperCheckStatus=[];
|
||||
for (const item of paperCheckStatusArr){
|
||||
paperCheckStatus[item.dicItemCode]=item.dicItemName;
|
||||
}
|
||||
|
||||
export default Form.create()((props) => {
|
||||
const { list, curPage, total, changePage, loading, applyStatusAllNameArr, reloadList, showNotification, current_user, form, detailStatus } = props;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue } = form;
|
||||
|
@ -179,7 +185,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 === 0 ? "待审核" : 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) && <a className="base_smallBtn blue_line_btn fl" onClick={() => { setComplainVisible(true); setCheckedItem(item) }}>
|
||||
|
@ -209,7 +215,7 @@ export default Form.create()((props) => {
|
|||
<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.content }}>
|
||||
<div className="editor-w-text comments-content" dangerouslySetInnerHTML={{ __html: commentsItem.details&&commentsItem.details.content }}>
|
||||
</div>
|
||||
</div>
|
||||
})
|
||||
|
|
|
@ -8,7 +8,7 @@ import '../../index.scss';
|
|||
import './index.scss';
|
||||
|
||||
|
||||
export default Form.create()((props) => {
|
||||
export default Form.create()(props => {
|
||||
const { changeVisible, taskId, visible, form, showNotification, reloadList } = props;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
|
||||
|
||||
|
|
|
@ -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 } from 'educoder';
|
||||
import Upload from '../../components/Upload';
|
||||
import StatusNav from '../../components/statusNav';
|
||||
import ItemListPaper from '../components/itemListPaper';
|
||||
|
@ -448,8 +448,8 @@ 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 && dataList.length && (!detailData.isProofBoolean) && detailData.user && (current_user.login === detailData.user.login) &&
|
||||
<a className="line_1 color-blue fr ml20" onClick={() => { setVisibleProofs(true) }}>上传佐证材料</a>}
|
||||
{detailData.status === 4 && dataList.length && (!detailData.isProofBoolean) && detailData.user && (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>}
|
||||
{(!detailData.showUserStatus) && taskLimit && <a className="fr color-orange ml20" onClick={showUser}>应征者名单公示 >></a>}
|
||||
|
|
Loading…
Reference in New Issue