diff --git a/src/military/iframe.jsx b/src/military/iframe.jsx
index 1dc4d15b2..f9feccb71 100644
--- a/src/military/iframe.jsx
+++ b/src/military/iframe.jsx
@@ -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
}
diff --git a/src/military/task/agreementManageNew/index.js b/src/military/task/agreementManageNew/index.js
deleted file mode 100644
index 9fa18360b..000000000
--- a/src/military/task/agreementManageNew/index.js
+++ /dev/null
@@ -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) => (
-
- {getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)}
-
- ), []);
-
-
- 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 (
-
-
-
-
-
-
- {
- approve === 2 &&
- }
- { setCurPage(page) }}
- loading={loading}
- showNotification={showNotification}
- reloadList={reloadList}
- newFlag={ true }
- />
-
-
-
-
-
- )
-}
-)
\ No newline at end of file
diff --git a/src/military/task/agreementManageNew/index.jsx b/src/military/task/agreementManageNew/index.jsx
new file mode 100644
index 000000000..721485070
--- /dev/null
+++ b/src/military/task/agreementManageNew/index.jsx
@@ -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) => (
+
+ {getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)}
+
+ ), []);
+
+
+ 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 {index + 1}
+ }
+ },
+ {
+ title: '任务名称',
+ dataIndex: 'taskName',
+ },
+ {
+ title: '胜出者',
+ dataIndex: 'winnerUserName',
+ },
+ {
+ title: '签订表文件',
+ dataIndex: 'user',
+ render: (text, record) => {
+ return record.signatureFormUnsignedFile ?
+ { record.signatureFormUnsignedFile.fileName }
+ : '-'
+ }
+ },
+ {
+ title: '协议文件文件',
+ dataIndex: 'user1',
+ render: (text, record) => {
+ return record.agreementFile ?
+ { record.agreementFile.fileName }
+ : '-'
+ }
+ },
+ {
+ title: '发布时间',
+ dataIndex: 'createdAt',
+ },
+ {
+ title: '操作',
+ key: 'action',
+ render: (text, record) => (
+
+
+ {record.firstDraftCheckStatus === 1 && 已通过}
+ {record.firstDraftCheckStatus === 0 && 未通过}
+
+ {
+ record.firstDraftCheckStatus === 2 &&
+
+
+
+ }
+
+
+ ),
+ },
+ ]
+ }, []);
+
+ function changeType(e) {
+ setSearchObj({
+ ...searchObj,
+ firstDraftCheckStatus: e
+ });
+ setCurrentPage(1);
+ }
+
+ return (
+
+
+
+ {helper(
+ "审核状态",
+ "firstDraftCheckStatus",
+ [],
+ ,
+ 2
+ )}
+
+ {helper(
+ "任务名称",
+ "taskName",
+ [{ max: 20, message: '长度不能超过20个字符' }],
+
+ )}
+
+
+
+
+
+
+
+
+
+
+
row.id}
+ dataSource={taskList}
+ columns={columns}
+ pagination={false}
+ className="mt10"
+ />
+ {total > 10 &&
+ { setCurrentPage(page) }}
+ current={currentPage}
+ total={total}
+ />}
+
+
+ { setVisible(false) }}
+ className="form-edit-modal"
+ >
+ {
+ helper('驳回原因', 'message', [{ required: visible, message: "请输入驳回的原因" }, { max: 200, message: '不能超过200字符' }],
+
+ )
+ }
+
+
+
+ )
+}
+)
\ No newline at end of file
diff --git a/src/military/task/agreementManageNew/index.scss b/src/military/task/agreementManageNew/index.scss
new file mode 100644
index 000000000..5e804270c
--- /dev/null
+++ b/src/military/task/agreementManageNew/index.scss
@@ -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;
+ }
+}
\ No newline at end of file
diff --git a/src/military/task/agreementSign/index.jsx b/src/military/task/agreementSign/index.jsx
index 459254f08..2edb2f283 100644
--- a/src/military/task/agreementSign/index.jsx
+++ b/src/military/task/agreementSign/index.jsx
@@ -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) => (
-
+
),
},
@@ -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
{helper(
"签订状态",
- "parentId",
+ "signStatus",
[],
- )}
-
- {helper(
- "发布主体",
- "number",
- [{ max: 20, message: '长度不能超过20个字符' }],
-
- )}
-
-
-
- {helper(
- "发布时间:",
- "startCreatedAt",
- [],
-
- )}
-
- {helper(
- "",
- "endCreatedAt",
- [],
-
- )}
-
-
@@ -209,12 +165,12 @@ export default Form.create()(({ current_user, form, showNotification, match, his
pagination={false}
className="mt10"
/>
- {total > 10 &&
+ {/* {total > 10 &&
{ setCurPage(page) }}
current={curPage}
total={total}
- />}
+ />} */}
diff --git a/src/military/task/api.js b/src/military/task/api.js
index d6ec33121..3aa53240a 100644
--- a/src/military/task/api.js
+++ b/src/military/task/api.js
@@ -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,
});
diff --git a/src/military/task/components/agreementModal/index.jsx b/src/military/task/components/agreementModal/index.jsx
index 49d16125e..afc1cd7c3 100644
--- a/src/military/task/components/agreementModal/index.jsx
+++ b/src/military/task/components/agreementModal/index.jsx
@@ -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 || "上传协议失败")
}
- })
+ });
}
})
}