sophieChenyx 5 лет назад
Родитель
Сommit
0249295174

+ 12 - 7
src/models/accounts.js

@@ -35,9 +35,6 @@ export default {
         });
       }
     },
-    *fetchCampusExcel({ payload }, { call }) {
-      window.open('/api/stmt/campus/export');
-    },
     *fetchTerminalsList({ payload }, { call, put }) {
       const response = yield call(queryTerminalsList, payload);
       if (response.success) {
@@ -52,10 +49,6 @@ export default {
         });
       }
     },
-    *fetchTerminalsExcel({ payload }, { call }) {
-      window.open('/api/stmt/terminal/user/export');
-    },
-
     *fetchCampusAmount({ payload }, { call, put }) {
       const response = yield call(queryCampusAmount, payload);
       if (response.success) {
@@ -81,6 +74,18 @@ export default {
         });
       }
     },
+    *fetchCampusExcel({ payload }, { call }) {
+      const url = '/api/stmt/campus/export';
+      window.location.href = url;
+    },
+    *fetchTerminalsExcel({ payload }, { call }) {
+      const url = '/api/stmt/terminal/user/export';
+      window.location.href = url;
+    },
+    *fetchOverdueExcel({ payload }, { call }) {
+      const url = '/api/stmt/terminal/user/export?fastExpired=1';
+      window.location.href = url;
+    },
   },
 
   reducers: {

+ 1 - 4
src/routes/Dashboard/Accounts/AccountsOverdue.js

@@ -32,10 +32,7 @@ export default class OverdueAccountsPage extends Component {
   // 下载
   handleDownloadOperation = () => {
     this.props.dispatch({
-      type: 'accounts/fetchTerminalsExcel',
-      payload: {
-        fastExpired: 1
-      }
+      type: 'accounts/fetchOverdueExcel'
     })
   };
 

+ 1 - 1
src/routes/Dashboard/Accounts/index.js

@@ -61,7 +61,7 @@ export default class AccountsPage extends Component {
           {routes.map(item => (
             <Route key={item.key} path={item.path} component={item.component} exact={item.exact} />
           ))}
-          <Redirect exact from="/dashboard/accounts" to="/dashboard/accounts/campus" />
+          <Redirect exact from="/dashboard/accounts" to="/dashboard/accounts/terminals" />
         </Switch>
       </PageHeaderLayout>
     );