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

禅道 32366 二级学院审核,所有二级学院审核后在已处理中加导出功能 103152

上级 adf21efd
...@@ -11,216 +11,213 @@ import AuditPage from './AuditPage'; ...@@ -11,216 +11,213 @@ import AuditPage from './AuditPage';
import * as destructionFunc from '../destruction'; import * as destructionFunc from '../destruction';
import { Link } from 'dva/router'; import { Link } from 'dva/router';
import CreateC from '../../ExportComponent/ContextCreate'; import CreateC from '../../ExportComponent/ContextCreate';
import prepareShow from '@/webPublic/one_stop_public/Table/prepareShow';
import exportHandledInfo from '@/webPublic/FormInsertDiy/AffairPage/AuditPage/exportHandledInfo';
class Index extends React.Component { class Index extends React.Component {
static defaultProps = { static defaultProps = {
hasBatchAudit: false, // 是否有批量审核按钮 默认关掉 如果有需要再在外面包一层 2020年5月6日 18:44:11 钟是志 hasBatchAudit: false, // 是否有批量审核按钮 默认关掉 如果有需要再在外面包一层 2020年5月6日 18:44:11 钟是志
batchAuditButtonName: '批量审核', // 如果需要批量审核 则直接用 BatchAudit.js 文件 batchAuditButtonName: '批量审核', // 如果需要批量审核 则直接用 BatchAudit.js 文件
}; };
constructor(props) { constructor(props) {
super(props); super(props);
let pathname = this.props.location.pathname; let pathname = this.props.location.pathname;
this.state = { this.state = {
columns: [], columns: [],
dataList: [], dataList: [],
headerInfo: [], headerInfo: [],
workId: this.props.workId || '', workId: this.props.workId || '',
searchCondition: [], searchCondition: [],
pathname, pathname,
dataBaseId: this.props.dataBaseId || '', dataBaseId: this.props.dataBaseId || '',
addCondition: [], addCondition: [],
addFields: [], // 新增时填写的字段。 addFields: [], // 新增时填写的字段。
tableInfo: {}, // 表格配置属性 tableInfo: {}, // 表格配置属性
allConfigSetInfo: {}, // 返回的数据 allConfigSetInfo: {}, // 返回的数据
}; };
window.callbackSubmitInfoZhiYong = undefined; window.callbackSubmitInfoZhiYong = undefined;
} }
getFormDetail = (workId) => { getFormDetail = (workId) => {
const { dataBaseId } = this.state; const { dataBaseId } = this.state;
service.getFormDetail(workId) service.getFormDetail(workId).then((response) => {
.then((response) => { console.log(response);
if (typeof response.unifiedServicePatternModel === 'undefined') { if (typeof response.unifiedServicePatternModel === 'undefined') {
return false; return false;
} }
destructionFunc.destructionGetDetail(response, workId) destructionFunc.destructionGetDetail(response, workId).then((x) => {
.then((x) => { const { addFields, tableInfo, allConfigSetInfo, searchCondition } = x;
const { this.setState(
addFields, {
tableInfo, addFields,
allConfigSetInfo, tableInfo,
searchCondition, searchCondition,
} = x; allConfigSetInfo,
this.setState( },
{ () => {
addFields, this.giveDetailColumns();
tableInfo, },
searchCondition, );
allConfigSetInfo, });
}, });
() => { };
this.giveDetailColumns();
},
);
});
});
};
giveDetailColumns = () => { giveDetailColumns = () => {
const { const { columns, workId, dataBaseId, addFields, tableInfo } = this.state;
columns, const { showPrint, routerConfig } = this.props;
workId, const process_status = columns.find((x) => {
dataBaseId, return x.name === 'process_status';
addFields, });
tableInfo if (process_status && process_status.dataIndex) {
} = this.state; process_status.render = (text, record) => {
const { return record.statusName || record[process_status.dataIndex];
showPrint, };
routerConfig }
} = this.props; columns.push({
const process_status = columns.find((x) => { dataIndex: 'operationDiy',
return x.name === 'process_status'; title: '操作',
}); fixed: 'right',
if (process_status && process_status.dataIndex) { render: (text, record) => {
process_status.render = (text, record) => { return (
return record.statusName || record[process_status.dataIndex]; <Link
}; to={{
} pathname: './Detail',
columns.push({ state: {
dataIndex: 'operationDiy', workId,
title: '操作', dataBaseId,
fixed: 'right', record,
render: (text, record) => { addFields,
return ( tableInfo,
<Link showPrint: showPrint || routerConfig.showPrint === '1',
to={{ },
pathname: './Detail', }}>
state: { {text || '详情'}
workId, </Link>
dataBaseId, );
record, },
addFields, });
tableInfo, this.setState({
showPrint: showPrint || routerConfig.showPrint === '1', columns,
}, });
}}> };
{text || '详情'}
</Link>
);
},
});
this.setState({
columns,
});
};
getColumn = () => { getColumn = () => {
const { workId } = this.state; const { workId } = this.state;
service.getColumns(workId) service.getColumns(workId).then((response) => {
.then((response) => { if (!response || !Array.isArray(response)) {
if (!response || !Array.isArray(response)) { response = [];
response = []; }
} // console.log('columns', response);
// console.log('columns', response); for (let item of response) {
for (let item of response) { if (item.dataIndex === 'taskName' && !item.width) {
if (item.dataIndex === 'taskName' && !item.width) { item.width = 150; // 29213 资助事务管理/国家三金/国家奖学金审核(高职),界面排版(100661,bdk@2022*$)
item.width = 150; // 29213 资助事务管理/国家三金/国家奖学金审核(高职),界面排版(100661,bdk@2022*$) }
} if (item.dataIndex === 'createTime' && !item.width) {
if (item.dataIndex === 'createTime' && !item.width) { item.width = 150; // 29213 资助事务管理/国家三金/国家奖学金审核(高职),界面排版(100661,bdk@2022*$)
item.width = 150; // 29213 资助事务管理/国家三金/国家奖学金审核(高职),界面排版(100661,bdk@2022*$) }
} }
} response = response.filter((x) => {
response = response.filter((x) => { return x.title !== '流程进度';
return x.title !== '流程进度'; });
}); if (response && response.length) {
if (response && response.length) { this.setState(
this.setState( {
{ columns: response, // 表头
columns: response, // 表头 },
}, () => {
() => { this.getFormDetail(workId);
this.getFormDetail(workId); },
}, );
); }
} });
}); };
};
componentDidMount() { componentDidMount() {
const { pathname } = this.state; const { pathname } = this.state;
const { workId } = this.state; const { workId } = this.state;
if (workId) { if (workId) {
this.getColumn(); this.getColumn();
} else { } else {
service.getId(pathname) service.getId(pathname).then((x) => {
.then((x) => { this.setState(
this.setState( {
{ workId: x.workId,
workId: x.workId, dataBaseId: x.dataBaseId,
dataBaseId: x.dataBaseId, },
}, () => {
() => { this.getColumn();
this.getColumn(); },
}, );
); });
}); }
} }
}
render() { render() {
const { const {
workId, workId,
dataBaseId, dataBaseId,
columns, columns,
searchCondition, searchCondition,
addFields, addFields,
allConfigSetInfo, allConfigSetInfo,
tableInfo, tableInfo,
} = this.state; } = this.state;
const { const { hasBatchAudit, batchAuditButtonName, showPrint, noNeedForm } = this.props;
hasBatchAudit, if (!workId) {
batchAuditButtonName, return null;
showPrint, }
noNeedForm, const tab2Buttons = [];
tab2Buttons = [], if (window.zdyTableTemplateWillMountProps?.auditTab2ButtonsExport) {
} = this.props; tab2Buttons.push({
if (!workId) { type: 'export',
return null; name: '导出',
} component: 'Normal',
if (Array.isArray(columns)){ handleClick: (selectRows, formValues, getPage, search, columns) => {
let d = []; exportHandledInfo({
for (let item of columns) { columns,
if (item.dataIndex !== 'operationDiy') { appId: workId,
d.push({ handled: 'handled',
key: item.dataIndex,
title: item.title,
}); });
} },
} }); // 解决禅道 32366 二级学院审核,所有二级学院审核后在已处理中加导出功能 103152
// console.log(JSON.stringify(d));
} }
return (
<AuditPage
hasBatchAudit={hasBatchAudit}
workId={workId} if (Array.isArray(columns)) {
dataBaseId={dataBaseId} let d = [];
columns={columns} for (let item of columns) {
addFields={addFields} if (item.dataIndex !== 'operationDiy') {
tableInfo={tableInfo} d.push({
allConfigSetInfo={allConfigSetInfo} key: item.dataIndex,
searchCondition={searchCondition} title: item.title,
batchAuditButtonName={batchAuditButtonName} });
showPrint={showPrint} }
noNeedForm={noNeedForm} }
tab2Buttons={tab2Buttons} // console.log(JSON.stringify(d));
/> }
); return (
} <AuditPage
hasBatchAudit={hasBatchAudit}
workId={workId}
dataBaseId={dataBaseId}
columns={columns}
addFields={addFields}
tableInfo={tableInfo}
allConfigSetInfo={allConfigSetInfo}
searchCondition={searchCondition}
batchAuditButtonName={batchAuditButtonName}
showPrint={showPrint}
noNeedForm={noNeedForm}
tab2Buttons={tab2Buttons}
/>
);
}
} }
export default function Pr(props) { export default function Pr(props) {
const { routerConfig } = useContext(CreateC); const { routerConfig } = useContext(CreateC);
// console.log(routerConfig); // console.log(routerConfig);
return <Index {...props} routerConfig={routerConfig}/>; return <Index {...props} routerConfig={routerConfig} />;
} }
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import { apiRequest } from '../request'; import { apiRequest } from '../request';
import { getOneStopConfig, isJSON } from '@/baseComponent/utils'; import { getOneStopConfig, isJSON } from '@/baseComponent/utils';
import { getHistoryFormDetail } from '@/webPublic/Services'; import { getHistoryFormDetail } from '@/webPublic/Services';
import prepareShow from '@/webPublic/one_stop_public/Table/prepareShow';
const giveValue = (x) => { const giveValue = (x) => {
if (x && x.rows) { if (x && x.rows) {
...@@ -141,7 +142,9 @@ const getFormDetail = (id) => { ...@@ -141,7 +142,9 @@ const getFormDetail = (id) => {
} else { } else {
return {}; return {};
} }
}); }).then((res) => {
return prepareShow(res);
});
}; };
/** /**
......
...@@ -88,24 +88,26 @@ function ActiveMenuComponent({ routerConfig, ...otherProps }) { ...@@ -88,24 +88,26 @@ function ActiveMenuComponent({ routerConfig, ...otherProps }) {
Res = <Audit workId={appId} {...otherProps} />; Res = <Audit workId={appId} {...otherProps} />;
break; break;
case 'BatchAudit': // 批量审批 case 'BatchAudit': // 批量审批
if(appId === '1492048888356405248' && getIsQian_Nan() || process.env.NODE_ENV === 'development'){ // if(appId === '1492048888356405248' && getIsQian_Nan() || process.env.NODE_ENV === 'development'){
// 禅道30031 // // 禅道30031
otherProps.tab2Buttons = [ // otherProps.tab2Buttons = [
{ // {
type: 'export', // type: 'export',
name: '导出', // name: '导出',
component: 'Normal', // component: 'Normal',
handleClick: (selectRows, formValues, getPage, search, columns) => { // handleClick: (selectRows, formValues, getPage, search, columns) => {
exportHandledInfo({ // exportHandledInfo({
columns, // columns,
appId, // appId,
handled: 'handled', // handled: 'handled',
}); // });
}, // },
}, // },
]; // ];
} // }
Res = <BatchAudit workId={appId} {...otherProps} />; Res = <BatchAudit workId={appId} {...otherProps}
workId={'1492048888356405248'}
/>;
break; break;
case 'AuditMerage': // 审核页面聚合 多个流程的审核页面放在一起 case 'AuditMerage': // 审核页面聚合 多个流程的审核页面放在一起
Res = <AuditMerge {...otherProps} routerConfig={routerConfig}/>; Res = <AuditMerge {...otherProps} routerConfig={routerConfig}/>;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论