forked from Gitlink/forgeplus-react
上传协议部分及bug修改
This commit is contained in:
parent
0b7fbe564c
commit
b6c2c66321
|
@ -1,6 +1,7 @@
|
|||
import React, { useEffect, useState } from "react";
|
||||
import { Upload, Button } from 'antd';
|
||||
import { appendFileSizeToUploadFileAll } from 'educoder';
|
||||
import { httpUrl } from '../fetch';
|
||||
|
||||
function Uploads({ className, size, actionUrl, fileList, showNotification, load }) {
|
||||
const [files, setFiles] = useState(undefined);
|
||||
|
@ -30,7 +31,20 @@ function Uploads({ className, size, actionUrl, fileList, showNotification, load
|
|||
return itemId !== id;
|
||||
});
|
||||
setFiles(nf);
|
||||
load && load(nf);
|
||||
backFiles(nf);
|
||||
}
|
||||
|
||||
function backFiles(fileList) {
|
||||
if (fileList && fileList.length) {
|
||||
let filesId = [];
|
||||
for (const item of fileList) {
|
||||
if (item) {
|
||||
let itemId = (item.response && item.response.data && item.response.data.id) || item.id;
|
||||
itemId && filesId.push(itemId);
|
||||
}
|
||||
}
|
||||
load && load(fileList, filesId.join());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,7 +58,7 @@ function Uploads({ className, size, actionUrl, fileList, showNotification, load
|
|||
fileList.splice(i, 1);
|
||||
}
|
||||
}
|
||||
load && load(fileList);
|
||||
backFiles(fileList);
|
||||
if (!info.file.response.data) {
|
||||
info.file.response && showNotification(info.file.response.message)
|
||||
}
|
||||
|
@ -63,7 +77,7 @@ function Uploads({ className, size, actionUrl, fileList, showNotification, load
|
|||
const upload = {
|
||||
name: 'file',
|
||||
fileList: files,
|
||||
action: actionUrl + `/busiAttachments/upload`,
|
||||
action: (httpUrl || actionUrl) + `/busiAttachments/upload`,
|
||||
onChange: handleChange,
|
||||
onRemove: onAttachmentRemove,
|
||||
beforeUpload: beforeUpload,
|
||||
|
|
|
@ -56,6 +56,11 @@ const PublicityComplain = Loadable({
|
|||
loading: Loading,
|
||||
});
|
||||
|
||||
const AgreementManage = Loadable({
|
||||
loader: () => import("./task/agreementManage"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const Index = (propsTransmit) => {
|
||||
// 开发时,从代理的位置获取用户信息
|
||||
const [currentUser, setCurrentUser] = useState(null);
|
||||
|
@ -148,6 +153,14 @@ const Index = (propsTransmit) => {
|
|||
)}
|
||||
></Route>
|
||||
|
||||
{/* 协议审核 */}
|
||||
<Route
|
||||
path="/task/agreementManage"
|
||||
render={(props) => (
|
||||
<AgreementManage {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
{/* 成果列表 */}
|
||||
<Route
|
||||
path="/task"
|
||||
|
|
|
@ -0,0 +1,153 @@
|
|||
import React, { useCallback, forwardRef, useEffect, useState } from 'react';
|
||||
import { Input, Button, Form } from 'antd';
|
||||
import ItemAgreementManage from '../components/itemAgreementManage';
|
||||
import StatusNav from '../../components/statusNav';
|
||||
import { agreementArr } from '../static';
|
||||
import { agreementList } from '../api';
|
||||
import '../index.scss';
|
||||
|
||||
agreementArr.splice(1,1);
|
||||
export default Form.create()(({ current_user, form, showNotification, match, history }) => {
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, getFieldsValue } = form;
|
||||
|
||||
const [approve, setApprove] = useState(1);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [searchObj, setSearchObj] = useState({});
|
||||
const [status, setStatus] = useState('1');
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [taskList, setTaskList] = useState([]);
|
||||
|
||||
const [reload, setReload] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
...searchObj,
|
||||
status,
|
||||
type:'',
|
||||
currentPage:curPage,
|
||||
pageSize: 10,
|
||||
};
|
||||
setLoading(true);
|
||||
agreementList(params).then(data => {
|
||||
if (data) {
|
||||
setTaskList(data.rows);
|
||||
setTotal(data.total);
|
||||
}
|
||||
setLoading(false);
|
||||
})
|
||||
}, [reload, status, curPage, searchObj]);
|
||||
|
||||
|
||||
const helper = useCallback(
|
||||
(name, rules, widget) => (
|
||||
<Form.Item>
|
||||
{getFieldDecorator(name, { rules, validateFirst: true, })(widget)}
|
||||
</Form.Item>
|
||||
), []);
|
||||
|
||||
|
||||
function onSearch() {
|
||||
validateFields((err, values) => {
|
||||
if (!err) {
|
||||
setSearchObj(values);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const changeOptionId = useCallback((option) => {
|
||||
setStatus(option.dicItemCode.toString() || '0,2');
|
||||
setCurPage(1);
|
||||
}, []);
|
||||
|
||||
function changeApprove(approve) {
|
||||
setApprove(approve);
|
||||
setCurPage(1);
|
||||
if (approve === 1) {
|
||||
setStatus('1');
|
||||
} else {
|
||||
setStatus('0,2');
|
||||
}
|
||||
}
|
||||
|
||||
function clearSearch() {
|
||||
setFieldsValue({
|
||||
numberInput: '',
|
||||
nameInput: '',
|
||||
enterpriseNameInput: ''
|
||||
});
|
||||
setSearchObj({});
|
||||
}
|
||||
|
||||
const reloadList = useCallback(() => {
|
||||
setReload(reload + 1);
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="centerbox task-manage">
|
||||
|
||||
<div className="center-screen" >
|
||||
<div className="center-left-but">
|
||||
<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">
|
||||
{helper(
|
||||
"numberInput",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="输入任务编号进行检索"
|
||||
/>
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"nameInput",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="输入任务名称进行检索"
|
||||
/>
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"enterpriseNameInput",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="输入发布主体名称进行检索"
|
||||
/>
|
||||
)}
|
||||
|
||||
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
||||
<Button className="mr10" type="" onClick={clearSearch}>清除</Button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="center-content">
|
||||
|
||||
{
|
||||
approve === 2 && <StatusNav
|
||||
key={'status'}
|
||||
type={'status'}
|
||||
options={agreementArr}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
}
|
||||
<ItemAgreementManage
|
||||
list={taskList}
|
||||
curPage={curPage}
|
||||
total={total}
|
||||
changePage={(page) => { setCurPage(page) }}
|
||||
loading={loading}
|
||||
showNotification={showNotification}
|
||||
reloadList={reloadList}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
)
|
|
@ -1,4 +1,4 @@
|
|||
import fetch,{} from '../fetch';
|
||||
import fetch, { } from '../fetch';
|
||||
import { notification } from 'antd';
|
||||
|
||||
// 获取字典分类列表
|
||||
|
@ -139,7 +139,7 @@ export function addPaper(data) {
|
|||
}
|
||||
|
||||
// 任务成果
|
||||
export async function getTaskPaper(params){
|
||||
export async function getTaskPaper(params) {
|
||||
let res = await fetch({
|
||||
url: '/api/paper/',
|
||||
method: 'get',
|
||||
|
@ -156,7 +156,7 @@ export async function getTaskPaper(params){
|
|||
}
|
||||
|
||||
// 审核任务成果
|
||||
export async function readyCheckPapers(params){
|
||||
export async function readyCheckPapers(params) {
|
||||
let res = await fetch({
|
||||
url: '/api/paper/admin/readyCheckPapers',
|
||||
method: 'get',
|
||||
|
@ -173,7 +173,7 @@ export async function readyCheckPapers(params){
|
|||
}
|
||||
|
||||
// 我的成果
|
||||
export async function myPapers(params){
|
||||
export async function myPapers(params) {
|
||||
let res = await fetch({
|
||||
url: '/api/paper/my',
|
||||
method: 'get',
|
||||
|
@ -198,7 +198,7 @@ export function updatePaper(data) {
|
|||
});
|
||||
}
|
||||
|
||||
export function deletePaper(id){
|
||||
export function deletePaper(id) {
|
||||
return fetch({
|
||||
url: `api/paper/${id}`,
|
||||
method: 'delete',
|
||||
|
@ -219,7 +219,7 @@ export function thumbUpPaper(id) {
|
|||
return fetch({
|
||||
url: `/api/paper/${id}/thumbUp`,
|
||||
method: 'post',
|
||||
data: {paperId:id}
|
||||
data: { paperId: id }
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,7 @@ export function checkAgreement(taskId) {
|
|||
}
|
||||
|
||||
// 检查用户是否提交了成果
|
||||
export function checkHavePaper(taskId){
|
||||
export function checkHavePaper(taskId) {
|
||||
return fetch({
|
||||
url: `/api/paper/${taskId}/check`,
|
||||
method: 'get'
|
||||
|
@ -253,7 +253,7 @@ export function agreement(taskId) {
|
|||
return fetch({
|
||||
url: `/api/paper/${taskId}/agreement`,
|
||||
method: 'post',
|
||||
data: {taskId}
|
||||
data: { taskId }
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -295,7 +295,7 @@ export function checkTask(data) {
|
|||
|
||||
|
||||
// 审核成果/评论
|
||||
export function checkPaper(data){
|
||||
export function checkPaper(data) {
|
||||
return fetch({
|
||||
url: `/api/paper/admin/complainPaper/${data.paperId}`,
|
||||
method: 'post',
|
||||
|
@ -304,7 +304,7 @@ export function checkPaper(data){
|
|||
}
|
||||
|
||||
// 成果申诉
|
||||
export function complainPaper(data){
|
||||
export function complainPaper(data) {
|
||||
return fetch({
|
||||
url: `/api/paper/complainInfo/${data.paperId}`,
|
||||
method: 'post',
|
||||
|
@ -330,7 +330,7 @@ export async function complainPaperList(params) {
|
|||
}
|
||||
|
||||
// 审核申诉材料
|
||||
export function checkComplain(data){
|
||||
export function checkComplain(data) {
|
||||
return fetch({
|
||||
url: `/api/paper/admin/complainMaterial/${data.paperId}`,
|
||||
method: 'post',
|
||||
|
@ -340,7 +340,7 @@ export function checkComplain(data){
|
|||
|
||||
|
||||
// 佐证上传
|
||||
export function proofAdd(data){
|
||||
export function proofAdd(data) {
|
||||
return fetch({
|
||||
url: `/api/taskResultProof/addTaskResultProof`,
|
||||
method: 'post',
|
||||
|
@ -366,7 +366,7 @@ export async function proofList(params) {
|
|||
}
|
||||
|
||||
// 审核佐证
|
||||
export function checkProof(data){
|
||||
export function checkProof(data) {
|
||||
return fetch({
|
||||
url: `/api/taskResultProof/adminCheckResultAndProof`,
|
||||
method: 'post',
|
||||
|
@ -375,7 +375,7 @@ export function checkProof(data){
|
|||
}
|
||||
|
||||
// 应征者公示期申诉
|
||||
export function publicityComplain(data){
|
||||
export function publicityComplain(data) {
|
||||
return fetch({
|
||||
url: `/api/myTasks/applicantComplaintDuringPublicity`,
|
||||
method: 'post',
|
||||
|
@ -401,7 +401,7 @@ export async function publicityComplainList(params) {
|
|||
}
|
||||
|
||||
// 审核公示期申诉
|
||||
export function checkPublicity(data){
|
||||
export function checkPublicity(data) {
|
||||
return fetch({
|
||||
url: `/api/tasks/backend/adminCheck/complaintMaterialDuringPublicity`,
|
||||
method: 'post',
|
||||
|
@ -409,11 +409,64 @@ export function checkPublicity(data){
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
export function signMethod(data){
|
||||
// 选择签订协议的方式
|
||||
export function signMethod(data) {
|
||||
return fetch({
|
||||
url: `/api/sign/method/${data.taskId}/${data.method}`,
|
||||
method: 'post',
|
||||
// data,
|
||||
});
|
||||
}
|
||||
|
||||
// 上传委托协议
|
||||
export function uploadAgreeRequire(data) {
|
||||
return fetch({
|
||||
url: `/api/sign/task/contract/${data.taskId}`,
|
||||
method: 'post',
|
||||
data: data.params
|
||||
});
|
||||
}
|
||||
|
||||
// 审核委托协议列表
|
||||
export async function agreementList(params) {
|
||||
let res = await fetch({
|
||||
url: '/api/sign/task/contract',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
if (res.data) {
|
||||
return res.data;
|
||||
} else {
|
||||
notification.open({
|
||||
message: "提示",
|
||||
description: res.message || '请求错误',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 审核协议
|
||||
export function adminCheckAgreement(data) {
|
||||
return fetch({
|
||||
url: `/api/sign/admin/${data.type === 1 ? 'task' : 'paper'}/contract/${data.agreementId}`,
|
||||
method: 'post',
|
||||
data: data.params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 上传委托协议
|
||||
export function uploadAgreePaper(data) {
|
||||
return fetch({
|
||||
url: `/api/sign/paper/contract/${data.paperId}`,
|
||||
method: 'post',
|
||||
data: data.params
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 胜出者确认收款
|
||||
export function confirmReceipt(paperId) {
|
||||
return fetch({
|
||||
url: `/api/sign/paper/money/${paperId}`,
|
||||
method: 'post',
|
||||
});
|
||||
}
|
|
@ -1,14 +1,13 @@
|
|||
import React, { useEffect, useState, useCallback, useMemo } from 'react';
|
||||
import { Modal, Form, Input, } from 'antd';
|
||||
import Upload from 'military/components/Upload';
|
||||
import { uploadAgreePaper } from "../../api";
|
||||
import { httpUrl } from 'military/fetch';
|
||||
import { complainPaper, publicityComplain, } from "../../api";
|
||||
import '../../index.scss';
|
||||
|
||||
const { TextArea } = Input;
|
||||
|
||||
export default Form.create()(props => {
|
||||
const { visible, setVisible, paperId, form, showNotification, reloadList } = props;
|
||||
const { visible, setVisible, checkedItem, detailStatus, form, showNotification, reloadList } = props;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
|
||||
|
||||
const [fileList, setFileList] = useState([]);
|
||||
|
@ -22,29 +21,6 @@ export default Form.create()(props => {
|
|||
});
|
||||
}
|
||||
|
||||
function uploadAgree() {
|
||||
validateFields((err, values) => {
|
||||
if (!err) {
|
||||
uploadAgreePaper({
|
||||
paperId,
|
||||
params: {
|
||||
files: values.files,
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.message === 'success') {
|
||||
setFieldsValue({
|
||||
files: '',
|
||||
});
|
||||
setVisible(false);
|
||||
showNotification("上传协议成功!");
|
||||
} else {
|
||||
showNotification(res.message || "上传协议失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const helper = useCallback(
|
||||
(name, rules, widget) => (
|
||||
<Form.Item>
|
||||
|
@ -56,30 +32,41 @@ export default Form.create()(props => {
|
|||
|
||||
function complain() {
|
||||
validateFields((error, values) => {
|
||||
// if (!error) {
|
||||
// if (detailStatus === 5) {
|
||||
// publicityComplain({
|
||||
// content: values.complainValue,
|
||||
// files: values.files,
|
||||
// paperId: checkedItem.id,
|
||||
// }).then(res => {
|
||||
// complainDeal(res);
|
||||
// });
|
||||
// } else {
|
||||
// complainPaper({
|
||||
// paperId: checkedItem.id,
|
||||
// params: {
|
||||
// content: values.complainValue,
|
||||
// files: values.files,
|
||||
// }
|
||||
// }).then(res => {
|
||||
// complainDeal(res);
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
if (!error) {
|
||||
if (detailStatus === 5) {
|
||||
publicityComplain({
|
||||
content: values.complainValue,
|
||||
files: values.files,
|
||||
paperId: checkedItem.id,
|
||||
}).then(res => {
|
||||
complainDeal(res);
|
||||
});
|
||||
} else {
|
||||
complainPaper({
|
||||
paperId: checkedItem.id,
|
||||
params: {
|
||||
content: values.complainValue,
|
||||
files: values.files,
|
||||
}
|
||||
}).then(res => {
|
||||
complainDeal(res);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function complainDeal(res) {
|
||||
if (res && res.message === 'success') {
|
||||
showNotification('申诉提交成功');
|
||||
setVisible(false);
|
||||
setFileList(null);
|
||||
setFieldsValue({
|
||||
files: ''
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<Modal
|
||||
|
@ -89,34 +76,33 @@ export default Form.create()(props => {
|
|||
onCancel={() => { setVisible(false) }}
|
||||
className="form-edit-modal"
|
||||
>
|
||||
<div className="task-popup-content">
|
||||
<p className="edu-txt-center lineh-20 mb10">你的申诉信息将发送给平台管理员</p>
|
||||
<p className="edu-txt-center lineh-20">请如实填写有效的申诉原由,我们将尽快完成审核</p>
|
||||
{
|
||||
helper('complainValue', [{ required: visible, message: "(必填)请在此输入发起申诉的原因,最大限制100个字符" },
|
||||
{ max: 100, message: '长度不能超过100个字符' }],
|
||||
<TextArea
|
||||
placeholder="(必填)请在此输入发起申诉的原因,最大限制100个字符"
|
||||
autoSize={{ minRows: 6 }}
|
||||
className="applyText"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
<Form.Item className="upload-form" label="附件上传" required={true}>
|
||||
<Upload
|
||||
className="commentStyle"
|
||||
load={uploadFunc}
|
||||
size={50}
|
||||
showNotification={showNotification}
|
||||
fileList={fileList}
|
||||
{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>
|
||||
{
|
||||
helper('complainValue', [{ required: visible, message: "(必填)请在此输入发起申诉的原因,最大限制100个字符" },
|
||||
{ max: 100, message: '长度不能超过100个字符' }],
|
||||
<TextArea
|
||||
placeholder="(必填)请在此输入发起申诉的原因,最大限制100个字符"
|
||||
autoSize={{ minRows: 6 }}
|
||||
className="applyText"
|
||||
/>
|
||||
{getFieldDecorator('files', {
|
||||
rules: [{ required: visible, message: "请上传文件" }],
|
||||
validateFirst: true
|
||||
})(<Input style={{ display: 'none' }} />)}
|
||||
</Form.Item>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
<Form.Item className="upload-form" label="附件上传" required={true}>
|
||||
<Upload
|
||||
className="commentStyle"
|
||||
load={uploadFunc}
|
||||
size={50}
|
||||
showNotification={showNotification}
|
||||
fileList={fileList}
|
||||
/>
|
||||
{getFieldDecorator('files', {
|
||||
rules: [{ required: visible, message: "请上传文件" }],
|
||||
validateFirst: true
|
||||
})(<Input style={{ display: 'none' }} />)}
|
||||
</Form.Item>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ export default Form.create()((props) => {
|
|||
}
|
||||
|
||||
{
|
||||
item.status === 4 && item.papersCount > 0 && (!item.isProofBoolean) &&
|
||||
(item.status === 3 || item.status === 4) && item.papersCount > 0 && (!item.isProofBoolean) &&
|
||||
<a onClick={() => { uploadProofs(item) }} className="line_1 color-blue">上传佐证材料</a>
|
||||
}
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@ import { timeAgo } from 'educoder';
|
|||
import Nodata from 'forge/Nodata';
|
||||
import Loading from "src/Loading";
|
||||
import { editorConfig } from 'military/components/config';
|
||||
import Upload from 'military/components/Upload';
|
||||
import AgreementModal from '../agreementModal';
|
||||
import { reportPaper, thumbUpPaper, commentAdd, complainPaper, publicityComplain, confirmReceipt } from '../../api';
|
||||
import ComplainModal from '../complainModal';
|
||||
import { reportPaper, thumbUpPaper, commentAdd, confirmReceipt } from '../../api';
|
||||
import { paperCheckStatusArr } from '../../static';
|
||||
import { httpUrl } from '../../../fetch';
|
||||
import winpng from '../../image/winner.png';
|
||||
|
@ -33,7 +33,6 @@ export default Form.create()((props) => {
|
|||
const [commentId, setCommentId] = useState(undefined);
|
||||
|
||||
const [complainVisible, setComplainVisible] = useState(false);
|
||||
const [fileList, setFileList] = useState(null);
|
||||
|
||||
const [loadingChild, setLoadingChild] = useState(false);
|
||||
|
||||
|
@ -113,49 +112,6 @@ export default Form.create()((props) => {
|
|||
window.location.href = `/users/${login}`;
|
||||
}
|
||||
|
||||
function complain() {
|
||||
validateFields((error, values) => {
|
||||
if (!error) {
|
||||
if (detailStatus === 5) {
|
||||
publicityComplain({
|
||||
content: values.complainValue,
|
||||
files: values.files,
|
||||
paperId: checkedItem.id,
|
||||
}).then(res => {
|
||||
complainDeal(res);
|
||||
});
|
||||
} else {
|
||||
complainPaper({
|
||||
paperId: checkedItem.id,
|
||||
params: {
|
||||
content: values.complainValue,
|
||||
files: values.files,
|
||||
}
|
||||
}).then(res => {
|
||||
complainDeal(res);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function complainDeal(res) {
|
||||
if (res && res.message === 'success') {
|
||||
showNotification('申诉提交成功');
|
||||
setComplainVisible(false);
|
||||
setFileList(null);
|
||||
setFieldsValue({
|
||||
files: ''
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function uploadFunc(fileList, files) {
|
||||
setFileList(fileList);
|
||||
setFieldsValue({
|
||||
files: files,
|
||||
});
|
||||
}
|
||||
|
||||
function confirmReceiptModal(paperId) {
|
||||
Modal.confirm({
|
||||
|
@ -310,44 +266,13 @@ export default Form.create()((props) => {
|
|||
</div>
|
||||
</Modal>
|
||||
|
||||
|
||||
<Modal
|
||||
title="申诉"
|
||||
<ComplainModal
|
||||
visible={complainVisible}
|
||||
onOk={complain}
|
||||
onCancel={() => { setComplainVisible(false) }}
|
||||
className="form-edit-modal"
|
||||
>
|
||||
<div className="task-popup-content">
|
||||
<p className="edu-txt-center lineh-20 mb10">你的申诉信息将发送给平台管理员</p>
|
||||
<p className="edu-txt-center lineh-20">请如实填写有效的申诉原由,我们将尽快完成审核</p>
|
||||
{
|
||||
helper('complainValue', [{ required: complainVisible, message: "(必填)请在此输入发起申诉的原因,最大限制100个字符" },
|
||||
{ max: 100, message: '长度不能超过100个字符' }],
|
||||
<TextArea
|
||||
placeholder="(必填)请在此输入发起申诉的原因,最大限制100个字符"
|
||||
autoSize={{ minRows: 6 }}
|
||||
className="applyText"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
<Form.Item className="upload-form" label="附件上传" required={true}>
|
||||
<Upload
|
||||
className="commentStyle"
|
||||
load={uploadFunc}
|
||||
size={50}
|
||||
showNotification={showNotification}
|
||||
fileList={fileList}
|
||||
/>
|
||||
{getFieldDecorator('files', {
|
||||
rules: [{ required: complainVisible, message: "请上传文件" }],
|
||||
validateFirst: true
|
||||
})(<Input style={{ display: 'none' }} />)}
|
||||
</Form.Item>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
setVisible={setComplainVisible}
|
||||
checkedItem={checkedItem}
|
||||
detailStatus={detailStatus}
|
||||
showNotification={showNotification}
|
||||
/>
|
||||
|
||||
{agreeVisible && <AgreementModal
|
||||
paperId={checkedItem.id}
|
||||
|
|
|
@ -119,6 +119,7 @@ export default Form.create()(props => {
|
|||
function proofItem() {
|
||||
if (!selectedRows.length) {
|
||||
showNotification("请至少选择一条数据!");
|
||||
return;
|
||||
}
|
||||
|
||||
validateFields((err, values) => {
|
||||
|
@ -210,6 +211,7 @@ export default Form.create()(props => {
|
|||
fileList={fileList}
|
||||
/>
|
||||
{getFieldDecorator('files', {
|
||||
rules: [{ required: visible, message: "请上传文件" }],
|
||||
validateFirst: true
|
||||
})(<Input style={{ display: 'none' }} />)}
|
||||
</Form.Item>
|
||||
|
|
|
@ -28,4 +28,7 @@
|
|||
.ant-form-item{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.upload-form .ant-form-item-label{
|
||||
padding-top:.5rem;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,23 +23,21 @@
|
|||
}
|
||||
}
|
||||
|
||||
.ant-form-item-control-wrapper {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.ant-select {
|
||||
min-width: 200px;
|
||||
}
|
||||
.ant-table-thead th {
|
||||
text-align: center;
|
||||
&:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
// &:first-child {
|
||||
// text-align: left;
|
||||
// }
|
||||
}
|
||||
td {
|
||||
text-align: center;
|
||||
color: #333;
|
||||
&:first-child {
|
||||
text-align: left;
|
||||
// text-align: left;
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
@ -68,5 +66,11 @@
|
|||
word-break: break-all;
|
||||
}
|
||||
|
||||
// .ant-form-item-control-wrapper {
|
||||
// display: inline-block;
|
||||
// }
|
||||
|
||||
.upload-form{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,14 +3,18 @@ import { Input, Button, Radio, Form, Table, Pagination, Modal } from 'antd';
|
|||
import { Link } from "react-router-dom";
|
||||
import StatusNav from '../../components/statusNav';
|
||||
import { complainPaperList, checkComplain } from '../api';
|
||||
import { paperCheckStatusArr } from '../static';
|
||||
import { paperComplainStatusArr } from '../static';
|
||||
import { httpUrl } from 'military/fetch';
|
||||
|
||||
import '../index.scss';
|
||||
|
||||
const TextArea = Input.TextArea;
|
||||
|
||||
const proofArrCheck = paperCheckStatusArr.slice(1);
|
||||
const paperComplainStatus = [];
|
||||
for (const item of paperComplainStatusArr) {
|
||||
paperComplainStatus[item.dicItemCode] = item.dicItemName;
|
||||
}
|
||||
const paperComplain = paperComplainStatusArr.slice(0, 2);
|
||||
|
||||
export default Form.create()(({ current_user, form, showNotification, match, }) => {
|
||||
|
||||
|
@ -26,7 +30,7 @@ export default Form.create()(({ current_user, form, showNotification, match, })
|
|||
const [reload, setReload] = useState(0);
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [activeId, setActiveId] = useState('');
|
||||
const [status, setStatus] = useState('0');
|
||||
const [status, setStatus] = useState('2');
|
||||
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
|
@ -76,9 +80,9 @@ export default Form.create()(({ current_user, form, showNotification, match, })
|
|||
setApprove(approve);
|
||||
setCurPage(1);
|
||||
if (approve === 1) {
|
||||
setStatus('0');
|
||||
setStatus('2');
|
||||
} else {
|
||||
setStatus('1,2');
|
||||
setStatus('0,1');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,16 +93,13 @@ export default Form.create()(({ current_user, form, showNotification, match, })
|
|||
|
||||
const columns = useMemo(() => {
|
||||
return [
|
||||
// {
|
||||
// title: '来源任务',
|
||||
// dataIndex: 'name',
|
||||
// width: "20%",
|
||||
// render: (text, record) => (
|
||||
// <span>
|
||||
// <Link className="line_1 color-grey3" to={`/task/taskDetail/${record.taskId}`}>{text}</Link>
|
||||
// </span >
|
||||
// ),
|
||||
// },
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
render: (text, record, index) => {
|
||||
return index + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '申诉内容',
|
||||
dataIndex: 'content',
|
||||
|
@ -124,32 +125,31 @@ export default Form.create()(({ current_user, form, showNotification, match, })
|
|||
|
||||
},
|
||||
{
|
||||
title: '评论/提交者',
|
||||
title: '提交者',
|
||||
dataIndex: 'user',
|
||||
render: (text, record) => {
|
||||
return record.user.nickname || record.user.login
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '评论/提交时间',
|
||||
title: '提交时间',
|
||||
dataIndex: 'createdAt',
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
dataIndex: 'verifyStatus',
|
||||
dataIndex: 'status',
|
||||
render: (text, record) => {
|
||||
return text ? '通过' : '未通过'
|
||||
return text !== 2 ? paperComplainStatus[text] : <React.Fragment>
|
||||
<Button className="mr5 font-12" type="primary" size="small" onClick={() => { checkPaperItem(record.id, 1) }}>通过</Button>
|
||||
<Button className="mr5 font-12" type="info" size="small" onClick={() => { setActiveId(record.id); setVisible(true) }}>不通过</Button>
|
||||
</React.Fragment>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<React.Fragment>
|
||||
<Button className="mr5 font-12" type="primary" size="small" onClick={() => { checkPaperItem(record.id, 1) }}>通过</Button>
|
||||
<Button className="mr5 font-12" type="info" size="small" onClick={() => { setActiveId(record.id); setVisible(true) }}>不通过</Button>
|
||||
{/* <Link className="line_1 color-grey3" to={`/task/taskDetail/${record.id}`}>查看详情</Link> */}
|
||||
</React.Fragment>
|
||||
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.taskId}`}>查看详情</Link>
|
||||
),
|
||||
},
|
||||
]
|
||||
|
@ -181,7 +181,7 @@ export default Form.create()(({ current_user, form, showNotification, match, })
|
|||
}
|
||||
|
||||
const changeOptionId = useCallback((option) => {
|
||||
setStatus(option.dicItemCode.toString() || '1,2');
|
||||
setStatus(option.dicItemCode.toString() || '0,1');
|
||||
setCurPage(1);
|
||||
}, []);
|
||||
|
||||
|
@ -213,9 +213,9 @@ export default Form.create()(({ current_user, form, showNotification, match, })
|
|||
<div className="center-content">
|
||||
{
|
||||
approve === 2 && <StatusNav
|
||||
key={'approveStatus'}
|
||||
type={'approveStatus'}
|
||||
options={proofArrCheck}
|
||||
key={'status'}
|
||||
type={'status'}
|
||||
options={paperComplain}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ export default Form.create()(({ current_user, form, showNotification, match, })
|
|||
>
|
||||
{helper(
|
||||
"message",
|
||||
[{ required: true, message: '请给出不通过的原因' }],
|
||||
[{ required: visible, message: '请给出不通过的原因' }],
|
||||
<TextArea
|
||||
placeholder="(必填)我想给点什么意见呢,200字以内"
|
||||
autoSize={{ minRows: 6 }}
|
||||
|
|
|
@ -77,6 +77,13 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
|
||||
const columns = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
render:(text,record,index)=>{
|
||||
return <div style={{textAlign:'center'}}>{index+1}</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '来源任务',
|
||||
dataIndex: 'name',
|
||||
|
@ -96,14 +103,14 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
}
|
||||
},
|
||||
{
|
||||
title: '评论/提交者',
|
||||
title: '提交者',
|
||||
dataIndex: 'user',
|
||||
render: (text, record) => {
|
||||
return record.user.nickname || record.user.login
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '评论/提交时间',
|
||||
title: '提交时间',
|
||||
dataIndex: 'createdAt',
|
||||
},
|
||||
{
|
||||
|
@ -153,6 +160,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
message: values.message,
|
||||
}
|
||||
}).then(res => {
|
||||
setLoading(false);
|
||||
if (res && res.message === 'success') {
|
||||
setReload(reload + 1);
|
||||
setVisible(false);
|
||||
|
@ -161,7 +169,6 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
message:'',
|
||||
})
|
||||
}
|
||||
setLoading(false);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -46,6 +46,12 @@ export const publicityArr=[
|
|||
{ dicItemCode: 0, name: "不受理", dicItemName: "不受理" },
|
||||
]
|
||||
|
||||
export const agreementArr = [
|
||||
{ dicItemCode: 0, name: "已驳回", dicItemName: "已驳回" },
|
||||
{ dicItemCode: 1, name: "待审核", dicItemName: "待审核" },
|
||||
{ dicItemCode: 2, name: "已同意", dicItemName: "已同意" },
|
||||
]
|
||||
|
||||
export const publishModeArr=["自主提交","统筹任务"];
|
||||
|
||||
export const sortArr = [{
|
||||
|
@ -90,6 +96,12 @@ export const paperCheckStatusArr=[
|
|||
{ dicItemCode: '2', name: "未通过", dicItemName: '未通过' },
|
||||
]
|
||||
|
||||
export const paperComplainStatusArr=[
|
||||
{ dicItemCode: '0', name: "未通过", dicItemName: '未通过' },
|
||||
{ dicItemCode: '1', name: "通过", dicItemName: '通过' },
|
||||
{ dicItemCode: '2', name: "待审核", dicItemName: '待审核' },
|
||||
]
|
||||
|
||||
|
||||
export const formItemLayout = {
|
||||
labelCol: {
|
||||
|
|
|
@ -299,7 +299,7 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
|
|||
</span><span className="color-grey-9 ml5 font-12 ">点击下载示例模版</span>
|
||||
</p>
|
||||
|
||||
<div className="pl15">
|
||||
<div className="pl15 task-edit-content">
|
||||
<p className="color-grey3 mb20">选择任务所在领域</p>
|
||||
|
||||
<div className="mb20 clearfix areaDiv" >
|
||||
|
|
|
@ -145,3 +145,10 @@
|
|||
line-height: 40px;
|
||||
}
|
||||
|
||||
|
||||
.task-edit-content{
|
||||
.ant-form-item-control-wrapper {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
"enterpriseNameInput",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="输入任务名称进行检索"
|
||||
placeholder="输入发布主体名称进行检索"
|
||||
/>
|
||||
)}
|
||||
|
||||
|
|
Loading…
Reference in New Issue