上传修改bug

This commit is contained in:
何童崇 2021-07-15 14:33:14 +08:00
parent 91fe328eaf
commit 4503e1b176
14 changed files with 132 additions and 75 deletions

View File

@ -227,13 +227,6 @@
}
}
.ant-modal-body{
.ant-form-item-control-wrapper{
max-width: 80%;
}
}
@media screen and (max-width: 1200px){

View File

@ -101,7 +101,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
placeholder="请选择协议"
onChange={(type) => { setType(type) }}
>
<Option key={'1'}>任务协议</Option>
<Option key={'1'}>委托协议</Option>
<Option key={'2'}>成果协议</Option>
</Select>,
type

View File

@ -15,7 +15,7 @@ for (const item of taskStatusAllArr) {
statusArr[item.dicItemCode] = item.dicItemName;
}
export default Form.create()((props) => {
const { form, list, curPage, total, changePage, taskCategoryValueArr, loading, publish, showNotification, reloadList } = props;
const { form, list, curPage, total, changePage, taskCategoryValueArr, loading, publish, showNotification, reloadList, joinTask } = props;
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
const [page, setPage] = useState(1);
@ -61,17 +61,17 @@ export default Form.create()((props) => {
if (!err) {
signMethod({
taskId,
method:values.method,
method: values.method,
}).then(res => {
if (res && res.message === 'success') {
showNotification('选择签订方式成功');
showNotification('选择协议签订方式成功');
setVisibleMethod(false);
setFieldsValue({
method: ''
});
reloadList();
} else {
showNotification((res && res.message) || '提交失败');
showNotification((res && res.message) || '操作失败');
}
})
}
@ -140,8 +140,15 @@ export default Form.create()((props) => {
<ul className="df">
<li key={1} className="mytask-title with35 edu-txt-left font-16 font-bd" >
<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 === 6 && <span className="list_status s_orange ml10">待签订协议</span>}
{
joinTask ? <React.Fragment>
{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>}
</React.Fragment>
}
</li>
<li key={2} className="with15 flex-column">
<span className="line_1">{taskCategoryValueArr[item.categoryId]}</span>
@ -158,28 +165,37 @@ export default Form.create()((props) => {
</li>
<li key={5} className="with15 flex-column">
{
item.status === 0 || item.status === 9 ?
<Link className="line_1 color-grey3" to={`/task/taskEdit/${item.id}`}>编辑草稿</Link> :
<Link className="line_1 color-grey3" to={`/task/taskDetail/${item.id}`}>查看详情</Link>
joinTask ? <Link className="line_1 color-grey3" to={`/task/taskDetail/${item.id}`}>查看详情</Link>
:
<React.Fragment>
{
item.status === 0 || item.status === 9 ?
<Link className="line_1 color-grey3" to={`/task/taskEdit/${item.id}`}>编辑草稿</Link> :
<Link className="line_1 color-grey3" to={`/task/taskDetail/${item.id}`}>查看详情</Link>
}
{
item.status === 4 && item.papersCount > 0 && (!item.isProofBoolean) &&
<a onClick={() => { uploadProofs(item) }} className="line_1 color-blue">上传佐证材料</a>
}
{
(!item.isProofBoolean) && (item.taskResultProof && item.taskResultProof.status === 0) &&
<a onClick={() => { adviceModal(item.advice) }} className="line_1 color-blue">佐证被拒原因</a>
}
{(item.status === 2 || item.status === 9) && <a onClick={() => { adviceModal(item.repairAdvice) }} className="line_1 color-blue">审核意见</a>}
{item.status === 6 && item.agreementSigning === 0 && <a className="line_1 color-blue" onClick={() => { signMethodModal(item) }}>选择协议签订方式</a>}
{item.status === 6 && item.agreementSigning === 2 && <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>
}
{
item.status === 4 && item.papersCount > 0 && (!item.isProofBoolean) &&
<a onClick={() => { uploadProofs(item) }} className="line_1 color-blue">上传佐证材料</a>
}
{
(!item.isProofBoolean) && (item.taskResultProof && item.taskResultProof.status === 0) &&
<a onClick={() => { adviceModal(item.advice) }} className="line_1 color-blue">佐证被拒原因</a>
}
{(item.status === 2 || item.status === 9) && <a onClick={() => { adviceModal(item.repairAdvice) }} className="line_1 color-blue">审核意见</a>}
{item.status === 6 && item.agreementSigning === 0 && <a className="line_1 color-blue" onClick={() => { signMethodModal(item) }}>选择协议签订方式</a>}
{item.status === 6 && item.agreementSigning === 2 && <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> */}
</li>
</ul>
</div>

View File

@ -163,7 +163,7 @@ export default Form.create()((props) => {
{item.status === 2 && detailStatus === 6 && (current_user.login === item.user.login) &&
<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.status === 2 && detailStatus === 7 && (current_user.login === item.user.login) && item.isPay &&
<a className="base_smallBtn blue_line_btn fl" onClick={() => { confirmReceiptModal(item.id) }}>确认收款</a>}
</li>
</ul>

View File

@ -94,7 +94,7 @@ export default Form.create()((props) => {
<span className="color-grey-9 fl">任务编号:</span>
<span className="infos_item mr15">{item.task.number}</span>
<span className="fl lineh-35 ml5">
<Link className="primary-link" to={`/task/taskDetail/${item.id}`}>{item.task.name}</Link>
<Link className="primary-link" to={`/task/taskDetail/${item.taskId}`}>{item.task.name}</Link>
</span>
</span>

View File

@ -52,4 +52,11 @@
font-size: 1rem;
}
}
.action-td{
// display: flex;
// flex-flow: column nowrap;
.ant-btn{
margin:.25rem;
}
}
}

View File

@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useState, useMemo } from 'react';
import { Tabs, Input, Table, Pagination, Modal } from 'antd';
import { Tabs, Input, Table, Pagination, Modal, Button } from 'antd';
import { Link } from "react-router-dom";
import ChooseNav from '../../components/chooseNav';
import ItemListMyTask from '../components/itemListMyTask';
@ -103,7 +103,7 @@ export default ({ taskCategoryValueArr, showNotification }) => {
title: '上传文件',
dataIndex: 'files',
render: (text) => {
return text || 0
return text ? text.split(',').length : 0
}
},
{
@ -120,18 +120,24 @@ export default ({ taskCategoryValueArr, showNotification }) => {
{
title: '操作',
key: 'action',
className: 'action-td',
render: (text, record) => (
<span>
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.task.id}`}>查看详情</Link>
<React.Fragment>
{/* <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)) &&
<a className="base_smallBtn blue_line_btn fl" onClick={() => { setComplainVisible(true); setCheckedItem(record) }}>申诉</a>}
<Button type="danger" size="small" onClick={() => { setComplainVisible(true); setCheckedItem(record) }}>申诉</Button>
}
{record.status === 2 && record.task.status === 6 &&
<a className="base_smallBtn blue_line_btn fl" onClick={() => { setAgreeVisible(true); setCheckedItem(record) }}>签订协议</a>}
<Button type="primary" size="small" onClick={() => { setAgreeVisible(true); setCheckedItem(record) }}>签订协议</Button>
}
{record.status === 2 && record.task.status === 7 &&
<a className="base_smallBtn blue_line_btn fl" onClick={() => { confirmReceiptModal(record.id) }}>确认收款</a>}
</span >
<Button type="primary" size="small" onClick={() => { setAgreeVisible(true); setCheckedItem(record) }}>确认收款</Button>
}
</React.Fragment>
),
},
];
@ -215,6 +221,7 @@ export default ({ taskCategoryValueArr, showNotification }) => {
taskCategoryValueArr={taskCategoryValueArr}
changePage={(page) => { setCurPage(page) }}
loading={loading}
joinTask={true}
/>
</TabPane>

View File

@ -194,7 +194,7 @@ export default Form.create()(({ current_user, form, showNotification, match, })
<Button className="circle-button" type={approve === 2 ? 'primary' : ''} onClick={() => { changeApprove(2) }}>已审批</Button>
</div>
<div className="center-right-but">
{/* <div className="center-right-but">
{helper(
"numberInput",
[{ max: 20, message: '长度不能超过20个字符' }],
@ -206,7 +206,7 @@ export default Form.create()(({ current_user, form, showNotification, match, })
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
<Button className="mr10" type="" onClick={clearSearch}>清除</Button>
</div>
</div> */}
</div>

View File

@ -21,7 +21,8 @@ export default Form.create()(({ current_user, form, showNotification, match, his
const [loading, setLoading] = useState(false);
const [searchObj, setSearchObj] = useState({
checkStatus: '0'
checkStatus: '0',
parentId: 0,
});
const [curPage, setCurPage] = useState(1);
const [total, setTotal] = useState(0);
@ -34,10 +35,9 @@ export default Form.create()(({ current_user, form, showNotification, match, his
useEffect(() => {
const params = {
...searchObj,
// orderBy: 'createdAtDesc',
curPage,
pageSize: 10,
...searchObj,
};
setLoading(true);
readyCheckPapers(params).then(data => {
@ -59,7 +59,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
function onSearch() {
let values = getFieldsValue(['checkStatus', 'endCreatedAt', 'startCreatedAt']);
let values = getFieldsValue(['checkStatus', 'endCreatedAt', 'startCreatedAt', 'parentId']);
if (values.startCreatedAt) values.startCreatedAt = values.startCreatedAt.format(format);
if (values.endCreatedAt) values.endCreatedAt = values.endCreatedAt.format(format);
if (values.checkStatus === '0,1,2') values.checkStatus = '';
@ -80,8 +80,8 @@ export default Form.create()(({ current_user, form, showNotification, match, his
{
title: '序号',
dataIndex: 'index',
render:(text,record,index)=>{
return <div style={{textAlign:'center'}}>{index+1}</div>
render: (text, record, index) => {
return <div style={{ textAlign: 'center' }}>{index + 1}</div>
}
},
{
@ -165,14 +165,13 @@ export default Form.create()(({ current_user, form, showNotification, match, his
setReload(reload + 1);
setVisible(false);
setFieldsValue({
pass:'',
message:'',
pass: '',
message: '',
})
}
});
}
});
}
function changeStatus(e) {
@ -183,6 +182,14 @@ export default Form.create()(({ current_user, form, showNotification, match, his
setCurPage(1);
}
function changeType(e) {
setSearchObj({
...searchObj,
parentId: e,
});
setCurPage(1);
}
return (
<div className="centerbox task-manage">
@ -197,7 +204,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
placeholder="请选择审核状态"
onChange={changeStatus}
>
<Option key={'0,1,2'}>{'全部成果'}</Option>
<Option key={'0,1,2'}>{'所有状态'}</Option>
{
paperCheckStatusArr.map(item => {
return <Option key={item.dicItemCode}>{item.dicItemName}</Option>
@ -206,6 +213,21 @@ export default Form.create()(({ current_user, form, showNotification, match, his
</Select>,
'0'
)}
{helper(
"",
"parentId",
[],
<Select
showArrow
placeholder="请选择需要审核的类型"
onChange={changeType}
>
<Option key={0} value={0}>成果</Option>
<Option key={1} value={1}>评论</Option>
</Select>,
0
)}
</div>
<div className="center-right-but">
@ -268,7 +290,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
{helper(
"",
"pass",
[{required:visible,message:'请选择是否允许申诉'}],
[{ required: visible, message: '请选择是否允许申诉' }],
<Radio.Group
className="mb10"
>
@ -281,7 +303,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
{helper(
"",
"message",
[{required:visible,message:'请输入拒绝的原因'}],
[{ required: visible, message: '请输入拒绝的原因' }],
<TextArea
placeholder="(必填)我想说点什么呢,200字以内"
autoSize={{ minRows: 6 }}

View File

@ -11,7 +11,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
const [approve, setApprove] = useState(1);
const [loading, setLoading] = useState(false);
const [searchObj, setSearchObj] = useState({});
const [statusString, setStatusString] = useState('2');
const [status, setStatus] = useState('2');
const [curPage, setCurPage] = useState(1);
const [total, setTotal] = useState(0);
const [taskList, setTaskList] = useState([]);
@ -21,7 +21,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
useEffect(() => {
const params = {
...searchObj,
statusString,
status,
orderBy: 'createdAtDesc',
curPage,
pageSize: 10,
@ -34,7 +34,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
}
setLoading(false);
})
}, [reload, statusString, curPage, searchObj]);
}, [reload, status, curPage, searchObj]);
const helper = useCallback(
@ -54,7 +54,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
}
const changeOptionId = useCallback((option) => {
setStatusString(option.dicItemCode.toString() || '0,1');
setStatus(option.dicItemCode.toString() || '0,1');
setCurPage(1);
}, []);
@ -63,9 +63,9 @@ export default Form.create()(({ current_user, form, showNotification, match, his
setApprove(approve);
setCurPage(1);
if (approve === 1) {
setStatusString('2');
setStatus('2');
} else {
setStatusString('0,1');
setStatus('0,1');
}
}

View File

@ -40,6 +40,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
showUserMode: showUserMode.length > 1 ? '' : showUserMode,
curPage,
pageSize: 10,
orderBy:'createdAtDesc',
};
setLoading(true);
getTaskAdminList(params).then(data => {
@ -140,12 +141,12 @@ export default Form.create()(({ current_user, form, showNotification, match, his
dataIndex: 'papersCount',
},
{
title: '任务主体',
title: '发布主体',
dataIndex: 'enterpriseName',
},
{
title: '发布时间',
dataIndex: 'publishedAt',
title: '创建时间',
dataIndex: 'createdAt',
render: (text, record) => {
return text || '--'
}
@ -238,7 +239,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
<div className="center-right-but">
{helper(
"发布时间:",
"创建时间:",
"startTime",
[],
<DatePicker

View File

@ -163,10 +163,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.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) && <p className="color-grey-6 font-12">{surplusTimetext.indexOf('-') > 0 ? ('延期' + surplusTimetext.replaceAll('-', '')) : ('剩余' + surplusTimetext)}</p>}
{detailData.status === status && (!detailData.delayTime) && days && <p className="color-grey-6 font-12">{surplusTimetext.indexOf('-') > 0 ? ('延期' + surplusTimetext.replaceAll('-', '')) : ('剩余' + surplusTimetext)}</p>}
</li>
)
}, [detailData]);
@ -397,7 +397,7 @@ export default Form.create()(
<i className="iconfont icon-laba fl mr5 color-orange font-15"></i>该需求已选稿作品公示期为{detailData.makePublicDays}天接受监督和举报{detailData.makePublicAt}公示期满后支付赏金
</p>}
<div className="clearfix padding20 mb30" style={{ background: "#FAFAFA" }}>
<div className="clearfix tasks_status_father mb30" style={{ background: "#FAFAFA" }}>
<ul className="tasks_status clearfix">
<li className="active"><span>发布任务</span></li>

View File

@ -34,12 +34,16 @@
background: #FFF8F5;
}
.tasks_status{
display: flex;
justify-content: space-around;
padding: 1rem;
}
.tasks_status li {
float: left;
position: relative;
margin-right: 20px;
background: #ebebeb;
min-width: 8rem;
width: 12.4%;
height: 35px;
line-height: 35px;
@ -47,6 +51,9 @@
text-align: center;
margin-bottom: 32px;
}
.tasks_status li:not(:last-child){
margin-right: 20px;
}
.tasks_status li.active {
background: #4cacff;

View File

@ -25,6 +25,7 @@ export default ({ history, current_user }) => {
const [total, setTotal] = useState(0);
const [taskList, setTaskList] = useState([]);
//
useEffect(() => {
getTaskCategory().then(data => {
if (data) {
@ -37,6 +38,7 @@ export default ({ history, current_user }) => {
});
}, []);
//
useEffect(() => {
const params = {
categoryId,
@ -59,7 +61,7 @@ export default ({ history, current_user }) => {
})
}, [categoryId, taskModeId, expiredStartTime, expiredEndTime, statusString, searchInput, orderBy, curPage]);
//
const changeOptionId = useCallback((option, type) => {
if (type === 'taskCategory') {
setCategoryId(option.dicItemCode);
@ -80,6 +82,7 @@ export default ({ history, current_user }) => {
}
}, []);
//
const changeSort = useCallback((sortType) => {
let sortValue = '';
if (sortType.type !== 'default') {
@ -97,6 +100,7 @@ export default ({ history, current_user }) => {
history.push(`/task/taskDetail/${id}`);
}
//
function goAdd() {
getCompanyInfo().then(res => {
if (res) {
@ -118,7 +122,7 @@ export default ({ history, current_user }) => {
});
} else {
Modal.info({
content: res.message
content: '您没有权限发布任务'
});
}
}