diff --git a/src/military/fetch.js b/src/military/fetch.js index da73e6fd..cded7401 100644 --- a/src/military/fetch.js +++ b/src/military/fetch.js @@ -3,7 +3,6 @@ import axios from 'axios'; import cookie from 'react-cookies'; - let actionUrl = ''; if (window.location.href.indexOf('localhost') > -1) { actionUrl='http://117.50.100.12:8008'; diff --git a/src/military/task.js b/src/military/task.js index 4eaaa264..29f15168 100644 --- a/src/military/task.js +++ b/src/military/task.js @@ -46,6 +46,11 @@ const PaperComplain = Loadable({ loading: Loading, }); +const ProofManage = Loadable({ + loader: () => import("./task/proofManage"), + loading: Loading, +}); + const Index = (propsTransmit) => { // 开发时,从代理的位置获取用户信息 const [currentUser, setCurrentUser] = useState(null); @@ -115,6 +120,13 @@ const Index = (propsTransmit) => { )} > + ( + + )} + > + ( diff --git a/src/military/task/api.js b/src/military/task/api.js index 29d2df67..f06d9535 100644 --- a/src/military/task/api.js +++ b/src/military/task/api.js @@ -298,3 +298,37 @@ export function checkComplain(data){ } +// 佐证上传 +export function proofAdd(data){ + return fetch({ + url: `/api/taskResultProof/addTaskResultProof`, + method: 'post', + data, + }); +} + +// 审核佐证材料列表查询 +export async function proofList(params) { + let res = await fetch({ + url: '/api/tasks/backend/proofList', + method: 'get', + params, + }); + if (res.data) { + return res.data; + } else { + notification.open({ + message: "提示", + description: res.message || '请求错误', + }); + } +} + +// 审核佐证 +export function checkProof(data){ + return fetch({ + url: `/api/taskResultProof/adminCheckResultAndProof`, + method: 'post', + data, + }); +} \ No newline at end of file diff --git a/src/military/task/components/itemListMyTask/index.jsx b/src/military/task/components/itemListMyTask/index.jsx index f1f1cc7e..0e51924c 100644 --- a/src/military/task/components/itemListMyTask/index.jsx +++ b/src/military/task/components/itemListMyTask/index.jsx @@ -13,11 +13,11 @@ for (const item of taskStatusAllArr) { statusArr[item.dicItemCode] = item.dicItemName; } export default (props) => { - const { list, curPage, total, changePage, taskCategoryValueArr, loading, publish, } = props; + const { list, curPage, total, changePage, taskCategoryValueArr, loading, publish, showNotification ,reloadList} = props; const [page, setPage] = useState(1); const [visibleProofs, setVisibleProofs] = useState(false); - const [taskId, setTaskId] = useState({}); + const [taskId, setTaskId] = useState(); const pageSize = props.pageSize || 10; useEffect(() => { @@ -36,6 +36,7 @@ export default (props) => { }) } + return ( -
+
{ - item.paperDetail.busiAttachments && item.paperDetail.busiAttachments.map(fileItem => { + item.paperDetail && item.paperDetail.busiAttachments && item.paperDetail.busiAttachments.map(fileItem => { return
{ downFile(fileItem) }}> {fileItem.fileName} diff --git a/src/military/task/components/itemProofManage/index.jsx b/src/military/task/components/itemProofManage/index.jsx new file mode 100644 index 00000000..7bfbc6f0 --- /dev/null +++ b/src/military/task/components/itemProofManage/index.jsx @@ -0,0 +1,181 @@ +import React, { useEffect, useState } from 'react'; +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 { checkProof } from '../../api'; +import { httpUrl } from 'military/fetch'; +import './index.scss'; +import winpng from '../../image/win.png'; + +const { TextArea } = Input; +export default (props) => { + const { list, curPage, total, changePage, loading, showNotification, reloadList } = props; + const [checkedItem, setCheckedItem] = useState(''); + const [page, setPage] = useState(1); + const [visible, setVisible] = useState(false); + const [advice, setRepairAdvice] = useState(''); + const pageSize = props.pageSize || 10; + + useEffect(() => { + changePage(page); + }, [page]); + + + function agreeClick(item) { + Modal.confirm({ + title: '是否确认审批通过?', + onOk() { + checkProof({ + id: item.taskResultProof.id, + isPassed: 1, + taskId: item.id, + advice: "", + }).then(res => { + if (res && res.message === 'success') { + showNotification('操作成功'); + reloadList(); + } + }) + } + }); + } + + function refuseClick(item) { + setCheckedItem(item); + setVisible(true); + } + + function refuse() { + if (!advice) { + showNotification('请输入拒绝的理由'); + return; + } + checkProof({ + id: checkedItem.taskResultProof.id, + taskId: checkedItem.id, + isPassed: 0, + advice: advice + }).then(res => { + if (res && res.message === 'success') { + showNotification('操作成功'); + reloadList(); + setRepairAdvice(''); + setVisible(false); + } + }); + } + + function goUser(login) { + window.location.href = `/users/${login}`; + } + + function goUserMes(login) { + window.location.href = `/users/${login}/message_detail`; + } + + function downFile(item) { + let url = httpUrl + '/busiAttachments/download/' + item.id; + window.open(url); + } + + return ( + loading ? : + + { + list.map(item => { + return ( +
+ + 头像加载失败 +
+
  • + { goUser(item.user.login) }}>{item.user.nickname || item.user.login} + {timeAgo(item.createdAt)} + + 主体名称: + {item.enterpriseName} + + + {item.taskResultProof.status === 1 && 已同意} + {item.taskResultProof.status === 0 && 已拒绝} + + { + item.taskResultProof.status === 2 && + { goUserMes(item.user.login) }}>私信 + { agreeClick(item) }}>同意 + { refuseClick(item) }}>拒绝 + + } + +
  • +
      +
      + 任务编号: + {item.number} + + {item.name} + +
      + +
      +
      + 评选胜出({item.taskResultProof.winnerName.split(',').length}): + {item.taskResultProof.winnerName} +
      +
      +
      + 佐证材料: + { + item.taskProofAttachments && item.taskProofAttachments.map(fileItem => { + return + { downFile(fileItem) }}> + {fileItem.fileName} + ({fileItem.fileSizeString}) + + }) + } +
      + + {item.taskResultProof.status === 0 &&

      拒绝原因:test1111

      } +
    + +
    +
    + ) + }) + } + + {list.length > 0 ? +
    + {total > pageSize && { setPage(page) }} + current={curPage} + total={total} + showTotal={total => `共 ${total} 条`} + />} +
    : + } + + { setVisible(false) }} + className="form-edit-modal" + > +