+
)
diff --git a/src/military/task/components/itemAgreementManage/index.jsx b/src/military/task/components/itemAgreementManage/index.jsx
index dc334af37..9487b5055 100644
--- a/src/military/task/components/itemAgreementManage/index.jsx
+++ b/src/military/task/components/itemAgreementManage/index.jsx
@@ -4,19 +4,19 @@ import { Link } from "react-router-dom";
import Nodata from 'forge/Nodata';
import Loading from "src/Loading";
import { timeAgo, getImageUrl,goUser,goUserMes } from 'educoder';
-import { adminCheckAgreement } from '../../api';
+import { adminCheckAgreement, adminCheckAgreementNew } from '../../api';
import { httpUrl } from '../../fetch';
import './index.scss';
const { TextArea } = Input;
export default Form.create()((props) => {
- const { form, list, curPage, total, changePage, loading, showNotification, reloadList } = props;
+ const { form, list, curPage, total, changePage, loading, showNotification, reloadList, newFlag = false } = props;
const { getFieldDecorator, validateFields, setFieldsValue } = form;
const [checkedItem, setCheckedItem] = useState({});
const [visible, setVisible] = useState(false);
const pageSize = props.pageSize || 10;
-
+ const checkFunction = newFlag ? adminCheckAgreementNew : adminCheckAgreement
function refuseClick(item) {
setCheckedItem(item);
@@ -26,8 +26,9 @@ export default Form.create()((props) => {
function dealAction() {
validateFields((error, values) => {
if (!error) {
- adminCheckAgreement({
+ checkFunction({
agreementId: checkedItem.id,
+ taskOnlineSignId: checkedItem.id,
type: checkedItem.type,
params: {
pass: 0,
@@ -51,8 +52,9 @@ export default Form.create()((props) => {
Modal.confirm({
title: '确认审批通过?',
onOk() {
- adminCheckAgreement({
+ checkFunction({
agreementId: item.id,
+ taskOnlineSignId: item.id,
type: item.type,
params: {
pass: 1,
@@ -146,6 +148,20 @@ export default Form.create()((props) => {
})
}
+ {
+ newFlag &&
驳回原因:
{item.content}
diff --git a/src/military/task/components/itemListPaper/index.jsx b/src/military/task/components/itemListPaper/index.jsx
index 0732a97ca..44bef0955 100644
--- a/src/military/task/components/itemListPaper/index.jsx
+++ b/src/military/task/components/itemListPaper/index.jsx
@@ -7,7 +7,7 @@ import Loading from "src/Loading";
import { editorConfig } from 'military/components/config';
import AgreementModal from '../agreementModal';
import ComplainModal from '../complainModal';
-import { reportPaper, thumbUpPaper, commentAdd, confirmReceipt } from '../../api';
+import { reportPaper, thumbUpPaper, commentAdd, confirmReceipt, getUploadStatus } from '../../api';
import { paperCheckStatusArr } from '../../static';
import { httpUrl } from '../../fetch';
import winpng from '../../image/winner.png';
@@ -24,7 +24,7 @@ for (const item of paperCheckStatusArr) {
}
export default Form.create()((props) => {
- const { list, curPage, total, changePage, loading, applyStatusAllNameArr, reloadList, showNotification, current_user, form, detailStatus, expertReview ,mygetHelmetapi} = props;
+ const { list, curPage, total, changePage, loading, applyStatusAllNameArr, reloadList, showNotification, current_user, form, detailStatus, expertReview ,agreementStatus, taskLimit} = props;
const { getFieldDecorator, validateFields, setFieldsValue } = form;
const [page, setPage] = useState(1);
const pageSize = props.pageSize || 10;
@@ -39,12 +39,20 @@ export default Form.create()((props) => {
const [loadingChild, setLoadingChild] = useState(false);
+ // 协议文件上传情况
+ const [uploadStatus, setUploadStatus] = useState(false);
useEffect(() => {
changePage(page);
}, [page]);
+ useEffect(() => {
+ if (detailStatus === 6 && current_user.admin) {
+ getUploadFileStatus()
+ }
+ },[list])
+
function downFile(item) {
if(item.uniqueFileName){
window.open(httpUrl+'/busiAttachments/downloadAttachment/'+item.uniqueFileName);
@@ -119,6 +127,27 @@ export default Form.create()((props) => {
window.location.href = `${chromesettingArray.main_web_site_url}/accounts/${login}`;
}
+ // 获取协议上传状态
+ function getUploadFileStatus() {
+ let numberList = []
+ list.forEach(e => {
+ if (e.status === 2) {
+ numberList.push(e.number)
+ }
+ })
+ if (numberList.length > 0) {
+ getUploadStatus({ paperNumbers: numberList.join(',') }).then(res => {
+ let status = {}
+ if (res.data) {
+ res.data.forEach(e => {
+ status[e.paperNumber] = e
+ })
+ }
+ setUploadStatus(status)
+ })
+ }
+ }
+
function confirmReceiptModal(paperId) {
Modal.confirm({
@@ -146,17 +175,8 @@ export default Form.create()((props) => {
);
function certificationCheck(item) {
- if (current_user.bankCertification) {
- setAgreeVisible(true);
- setCheckedItem(item);
- } else {
- Modal.confirm({
- content: "签订协议前请先完成财务认证,是否前往认证?",
- onOk() {
- window.location.href=`${mygetHelmetapi && mygetHelmetapi.main_web_site_url}/users/${current_user.login}/profiles`;
- }
- })
- }
+ setAgreeVisible(true);
+ setCheckedItem(item);
}
return (
@@ -181,14 +201,21 @@ export default Form.create()((props) => {
{winReview && i ==0 &&
第一名}
{winReview && i ==1 &&
第二名}
{winReview && i ==2 &&
第三名}
+ {
+ // 管理员、签订协议阶段暂时使用手动上传模式
+ item.status === 2 && detailStatus === 6 && current_user.admin && uploadStatus[item.number] &&
+ (!( uploadStatus[item.number].agreementUpload && uploadStatus[item.number].signatureFormUpload ) || uploadStatus[item.number].firstDraftCheckStatus === 0) &&
+
{certificationCheck(item); }}>签订协议
+ }
+ {
+ item.status === 2 && detailStatus > 6 && (current_user.login === item.user.login) &&
+
下载协议
+ }
{((item.needComplain && detailStatus === 3) || (detailStatus === 5 && item.publicTaskComplain && item.checkStatus === 1 && item.status !== 2)) && (current_user.login === item.user.login) &&
{ setComplainVisible(true); setCheckedItem(item) }}>申诉}
- {item.status === 2 && detailStatus === 6 && (current_user.login === item.user.login) && (!item.sign) && (item.canApplicantSign || item.canApplicantSignByPlatform) &&
- {certificationCheck(item); }}>签订协议}
-
{item.status === 2 && detailStatus === 7 && (current_user.login === item.user.login) && (item.task && item.task.agreementSigning === 1) && (!item.isPay) &&
{ confirmReceiptModal(item.id) }}>确认收款}
@@ -311,6 +338,7 @@ export default Form.create()((props) => {
setVisible={setAgreeVisible}
showNotification={showNotification}
reloadList={reloadList}
+ uploadStatus={uploadStatus[checkedItem.number]}
/>}
diff --git a/src/military/task/components/itemListPaper/index.scss b/src/military/task/components/itemListPaper/index.scss
index b1e9d7604..e053e5ac9 100644
--- a/src/military/task/components/itemListPaper/index.scss
+++ b/src/military/task/components/itemListPaper/index.scss
@@ -66,6 +66,21 @@
}
}
}
+.right-button {
+ width:81px;
+ height:34px;
+ border:1px solid;
+ border-color:#4154f1;
+ border-radius:2px;
+ color: #4154f1 !important;;
+ font-size:15px;
+ line-height: 34px;
+ text-align: center;
+ position: absolute;
+ right: 0;
+ top: 50%;
+ transform: translate(0, -50%);
+}
.fileComments{
.icon-dianzan_icon{
diff --git a/src/military/task/static.js b/src/military/task/static.js
index 61ffad64c..cce3ee40f 100644
--- a/src/military/task/static.js
+++ b/src/military/task/static.js
@@ -253,3 +253,15 @@ export function surplusTime(item) {
delayTime
};
}
+
+export const signStatus = {
+ all: 'all', // 全部
+ unsigned: 'unsigned', // 未签署
+ signed: 'signed', // 已签署
+};
+
+//
+export const urlType = {
+ edit: 1, // 协同编辑
+ agreement: 2 // 协议签署
+};
diff --git a/src/military/task/taskDetail/index.jsx b/src/military/task/taskDetail/index.jsx
index ed6b1491f..77c607c21 100644
--- a/src/military/task/taskDetail/index.jsx
+++ b/src/military/task/taskDetail/index.jsx
@@ -1,5 +1,5 @@
import React, { forwardRef, useEffect, useState, useCallback, useMemo } from 'react';
-import { Form, Input, Button, Modal, Checkbox, Tooltip } from 'antd';
+import { Form, Input, Button, Modal, Checkbox, Steps } from 'antd';
import classNames from 'classnames';
import moment from 'moment';
import { Link } from "react-router-dom";
@@ -10,12 +10,13 @@ import StatusNav from '../../components/statusNav';
import ItemListPaper from '../components/itemListPaper';
import ProofModal from '../components/proofModal';
import ExportPaper from './exportPaper';
-import { getTaskDetail, getTaskCategory, getTaskPaper, makePublic, addPaper, getAgreement, agreement, checkAgreement, checkHavePaper, addExpertReview, followTask, unfollowTask } from '../api';
-import { taskModeIdArr, applyStatusArr, applyStatusAllArr, paperCheckSearchArr, agreementContent, paperCheckTextArr, surplusTime } from '../static';
+import { getTaskDetail, getTaskCategory, getTaskPaper, makePublic, addPaper, getAgreement, agreement, checkAgreement, checkHavePaper, addExpertReview, followTask, unfollowTask, getTaskSignStatus, getUserSignUrl } from '../api';
+import { taskModeIdArr, applyStatusArr, applyStatusAllArr, paperCheckSearchArr, agreementContent, paperCheckTextArr, surplusTime, urlType } from '../static';
import { httpUrl } from '../fetch';
import './index.scss';
import { getRules } from 'src/military/expert/api';
const { TextArea } = Input;
+const { Step } = Steps;
const taskModeNameArr = [];
@@ -52,6 +53,7 @@ export default Form.create()(
const [total, setTotal] = useState(0);
const [dataList, setDataList] = useState([]);
const [loading, setLoading] = useState(false);
+ const [signLoading, setSignLoading] = useState(false);
const [reload, setReload] = useState(0);
const [relaodChildList, setRelaodChildList] = useState(0);
@@ -61,11 +63,15 @@ export default Form.create()(
const [publishedReviewRules, setPublishedReviewRules] = useState(undefined);
const [download, setDownload] = useState();
+ // 在线协议当前签署状态
+ const [agreementStatus, setAgreementStatus] = useState({
+ phase: 0
+ })
+
// useEffect(()=>{
// !current_user.login&&showLoginDialog();
// },[current_user.login]);
- console.log(current_user);
// 获取任务领域配置数据
useEffect(() => {
@@ -123,6 +129,37 @@ export default Form.create()(
}
}, [detailData, current_user])
+ // 判断是否是胜出者
+ const isWinner = useMemo(() => {
+ let isWin = false
+ for (const item of dataList) {
+ if (item.user.login === current_user.login && item.status === 2) {
+ isWin = true
+ }
+ }
+ return isWin
+ },[dataList, current_user])
+
+ const signStep = () => {
+ return agreementStatus.phase === 1 && agreementStatus.checkedAgreementSignTaskId?
+
协议在线签字,
+ :
协议在线签字
+ }
+
+ // 获取编辑或者签署链接
+ const getSignFormUrl = () => {
+ setSignLoading(true);
+ const params = {
+ urlType: urlType.agreement , // 链接类型: 1-协同编辑 2-协议签署
+ taskId: id
+ }
+ getUserSignUrl(params).then(data => {
+ history.push({ pathname: '/iframe', state: { url: data.data.actorAgreementSignTaskEmbedUrl } })
+ }).finally(() => {
+ setSignLoading(false);
+ })
+ }
+
// 获取协议内容
useEffect(() => {
applyModal && current_user.login && getAgreement(1).then(res => {
@@ -164,6 +201,23 @@ export default Form.create()(
}
}, [id, status, checkStatus, curPage, reload, relaodChildList, detailData, current_user.login]);
+ // 签订协议阶段获取协议状态
+ useEffect(() => {
+ // 当前为签订协议阶段并且为胜出者
+ if (detailData.status >= 6 && isWinner) {
+ const params = {
+ taskId: id
+ }
+ getTaskSignStatus(params).then(data => {
+ if (data.data) {
+ data.data.phase = data.data.phase - 2
+ setAgreementStatus(data.data); // 当前少了在线编辑步骤
+ }
+ });
+ }
+ }, [dataList]);
+
+
// 流程步骤显示,返回剩余时间
const process = useCallback((title, status, days) => {
@@ -569,6 +623,15 @@ export default Form.create()(
}
{(!current_user.login || (current_user.enterpriseCertification || current_user.authentication) && detailData.status === 3 && (!detailData.exceptClosedBoolean)) && signContent()}
+ {
+ current_user.login && detailData.status === 6 && isWinner &&
+
+
+
+
+
+ }
+
交稿
{/* 此功能暂时去掉 */}
@@ -609,6 +672,7 @@ export default Form.create()(
diff --git a/src/military/task/taskDetail/index.scss b/src/military/task/taskDetail/index.scss
index ec2c6df90..af129b985 100644
--- a/src/military/task/taskDetail/index.scss
+++ b/src/military/task/taskDetail/index.scss
@@ -219,4 +219,11 @@ li.except-close{
.color-blue_41{
color: #4154f1;
+}
+
+.step-contain {
+ padding: 30px 20%;
+ a {
+ color: #4154f1;
+ }
}
\ No newline at end of file
diff --git a/src/military/task/taskEdit/index.jsx b/src/military/task/taskEdit/index.jsx
index f2ad92d62..e1c07be54 100644
--- a/src/military/task/taskEdit/index.jsx
+++ b/src/military/task/taskEdit/index.jsx
@@ -74,6 +74,7 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
taskModeId: data.taskModeId,
collectionMode: data.collectionMode,
publishMode: data.publishMode + '',
+ agreementType: data.agreementType + '',
description: data.description,
collectingDays: data.collectingDays,
@@ -113,6 +114,7 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
taskModeId: 1,
collectionMode: 1,
publishMode: '0',
+ agreementType: '1',
collectingDays: 30,
choosingDays: 15,
makePublicDays: 7,
@@ -254,6 +256,7 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
enterpriseName: enterpriseName,
categoryId,
};
+
params.expertReview=Boolean(params.expertReview);
let dateSum = params.collectingDays + params.choosingDays + params.makePublicDays + params.signingDays + params.payingDays;
if (dateSum > 180) {
@@ -491,6 +494,17 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
)}
+ {helper(
+ "协议类型:",
+ "agreementType",
+ [{ required: true, message: "协议类型" }],
+
+ 理论成果协议
+ 软件成果协议
+ 实物成果协议
+
+ )}
+
需求提报
diff --git a/src/military/task/taskList/index.jsx b/src/military/task/taskList/index.jsx
index 7d6c7024d..d923127ca 100644
--- a/src/military/task/taskList/index.jsx
+++ b/src/military/task/taskList/index.jsx
@@ -16,7 +16,6 @@ const Search = Input.Search;
export default ({ history, current_user, showLoginDialog, location, mygetHelmetapi }) => {
- console.log(current_user);
let initType = getUrlToken('type', location.search) || '';
let taskParams = sessionStorage.getItem("taskParams") ? JSON.parse(sessionStorage.getItem("taskParams")) : {};