提交 aa50d1cd authored 作者: 钟是志's avatar 钟是志

增加审批回调函数

上级 4675e122
...@@ -5,6 +5,7 @@ import { getToken } from '@/webPublic/one_stop_public/utils/token'; ...@@ -5,6 +5,7 @@ import { getToken } from '@/webPublic/one_stop_public/utils/token';
import { callbackSubmitData } from '@/webPublic/one_stop_public/models/callbackExamineProcess'; import { callbackSubmitData } from '@/webPublic/one_stop_public/models/callbackExamineProcess';
import { getModal } from '@/webPublic/one_stop_public/utils/utils'; import { getModal } from '@/webPublic/one_stop_public/utils/utils';
import { isJSON } from '@/webPublic/one_stop_public/copy'; import { isJSON } from '@/webPublic/one_stop_public/copy';
import beforeAuditSubmit from '@/webPublic/one_stop_public/utils/beforeAuditSubmit';
const Modal = getModal(); const Modal = getModal();
...@@ -108,34 +109,43 @@ const submitValues = ({ ...@@ -108,34 +109,43 @@ const submitValues = ({
token: getToken(), token: getToken(),
}; };
payload = callbackSubmitData(payload); payload = callbackSubmitData(payload);
dispatch({ beforeAuditSubmit(payload)
type: 'affair/getExamineProcess', .then(resParams => {
payload, if (!resParams) {
callback: val => { return false;
if (val) { } else {
that.getInit(); dispatch({
that.setState({ type: 'affair/getExamineProcess',
isHandle: false, payload: resParams,
isSumbitLoading: false, callback: val => {
isSign: checked, if (val) {
}); that.getInit();
Modal.success({ that.setState({
title: '操作成功', isHandle: false,
content: ( isSumbitLoading: false,
<div> isSign: checked,
<p>操作成功,点击确认刷新页面!</p> });
</div> Modal.success({
), title: '操作成功',
onOk: () => { content: (
that.getInit(); <div>
<p>操作成功,点击确认刷新页面!</p>
</div>
),
onOk: () => {
that.getInit();
},
okText: '确认',
});
} else {
openToast('error', '失败', '请稍后重试');
}
}, },
okText: '确认',
}); });
} else {
openToast('error', '失败', '请稍后重试');
} }
}, });
});
}, },
); );
}; };
......
import { message, Modal } from 'antd'; import { message, Modal } from 'antd';
import {uaaRequest} from "@/webPublic/one_stop_public/utils/request"; import { uaaRequest } from '@/webPublic/one_stop_public/utils/request';
import {isJSON} from "@/webPublic/one_stop_public/tableCompon/Split_Index/staticInfo"; import { isJSON } from '@/webPublic/one_stop_public/tableCompon/Split_Index/staticInfo';
export default function beforeApplySubmit(params) { export default function beforeApplySubmit(params) {
if ( if (params && window.beforeApplySubmit && typeof window.beforeApplySubmit === 'function') {
params &&
window.beforeApplySubmit &&
typeof window.beforeApplySubmit === 'function'
) {
console.log('beforeApplySubmit函数开始执行'); console.log('beforeApplySubmit函数开始执行');
const content = params.content && isJSON(params.content) ? JSON.parse(params.content) : {}; const content = params.content && isJSON(params.content) ? JSON.parse(params.content) : {};
return window
return window
.beforeApplySubmit({ .beforeApplySubmit({
message, message,
Modal, Modal,
...@@ -24,7 +18,7 @@ export default function beforeApplySubmit(params) { ...@@ -24,7 +18,7 @@ export default function beforeApplySubmit(params) {
content, content,
}) })
.then((res) => { .then((res) => {
// console.log(res); // console.log(res);
return res; return res;
}) })
.catch((err) => { .catch((err) => {
......
import { message, Modal } from 'antd';
import { uaaRequest } from '@/webPublic/one_stop_public/utils/request';
export default function beforeAuditSubmit(params) {
if (
params &&
window.beforeAuditSubmit &&
typeof window.beforeAuditSubmit === 'function'
) {
console.log('beforeAuditSubmit函数开始执行');
// const content = params.content && isJSON(params.content) ? JSON.parse(params.content) : {};
return window
.beforeAuditSubmit({
message,
Modal,
uaaRequest: (url, data) => {
return uaaRequest(url, data);
},
userNowInfo: localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : '',
submitParams: params,
})
.then((res) => {
// console.log(res);
return res;
})
.catch((err) => {
return false;
});
} else {
return new Promise((resolve, reject) => {
resolve(params);
});
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论