diff --git a/package-lock.json b/package-lock.json index 5a00b8077..8e747a481 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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==" } } diff --git a/public/css/edu-purge.css b/public/css/edu-purge.css index a77a0fc0d..2a2999d7c 100644 --- a/public/css/edu-purge.css +++ b/public/css/edu-purge.css @@ -2357,7 +2357,7 @@ input::-ms-clear { .newContainer { min-height: 100%; - height: auto !important; + /* height: auto !important; */ height: 100%; /*IE6不识别min-height*/ position: relative; diff --git a/src/App.js b/src/App.js index ef8dd4955..f77203b09 100644 --- a/src/App.js +++ b/src/App.js @@ -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*/} + {/* iframe页面 */} + ( +} + +export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Iframe)))); \ No newline at end of file diff --git a/src/military/task/agreementList/index.jsx b/src/military/task/agreementList/index.jsx new file mode 100644 index 000000000..3597ff1a5 --- /dev/null +++ b/src/military/task/agreementList/index.jsx @@ -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) => ( + + {getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)} + + ), []); + + + 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
{index + 1}
+ } + }, + { + title: '任务编号', + dataIndex: 'taskId', + }, + { + title: '任务名称', + dataIndex: 'taskName', + }, + { + title: '发布时间', + dataIndex: 'taskPublishedTime', + }, + { + title: '胜出者姓名', + dataIndex: 'winnerUserName', + }, + { + title: '协议', + dataIndex: 'content', + render: (text, record) => { + return record.checkedAgreementFileId ? 协议预览 : '-' + } + }, + { + title: '操作', + key: 'action', + render: (text, record) => ( + !record.checkedAgreementFileId ? : '已签署' + ), + }, + ] + }, []); + + function changeType(e) { + setSearchObj({ + ...searchObj, + signStatus: e, + }); + setCurPage(1); + } + + return ( +
+
+
+ {helper( + "签署状态", + "signStatus", + [], + , + signStatus.unsigned + )} + + {helper( + "任务名称", + "number", + [{ max: 20, message: '长度不能超过20个字符' }], + + )} + + +
+
+ + +
+ + row.id} + dataSource={taskList} + columns={columns} + pagination={false} + className="mt10" + /> + {total > 10 && + { setCurPage(page) }} + current={curPage} + total={total} + />} + + + + ) +} +) \ No newline at end of file diff --git a/src/military/task/agreementList/index.scss b/src/military/task/agreementList/index.scss new file mode 100644 index 000000000..4763ac852 --- /dev/null +++ b/src/military/task/agreementList/index.scss @@ -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; +} \ 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..97f7097ef --- /dev/null +++ b/src/military/task/agreementManageNew/index.jsx @@ -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) => ( + + {getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)} + + ), []); + + + 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
{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: 'firstDraftCheckTime', + }, + { + title: '操作', + key: 'action', + render: (text, record) => ( + + + {record.firstDraftCheckStatus === 1 && 已通过} + {record.firstDraftCheckStatus === 0 && 未通过} + + { + record.firstDraftCheckStatus === 2 && ( + ( record.signatureFormUnsignedFile && record.agreementFile ) ? + + + + : 暂未上传文件 + ) + } + + + ), + }, + ] + }, []); + + 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" + confirmLoading={ checkLoading } + > + { + helper('驳回原因', 'message', [{ required: visible, message: "请输入驳回的原因" }, { max: 200, message: '不能超过200字符' }], +