|
|
@@ -6,7 +6,7 @@
|
|
|
import React, { Component } from 'react'
|
|
|
import { connect } from 'react-redux'
|
|
|
import { isObjEmpty } from '../../../utils/common/common.util'
|
|
|
-import { Toast, List } from 'antd-mobile'
|
|
|
+import { Toast, List, Modal } from 'antd-mobile'
|
|
|
import { fetchPostForm, fetchGet } from '../../../utils/common/fetchRequest'
|
|
|
import { API } from '../../../configs/api.config'
|
|
|
import { message } from 'antd'
|
|
|
@@ -14,6 +14,7 @@ import { clearAllRedux } from '../../../redux/utils/redux.utils'
|
|
|
import './change-account.less'
|
|
|
|
|
|
const Item = List.Item
|
|
|
+const alert = Modal.alert
|
|
|
|
|
|
class ChangeAccount extends Component {
|
|
|
|
|
|
@@ -77,19 +78,26 @@ class ChangeAccount extends Component {
|
|
|
if (item && item.ma_function == this.props.userState.accountName) {
|
|
|
return false
|
|
|
}
|
|
|
- fetchPostForm(API.COMMON_CHANGEACCOUNT, {
|
|
|
- to: item.ma_name,
|
|
|
- }).then(response => {
|
|
|
- clearAllRedux()
|
|
|
- message.success('切换账套成功')
|
|
|
- this.props.history.goBack()
|
|
|
- }).catch(error => {
|
|
|
- if (typeof error === 'string') {
|
|
|
- message.error(error)
|
|
|
- } else {
|
|
|
- message.error('账套切换失败')
|
|
|
- }
|
|
|
- })
|
|
|
+ alert('提示', '确定切换账套到' + item.ma_function + '?', [
|
|
|
+ { text: '取消', onPress: () => { } },
|
|
|
+ {
|
|
|
+ text: '确定', onPress: () => {
|
|
|
+ fetchPostForm(API.COMMON_CHANGEACCOUNT, {
|
|
|
+ to: item.ma_name,
|
|
|
+ }).then(response => {
|
|
|
+ clearAllRedux()
|
|
|
+ message.success('切换账套成功')
|
|
|
+ this.props.history.goBack()
|
|
|
+ }).catch(error => {
|
|
|
+ if (typeof error === 'string') {
|
|
|
+ message.error(error)
|
|
|
+ } else {
|
|
|
+ message.error('账套切换失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ])
|
|
|
|
|
|
}
|
|
|
|