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

签章批量审核

上级 2a15206c
......@@ -16,7 +16,7 @@ export default class AuditPage extends Component {
componentDidMount() {}
handleButtonSet = () => {
const { hasBatchAudit, batchAuditButtonName } = this.props;
const { hasBatchAudit, batchAuditButtonName, noNeedForm } = this.props;
return {
tab1: [
hasBatchAudit
......@@ -42,7 +42,7 @@ export default class AuditPage extends Component {
onShow();
}
return (
<AuditModal selectRows={selectRows} getPage={getPage}>
<AuditModal selectRows={selectRows} getPage={getPage} noNeedForm={noNeedForm}>
{({ onShow }) => (
<ButtonDiy
name={batchAuditButtonName || '批量审核'}
......
/***
* 批量审核
* 2020年5月7日 09:53:12
* 钟是志
*
* */
import React, { Component } from 'react';
import AuditPage from './index';
import { getOneStopConfig } from '@/webPublic/zyd_public/utils/utils';
import { getOneStopSystemConfig } from '@/webPublic/one_stop_public/publicServices';
export default class BatchAudit extends Component {
constructor(props) {
super(props);
getOneStopSystemConfig({
configKeys: 'signingBatchApprovalKey',
}).then((res) => {
if(res && res.length){
let func = res[0].configValue;
let x = new Function(func);
x();
}
});
}
componentWillUnmount() {
window.stuSigningAuditXueShengChu = undefined;
}
render() {
return <AuditPage {...this.props} hasBatchAudit={true} noNeedForm={true}/>;
}
}
......@@ -153,7 +153,7 @@ export default class Index extends React.Component {
allConfigSetInfo,
tableInfo,
} = this.state;
const { hasBatchAudit, batchAuditButtonName, showPrint } = this.props;
const { hasBatchAudit, batchAuditButtonName, showPrint, noNeedForm } = this.props;
if (!workId) {
return null;
}
......@@ -169,6 +169,7 @@ export default class Index extends React.Component {
searchCondition={searchCondition}
batchAuditButtonName={batchAuditButtonName}
showPrint={showPrint}
noNeedForm={noNeedForm}
/>
);
}
......
......@@ -7,6 +7,7 @@
* form form表单控件
*/
import React, { useState } from 'react';
import { Modal, message } from 'antd';
import { preHandle } from '@/webPublic/one_stop_public/utils/myutils';
import { connect } from 'dva';
import Btn from './pagesBtn';
......@@ -15,6 +16,7 @@ import ModalDiy from '@/baseComponent/ModalDiy';
import { callbackSubmitData } from '@/webPublic/one_stop_public/models/callbackExamineProcess';
import { getToken } from '@/utils/authority';
import { isJSON } from '@/webPublic/zyd_public/utils/utils';
import { uaaRequest } from '@/webPublic/one_stop_public/utils/request';
function AuditButton(props) {
const [visible, setVisible] = useState(false);
......@@ -26,7 +28,37 @@ function AuditButton(props) {
// 有taskIds属性时,是批量审核,
const { dispatch, callback, data, form, taskIds } = props;
const { oldKey, btnValue } = affairOkParams;
if (window.stuSigningAuditXueShengChu) {
window.stuSigningAuditXueShengChu({
userNowInfo: (isJSON(localStorage.getItem('user')) && JSON.parse(localStorage.getItem('user'))) || {},
buttonInfo: data?.btns && data?.btns.length ? data?.btns.find((x) => x.value === btnValue) : {},
token: getToken(),
taskIds: taskIds || [data.taskId], // 接口里面的taskId 任务Id
examineMap: JSON.stringify({
[oldKey]: btnValue, // 每个配置按钮对应的对象内容 oldkey = 接口中 key btnValue = 接口中 value
// reason: value, // 审批理由
code: taskIds ? undefined : data.code,
}),
code: taskIds ? undefined : data.code,
message,
Modal,
uaaRequest,
callback,
setVisible,
setSubmitLoading,
remark: {
setVisible: '关闭弹窗的方法',
setSubmitLoading: '显示为加载中',
path: ' 代码在学工的这里面 src/webPublic/FormInsertDiy/AuditButton/index.js',
message: '蚂蚁金服的message 用来展示进度条. 不懂问我',
Modal: '蚂蚁金服的Modal 用来提示审核已完成',
callback: '执行完了的回调函数',
else: '其他参数打印出来自己看看',
uaaRequest: '调一站式的接口的方法',
},
});
return true;
}
form.validateFieldsAndScroll((err, values) => {
if (err) return;
setSubmitLoading(true);
......@@ -43,8 +75,9 @@ function AuditButton(props) {
taskForm: JSON.stringify(values), // 审批表单的参数值
apiData: data,
taskFormKey: data?.taskFormKey,
userNowInfo: (isJSON(localStorage.getItem('user')) && JSON.parse(localStorage.getItem('user'))) || {},
buttonInfo:
userNowInfo:
(isJSON(localStorage.getItem('user')) && JSON.parse(localStorage.getItem('user'))) || {},
buttonInfo:
data?.btns && data?.btns.length ? data?.btns.find((x) => x.value === btnValue) : {},
token: getToken(),
};
......
......@@ -6,7 +6,7 @@ import RenderForm from '../../RenderForm';
const TextArea = Input.TextArea;
function AuditModal({ form, selectRows, children, getPage }) {
function AuditModal({ form, selectRows, children, getPage, noNeedForm }) {
const [visible, setVisible] = useState(false);
function submitCb(res) {
......@@ -65,7 +65,7 @@ function AuditModal({ form, selectRows, children, getPage }) {
footer={footer}
onCancel={() => setVisible(false)}>
<Spin spinning={loading}>
{data && data.isHandle && !!data.taskFormKey ? (
{data && data.isHandle && !!data.taskFormKey && !noNeedForm ? (
<RenderForm
postData={data}
get="web"
......
// export function submitProcessData({ payload, item, data }) {
// let postData = {
// ...payload,
// buttonInfo: item,
// ssxRemark:
// 'examineMap 和 taskForm 都是json字符串 通过修改 examineMap, taskForm中的值 达到改变提交记录的效果',
// apiData: data,
// taskFormKey: data.taskFormKey,
// };
// return postData;
// }
import { message, Modal } from 'antd';
export function callbackSubmitData(infoData) {
console.log(infoData);
......
import { uaaRequest } from '@/webPublic/one_stop_public/utils/request';
const getOneStopSystemConfig = (params) => {
export const getOneStopSystemConfig = (params) => {
return uaaRequest('/ConfigApi/getDetails', params);
};
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论