cont.
This commit is contained in:
parent
23a352be27
commit
5239fb37d0
|
|
@ -7,10 +7,10 @@ import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
|
|||
|
||||
const Iframe = (props) => {
|
||||
|
||||
console.log(props)
|
||||
const history = props.history
|
||||
const location = history.location
|
||||
|
||||
function iframeLoad() {
|
||||
console.log(1111)
|
||||
let myIframe = document.getElementById("iframe");
|
||||
myIframe.height = `${document.documentElement.clientHeight - 300}px`
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ const Iframe = (props) => {
|
|||
return <iframe
|
||||
id="iframe"
|
||||
width="100%"
|
||||
src="https://cn.bing.com/?FORM=Z9FD1"
|
||||
src={ location.state.url }
|
||||
onLoad={iframeLoad}
|
||||
></iframe>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,179 +0,0 @@
|
|||
import React, { useCallback, useEffect, useState, useRef } from 'react';
|
||||
import { Input, Button, Form, Select } from 'antd';
|
||||
|
||||
import ItemAgreementManage from '../components/itemAgreementManage';
|
||||
import StatusNav from '../../components/statusNav';
|
||||
import { agreementArr } from '../static';
|
||||
import { agreementListNew } from '../api';
|
||||
import '../index.scss';
|
||||
const Option = Select.Option;
|
||||
|
||||
const agreementOptionArr = agreementArr.slice(0, 2);
|
||||
export default Form.create()(({ form, showNotification, match, history }) => {
|
||||
|
||||
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
|
||||
|
||||
const [approve, setApprove] = useState(1);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [searchObj, setSearchObj] = useState({});
|
||||
const [status, setStatus] = useState('2');
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [taskList, setTaskList] = useState([]);
|
||||
|
||||
const [reload, setReload] = useState(0);
|
||||
const iframe = useRef()
|
||||
|
||||
|
||||
// 加载审核协议列表
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
...searchObj,
|
||||
status,
|
||||
currentPage: curPage,
|
||||
pageSize: 10,
|
||||
};
|
||||
setLoading(true);
|
||||
agreementListNew(params).then(data => {
|
||||
data = data.data
|
||||
if (data) {
|
||||
if((data.rows && data.rows.length<=0) && curPage>1){
|
||||
setCurPage(curPage-1);
|
||||
}
|
||||
setTaskList(data.rows);
|
||||
setTotal(data.total);
|
||||
}
|
||||
setLoading(false);
|
||||
});
|
||||
}, [reload, status, curPage, searchObj]);
|
||||
|
||||
useEffect(() => {
|
||||
if (iframe.current) {
|
||||
if (!iframe.current.onload) {
|
||||
iframe.current.onload = (e) => {
|
||||
console.log(iframe.current)
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [iframe])
|
||||
|
||||
// form表单公共处理函数
|
||||
const helper = useCallback(
|
||||
(name, rules, widget, initialValue) => (
|
||||
<Form.Item>
|
||||
{getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)}
|
||||
</Form.Item>
|
||||
), []);
|
||||
|
||||
|
||||
function onSearch() {
|
||||
validateFields((err, values) => {
|
||||
if (!err) {
|
||||
setSearchObj(values);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 修改选项
|
||||
const changeOptionId = useCallback((option) => {
|
||||
setStatus(option.dicItemCode.toString() || '0,1');
|
||||
setCurPage(1);
|
||||
}, []);
|
||||
|
||||
// 修改状态
|
||||
function changeApprove(approve) {
|
||||
setApprove(approve);
|
||||
setCurPage(1);
|
||||
if (approve === 1) {
|
||||
setStatus('2');
|
||||
} else {
|
||||
setStatus('0,1');
|
||||
}
|
||||
}
|
||||
|
||||
// 清除查询内容
|
||||
function clearSearch() {
|
||||
setFieldsValue({
|
||||
taskNumber: '',
|
||||
taskName: '',
|
||||
userName: ''
|
||||
});
|
||||
setSearchObj({});
|
||||
}
|
||||
|
||||
// 刷新数据
|
||||
const reloadList = useCallback(() => {
|
||||
setReload(Math.random());
|
||||
}, []);
|
||||
|
||||
|
||||
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(
|
||||
"taskNumber",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="输入任务编号进行检索"
|
||||
/>
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"taskName",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="输入任务名称进行检索"
|
||||
/>
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"userName",
|
||||
[{ 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={agreementOptionArr}
|
||||
changeOptionId={changeOptionId}
|
||||
/>
|
||||
}
|
||||
<ItemAgreementManage
|
||||
list={taskList}
|
||||
curPage={curPage}
|
||||
total={total}
|
||||
changePage={(page) => { setCurPage(page) }}
|
||||
loading={loading}
|
||||
showNotification={showNotification}
|
||||
reloadList={reloadList}
|
||||
newFlag={ true }
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
@ -0,0 +1,272 @@
|
|||
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';
|
||||
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);
|
||||
|
||||
|
||||
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']);
|
||||
if (values.firstDraftCheckStatus === '0,1,2') values.firstDraftCheckStatus = '';
|
||||
setSearchObj(values);
|
||||
}
|
||||
|
||||
function clearSearch() {
|
||||
setFieldsValue({
|
||||
firstDraftCheckStatus: '',
|
||||
});
|
||||
setSearchObj({});
|
||||
}
|
||||
|
||||
function agreeClick(item) {
|
||||
Modal.confirm({
|
||||
title: '确认审批通过?',
|
||||
onOk() {
|
||||
adminCheckAgreementNew({
|
||||
taskOnlineSignId: item.id,
|
||||
params: {
|
||||
pass: 1,
|
||||
}
|
||||
}).then(res => {
|
||||
if (res && res.message === 'success') {
|
||||
showNotification('操作成功');
|
||||
setReload(Math.random());
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function refuseClick(item) {
|
||||
setCheckedItem(item);
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
function dealAction() {
|
||||
validateFields((error, values) => {
|
||||
if (!error) {
|
||||
adminCheckAgreementNew({
|
||||
taskOnlineSignId: checkedItem.id,
|
||||
params: {
|
||||
pass: 0,
|
||||
message: values.message
|
||||
}
|
||||
}).then(res => {
|
||||
if (res && res.message === 'success') {
|
||||
showNotification('操作成功');
|
||||
setReload(Math.random());
|
||||
setVisible(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 ?
|
||||
<a href={ record.signatureFormUnsignedFile.fileDownloadPath } target='_blank' download={ record.signatureFormUnsignedFile.fileName }><Icon type="file" /> { record.signatureFormUnsignedFile.fileName }</a>
|
||||
: '-'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '协议文件文件',
|
||||
dataIndex: 'user1',
|
||||
render: (text, record) => {
|
||||
return record.agreementFile ?
|
||||
<a href={ record.agreementFile.fileDownloadPath } target='_blank' download={ record.agreementFile.fileName }><Icon type="file" /> { record.agreementFile.fileName }</a>
|
||||
: '-'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '发布时间',
|
||||
dataIndex: 'createdAt',
|
||||
},
|
||||
{
|
||||
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 && <React.Fragment>
|
||||
<Button type="primary" className="mr20" onClick={() => { agreeClick(record) }}>同意</Button>
|
||||
<Button onClick={() => { refuseClick(record) }}>驳回</Button>
|
||||
</React.Fragment>
|
||||
}
|
||||
</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={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}
|
||||
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"
|
||||
>
|
||||
{
|
||||
helper('驳回原因', 'message', [{ required: visible, message: "请输入驳回的原因" }, { max: 200, message: '不能超过200字符' }],
|
||||
<TextArea
|
||||
placeholder="(必填)我想说点什么呢,200字以内"
|
||||
autoSize={{ minRows: 6 }}
|
||||
className="applyText"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ import { Input, Radio, Select, Button, Form, DatePicker, Table, Pagination, Moda
|
|||
import { Link } from "react-router-dom";
|
||||
import { Confirm } from '../../components/ModalFun';
|
||||
import { paperCheckStatusArr,taskStatusAllArr } from '../static';
|
||||
import { readyCheckPapers, checkPaper, } from '../api';
|
||||
import { readyCheckPapers, agreementSignList, getSignUrl } from '../api';
|
||||
import '../index.scss';
|
||||
import './index.scss';
|
||||
const format = "YYYY-MM-DD HH:mm:ss";
|
||||
|
|
@ -25,7 +25,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [searchObj, setSearchObj] = useState({
|
||||
checkStatus: '2',
|
||||
signStatus: '2',
|
||||
parentId: 0,
|
||||
});
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
|
|
@ -33,23 +33,22 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
const [taskList, setTaskList] = useState([]);
|
||||
|
||||
const [reload, setReload] = useState(0);
|
||||
const [activeId, setActiveId] = useState('');
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
curPage,
|
||||
pageSize: 10,
|
||||
// curPage,
|
||||
// pageSize: 10,
|
||||
...searchObj,
|
||||
};
|
||||
setLoading(true);
|
||||
readyCheckPapers(params).then(data => {
|
||||
agreementSignList(params).then(data => {
|
||||
if (data) {
|
||||
if((data.rows && data.rows.length<=0) && curPage>1){
|
||||
if((data.data && data.data.length<=0) && curPage>1){
|
||||
setCurPage(curPage-1);
|
||||
}
|
||||
setTaskList(data.rows);
|
||||
setTotal(data.total);
|
||||
setTaskList(data.data);
|
||||
// setTotal(data.total);
|
||||
}
|
||||
setLoading(false);
|
||||
})
|
||||
|
|
@ -65,25 +64,25 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
|
||||
|
||||
function onSearch() {
|
||||
let values = getFieldsValue(['checkStatus', 'endCreatedAt', 'startCreatedAt', 'parentId','number']);
|
||||
if (values.startCreatedAt) values.startCreatedAt = values.startCreatedAt.format(format);
|
||||
if (values.endCreatedAt) values.endCreatedAt = values.endCreatedAt.format(format);
|
||||
if (values.checkStatus === '0,1,2') values.checkStatus = '';
|
||||
let values = getFieldsValue(['signStatus']);
|
||||
setSearchObj(values);
|
||||
}
|
||||
|
||||
function clearSearch() {
|
||||
setFieldsValue({
|
||||
startCreatedAt: '',
|
||||
endCreatedAt: '',
|
||||
checkStatus: '0,1,2',
|
||||
number:''
|
||||
signStatus: '',
|
||||
});
|
||||
setSearchObj({});
|
||||
}
|
||||
|
||||
function getSignUrl() {
|
||||
|
||||
function getSignFormUrl(item) {
|
||||
const params = {
|
||||
signTaskType: 1 , //类型: 1-签订表 2-协议
|
||||
signatureFormSignTaskId: item.signatureFormSignTaskId
|
||||
}
|
||||
getSignUrl(params).then(data => {
|
||||
history.push({ pathname: '/managements/iframe', state: { url: data.data } })
|
||||
})
|
||||
}
|
||||
|
||||
const columns = useMemo(() => {
|
||||
|
|
@ -97,14 +96,14 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
},
|
||||
{
|
||||
title: '任务名称',
|
||||
dataIndex: 'number',
|
||||
dataIndex: 'taskName',
|
||||
},
|
||||
{
|
||||
title: '发布主体',
|
||||
dataIndex: 'user',
|
||||
render: (text, record) => {
|
||||
return record.user.nickname || record.user.login
|
||||
}
|
||||
// render: (text, record) => {
|
||||
// return record.user.nickname || record.user.login
|
||||
// }
|
||||
},
|
||||
{
|
||||
title: '发布时间',
|
||||
|
|
@ -115,7 +114,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<React.Fragment>
|
||||
<Button className="mr5 font-12" type="primary" size="small" onClick={() => { getSignUrl() }}>签订表签字</Button>
|
||||
<Button className="mr5 font-12" type="primary" onClick={() => { getSignFormUrl(record) }}>签订表签字</Button>
|
||||
</React.Fragment>
|
||||
),
|
||||
},
|
||||
|
|
@ -125,7 +124,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
function changeType(e) {
|
||||
setSearchObj({
|
||||
...searchObj,
|
||||
parentId: e,
|
||||
signStatus: e,
|
||||
});
|
||||
setCurPage(1);
|
||||
}
|
||||
|
|
@ -136,7 +135,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
<div className="center-left-but">
|
||||
{helper(
|
||||
"签订状态",
|
||||
"parentId",
|
||||
"signStatus",
|
||||
[],
|
||||
<Select
|
||||
showArrow
|
||||
|
|
@ -149,49 +148,6 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
0
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"任务名称",
|
||||
"number",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="请输入任务名称"
|
||||
/>
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"发布主体",
|
||||
"number",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="请输入发布主体"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="center-right-but">
|
||||
{helper(
|
||||
"发布时间:",
|
||||
"startCreatedAt",
|
||||
[],
|
||||
<DatePicker
|
||||
showTime
|
||||
format={format}
|
||||
placeholder="请选择开始时间"
|
||||
/>
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"",
|
||||
"endCreatedAt",
|
||||
[],
|
||||
<DatePicker
|
||||
showTime
|
||||
format={format}
|
||||
placeholder="请选择结束时间"
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
||||
<Button className="mr10" type="" onClick={clearSearch}>清除</Button>
|
||||
|
||||
|
|
@ -209,12 +165,12 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
pagination={false}
|
||||
className="mt10"
|
||||
/>
|
||||
{total > 10 &&
|
||||
{/* {total > 10 &&
|
||||
<Pagination
|
||||
onChange={(page) => { setCurPage(page) }}
|
||||
current={curPage}
|
||||
total={total}
|
||||
/>}
|
||||
/>} */}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -764,7 +764,7 @@ export function agreementSignList(params) {
|
|||
// 获取签订表签署链接
|
||||
export function getSignUrl(params) {
|
||||
return fetch({
|
||||
url: `/api/taskOnlineSign/admin/signatureForm/get-url`,
|
||||
url: `/api/taskOnlineSign/admin/get-url`,
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,13 +9,15 @@ import '../../index.scss';
|
|||
|
||||
|
||||
export default Form.create()(props => {
|
||||
const { visible, setVisible, checkedItem, form, showNotification ,reloadList, paperId } = props;
|
||||
const { visible, setVisible, checkedItem, form, showNotification ,reloadList } = props;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
|
||||
|
||||
const [fileList, setFileList] = useState([]);
|
||||
const [fileList1, setFileList1] = useState([]);
|
||||
const [content,setContent]=useState('');
|
||||
|
||||
const uploadList = [uploadAgreement, uploadSignForm]
|
||||
|
||||
useEffect(()=>{
|
||||
visible && getAgreement({title:'协议模板'}).then(res=>{
|
||||
if(res.data){
|
||||
|
|
@ -50,25 +52,29 @@ export default Form.create()(props => {
|
|||
|
||||
function uploadAgree() {
|
||||
validateFields((err, values) => {
|
||||
console.log(values)
|
||||
if (!err) {
|
||||
uploadAgreement({
|
||||
params: {
|
||||
files: values.files,
|
||||
taskOnlineSignId: paperId
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.message === 'success') {
|
||||
const promiseList = []
|
||||
uploadList.forEach(e => {
|
||||
promiseList.push(e({
|
||||
params: {
|
||||
files: values.files,
|
||||
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 {
|
||||
}else{
|
||||
showNotification(res.message || "上传协议失败")
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue