张涛 hace 2 años
padre
commit
41fee08fd6
Se han modificado 2 ficheros con 86 adiciones y 54 borrados
  1. 75
    50
      src/pages/issue/detail/components/BasicProfile.jsx
  2. 11
    4
      src/pages/issue/index.jsx

+ 75
- 50
src/pages/issue/detail/components/BasicProfile.jsx Ver fichero

@@ -1,61 +1,63 @@
1
-import React from 'react';
2
-import { Card, Descriptions, Badge } from 'antd';
3
-import dayjs from 'dayjs';
4
-import useBool from '@/utils/hooks/useBool';
5
-import { getTaIssueById } from '@/service/taissue';
6
-import { getSysOrgById } from '@/service/sysorg';
7
-import { processStatus } from '@/utils/biz';
8
-import AttachList from './AttachList';
1
+import React from "react";
2
+import { Card, Descriptions, Badge } from "antd";
3
+import dayjs from "dayjs";
4
+import useBool from "@/utils/hooks/useBool";
5
+import { getTaIssueById } from "@/service/taissue";
6
+import { getSysOrgById } from "@/service/sysorg";
7
+import { processStatus } from "@/utils/biz";
8
+import AttachList from "./AttachList";
9 9
 
10
-const yestoday = dayjs().subtract(1, 'day').format('YYYY-MM-DD');
11
-const fmDate = dt => !dt ? '-' : dayjs(dt).format('YYYY-MM-DD');
12
-const fmDateTime = dt => !dt ? '-' : dayjs(dt).format('YYYY-MM-DD HH:mm:ss');
13
-const getStatusLabel = val => (processStatus.filter(x => x.value == val)[0])?.label;
10
+const yestoday = dayjs().subtract(1, "day").format("YYYY-MM-DD");
11
+const fmDate = (dt) => (!dt ? "-" : dayjs(dt).format("YYYY-MM-DD"));
12
+const fmDateTime = (dt) =>
13
+  !dt ? "-" : dayjs(dt).format("YYYY-MM-DD HH:mm:ss");
14
+const getStatusLabel = (val) =>
15
+  processStatus.filter((x) => x.value == val)[0]?.label;
14 16
 
15 17
 export default (props) => {
16
-
17 18
   const { issueId, onIssueChange } = props;
18 19
 
19 20
   const [loading, startLoading, stopLoading] = useBool();
20 21
   const [detail, setDetail] = React.useState();
21 22
 
22
-  const [
23
-    isExpire,
24
-    status,
25
-  ] = React.useMemo(() => {
23
+  const [isExpire, status] = React.useMemo(() => {
26 24
     if (!detail) return [];
27 25
     return [
28
-      detail.processNode != '03' && yestoday > detail.expireDate,
29
-      processStatus.filter(x => x.value == detail.processNode)[0],
30
-    ]
26
+      detail.processNode != "03" && yestoday > detail.expireDate,
27
+      processStatus.filter((x) => x.value == detail.processNode)[0],
28
+    ];
31 29
   }, [detail]);
32 30
 
33 31
   React.useEffect(() => {
34 32
     if (issueId) {
35 33
       startLoading();
36
-      getTaIssueById(issueId).then((res) => {
37
-        if (onIssueChange) {
38
-          onIssueChange(res);
39
-        }
34
+      getTaIssueById(issueId)
35
+        .then((res) => {
36
+          if (onIssueChange) {
37
+            onIssueChange(res);
38
+          }
40 39
 
41
-        if (res.orgId) {
42
-          getSysOrgById(res.orgId).then(r => {
43
-            stopLoading();
44
-            setDetail({
45
-              ...res,
46
-              orgName: r.name
47
-            });
48
-          }).catch(() => {
40
+          if (res.orgId) {
41
+            getSysOrgById(res.orgId)
42
+              .then((r) => {
43
+                stopLoading();
44
+                setDetail({
45
+                  ...res,
46
+                  orgName: r.name,
47
+                });
48
+              })
49
+              .catch(() => {
50
+                stopLoading();
51
+                setDetail(res);
52
+              });
53
+          } else {
49 54
             stopLoading();
50 55
             setDetail(res);
51
-          });
52
-        } else {
56
+          }
57
+        })
58
+        .catch((er) => {
53 59
           stopLoading();
54
-          setDetail(res);
55
-        }
56
-      }).catch(er => {
57
-        stopLoading();
58
-      });
60
+        });
59 61
     }
60 62
   }, [issueId]);
61 63
   return (
@@ -63,18 +65,41 @@ export default (props) => {
63 65
       <Descriptions layout="vertical" column={3} bordered>
64 66
         <Descriptions.Item label="点位">{detail?.locName}</Descriptions.Item>
65 67
         <Descriptions.Item label="地址">{detail?.addr}</Descriptions.Item>
66
-        <Descriptions.Item label="上报时间">{fmDate(detail?.createDate)}</Descriptions.Item>
68
+        <Descriptions.Item label="上报时间">
69
+          {fmDate(detail?.createDate)}
70
+        </Descriptions.Item>
67 71
         <Descriptions.Item label="上报人">{detail?.userName}</Descriptions.Item>
68
-        <Descriptions.Item label="问题类型">{detail?.typeName}</Descriptions.Item>
72
+        <Descriptions.Item label="问题类型">
73
+          {detail?.typeName}
74
+        </Descriptions.Item>
75
+        <Descriptions.Item label="问题来源">
76
+          {detail?.sourceType == "check"
77
+            ? "实地检测"
78
+            : detail?.sourceType == "feedback"
79
+            ? "市民上报"
80
+            : detail?.sourceType == "inspector"
81
+            ? "日常督查"
82
+            : ""}
83
+        </Descriptions.Item>
69 84
         <Descriptions.Item label="流程状态">
70
-          {
71
-            isExpire ? <Badge status="error" text="已逾期" /> : <Badge status={status?.badge} text={status?.label} />
72
-          }
85
+          {isExpire ? (
86
+            <Badge status="error" text="已逾期" />
87
+          ) : (
88
+            <Badge status={status?.badge} text={status?.label} />
89
+          )}
90
+        </Descriptions.Item>
91
+        <Descriptions.Item label="截止日期">
92
+          {fmDate(detail?.expireDate)}
93
+        </Descriptions.Item>
94
+        <Descriptions.Item label="责任单位" span={2}>
95
+          {detail?.orgName}
96
+        </Descriptions.Item>
97
+        <Descriptions.Item label="办结时间">
98
+          {fmDateTime(detail?.endDate)}
99
+        </Descriptions.Item>
100
+        <Descriptions.Item label="交办次数" span={2}>
101
+          {detail?.processNum}
73 102
         </Descriptions.Item>
74
-        <Descriptions.Item label="截止日期">{fmDate(detail?.expireDate)}</Descriptions.Item>
75
-        <Descriptions.Item label="责任单位" span={2}>{detail?.orgName}</Descriptions.Item>
76
-        <Descriptions.Item label="办结时间">{fmDateTime(detail?.endDate)}</Descriptions.Item>
77
-        <Descriptions.Item label="交办次数" span={2}>{detail?.processNum}</Descriptions.Item>
78 103
         <Descriptions.Item label="问题描述" span={3}>
79 104
           <div dangerouslySetInnerHTML={{ __html: detail?.content }}></div>
80 105
         </Descriptions.Item>
@@ -83,5 +108,5 @@ export default (props) => {
83 108
         </Descriptions.Item>
84 109
       </Descriptions>
85 110
     </Card>
86
-  )
87
-}
111
+  );
112
+};

+ 11
- 4
src/pages/issue/index.jsx Ver fichero

@@ -64,12 +64,19 @@ export default (props) => {
64 64
     },
65 65
     {
66 66
       title: "问题来源",
67
-      dataIndex: "sourceType2",
67
+      dataIndex: "sourceType",
68 68
       valueType: "select",
69 69
       valueEnum: {
70
-        'check': "实地测评",
71
-        'feedback': "市民上报",
72
-        'inspector': "日常督查",
70
+        check: "实地测评",
71
+        feedback: "市民上报",
72
+        inspector: "日常督查",
73
+      },
74
+      search: {
75
+        transform: (value) => {
76
+          return {
77
+            'sourceType2': value,
78
+          };
79
+        },
73 80
       },
74 81
     },
75 82
     {