|
@@ -21,6 +21,7 @@ import {
|
|
queryContractCancelCheck,
|
|
queryContractCancelCheck,
|
|
queryContractCheck,
|
|
queryContractCheck,
|
|
queryContractDownload,
|
|
queryContractDownload,
|
|
|
|
+ queryContractSaveDraft,
|
|
queryDelById,
|
|
queryDelById,
|
|
queryGetContractList,
|
|
queryGetContractList,
|
|
queryOAReCall,
|
|
queryOAReCall,
|
|
@@ -33,6 +34,7 @@ import EllipsisText from './component/EllipsisText';
|
|
import { stringify } from 'qs';
|
|
import { stringify } from 'qs';
|
|
import { audit, createAduit } from '@/services/boom';
|
|
import { audit, createAduit } from '@/services/boom';
|
|
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
|
|
+import DraftModal from './component/DraftModal';
|
|
|
|
|
|
const ConteactManager = (props) => {
|
|
const ConteactManager = (props) => {
|
|
const { dispatch } = props;
|
|
const { dispatch } = props;
|
|
@@ -56,6 +58,8 @@ const ConteactManager = (props) => {
|
|
const [fileViewerData, setFileViewerData] = useState();
|
|
const [fileViewerData, setFileViewerData] = useState();
|
|
const [modal, contextHolder] = Modal.useModal();
|
|
const [modal, contextHolder] = Modal.useModal();
|
|
|
|
|
|
|
|
+ const [draftOpen, setDraftOpen] = useState(false);
|
|
|
|
+
|
|
const showBtn = (record, type) => {
|
|
const showBtn = (record, type) => {
|
|
let bool = false;
|
|
let bool = false;
|
|
switch (type) {
|
|
switch (type) {
|
|
@@ -315,6 +319,18 @@ const ConteactManager = (props) => {
|
|
},
|
|
},
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+ //保存草稿
|
|
|
|
+ const { run: saveDraftRun } = useRequest(
|
|
|
|
+ (data) => queryContractSaveDraft(data),
|
|
|
|
+ {
|
|
|
|
+ manual: true,
|
|
|
|
+ onSuccess: (res) => {
|
|
|
|
+ setVisible(false);
|
|
|
|
+ message.success('保存成功');
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ );
|
|
|
|
+
|
|
const handleDelete = (id) => {
|
|
const handleDelete = (id) => {
|
|
modal.confirm({
|
|
modal.confirm({
|
|
icon: <ExclamationCircleOutlined />,
|
|
icon: <ExclamationCircleOutlined />,
|
|
@@ -375,6 +391,14 @@ const ConteactManager = (props) => {
|
|
);
|
|
);
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ const handleDraftOpen = (data) => {
|
|
|
|
+ console.log(data);
|
|
|
|
+ setDraftOpen(false);
|
|
|
|
+ typeRef.current = Type.add;
|
|
|
|
+ setDetail(data);
|
|
|
|
+ setVisible(true);
|
|
|
|
+ };
|
|
|
|
+
|
|
const handleQueryChildren = async (req) => {
|
|
const handleQueryChildren = async (req) => {
|
|
const res = await queryGetContractList(req);
|
|
const res = await queryGetContractList(req);
|
|
if (res?.data?.list) {
|
|
if (res?.data?.list) {
|
|
@@ -414,12 +438,14 @@ const ConteactManager = (props) => {
|
|
extend_code: data.code,
|
|
extend_code: data.code,
|
|
extend_type: 0, //归档提交
|
|
extend_type: 0, //归档提交
|
|
});
|
|
});
|
|
|
|
+ } else if (type == Type.save) {
|
|
|
|
+ saveDraftRun(data);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
const handlerReCall = async (id) => {
|
|
const handlerReCall = async (id) => {
|
|
modal.confirm({
|
|
modal.confirm({
|
|
- icon: <ExclamationCircleOutlined />,
|
|
|
|
|
|
+ icon: <ExclamationCircleOutlined ined />,
|
|
title: '提示:',
|
|
title: '提示:',
|
|
content: <div>确定撤回合同存档审批!</div>,
|
|
content: <div>确定撤回合同存档审批!</div>,
|
|
onOk: async () => {
|
|
onOk: async () => {
|
|
@@ -427,7 +453,9 @@ const ConteactManager = (props) => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
message.success('撤回成功');
|
|
message.success('撤回成功');
|
|
setVisible(false);
|
|
setVisible(false);
|
|
- run(searchData);
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ run(searchData);
|
|
|
|
+ }, 1000);
|
|
} else {
|
|
} else {
|
|
message.success('撤回失败,请重试');
|
|
message.success('撤回失败,请重试');
|
|
}
|
|
}
|
|
@@ -515,6 +543,7 @@ const ConteactManager = (props) => {
|
|
</Button>
|
|
</Button>
|
|
<Button
|
|
<Button
|
|
type="primary"
|
|
type="primary"
|
|
|
|
+ className={styles.searchBtnSty}
|
|
onClick={() => {
|
|
onClick={() => {
|
|
typeRef.current = Type.add;
|
|
typeRef.current = Type.add;
|
|
setDetail({});
|
|
setDetail({});
|
|
@@ -523,6 +552,9 @@ const ConteactManager = (props) => {
|
|
>
|
|
>
|
|
新增
|
|
新增
|
|
</Button>
|
|
</Button>
|
|
|
|
+ <Button type="primary" onClick={() => setDraftOpen(true)}>
|
|
|
|
+ 草稿箱
|
|
|
|
+ </Button>
|
|
<Button
|
|
<Button
|
|
type="primary"
|
|
type="primary"
|
|
className={styles.exportBtnSty}
|
|
className={styles.exportBtnSty}
|
|
@@ -565,6 +597,11 @@ const ConteactManager = (props) => {
|
|
setFileViewerVisible(false);
|
|
setFileViewerVisible(false);
|
|
}}
|
|
}}
|
|
/>
|
|
/>
|
|
|
|
+ <DraftModal
|
|
|
|
+ open={draftOpen}
|
|
|
|
+ onOk={handleDraftOpen}
|
|
|
|
+ onCancel={() => setDraftOpen(false)}
|
|
|
|
+ />
|
|
{contextHolder}
|
|
{contextHolder}
|
|
</PageContent>
|
|
</PageContent>
|
|
);
|
|
);
|