|
|
@@ -462,7 +462,7 @@ class Approval extends Component {
|
|
|
<div className={optionAble ? 'bottomMenu' : 'displayNone'}>
|
|
|
<div className='gray-line' style={{ height: '2px' }}></div>
|
|
|
<div className='menuParent'>
|
|
|
- {/*<div className={approvalStatus === 0
|
|
|
+ <div className={approvalStatus === 0
|
|
|
? 'menuItem'
|
|
|
: 'displayNone'}
|
|
|
onClick={this.urgeToApproval}>催办
|
|
|
@@ -472,7 +472,7 @@ class Approval extends Component {
|
|
|
background: '#cccccc',
|
|
|
width: '1px',
|
|
|
height: '24px',
|
|
|
- }}></div>*/}
|
|
|
+ }}></div>
|
|
|
|
|
|
<div className={revokeAble ? 'menuItem' : 'displayNone'}
|
|
|
onClick={this.revokeApproval}>撤回
|
|
|
@@ -537,8 +537,11 @@ class Approval extends Component {
|
|
|
this.setState({
|
|
|
changeModalOpen: false,
|
|
|
})
|
|
|
+ if (this.state.approvalStatus == 1) {
|
|
|
+ this.loadNextProcess()
|
|
|
+ }
|
|
|
}}
|
|
|
- title={'变更处理人'}
|
|
|
+ title={'指定处理人'}
|
|
|
popup
|
|
|
>
|
|
|
<SearchBar
|
|
|
@@ -2080,9 +2083,6 @@ class Approval extends Component {
|
|
|
message.success('单据审批成功')
|
|
|
this.setState({
|
|
|
loading: false,
|
|
|
- // finished: true,
|
|
|
- // finishMsg: '单据审批成功',
|
|
|
- // finishSuccess: true,
|
|
|
approvalStatus: 1,
|
|
|
})
|
|
|
if (mType == 0) {
|
|
|
@@ -2096,6 +2096,7 @@ class Approval extends Component {
|
|
|
})()
|
|
|
}
|
|
|
}
|
|
|
+ // this.judgeApprovers()
|
|
|
this.loadNextProcess()
|
|
|
}).catch(error => {
|
|
|
Toast.hide()
|
|
|
@@ -2106,13 +2107,64 @@ class Approval extends Component {
|
|
|
}
|
|
|
this.setState({
|
|
|
loading: false,
|
|
|
- // finished: true,
|
|
|
- // finishMsg: error.toString(),
|
|
|
- // finishSuccess: false
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取下一节点审批人
|
|
|
+ */
|
|
|
+ judgeApprovers = () => {
|
|
|
+ Toast.loading('正在下一节点审批人', 0)
|
|
|
+ fetchPost(mBaseUrl + '/uapproval/common/getMultiNodeAssigns.action', {
|
|
|
+ caller: mApprovalRecord.caller,
|
|
|
+ id: mApprovalRecord.id,
|
|
|
+ master: mMaster,
|
|
|
+ }).then(response => {
|
|
|
+ Toast.hide()
|
|
|
+ this.handlerNextStepoInstance(response)
|
|
|
+ }).catch(error => {
|
|
|
+ Toast.hide()
|
|
|
+ if (typeof error === 'string') {
|
|
|
+ message.error(error)
|
|
|
+ } else {
|
|
|
+ message.error('下一节点审批人获取异常')
|
|
|
+ }
|
|
|
+ this.loadNextProcess()
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 处理下一节点审批人数据
|
|
|
+ */
|
|
|
+ handlerNextStepoInstance = (response) => {
|
|
|
+ if (!isObjEmpty(response.assigns)) {
|
|
|
+ let assignArray = response.assigns
|
|
|
+ let assignObj = assignArray[0]
|
|
|
+ let nodeid = assignObj ? (assignObj.JP_NODEID || '') : ''
|
|
|
+ let candidates = assignObj ? (assignObj.JP_CANDIDATES || []) : []
|
|
|
+ if (!isObjEmpty(nodeid) && !isObjEmpty(candidates)) {
|
|
|
+ let candidateList = []
|
|
|
+ candidates.forEach(item => {
|
|
|
+ let candidate = item
|
|
|
+ candidate.nodeId = nodeid
|
|
|
+
|
|
|
+ candidateList.push(candidate)
|
|
|
+ })
|
|
|
+ mEmployeeList = candidateList
|
|
|
+ this.setState({
|
|
|
+ changeModalOpen: true,
|
|
|
+ changeDataSource: this.state.changeDataSource.cloneWithRows(
|
|
|
+ mEmployeeList),
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.loadNextProcess()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.loadNextProcess()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 变更处理人
|
|
|
* @param rowData
|
|
|
@@ -2121,53 +2173,75 @@ class Approval extends Component {
|
|
|
if (!isObjNull(rowData)) {
|
|
|
let selectChange = rowData
|
|
|
|
|
|
- Toast.loading('处理人变更中', 0)
|
|
|
- fetchPost(mBaseUrl + '/common/setAssignee.action', {
|
|
|
- taskId: mNodeId,
|
|
|
- master: mMaster,
|
|
|
- assigneeId: selectChange.EM_CODE,
|
|
|
- processInstanceId: mApprovalRecord.processInstanceId,
|
|
|
- description: this.state.approvalContent,
|
|
|
- _center: 0,
|
|
|
- _noc: 1,
|
|
|
- }).then(response => {
|
|
|
- Toast.hide()
|
|
|
- if (response.result == true) {
|
|
|
- let nextnode = response.nextnode
|
|
|
- if (!isObjEmpty(nextnode)) {
|
|
|
- mNodeId = nextnode
|
|
|
- message.success('处理人变更成功')
|
|
|
- this.toNextNode()
|
|
|
- } else {
|
|
|
- message.success('处理人变更成功')
|
|
|
- this.setState({
|
|
|
- approvalStatus: 4,
|
|
|
- })
|
|
|
- if (mType == 0) {
|
|
|
- let { homeState: { receiveState: { tabIndex, itemIndex, listData, todoCount } } } = this.props
|
|
|
- if (tabIndex == 0 && !isObjEmpty(listData) && listData.length >
|
|
|
- itemIndex) {
|
|
|
- listData.splice(itemIndex, 1)
|
|
|
- saveReceiveState({
|
|
|
- listData,
|
|
|
- todoCount: todoCount > 0 ? todoCount - 1 : 0,
|
|
|
- })()
|
|
|
+ Toast.loading('处理人指定中', 0)
|
|
|
+ let params, url
|
|
|
+ let isApproval = !isObjNull(selectChange.nodeId)
|
|
|
+ if (isApproval) {
|
|
|
+ url = '/common/takeOverTask.action'
|
|
|
+ let deal = {
|
|
|
+ em_code: selectChange.EM_CODE,
|
|
|
+ nodeId: selectChange.nodeId,
|
|
|
+ }
|
|
|
+ params = {
|
|
|
+ _noc: '1',
|
|
|
+ master: mMaster,
|
|
|
+ params: JSON.stringify(deal),
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ url = '/common/setAssignee.action'
|
|
|
+ params = {
|
|
|
+ taskId: mNodeId,
|
|
|
+ master: mMaster,
|
|
|
+ assigneeId: selectChange.EM_CODE,
|
|
|
+ processInstanceId: mApprovalRecord.processInstanceId,
|
|
|
+ description: this.state.approvalContent,
|
|
|
+ _center: 0,
|
|
|
+ _noc: 1,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fetchPost(mBaseUrl + url, params).
|
|
|
+ then(response => {
|
|
|
+ Toast.hide()
|
|
|
+ if (isApproval) {
|
|
|
+ this.loadNextProcess()
|
|
|
+ } else if (response.result == true) {
|
|
|
+ let nextnode = response.nextnode
|
|
|
+ if (!isObjEmpty(nextnode)) {
|
|
|
+ mNodeId = nextnode
|
|
|
+ message.success('处理人指定成功')
|
|
|
+ this.toNextNode()
|
|
|
+ } else {
|
|
|
+ message.success('处理人指定成功')
|
|
|
+ this.setState({
|
|
|
+ approvalStatus: 4,
|
|
|
+ })
|
|
|
+ if (mType == 0) {
|
|
|
+ let { homeState: { receiveState: { tabIndex, itemIndex, listData, todoCount } } } = this.props
|
|
|
+ if (tabIndex == 0 && !isObjEmpty(listData) &&
|
|
|
+ listData.length >
|
|
|
+ itemIndex) {
|
|
|
+ listData.splice(itemIndex, 1)
|
|
|
+ saveReceiveState({
|
|
|
+ listData,
|
|
|
+ todoCount: todoCount > 0 ? todoCount - 1 : 0,
|
|
|
+ })()
|
|
|
+ }
|
|
|
+ this.props.history.goBack()
|
|
|
}
|
|
|
- this.props.history.goBack()
|
|
|
+ message.warn('没有下一条待审批单据')
|
|
|
}
|
|
|
- message.warn('没有下一条待审批单据')
|
|
|
+ } else {
|
|
|
+ message.error('指定处理人失败')
|
|
|
}
|
|
|
- } else {
|
|
|
- message.error('变更处理人失败')
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- Toast.hide()
|
|
|
- if (typeof error === 'string') {
|
|
|
- message.error(error)
|
|
|
- } else {
|
|
|
- message.error('处理人变更异常')
|
|
|
- }
|
|
|
- })
|
|
|
+ }).
|
|
|
+ catch(error => {
|
|
|
+ Toast.hide()
|
|
|
+ if (typeof error === 'string') {
|
|
|
+ message.error(error)
|
|
|
+ } else {
|
|
|
+ message.error('处理人指定异常')
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
this.setState({
|