Browse Source

uas手机版
切换账套确认弹窗

samhoo 5 years ago
parent
commit
37757ac4e7

+ 1 - 1
uas-office-web/uas-mobile/src/configs/antd.config.less

@@ -66,7 +66,7 @@
 
     .ant-select {
       min-width: 50px !important;
-      width: 70px !important;
+      width: 75px !important;
 
       .ant-select-selector {
         border: none;

+ 22 - 14
uas-office-web/uas-mobile/src/pages/private/changeAccount/ChangeAccount.jsx

@@ -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('账套切换失败')
+            }
+          })
+        },
+      },
+    ])
 
   }
 

+ 0 - 1
uas-office-web/uas-mobile/src/pages/private/schedulePage/SchedulePage.jsx

@@ -72,7 +72,6 @@ class SchedulePage extends Component {
           calendarData: response.data.calendarData,
         })
       }
-      message.success('加载成功')
     }).catch(error => {
       Toast.hide()
       if (typeof error === 'string') {