张涛 2 年之前
父節點
當前提交
5afe7b244e
共有 5 個文件被更改,包括 2492 次插入85 次删除
  1. 29
    25
      src/pages/issue/detail/components/ApplyInfo.jsx
  2. 1
    1
      src/pages/issue/detail/components/BasicProfile.jsx
  3. 85
    46
      src/pages/issue/index.jsx
  4. 13
    13
      src/utils/biz.js
  5. 2364
    0
      yarn.lock

+ 29
- 25
src/pages/issue/detail/components/ApplyInfo.jsx 查看文件

1
-import React from 'react';
2
-import { ProTable } from '@ant-design/pro-components';
3
-import { Card } from 'antd';
4
-import { getTaIssueApply } from '@/service/taissueapply';
5
-import { getSysOrg } from '@/service/sysorg';
6
-import { queryTable, queryDict } from '@/utils/request';
7
-import useBool from '@/utils/hooks/useBool';
8
-import { processEnum } from '@/utils/biz';
1
+import React from "react";
2
+import { ProTable } from "@ant-design/pro-components";
3
+import { Card } from "antd";
4
+import { getTaIssueApply } from "@/service/taissueapply";
5
+import { getSysOrg } from "@/service/sysorg";
6
+import { queryTable, queryDict } from "@/utils/request";
7
+import useBool from "@/utils/hooks/useBool";
8
+import { processEnum } from "@/utils/biz";
9
 
9
 
10
-const fetchOrg = queryDict(getSysOrg, { labelKey: 'name', valueKey: 'orgId' });
10
+const fetchOrg = queryDict(getSysOrg, { labelKey: "name", valueKey: "orgId" });
11
 const fetchData = queryTable(getTaIssueApply);
11
 const fetchData = queryTable(getTaIssueApply);
12
 
12
 
13
 export default (props) => {
13
 export default (props) => {
17
     {
17
     {
18
       title: "申请日期",
18
       title: "申请日期",
19
       dataIndex: "createDate",
19
       dataIndex: "createDate",
20
-      valueType: 'date',
20
+      valueType: "date",
21
     },
21
     },
22
     {
22
     {
23
       title: "申请类别",
23
       title: "申请类别",
24
       dataIndex: "applyType",
24
       dataIndex: "applyType",
25
-      valueEnum: processEnum
25
+      valueEnum: processEnum,
26
+    },
27
+    {
28
+      title: "申请理由",
29
+      dataIndex: "remark",
26
     },
30
     },
27
     {
31
     {
28
       title: "申请人",
32
       title: "申请人",
31
     {
35
     {
32
       title: "审批日期",
36
       title: "审批日期",
33
       dataIndex: "verifyDate",
37
       dataIndex: "verifyDate",
34
-      valueType: 'date',
38
+      valueType: "date",
35
     },
39
     },
36
     {
40
     {
37
       title: "审批人",
41
       title: "审批人",
42
       dataIndex: "verifyStatus",
46
       dataIndex: "verifyStatus",
43
       valueEnum: {
47
       valueEnum: {
44
         ready: {
48
         ready: {
45
-          text: '未审批',
46
-          status: 'Default',
49
+          text: "未审批",
50
+          status: "Default",
47
         },
51
         },
48
         pass: {
52
         pass: {
49
-          text: '通过',
50
-          status: 'Success',
53
+          text: "通过",
54
+          status: "Success",
51
         },
55
         },
52
         reject: {
56
         reject: {
53
-          text: '驳回',
54
-          status: 'Error',
57
+          text: "驳回",
58
+          status: "Error",
55
         },
59
         },
56
-      }
60
+      },
57
     },
61
     },
58
     {
62
     {
59
       title: "审批意见",
63
       title: "审批意见",
61
     },
65
     },
62
     {
66
     {
63
       title: "申请单位",
67
       title: "申请单位",
64
-      valueType: 'select',
68
+      valueType: "select",
65
       dataIndex: "orgId",
69
       dataIndex: "orgId",
66
-      request: fetchOrg
67
-    }
68
-  ]
70
+      request: fetchOrg,
71
+    },
72
+  ];
69
 
73
 
70
   return (
74
   return (
71
     <Card title="申请流程">
75
     <Card title="申请流程">
78
         toolBarRender={false}
82
         toolBarRender={false}
79
       />
83
       />
80
     </Card>
84
     </Card>
81
-  )
82
-}
85
+  );
86
+};

+ 1
- 1
src/pages/issue/detail/components/BasicProfile.jsx 查看文件

58
       });
58
       });
59
     }
59
     }
60
   }, [issueId]);
60
   }, [issueId]);
61
-
61
+console.log(detail)
62
   return (
62
   return (
63
     <Card title="基础信息" loading={loading}>
63
     <Card title="基础信息" loading={loading}>
64
       <Descriptions layout="vertical" column={3} bordered>
64
       <Descriptions layout="vertical" column={3} bordered>

+ 85
- 46
src/pages/issue/index.jsx 查看文件

1
-import React from 'react';
2
-import { Button, Badge } from 'antd';
3
-import { useNavigate } from 'react-router-dom';
4
-import List from '@/components/Page/List';
5
-import { getTaIssue, getTaOrgIssue, exportTaIssue, exportTaOrgIssue } from '@/service/taissue';
6
-import { getTdLocType } from '@/service/tdloctype';
7
-import { getSysOrg } from '@/service/sysorg';
8
-import { queryDict } from '@/utils/request';
9
-import { processEnum, processStatus } from '@/utils/biz';
10
-import useBool from '@/utils/hooks/useBool';
11
-import useOrgResponsible from '@/utils/hooks/useOrgResponsible';
12
-import dayjs from 'dayjs';
1
+import React from "react";
2
+import { Button, Badge } from "antd";
3
+import { useNavigate } from "react-router-dom";
4
+import List from "@/components/Page/List";
5
+import {
6
+  getTaIssue,
7
+  getTaOrgIssue,
8
+  exportTaIssue,
9
+  exportTaOrgIssue,
10
+} from "@/service/taissue";
11
+import { getTdLocType } from "@/service/tdloctype";
12
+import { getSysOrg } from "@/service/sysorg";
13
+import { queryDict } from "@/utils/request";
14
+import { processEnum, processStatus } from "@/utils/biz";
15
+import useBool from "@/utils/hooks/useBool";
16
+import useOrgResponsible from "@/utils/hooks/useOrgResponsible";
17
+import dayjs from "dayjs";
13
 
18
 
14
-const queryOrg = queryDict(getSysOrg, { labelKey: 'name', valueKey: 'orgId' });
15
-const queryLocType = queryDict(getTdLocType, { labelKey: 'name', valueKey: 'typeId' });
16
-
17
-const yestoday = dayjs().subtract(1, 'day').format('YYYY-MM-DD');
19
+const queryOrg = queryDict(getSysOrg, { labelKey: "name", valueKey: "orgId" });
20
+const queryLocType = queryDict(getTdLocType, {
21
+  labelKey: "name",
22
+  valueKey: "typeId",
23
+});
18
 
24
 
25
+const yestoday = dayjs().subtract(1, "day").format("YYYY-MM-DD");
19
 export default (props) => {
26
 export default (props) => {
20
   const [loading, startLoading, stopLoading] = useBool();
27
   const [loading, startLoading, stopLoading] = useBool();
21
   const navigate = useNavigate();
28
   const navigate = useNavigate();
27
       isResponsible ? getTaOrgIssue : getTaIssue,
34
       isResponsible ? getTaOrgIssue : getTaIssue,
28
       isResponsible ? { orgId: org?.orgId } : { all: true },
35
       isResponsible ? { orgId: org?.orgId } : { all: true },
29
       isResponsible ? exportTaOrgIssue : exportTaIssue,
36
       isResponsible ? exportTaOrgIssue : exportTaIssue,
30
-    ]
37
+    ];
31
   }, [isResponsible, org]);
38
   }, [isResponsible, org]);
32
 
39
 
33
   const columns = [
40
   const columns = [
35
       title: "问题单号",
42
       title: "问题单号",
36
       dataIndex: "issueId",
43
       dataIndex: "issueId",
37
     },
44
     },
45
+    {
46
+      title: "创建时间",
47
+      dataIndex: "createdAt",
48
+      valueType: "dateRange",
49
+      hideInTable: true,
50
+      search: {
51
+        transform: (value) => {
52
+          return {
53
+            createDateStart: value[0],
54
+            createDateEnd: value[1],
55
+          };
56
+        },
57
+      },
58
+    },
59
+    {
60
+      title: "办结时间",
61
+      dataIndex: "createdAts",
62
+      valueType: "dateRange",
63
+      hideInTable: true,
64
+      search: {
65
+        transform: (value) => {
66
+          return {
67
+            endDateStart: value[0],
68
+            endDateEnd: value[1],
69
+          };
70
+        },
71
+      },
72
+    },
38
     {
73
     {
39
       title: "上报日期",
74
       title: "上报日期",
40
       dataIndex: "createDate",
75
       dataIndex: "createDate",
41
-      valueType: 'date',
76
+      valueType: "date",
42
       hideInSearch: true,
77
       hideInSearch: true,
43
     },
78
     },
44
     {
79
     {
45
       title: "点位",
80
       title: "点位",
46
       dataIndex: "locId",
81
       dataIndex: "locId",
47
-      valueType: 'select',
82
+      valueType: "select",
48
       request: queryLocType,
83
       request: queryLocType,
49
     },
84
     },
50
     {
85
     {
61
     {
96
     {
62
       title: "责任单位",
97
       title: "责任单位",
63
       dataIndex: "orgId",
98
       dataIndex: "orgId",
64
-      valueType: 'select',
99
+      valueType: "select",
65
       request: queryOrg,
100
       request: queryOrg,
66
       hideInSearch: isResponsible,
101
       hideInSearch: isResponsible,
67
     },
102
     },
68
     {
103
     {
69
       title: "流程状态",
104
       title: "流程状态",
70
       dataIndex: "bizStatus",
105
       dataIndex: "bizStatus",
71
-      valueType: 'select',
106
+      valueType: "select",
72
       valueEnum: processEnum,
107
       valueEnum: processEnum,
73
       render: (_, row) => {
108
       render: (_, row) => {
74
-        if (row.processNode != '03' && yestoday > row.expireDate) {
109
+        console.log(row)
110
+        if (row.processNode != "03" && yestoday > row.expireDate) {
75
           return <Badge status="error" text="已逾期" />;
111
           return <Badge status="error" text="已逾期" />;
112
+        } else if(row.processNode=="03"&& yestoday > row.expireDate){
113
+          return <Badge status="warning" text="延期办结" />;
76
         } else {
114
         } else {
77
-          const st = processStatus.filter(x => x.value == row.processNode)[0];
115
+          const st = processStatus.filter((x) => x.value == row.processNode)[0];
78
           return <Badge status={st?.badge} text={st?.label} />;
116
           return <Badge status={st?.badge} text={st?.label} />;
79
         }
117
         }
80
-      }
118
+      },
81
     },
119
     },
82
     {
120
     {
83
       title: "截止日期",
121
       title: "截止日期",
88
       title: "上报人",
126
       title: "上报人",
89
       dataIndex: "userName",
127
       dataIndex: "userName",
90
       hideInSearch: true,
128
       hideInSearch: true,
91
-    }
129
+    },
92
   ];
130
   ];
93
 
131
 
94
   const onExport = () => {
132
   const onExport = () => {
95
     startLoading();
133
     startLoading();
96
-    exportFn(paramsRef.current).then(() => {
97
-      stopLoading();
98
-    }).catch(() => {
99
-      stopLoading();
100
-    });
101
-  }
134
+    exportFn(paramsRef.current)
135
+      .then(() => {
136
+        stopLoading();
137
+      })
138
+      .catch(() => {
139
+        stopLoading();
140
+      });
141
+  };
102
 
142
 
103
   const beforeSearchSubmit = (params) => {
143
   const beforeSearchSubmit = (params) => {
104
     paramsRef.current = {
144
     paramsRef.current = {
105
-      ...params || {},
145
+      ...(params || {}),
106
       all: true,
146
       all: true,
107
     };
147
     };
108
     return params;
148
     return params;
109
-  }
149
+  };
110
 
150
 
111
   return (
151
   return (
112
     <List
152
     <List
116
       params={params}
156
       params={params}
117
       beforeSearchSubmit={beforeSearchSubmit}
157
       beforeSearchSubmit={beforeSearchSubmit}
118
       optionRender={(_, row) => [
158
       optionRender={(_, row) => [
119
-        <Button key="detail" type="link" onClick={() => navigate(`/issue/detail?id=${row.issueId}`)}>详情</Button>
159
+        <Button
160
+          key="detail"
161
+          type="link"
162
+          onClick={() => navigate(`/issue/detail?id=${row.issueId}`)}
163
+        >
164
+          详情
165
+        </Button>,
120
       ]}
166
       ]}
121
       toolBarRender={() => [
167
       toolBarRender={() => [
122
-        (
123
-          <Button
124
-            key="1"
125
-            type="primary"
126
-            loading={loading}
127
-            onClick={onExport}
128
-          >
129
-            导出
130
-          </Button>
131
-        )
168
+        <Button key="1" type="primary" loading={loading} onClick={onExport}>
169
+          导出
170
+        </Button>,
132
       ]}
171
       ]}
133
     />
172
     />
134
-  )
135
-}
173
+  );
174
+};

+ 13
- 13
src/utils/biz.js 查看文件

1
-
2
-import { Badge } from 'antd';
1
+import { Badge } from "antd";
3
 
2
 
4
 export const processStatus = [
3
 export const processStatus = [
5
-  { value: '01', label: "待交办", badge: 'default' },
6
-  { value: '02', label: "已交办", badge: 'processing' },
7
-  { value: '03', label: "已办结", badge: 'success' },
8
-  { value: 'expired', label: "已逾期", badge: 'error' },
9
-  { value: '0201', label: "驳回申请中", badge: 'processing' },
10
-  { value: '0202', label: "延期申请中", badge: 'processing' },
11
-  { value: '0203', label: "单位审核中", badge: 'processing' },
12
-  { value: '0204', label: "消单申请中", badge: 'processing' },
13
-]
4
+  { value: "01", label: "待交办", badge: "default" },
5
+  { value: "02", label: "已交办", badge: "processing" },
6
+  { value: "03", label: "已办结", badge: "success" },
7
+  { value: "expired", label: "已逾期", badge: "error" },
8
+  { value: "0201", label: "驳回申请中", badge: "processing" },
9
+  { value: "0202", label: "延期申请中", badge: "processing" },
10
+  { value: "0203", label: "单位审核中", badge: "processing" },
11
+  { value: "0204", label: "消单申请中", badge: "processing" },
12
+  { value: "expiredEnd", label: "延期办结", badge: "warning" },
13
+];
14
 
14
 
15
 export const processEnum = processStatus.reduce((acc, it) => {
15
 export const processEnum = processStatus.reduce((acc, it) => {
16
   return {
16
   return {
17
     ...acc,
17
     ...acc,
18
     [it.value]: {
18
     [it.value]: {
19
       text: it.label,
19
       text: it.label,
20
-    }
21
-  }
20
+    },
21
+  };
22
 }, {});
22
 }, {});

+ 2364
- 0
yarn.lock
文件差異過大導致無法顯示
查看文件