李志伟 hace 3 años
padre
commit
cfd51ba3de

+ 1
- 0
src/app.jsx Ver fichero

@@ -30,6 +30,7 @@ export async function getInitialState() {
30 30
   if (history.location.pathname !== loginPath) {
31 31
     const res = await fetchUserInfo();
32 32
     localStorage.setItem('roleAlias', res.roleAlias);
33
+    localStorage.setItem('orgId', res.user.orgId);
33 34
     return {
34 35
       fetchUserInfo,
35 36
       currentUser: res.user,

+ 3
- 2
src/pages/resumework/abnormal/index.jsx Ver fichero

@@ -2,13 +2,14 @@ import React from 'react'
2 2
 import moment from 'moment';
3 3
 import { Badge, Image } from 'antd';
4 4
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
5
-import { getAbnormalList } from '@/services/work'
5
+import { getAbnormalList,getOrgAbnormalList } from '@/services/work'
6 6
 import PageTable from '@/components/PageTable'
7 7
 
8 8
 const formatterTime = (val) => {
9 9
   return val ? moment(val).format('YYYY-MM-DD HH:mm') : '';
10 10
 };
11 11
 export default (props) => {
12
+  let role = localStorage.getItem('roleAlias');
12 13
   const columns = [
13 14
     {
14 15
       title: '企业名称',
@@ -64,7 +65,7 @@ export default (props) => {
64 65
     <PageHeaderWrapper>
65 66
       <PageTable
66 67
         columns={columns}
67
-        request={getAbnormalList}
68
+        request={role=='admin'?getAbnormalList:getOrgAbnormalList}
68 69
         search={false}
69 70
         options={false}
70 71
         rowKey="formId"

+ 1
- 0
src/pages/user/orgLogin/index.jsx Ver fichero

@@ -19,6 +19,7 @@ const Login = () => {
19 19
       // 登录
20 20
       const { user, menu, report_url, roleAlias } = await orgLogin({ ...values, password: md5(values.password) });
21 21
       localStorage.setItem('roleAlias', roleAlias);
22
+      localStorage.setItem('orgId', user.orgId);
22 23
       await setInitialState((s) => ({ ...s, currentUser: user, menuAccess: menu, report_url: report_url, roleAlias: roleAlias }));
23 24
       message.success('登录成功!');
24 25
       /** 此方法会跳转到 redirect 参数所在的位置 */

+ 10
- 0
src/services/work.js Ver fichero

@@ -28,3 +28,13 @@ export const getDeleteformList = (params) =>
28 28
  * @returns
29 29
  */
30 30
 export const deleteworkForm = (id) => request(`/resume-work-form/${id}`, { method: 'delete' });
31
+
32
+let orgId = localStorage.getItem('orgId');
33
+// 获取企业异常列表
34
+export const getOrgAbnormalList = (params) =>
35
+  request(
36
+    `/resume-work-form?start=${moment(Date.now()).format('YYYY-MM-DD')}&end=${moment(
37
+      Date.now(),
38
+    ).format('YYYY-MM-DD')}&orgId=${orgId}&isAbnormal=true`,
39
+    { params },
40
+  );