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

30305 所有申请应用--学生填错后,在审核前可以撤回一次

上级 5fbdea9d
......@@ -2,9 +2,9 @@ import { getIsBei_Dian } from '@/webPublic/zyd_public/utils/getSchoolType';
import { message, Modal } from 'antd';
import { uaaRequest } from '@/webPublic/one_stop_public/utils/request';
export default function rebackButton(){
export default function rebackButton(serviceInfo){
let reBack = [];
if (getIsBei_Dian()) {
if (getIsBei_Dian() && serviceInfo.isCanRecall) {
reBack.push({
type: 'chehui',
name: '撤回',
......
......@@ -6,7 +6,7 @@
* */
import { message, Modal } from 'antd';
import React, { useEffect, useState, } from 'react';
import React, { useEffect, useState } from 'react';
import * as service from '../publicApiService';
import * as destructionFunc from '../destruction';
import { Link } from 'dva/router';
......@@ -23,17 +23,18 @@ import ApplyForZyd from '@/webPublic/one_stop_public/ForZydApply/index';
import { uaaRequest } from '@/webPublic/one_stop_public/utils/request';
import rebackButton from '@/webPublic/FormInsertDiy/AffairPage/ApplyPage/ReBackButton';
export default function index(props) {
const { state = {} } = props.location;
const [show, setShow] = useState(false);
useEffect(() => {
useEffect(
() => {
setShow(false);
setTimeout(() => {
setShow(true);
}, 100);
}, [props.location.pathname]);
},
[props.location.pathname],
);
if (!show) {
return null;
}
......@@ -48,10 +49,7 @@ class AffairPage extends React.Component {
constructor(props) {
super(props);
let pathname = this.props.location.pathname;
const {
dataBaseId,
workId
} = this.props;
const { dataBaseId, workId } = this.props;
this.state = {
showIframe: false,
columns: [],
......@@ -62,22 +60,29 @@ class AffairPage extends React.Component {
addFields: [], // 新增时填写的字段。
renderIframe: false,
allConfigSetInfo: null,
serviceInfo: null,
};
}
getServiceDetail = (serviceId) => {
service.getServiceDetail(serviceId).then((res) => {
this.setState({
serviceInfo: res,
});
});
};
getFormDetail = (workId) => {
service.getFormDetail(workId)
.then((response) => {
service.getFormDetail(workId).then((response) => {
console.log(response);
if (typeof response.unifiedServicePatternModel === 'undefined') {
return false;
}
destructionFunc.destructionGetDetail(response)
.then((x) => {
const {
addFields,
tableInfo,
allConfigSetInfo
} = x;
if(response.serviceId){
this.getServiceDetail(response.serviceId);
}
destructionFunc.destructionGetDetail(response).then((x) => {
const { addFields, tableInfo, allConfigSetInfo } = x;
this.setState(
{
addFields,
......@@ -93,12 +98,7 @@ class AffairPage extends React.Component {
};
giveDetailColumns = () => {
const {
columns,
workId,
dataBaseId,
addFields
} = this.state;
const { columns, workId, dataBaseId, addFields } = this.state;
const process_status = columns.find((x) => {
return x.name === 'process_status';
});
......@@ -123,7 +123,6 @@ class AffairPage extends React.Component {
dataBaseId,
record,
addFields,
},
}}>
详情
......@@ -133,18 +132,14 @@ class AffairPage extends React.Component {
});
}
this.setState({
columns,
});
};
handleButtonSet = () => {
const {
canApply,
otherButtons = [],
} = this.props;
const { allConfigSetInfo } = this.state;
const { canApply, otherButtons = [] } = this.props;
const { allConfigSetInfo, serviceInfo } = this.state;
if (!allConfigSetInfo) {
return [];
}
......@@ -154,7 +149,6 @@ class AffairPage extends React.Component {
return [...otherButtons];
}
return [
{
type: 'add',
......@@ -166,21 +160,17 @@ class AffairPage extends React.Component {
showIframe: true,
renderIframe: true,
},
() => {
},
() => {},
);
},
},
...rebackButton(),
...rebackButton(serviceInfo),
...otherButtons,
];
};
handleSearchSet = () => {
const {
columns,
searchCondition
} = this.state;
const { columns, searchCondition } = this.state;
const { onResponse } = this.props;
const pageSearch = {
search: {
......@@ -195,11 +185,11 @@ class AffairPage extends React.Component {
condition: searchCondition,
nameSpan: {
big: 8,
small: 9
small: 9,
},
fileSpan: {
big: 4,
small: 4
small: 4,
},
},
tableRowKey: 'id',
......@@ -210,8 +200,7 @@ class AffairPage extends React.Component {
getColumns = () => {
const { workId } = this.state;
service.getColumns(workId)
.then((response) => {
service.getColumns(workId).then((response) => {
if (response && Array.isArray(response)) {
response = response.filter((x) => {
return x.title !== '流程进度';
......@@ -231,18 +220,13 @@ class AffairPage extends React.Component {
});
};
initData = () => {
if (!getToken()) {
message.error('您的数据未同步,请联系管理员!');
return false;
}
const { pathname } = this.state;
const {
dataBaseId,
workId,
iframeHeight
} = this.props;
const { dataBaseId, workId, iframeHeight } = this.props;
if (dataBaseId || workId) {
this.setState(
{
......@@ -254,8 +238,7 @@ class AffairPage extends React.Component {
},
);
} else {
service.getId(pathname)
.then((x) => {
service.getId(pathname).then((x) => {
this.setState(
{
workId: x.workId,
......@@ -383,7 +366,7 @@ class AffairPage extends React.Component {
</div>
</Shell>
{renderIframe ? (
iframeUrlDiy ?
iframeUrlDiy ? (
<iframe
src={iframeUrlDiy}
frameBorder={0}
......@@ -400,12 +383,10 @@ class AffairPage extends React.Component {
overflowY: 'hidden',
backgroundColor: '#fff',
}}
/> :
<ApplyForZyd
{...this.props}
returnList={this.returnList}
id={workId}
/>
) : (
<ApplyForZyd {...this.props} returnList={this.returnList} id={workId} />
)
) : null}
</div>
</PageHeaderWrapper>
......
......@@ -144,6 +144,19 @@ const getFormDetail = (id) => {
});
};
/**
*
* */
const getServiceDetail = (id) => {
return apiRequest('/UnifiedServiceApi/getDetail', { id }).then((x) => {
if (x) {
return x;
} else {
return {};
}
});
};
/**
* 发起流程
* */
......@@ -248,6 +261,7 @@ export {
getColumns,
getPages,
getFormDetail,
getServiceDetail,
getOptions,
getBatchOptions,
startProcess,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论