Merge pull request '在线协议签订' (#595) from Eeeros/forgeplus-react:feature/signOnline into pre_dev_military_sign

1
This commit is contained in:
Eeeros 2023-12-05 11:15:07 +08:00
commit a9e1825718
23 changed files with 1209 additions and 68 deletions

6
package-lock.json generated
View File

@ -5773,7 +5773,7 @@
"dependencies": {
"debug": {
"version": "3.2.7",
"resolved": "http://173.15.15.82:8081/repository/npm-all/debug/-/debug-3.2.7.tgz",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
"integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
"requires": {
"ms": "^2.1.1"
@ -5781,7 +5781,7 @@
},
"ms": {
"version": "2.1.3",
"resolved": "http://173.15.15.82:8081/repository/npm-all/ms/-/ms-2.1.3.tgz",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
}
}
@ -8617,7 +8617,7 @@
},
"ms": {
"version": "2.1.2",
"resolved": "http://173.15.15.82:8081/repository/npm-all/ms/-/ms-2.1.2.tgz",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
}
}

View File

@ -2357,7 +2357,7 @@ input::-ms-clear {
.newContainer {
min-height: 100%;
height: auto !important;
/* height: auto !important; */
height: 100%;
/*IE6不识别min-height*/
position: relative;

View File

@ -160,8 +160,13 @@ const Managements = Loadable({
// loading: Loading,
// })
const Iframe = Loadable({
loader: () => import('./military/iframe'),
loading: Loading,
})
// 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。
const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder","task","notice","achievement","managements","expert","competition","administration", "needs"];
const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder","task","notice","achievement","managements","expert","competition","administration", "needs", "iframe"];
class App extends Component {
constructor(props) {
@ -415,6 +420,19 @@ class App extends Component {
{/*启智2022*/}
<Route path="/competition/:competitionId" component={Competition} />
{/* iframe页面 */}
<Route path="/iframe"
render={
(props) => (<Iframe {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/managements/iframe"
render={
(props) => (<Iframe {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/explore/all"
render={
(props) => (

View File

@ -49,6 +49,22 @@ const AgreementManage = Loadable({
loading: Loading,
});
const AgreementManageNew = Loadable({
loader: () => import("../military/task/agreementManageNew"),
loading: Loading,
});
const AgreementSign = Loadable({
loader: () => import("../military/task/agreementSign"),
loading: Loading,
});
const AgreementList = Loadable({
loader: () => import("../military/task/agreementList"),
loading: Loading,
});
const PayProof = Loadable({
loader: () => import("../military/task/payProof"),
loading: Loading,
@ -222,6 +238,31 @@ const Managements = (propsF) => {
)}
></Route>
{/* 管理员协议审核(在线协议签订) */}
<Route
path="/managements/task/agreementManageNew"
render={(props) => (
<AgreementManageNew {...propsF} {...props} />
)}
></Route>
{/* 签订表签字 */}
<Route
path="/managements/task/signatureFormSign"
render={(props) => (
<AgreementSign {...propsF} {...props} />
)}
></Route>
{/* 签订表列表 */}
<Route
path="/managements/task/agreementSign"
render={(props) => (
<AgreementList {...propsF} {...props} />
)}
></Route>
{/* 管理员上传支付凭证 */}
<Route
path="/managements/task/payProof"

View File

@ -3,7 +3,7 @@ import { Upload, Button } from 'antd';
import { appendFileSizeToUploadFileAll } from 'educoder';
import { httpUrl } from '../task/fetch';
function Uploads({ className, size, actionUrl, fileList, showNotification, load,btnText }) {
function Uploads({ className, size, actionUrl, fileList, showNotification, load,btnText, uploadUrl = null }) {
const [files, setFiles] = useState(undefined);
useEffect(() => {
@ -48,7 +48,6 @@ function Uploads({ className, size, actionUrl, fileList, showNotification, load,
function handleChange(info) {
console.log(info);
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let fileList = info.fileList;
setFiles(appendFileSizeToUploadFileAll(fileList));
@ -75,13 +74,15 @@ function Uploads({ className, size, actionUrl, fileList, showNotification, load,
return isLt100M;
}
const upload = {
name: 'file',
fileList: files,
action: (httpUrl || actionUrl) + `/busiAttachments/upload`,
action: (httpUrl || actionUrl) + (uploadUrl ? uploadUrl : `/busiAttachments/upload`),
onChange: handleChange,
onRemove: onAttachmentRemove,
beforeUpload: beforeUpload,
withCredentials: true
};
return (
<Upload {...upload} className={className}>

View File

@ -89,6 +89,7 @@ export default props => {
<Menu.Item title="approver" key={"paperComplain"}><Link to="/managements/task/paperComplain">成果上传申诉审批</Link></Menu.Item>
<Menu.Item title="approver" key={"publicityComplain"}><Link to="/managements/task/publicityComplain">公示期成果申诉审批</Link></Menu.Item>
<Menu.Item title="approver" key={"agreementManage"}><Link to="/managements/task/agreementManage">协议审批</Link></Menu.Item>
<Menu.Item title="approver" key={"agreementManageNew"}><Link to="/managements/task/agreementManageNew">协议审批()</Link></Menu.Item>
<Menu.Item ><a rel="noopener noreferrer" href={`${main_web_site_url}/admin/tasks/report_result_tasks`}>成果举报申诉</a></Menu.Item>
<Menu.Item title="approver" key={"proofManage"}><Link to="/managements/task/proofManage">评选佐证材料</Link></Menu.Item>
</Menu>

33
src/military/iframe.jsx Normal file
View File

@ -0,0 +1,33 @@
import React, { useEffect, useState, useCallback } from 'react';
import { withRouter } from "react-router";
import { SnackbarHOC } from "educoder";
import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC";
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
const Iframe = (props) => {
const history = props.history
const location = history.location
if (!location.state.url) {
history.push("/404");
}
function iframeLoad() {
let myIframe = document.getElementById("iframe");
myIframe.height = `${document.documentElement.clientHeight - 300}px`
if (myIframe.contentWindow.location && myIframe.contentWindow.location.href) {
window.location.href = myIframe.contentWindow.location.href
}
}
return <iframe
id="iframe"
width="100%"
src={ location.state.url }
onLoad={iframeLoad}
></iframe>
}
export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Iframe))));

View File

@ -0,0 +1,199 @@
import React, { useCallback, useEffect, useState, useMemo } from 'react';
import { Input, Radio, Select, Button, Form, DatePicker, Table, Pagination, Modal } from 'antd';
import { paperCheckStatusArr,taskStatusAllArr, signStatus } from '../static';
import { agreementSignList, getSignUrl, } from '../api';
import '../index.scss';
import './index.scss';
import { httpUrl } from '../fetch';
const format = "YYYY-MM-DD HH:mm:ss";
const Option = Select.Option;
const statusArr = [];
for (const item of taskStatusAllArr) {
statusArr[item.dicItemCode] = item.dicItemName;
}
const checkStatusArr = [];
for (const item of paperCheckStatusArr) {
checkStatusArr[item.dicItemCode] = item.dicItemName;
}
export default Form.create()(({ form, history, showNotification }) => {
const { getFieldDecorator, setFieldsValue, getFieldsValue } = form;
const [loading, setLoading] = useState(false);
const [signLoading, setSignLoading] = useState(false);
const [searchObj, setSearchObj] = useState({
signStatus: signStatus.unsigned,
});
const [curPage, setCurPage] = useState(1);
const [total, setTotal] = useState(0);
const [taskList, setTaskList] = useState([]);
const [reload, setReload] = useState(0);
useEffect(() => {
const params = {
...searchObj,
};
setLoading(true);
agreementSignList(params).then(data => {
if (data) {
if((data.data && data.data.length<=0) && curPage>1){
setCurPage(curPage-1);
}
setTaskList(data.data);
setTotal(data.total);
}
setLoading(false);
})
}, [reload, curPage, searchObj]);
const helper = useCallback(
(label, name, rules, widget, initialValue) => (
<Form.Item label={label}>
{getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)}
</Form.Item>
), []);
function onSearch() {
let values = getFieldsValue(['signStatus']);
setSearchObj(values);
}
function clearSearch() {
setFieldsValue({
signStatus: signStatus.all,
});
setSearchObj({});
}
function getAgreementSignUrl(item) {
setSignLoading(true);
const params = {
signTaskType: 2 , //: 1- 2-
signatureFormSignTaskId: item.checkedAgreementSignTaskId
}
getSignUrl(params).then(data => {
if (data.data) {
history.push({ pathname: '/managements/iframe', state: { url: data.data } })
} else {
showNotification('签署链接获取失败,请联系管理员');
}
}).finally(() => {
setSignLoading(false);
})
}
const columns = useMemo(() => {
return [
{
title: '序号',
dataIndex: 'index',
render: (text, record, index) => {
return <div style={{ textAlign: 'center' }}>{index + 1}</div>
}
},
{
title: '任务编号',
dataIndex: 'taskId',
},
{
title: '任务名称',
dataIndex: 'taskName',
},
{
title: '发布时间',
dataIndex: 'taskPublishedTime',
},
{
title: '胜出者姓名',
dataIndex: 'winnerUserName',
},
{
title: '协议',
dataIndex: 'content',
render: (text, record) => {
return record.checkedAgreementFileId ? <a href={`${ httpUrl }/busiAttachments/viewAttachment/${ record.checkedAgreementFile.uniqueFileName }`} target='_blank'>协议预览</a> : '-'
}
},
{
title: '操作',
key: 'action',
render: (text, record) => (
!record.checkedAgreementFileId ? <Button className="mr5 font-12" type="primary" onClick={() => { getAgreementSignUrl(record) }} loading={ signLoading } >协议签字</Button> : '已签署'
),
},
]
}, []);
function changeType(e) {
setSearchObj({
...searchObj,
signStatus: e,
});
setCurPage(1);
}
return (
<div className="task-manage paper-manage imageLayerParent">
<div className="center-screen clearfix" >
<div className="center-left-but">
{helper(
"签署状态",
"signStatus",
[],
<Select
showArrow
placeholder="请选择签署状态"
onChange={changeType}
>
<Option key={0} value={ signStatus.all }>全部</Option>
<Option key={1} value={ signStatus.unsigned }>未签署</Option>
<Option key={2} value={ signStatus.signed }>已签署</Option>
</Select>,
signStatus.unsigned
)}
{helper(
"任务名称",
"number",
[{ 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">
<Table
loading={loading || signLoading}
rowKey={(row) => row.id}
dataSource={taskList}
columns={columns}
pagination={false}
className="mt10"
/>
{total > 10 &&
<Pagination
onChange={(page) => { setCurPage(page) }}
current={curPage}
total={total}
/>}
</div>
</div>
)
}
)

View File

@ -0,0 +1,27 @@
.paper-manage{
.center-screen{
display: block;
.center-left-but,.center-right-but{
float: left;
}
}
.center-left-but{
width: 100%;
.ant-form-item{
width: 30%;
}
}
.center-right-but{
width: 100%;
}
.line_1{
display: inline-block;
}
a {
color: #4154f1;
}
}
.ant-modal-body {
display: flex;
}

View File

@ -0,0 +1,295 @@
import React, { useCallback, useEffect, useState, useMemo } from 'react';
import { Input, Radio, Select, Button, Form, Icon, Table, Pagination, Modal } from 'antd';
import { Link } from "react-router-dom";
import { Confirm } from '../../components/ModalFun';
import { paperCheckStatusArr,taskStatusAllArr } from '../static';
import { agreementListNew, adminCheckAgreementNew } from '../api';
import '../index.scss';
import './index.scss';
import { httpUrl } from '../fetch';
const format = "YYYY-MM-DD HH:mm:ss";
const Option = Select.Option;
const TextArea = Input.TextArea;
const statusArr = [];
for (const item of taskStatusAllArr) {
statusArr[item.dicItemCode] = item.dicItemName;
}
const checkStatusArr = [];
for (const item of paperCheckStatusArr) {
checkStatusArr[item.dicItemCode] = item.dicItemName;
}
export default Form.create()(({ current_user, form, showNotification, match, history }) => {
const { getFieldDecorator, setFieldsValue, getFieldsValue, validateFields } = form;
const [loading, setLoading] = useState(false);
const [searchObj, setSearchObj] = useState({
firstDraftCheckStatus: '2',
});
const [currentPage, setCurrentPage] = useState(1);
const [total, setTotal] = useState(0);
const [taskList, setTaskList] = useState([]);
const [reload, setReload] = useState(0);
const [activeId, setActiveId] = useState('');
const [checkedItem, setCheckedItem] = useState({});
const [visible, setVisible] = useState(false);
const [checkLoading, setCheckLoading] = useState(false);
useEffect(() => {
const params = {
currentPage,
pageSize: 10,
...searchObj,
};
setLoading(true);
agreementListNew(params).then(data => {
data = data.data
if (data) {
if((data.rows && data.rows.length<=0) && currentPage>1){
setCurrentPage(currentPage-1);
}
setTaskList(data.rows);
setTotal(data.total);
}
setLoading(false);
})
}, [reload, currentPage, searchObj]);
const helper = useCallback(
(label, name, rules, widget, initialValue) => (
<Form.Item label={label}>
{getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)}
</Form.Item>
), []);
function onSearch() {
let values = getFieldsValue(['firstDraftCheckStatus', 'taskName']);
setSearchObj(values);
}
function clearSearch() {
setFieldsValue({
firstDraftCheckStatus: '',
});
setSearchObj({});
}
function agreeClick(item) {
Modal.confirm({
title: '确认审批通过?',
onOk() {
setCheckLoading(true);
adminCheckAgreementNew({
taskOnlineSignId: item.id,
params: {
pass: 1,
}
}).then(res => {
if (res && res.message === 'success') {
showNotification('操作成功');
setReload(Math.random());
}
}).finally(() => {
setCheckLoading(false);
})
},
confirmLoading: checkLoading
});
}
function refuseClick(item) {
setCheckedItem(item);
setVisible(true);
}
function dealAction() {
validateFields((error, values) => {
if (!error) {
setCheckLoading(true);
adminCheckAgreementNew({
taskOnlineSignId: checkedItem.id,
params: {
pass: 0,
message: values.message
}
}).then(res => {
if (res && res.message === 'success') {
showNotification('操作成功');
setReload(Math.random());
setVisible(false);
}
}).finally(() => {
setCheckLoading(false);
});
}
});
}
const columns = useMemo(() => {
return [
{
title: '序号',
dataIndex: 'index',
render: (text, record, index) => {
return <div style={{ textAlign: 'center' }}>{index + 1}</div>
}
},
{
title: '任务名称',
dataIndex: 'taskName',
},
{
title: '胜出者',
dataIndex: 'winnerUserName',
},
{
title: '签订表文件',
dataIndex: 'user',
render: (text, record) => {
return record.signatureFormUnsignedFile ?
<div>
<Icon type="file" /> { record.signatureFormUnsignedFile.fileName }
<a href={`${ httpUrl }/busiAttachments/downloadAttachment/${ record.signatureFormUnsignedFile.uniqueFileName }`} target="_blank" download={ record.signatureFormUnsignedFile.fileName } className="ml10">下载</a>
<a href={`${ httpUrl }/busiAttachments/viewAttachment/${ record.signatureFormUnsignedFile.uniqueFileName }`} target="_blank" className="ml10">预览</a>
</div>
: '-'
}
},
{
title: '协议文件',
dataIndex: 'user1',
render: (text, record) => {
return record.agreementFile ?
<div>
<Icon type="file" /> { record.agreementFile.fileName }
<a href={`${ httpUrl }/busiAttachments/downloadAttachment/${ record.agreementFile.uniqueFileName }`} target="_blank" download={ record.agreementFile.fileName } className="ml10">下载</a>
<a href={`${ httpUrl }/busiAttachments/viewAttachment/${ record.agreementFile.uniqueFileName }`} target="_blank" className="ml10">预览</a>
</div>
: '-'
}
},
{
title: '审核时间',
dataIndex: 'firstDraftCheckTime',
},
{
title: '操作',
key: 'action',
render: (text, record) => (
<React.Fragment>
<span>
{record.firstDraftCheckStatus === 1 && <span className="spanTitle color-grey-6 fl ml20">已通过</span>}
{record.firstDraftCheckStatus === 0 && <span className="spanTitle color-red fl ml20">未通过</span>}
{
record.firstDraftCheckStatus === 2 && (
( record.signatureFormUnsignedFile && record.agreementFile ) ? <React.Fragment>
<Button type="primary" className="mr20" onClick={() => { agreeClick(record) }} >同意</Button>
<Button onClick={() => { refuseClick(record) }} >驳回</Button>
</React.Fragment>
: <span>暂未上传文件</span>
)
}
</span>
</React.Fragment>
),
},
]
}, []);
function changeType(e) {
setSearchObj({
...searchObj,
firstDraftCheckStatus: e
});
setCurrentPage(1);
}
return (
<div className="task-manage paper-manage">
<div className="center-screen clearfix" >
<div className="center-left-but">
{helper(
"审核状态",
"firstDraftCheckStatus",
[],
<Select
showArrow
placeholder="请选择审核状态"
onChange={changeType}
>
<Option key='all' value={''}>全部</Option>
<Option key={0} value={0}>未通过</Option>
<Option key={1} value={1}>已通过</Option>
<Option key={2} value={2}>待审核</Option>
</Select>,
2
)}
{helper(
"任务名称",
"taskName",
[{ 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">
<Table
loading={loading || checkLoading }
rowKey={(row) => row.id}
dataSource={taskList}
columns={columns}
pagination={false}
className="mt10"
/>
{total > 10 &&
<Pagination
onChange={(page) => { setCurrentPage(page) }}
current={currentPage}
total={total}
/>}
</div>
<Modal
title="驳回协议"
visible={visible}
onOk={dealAction}
onCancel={() => { setVisible(false) }}
className="form-edit-modal"
confirmLoading={ checkLoading }
>
{
helper('驳回原因', 'message', [{ required: visible, message: "请输入驳回的原因" }, { max: 200, message: '不能超过200字符' }],
<TextArea
placeholder="(必填)我想说点什么呢,200字以内"
autoSize={{ minRows: 6 }}
className="applyText"
/>
)
}
</Modal>
</div>
)
}
)

View File

@ -0,0 +1,24 @@
.paper-manage{
.center-screen{
display: block;
.center-left-but,.center-right-but{
float: left;
}
}
.center-left-but{
width: 100%;
.ant-form-item{
width: 30%;
}
}
.center-right-but{
width: 100%;
}
.line_1{
display: inline-block;
}
a {
color: #4154f1;
}
}

View File

@ -0,0 +1,199 @@
import React, { useCallback, useEffect, useState, useMemo } from 'react';
import { Input, Radio, Select, Button, Form, DatePicker, Table, Pagination, Modal } from 'antd';
import { Link } from "react-router-dom";
import { Confirm } from '../../components/ModalFun';
import { paperCheckStatusArr,taskStatusAllArr, signStatus } from '../static';
import { readyCheckPapers, signatureFormList, getSignUrl } from '../api';
import '../index.scss';
import './index.scss';
import { httpUrl } from '../fetch';
const format = "YYYY-MM-DD HH:mm:ss";
const Option = Select.Option;
const TextArea = Input.TextArea;
const statusArr = [];
for (const item of taskStatusAllArr) {
statusArr[item.dicItemCode] = item.dicItemName;
}
const checkStatusArr = [];
for (const item of paperCheckStatusArr) {
checkStatusArr[item.dicItemCode] = item.dicItemName;
}
export default Form.create()(({ current_user, form, showNotification, match, history }) => {
const { getFieldDecorator, setFieldsValue, getFieldsValue } = form;
const [loading, setLoading] = useState(false);
const [signLoading, setSignLoading] = useState(false);
const [searchObj, setSearchObj] = useState({
signStatus: signStatus.unsigned,
});
const [curPage, setCurPage] = useState(1);
const [total, setTotal] = useState(0);
const [taskList, setTaskList] = useState([]);
const [reload, setReload] = useState(0);
useEffect(() => {
const params = {
// curPage,
// pageSize: 10,
...searchObj,
};
setLoading(true);
signatureFormList(params).then(data => {
if (data) {
if((data.data && data.data.length<=0) && curPage>1){
setCurPage(curPage-1);
}
setTaskList(data.data);
// setTotal(data.total);
}
setLoading(false);
})
}, [reload, curPage, searchObj]);
const helper = useCallback(
(label, name, rules, widget, initialValue) => (
<Form.Item label={label}>
{getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)}
</Form.Item>
), []);
function onSearch() {
let values = getFieldsValue(['signStatus']);
setSearchObj(values);
}
function clearSearch() {
setFieldsValue({
signStatus: signStatus.all,
});
setSearchObj({});
}
function getSignFormUrl(item) {
setSignLoading(true);
const params = {
signTaskType: 1 , //: 1- 2-
signatureFormSignTaskId: item.signatureFormSignTaskId
}
getSignUrl(params).then(data => {
if (data.data) {
history.push({ pathname: '/managements/iframe', state: { url: data.data } });
} else {
showNotification('签署链接获取失败,请联系管理员');
}
}).finally(() => {
setSignLoading(false);
})
}
const columns = useMemo(() => {
return [
{
title: '序号',
dataIndex: 'index',
render: (text, record, index) => {
return <div style={{ textAlign: 'center' }}>{index + 1}</div>
}
},
{
title: '任务编号',
dataIndex: 'taskId',
},
{
title: '任务名称',
dataIndex: 'taskName',
},
{
title: '胜出者姓名',
dataIndex: 'winnerUserName',
},
{
title: '发布主体',
dataIndex: 'publisher',
},
{
title: '发布时间',
dataIndex: 'taskPublishedTime',
},
{
title: '签订表预览',
dataIndex: 'content',
render: (text, record) => {
return record.signatureFormSignedFileId ? <a href={`${ httpUrl }/busiAttachments/viewAttachment/${ record.signatureFormSignedFile.uniqueFileName }`} target='_blank'>签订表预览</a> : '-'
}
},
{
title: '操作',
key: 'action',
render: (text, record) => (
!record.signatureFormSignedFileId ? <Button className="mr5 font-12" type="primary" onClick={() => { getSignFormUrl(record) }} loading={ signLoading } >签订表签字</Button> : '已签署'
),
},
]
}, []);
function changeType(e) {
setSearchObj({
...searchObj,
signStatus: e,
});
setCurPage(1);
}
return (
<div className="task-manage paper-manage">
<div className="center-screen clearfix" >
<div className="center-left-but">
{helper(
"签署状态",
"signStatus",
[],
<Select
showArrow
placeholder="请选择签署状态"
onChange={changeType}
>
<Option key={0} value={ signStatus.all }>全部</Option>
<Option key={1} value={ signStatus.unsigned }>未签署</Option>
<Option key={2} value={ signStatus.signed }>已签署</Option>
</Select>,
signStatus.unsigned
)}
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
<Button className="mr10" type="" onClick={clearSearch}>清除</Button>
</div>
</div>
<div className="center-content">
<Table
loading={loading}
rowKey={(row) => row.id}
dataSource={taskList}
columns={columns}
pagination={false}
className="mt10"
/>
{/* {total > 10 &&
<Pagination
onChange={(page) => { setCurPage(page) }}
current={curPage}
total={total}
/>} */}
</div>
</div>
)
}
)

View File

@ -0,0 +1,21 @@
.paper-manage{
.center-screen{
display: block;
.center-left-but,.center-right-but{
float: left;
}
}
.center-left-but{
width: 100%;
.ant-form-item{
width: 30%;
}
}
.center-right-but{
width: 100%;
}
.line_1{
display: inline-block;
}
}

View File

@ -732,4 +732,94 @@ export function changePinnedTaskSort(data){
method: 'post',
data
});
}
// 签订表+协议审核列表
export function agreementListNew(params) {
return fetch({
url: `/api/taskOnlineSign/admin/firstDraft/list`,
method: 'get',
params,
});
}
// 审核签订表+协议
export function adminCheckAgreementNew(data) {
return fetch({
url: `/api/taskOnlineSign/admin/firstDraft/check/${data.taskOnlineSignId}`,
method: 'post',
data: data.params
});
}
// 签订表签署列表
export function signatureFormList(params) {
return fetch({
url: `/api/taskOnlineSign/admin/signatureForm/list`,
method: 'get',
params,
});
}
// 获取签订表签署链接
export function getSignUrl(params) {
return fetch({
url: `/api/taskOnlineSign/admin/get-url`,
method: 'get',
params,
});
}
// 上传协议
export function uploadAgreement(data) {
return fetch({
url: `/api/taskOnlineSign/admin/agreement/upload`,
method: 'post',
data: data.params
});
}
// 上传签订表
export function uploadSignForm(data) {
return fetch({
url: `/api/taskOnlineSign/admin/signatureForm/upload`,
method: 'post',
data: data.params
});
}
// 获取协议签署列表
export function agreementSignList(params) {
return fetch({
url: `/api/taskOnlineSign/admin/agreement/list`,
method: 'get',
params,
});
}
// 用户获取任务签署状态
export function getTaskSignStatus(params) {
return fetch({
url: `/api/taskOnlineSign/signTaskStatus`,
method: 'get',
params,
});
}
// 用户获取签订表签署链接
export function getUserSignUrl(params) {
return fetch({
url: `/api/taskOnlineSign/user/get-url`,
method: 'get',
params,
});
}
// 查询当前任务文件上传情况
export function getUploadStatus(params) {
return fetch({
url: `/api/taskOnlineSign/firstDraftUploadStatus`,
method: 'get',
params,
});
}

View File

@ -3,55 +3,79 @@ import { Modal, Form, Input, } from 'antd';
import RenderHtml from 'src/components/render-html';
import Upload from 'military/components/Upload';
import ExportWord from 'military/components/ExportWord';
import { uploadAgreePaper,getAgreement } from "../../api";
import { uploadAgreement, uploadSignForm,getAgreement } from "../../api";
import '../../index.scss';
export default Form.create()(props => {
const { visible, setVisible, checkedItem, form, showNotification ,reloadList } = props;
const { visible, setVisible, checkedItem, form, showNotification ,reloadList, uploadStatus } = props;
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
const [fileList, setFileList] = useState([]);
const [content,setContent]=useState('');
useEffect(()=>{
visible && getAgreement({title:'协议模板'}).then(res=>{
if(res.data){
setContent(res.data.content);
}
})
},visible)
const [fileList1, setFileList1] = useState([]);
const [content, setContent]=useState('');
const [loading, setLoading]=useState(false);
const uploadList = [{
func: uploadAgreement,
params: 'files'
}, {
func: uploadSignForm,
params: 'files1'
}, ]
//
function uploadFunc(fileList, files) {
setFileList(fileList);
setFieldsValue({
files,
});
function uploadFuncAgree(fileList, files) {
uploadFunc(fileList, files, false)
}
function uploadFuncSign(fileList, files) {
uploadFunc(fileList, files, true)
}
function uploadFunc(fileList, files, isSign) {
if (isSign) {
setFileList1(fileList);
setFieldsValue({
files1: files,
});
} else {
setFileList(fileList);
setFieldsValue({
files: files,
});
}
}
function uploadAgree() {
validateFields((err, values) => {
if (!err) {
uploadAgreePaper({
paperId: checkedItem.id,
params: {
files: values.files,
}
}).then(res => {
if (res.message === 'success') {
const promiseList = []
setLoading(true)
uploadList.forEach(e => {
promiseList.push(e.func({
params: {
files: values[e.params],
paperNumber: checkedItem.number
}
}))
})
Promise.all(promiseList).then((values) => {
if(values.filter(item=>item.message === 'success').length === promiseList.length){
setFieldsValue({
files: '',
files1: ''
});
setVisible(false);
showNotification("上传协议成功!");
reloadList();
} else {
showNotification(res.message || "上传协议失败")
}else{
showNotification("上传协议失败")
}
})
}).finally(() => {
setLoading(false)
});
}
})
}
@ -63,32 +87,44 @@ export default Form.create()(props => {
onOk={uploadAgree}
onCancel={() => { setVisible(false) }}
className="form-edit-modal"
confirmLoading={ loading }
>
<div className="task-popup-content">
<div>
{/* paperAuditing */}
{checkedItem.paperAuditing && <p className=" mb10 color-orange task_tip">审核意见{checkedItem.paperAuditing.message}</p>}
<ExportWord
{uploadStatus.firstDraftCheckStatus === 0 && <p className=" mb10 color-orange task_tip">审核意见{ uploadStatus.firstDraftCheckComment }</p>}
{/* <ExportWord
className="icon icon-attachment font-13 color-blue"
title="协议模板.doc"
fileName="协议模板"
wordId="wordExpert"
/>
/> */}
<Form.Item className="upload-form" label="协议上传" required={true}>
<Upload
load={uploadFunc}
load={uploadFuncAgree}
size={50}
showNotification={showNotification}
fileList={fileList}
uploadUrl="/busiAttachments/taskOnlineSign/upload"
/>
{getFieldDecorator('files', {
rules: [{ required: visible, message: "请上传文件" }],
validateFirst: true
})(<Input style={{ display: 'none' }} />)}
</Form.Item>
<div id="wordExpert" style={{display:'none'}} >
<RenderHtml className="break_word_comments imageLayerParent" value={content} />
</div>
<Form.Item className="upload-form" label="签订表上传" required={true}>
<Upload
load={uploadFuncSign}
size={50}
showNotification={showNotification}
fileList={fileList1}
uploadUrl="/busiAttachments/taskOnlineSign/upload"
/>
{getFieldDecorator('files1', {
rules: [{ required: visible, message: "请上传文件" }],
validateFirst: true
})(<Input style={{ display: 'none' }} />)}
</Form.Item>
</div>
</Modal>
)

View File

@ -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) => {
})
}
</div>
{
newFlag && <div className="width100 lineh-35 clearfix">
<span className="color-grey-9 fl">签订表文件</span>
{
item.busiAttachments && item.busiAttachments.map(fileItem => {
return <span className="file-list-prof " key={fileItem.id}>
<a onClick={() => { downFile(fileItem) }}><i className="iconfont icon-fujian color-green font-14 mr3"></i>
{fileItem.fileName} </a>
<span className="ml10 color-grey-9">({fileItem.fileSizeString})</span>
</span>
})
}
</div>
}
{/* <div className="width100 lineh-35">
<span className="color-grey-9 fl">驳回原因</span>
<span className="infos_item">{item.content}</span>

View File

@ -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 && <span className='winReview'><img src={win1}/>第一名</span>}
{winReview && i ==1 && <span className='winReview'><img src={win2}/>第二名</span>}
{winReview && i ==2 && <span className='winReview'><img src={win3}/>第三名</span>}
{
// 使
item.status === 2 && detailStatus === 6 && current_user.admin && uploadStatus[item.number] &&
(!( uploadStatus[item.number].agreementUpload && uploadStatus[item.number].signatureFormUpload ) || uploadStatus[item.number].firstDraftCheckStatus === 0) &&
<a className="right-button" onClick={() => {certificationCheck(item); }}>签订协议</a>
}
{
item.status === 2 && detailStatus > 6 && (current_user.login === item.user.login) &&
<a className="right-button" href={`${httpUrl}/busiAttachments/downloadAttachment/${agreementStatus.checkedAgreementFileUniqueId}`} target='_blank'>下载协议</a>
}
</li>
<li className="fr">
{((item.needComplain && detailStatus === 3) || (detailStatus === 5 && item.publicTaskComplain && item.checkStatus === 1 && item.status !== 2)) && (current_user.login === item.user.login) &&
<a className="base_smallBtn blue_line_btn fl" onClick={() => { setComplainVisible(true); setCheckedItem(item) }}>申诉</a>}
{item.status === 2 && detailStatus === 6 && (current_user.login === item.user.login) && (!item.sign) && (item.canApplicantSign || item.canApplicantSignByPlatform) &&
<a className="base_smallBtn blue_line_btn fl" onClick={() => {certificationCheck(item); }}>签订协议</a>}
{item.status === 2 && detailStatus === 7 && (current_user.login === item.user.login) && (item.task && item.task.agreementSigning === 1) && (!item.isPay) &&
<a className="base_smallBtn blue_line_btn fl" onClick={() => { confirmReceiptModal(item.id) }}>确认收款</a>}
</li>
@ -311,6 +338,7 @@ export default Form.create()((props) => {
setVisible={setAgreeVisible}
showNotification={showNotification}
reloadList={reloadList}
uploadStatus={uploadStatus[checkedItem.number]}
/>}
</React.Fragment>

View File

@ -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{

View File

@ -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 // 协议签署
};

View File

@ -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?
<span>协议在线签字,<Button type="link" size="large" onClick={ getSignFormUrl } loading={ signLoading }>点击前往</Button></span>
: <span>协议在线签字</span>
}
//
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 && <div className="edu-back-white step-contain mt20">
<Steps current={ agreementStatus.phase }>
<Step title="等待平台审核协议内容" />
<Step title={ signStep() }></Step>
</Steps>
</div>
}
<div className="applyList edu-back-white padding30 mt20">
<div className="font-16 font-bd">交稿
{/* 此功能暂时去掉 */}
@ -609,6 +672,7 @@ export default Form.create()(
<ItemListPaper
current_user={current_user}
taskLimit={taskLimit}
list={dataList}
itemClick={dataList}
curPage={curPage}
@ -622,6 +686,7 @@ export default Form.create()(
agreementSigning={detailData.agreementSigning}
expertReview={detailData.expertReview}
mygetHelmetapi={mygetHelmetapi}
agreementStatus={ agreementStatus }
/>
</div>

View File

@ -219,4 +219,11 @@ li.except-close{
.color-blue_41{
color: #4154f1;
}
.step-contain {
padding: 30px 20%;
a {
color: #4154f1;
}
}

View File

@ -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,
</Radio.Group>
)}
{helper(
"协议类型:",
"agreementType",
[{ required: true, message: "协议类型" }],
<Radio.Group disabled={published}>
<Radio value={'1'}>理论成果协议</Radio>
<Radio value={'2'}>软件成果协议</Radio>
<Radio value={'3'}>实物成果协议</Radio>
</Radio.Group>
)}
<div className="task-setting-days">
<div className="timing_task">
<div className="mbt10 color-grey-9 lineh-35"><span className="inline-span active">需求提报</span></div>

View File

@ -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")) : {};