Yansen 2 年之前
父節點
當前提交
99d6534e05

+ 114
- 0
src/pages/checkAnswer/loc/detail.jsx 查看文件

@@ -0,0 +1,114 @@
1
+import React from 'react';
2
+import { Button, notification } from "antd";
3
+import { ProTable } from "@ant-design/pro-components";
4
+import { useNavigate, useSearchParams } from 'react-router-dom';
5
+import { queryTable, queryDict } from "@/utils/request";
6
+import Page from '@/components/Page';
7
+import { getTaCheck } from '@/service/tacheck';
8
+import { getTdLocType } from '@/service/tdloctype';
9
+import { getTaCheckAnswerDetail, exportTaCheckAnswerDetail } from '@/service/tacheckanswer';
10
+import useBool from '@/utils/hooks/useBool';
11
+
12
+const getCheck = queryDict(getTaCheck, { labelKey: 'title', valueKey: 'checkId' });
13
+const getLocType = queryDict(getTdLocType, { labelKey: 'name', valueKey: 'typeId' });
14
+const getAnswer = queryTable(getTaCheckAnswerDetail);
15
+
16
+export default (props) => {
17
+
18
+  const [loading, startLoading, stopLoading] = useBool();
19
+  const paramsRef = React.useRef();
20
+  const [notificationApi, contextHolder] = notification.useNotification();
21
+  const [params] = useSearchParams();
22
+  const answerId = params.get('answerId');
23
+  const itemType = params.get('itemType');
24
+
25
+  const columns = [
26
+    // {
27
+    //   title: "模拟测评",
28
+    //   dataIndex: "checkId",
29
+    //   valueType: 'select',
30
+    //   request: getCheck,
31
+    //   hideInTable: true,
32
+    //   formItemProps: {
33
+    //     rules: [
34
+    //       { required: true, message: '请选择模拟测评' }
35
+    //     ]
36
+    //   }
37
+    // },
38
+    {
39
+      title: "点位名称",
40
+      valueType: 'select',
41
+      request: getLocType,
42
+      dataIndex: "typeId",
43
+    },
44
+    {
45
+      title: "问题",
46
+      dataIndex: "quTitle",
47
+      hideInSearch: true,
48
+    },
49
+    {
50
+      title: "答案",
51
+      dataIndex: "answer",
52
+      hideInSearch: true,
53
+    },
54
+    {
55
+      title: "得分",
56
+      dataIndex: "score",
57
+      hideInSearch: true,
58
+    },
59
+    // {
60
+    //   title: "答题时间",
61
+    //   dataIndex: "createDate",
62
+    //   valueType: 'date',
63
+    //   hideInSearch: true,
64
+    // },
65
+    // {
66
+    //   title: "答题人",
67
+    //   dataIndex: "userName",
68
+    //   hideInSearch: true,
69
+    // },
70
+  ]
71
+
72
+  const beforeSearchSubmit = (params) => {
73
+    paramsRef.current = params;
74
+    return params;
75
+  }
76
+
77
+  const onExport = () => {
78
+    startLoading();
79
+    exportTaCheckAnswerDetail({
80
+      answerId,
81
+      itemType,
82
+    }).then(() => {
83
+      stopLoading();
84
+    }).catch(() => {
85
+      stopLoading();
86
+    });
87
+  }
88
+
89
+  return (
90
+    <Page>
91
+      {contextHolder}
92
+      <ProTable
93
+        rowKey="answerItemId"
94
+        // manualRequest
95
+        search={false}
96
+        columns={columns}
97
+        request={getAnswer}
98
+        params={{ answerId, itemType }}
99
+        beforeSearchSubmit={beforeSearchSubmit}
100
+        form={{ ignoreRules: false }}
101
+        toolBarRender={() => [
102
+          <Button
103
+            key="1"
104
+            type="primary"
105
+            loading={loading}
106
+            onClick={onExport}
107
+          >
108
+            导出
109
+          </Button>,
110
+        ]}
111
+      />
112
+    </Page>
113
+  )
114
+}

+ 48
- 35
src/pages/checkAnswer/loc/index.jsx 查看文件

@@ -6,18 +6,25 @@ import { queryTable, queryDict } from "@/utils/request";
6 6
 import Page from '@/components/Page';
7 7
 import { getTaCheck } from '@/service/tacheck';
8 8
 import { getTdLocType } from '@/service/tdloctype';
9
-import { getTaCheckAnswer, exportTaCheckAnswer } from '@/service/tacheckanswer';
9
+import { getTaCheckAnswer } from '@/service/tacheckanswer';
10 10
 import useBool from '@/utils/hooks/useBool';
11 11
 
12 12
 const getCheck = queryDict(getTaCheck, { labelKey: 'title', valueKey: 'checkId' });
13 13
 const getLocType = queryDict(getTdLocType, { labelKey: 'name', valueKey: 'typeId' });
14 14
 const getAnswer = queryTable(getTaCheckAnswer);
15 15
 
16
+const addOnParams = { itemType: 'loc' };
17
+
16 18
 export default (props) => {
17 19
 
18 20
   const [loading, startLoading, stopLoading] = useBool();
19 21
   const paramsRef = React.useRef();
20 22
   const [notificationApi, contextHolder] = notification.useNotification();
23
+  const navigate = useNavigate();
24
+
25
+  const goToDetail = (row) => {
26
+    navigate(`/checkAnswer/loc/detail?answerId=${row.answerId}&itemType=loc`)
27
+  }
21 28
 
22 29
   const columns = [
23 30
     {
@@ -32,6 +39,12 @@ export default (props) => {
32 39
         ]
33 40
       }
34 41
     },
42
+    {
43
+      title: "答题时间",
44
+      dataIndex: "createDate",
45
+      valueType: 'date',
46
+      hideInSearch: true,
47
+    },
35 48
     {
36 49
       title: "点位名称",
37 50
       valueType: 'select',
@@ -39,26 +52,25 @@ export default (props) => {
39 52
       dataIndex: "typeId",
40 53
     },
41 54
     {
42
-      title: "问题",
43
-      dataIndex: "quTitle",
44
-      hideInSearch: true,
45
-    },
46
-    {
47
-      title: "答案",
48
-      dataIndex: "answer",
55
+      title: "答题人",
56
+      dataIndex: "userName",
49 57
       hideInSearch: true,
50 58
     },
51 59
     {
52
-      title: "答题时间",
53
-      dataIndex: "createDate",
54
-      valueType: 'date',
60
+      title: "得分",
61
+      dataIndex: "score",
55 62
       hideInSearch: true,
56 63
     },
57 64
     {
58
-      title: "答题人",
59
-      dataIndex: "userName",
65
+      title: '操作',
60 66
       hideInSearch: true,
61
-    },
67
+      key: 'options',
68
+      render: (_, row) => {
69
+        return (
70
+          <Button type="link" onClick={() => goToDetail(row)}>详情</Button>
71
+        )
72
+      }
73
+    }
62 74
   ]
63 75
 
64 76
   const beforeSearchSubmit = (params) => {
@@ -67,39 +79,40 @@ export default (props) => {
67 79
   }
68 80
 
69 81
   const onExport = () => {
70
-    if (!paramsRef.current) {
71
-      notificationApi.warning({ message: '请先进行条件查询' });
72
-      return
73
-    }
82
+    // if (!paramsRef.current) {
83
+    //   notificationApi.warning({ message: '请先进行条件查询' });
84
+    //   return
85
+    // }
74 86
 
75
-    startLoading();
76
-    exportTaCheckAnswer(paramsRef.current).then(() => {
77
-      stopLoading();
78
-    }).catch(() => {
79
-      stopLoading();
80
-    });
87
+    // startLoading();
88
+    // exportTaCheckAnswer(paramsRef.current).then(() => {
89
+    //   stopLoading();
90
+    // }).catch(() => {
91
+    //   stopLoading();
92
+    // });
81 93
   }
82 94
 
83 95
   return (
84 96
     <Page>
85 97
       {contextHolder}
86 98
       <ProTable
87
-        rowKey="answerItemId"
99
+        rowKey="answerId"
88 100
         manualRequest
89 101
         columns={columns}
90 102
         request={getAnswer}
103
+        params={addOnParams}
91 104
         beforeSearchSubmit={beforeSearchSubmit}
92 105
         form={{ ignoreRules: false }}
93
-        toolBarRender={() => [
94
-          <Button
95
-            key="1"
96
-            type="primary"
97
-            loading={loading}
98
-            onClick={onExport}
99
-          >
100
-            导出
101
-          </Button>,
102
-        ]}
106
+        // toolBarRender={() => [
107
+        //   <Button
108
+        //     key="1"
109
+        //     type="primary"
110
+        //     loading={loading}
111
+        //     onClick={onExport}
112
+        //   >
113
+        //     导出
114
+        //   </Button>,
115
+        // ]}
103 116
       />
104 117
     </Page>
105 118
   )

+ 125
- 0
src/pages/checkAnswer/survey/detail.jsx 查看文件

@@ -0,0 +1,125 @@
1
+import React from 'react';
2
+import Page from '@/components/Page';
3
+import { useNavigate, useSearchParams } from 'react-router-dom';
4
+import { queryTable, queryDict } from "@/utils/request";
5
+import { ProTable } from "@ant-design/pro-components";
6
+import { Button, notification } from "antd";
7
+import { getTaCheck } from '@/service/tacheck';
8
+import { getTaCheckAnswerDetail, exportTaCheckAnswerDetail } from '@/service/tacheckanswer';
9
+import useBool from '@/utils/hooks/useBool';
10
+
11
+const getCheck = queryDict(getTaCheck, { labelKey: 'title', valueKey: 'checkId' });
12
+const getAnswer = queryTable(getTaCheckAnswerDetail);
13
+
14
+const addOnParams = { itemType: 'survey' };
15
+
16
+export default (props) => {
17
+  const [loading, startLoading, stopLoading] = useBool();
18
+  const paramsRef = React.useRef();
19
+  const [notificationApi, contextHolder] = notification.useNotification();
20
+  const [params] = useSearchParams();
21
+  const answerId = params.get('answerId');
22
+  const itemType = params.get('itemType');
23
+
24
+  const columns = [
25
+    // {
26
+    //   title: "模拟测评",
27
+    //   dataIndex: "checkId",
28
+    //   valueType: 'select',
29
+    //   request: getCheck,
30
+    //   hideInTable: true,
31
+    //   formItemProps: {
32
+    //     rules: [
33
+    //       { required: true, message: '请选择模拟测评' }
34
+    //     ]
35
+    //   }
36
+    // },
37
+    {
38
+      title: "社区",
39
+      dataIndex: "communityName",
40
+    },
41
+    // {
42
+    //   title: "小区",
43
+    //   dataIndex: "addr",
44
+    // },
45
+    {
46
+      title: "问题",
47
+      dataIndex: "quTitle",
48
+      hideInSearch: true,
49
+    },
50
+    {
51
+      title: "答案",
52
+      dataIndex: "answer",
53
+      hideInSearch: true,
54
+    },
55
+    {
56
+      title: "得分",
57
+      dataIndex: "score",
58
+      hideInSearch: true,
59
+    },
60
+    // {
61
+    //   title: "答题时间",
62
+    //   dataIndex: "createDate",
63
+    //   valueType: 'date',
64
+    //   hideInSearch: true,
65
+    // },
66
+    // {
67
+    //   title: "答题人",
68
+    //   dataIndex: "userName",
69
+    //   hideInSearch: true,
70
+    // },
71
+    // {
72
+    //   title: "受访者性别",
73
+    //   dataIndex: "sex",
74
+    //   hideInSearch: true,
75
+    // },
76
+    // {
77
+    //   title: "年龄段",
78
+    //   dataIndex: "age",
79
+    //   hideInSearch: true,
80
+    // }
81
+  ]
82
+  
83
+  const beforeSearchSubmit = (params) => {
84
+    paramsRef.current = params;
85
+    return params;
86
+  }
87
+
88
+  const onExport = () => {
89
+    startLoading();
90
+    exportTaCheckAnswerDetail({
91
+      answerId,
92
+      itemType,
93
+    }).then(() => {
94
+      stopLoading();
95
+    }).catch(() => {
96
+      stopLoading();
97
+    });
98
+  }
99
+
100
+  return (
101
+    <Page>
102
+      {contextHolder}
103
+      <ProTable
104
+        rowKey="answerItemId"
105
+        // manualRequest
106
+        search={false}
107
+        columns={columns}
108
+        request={getAnswer}
109
+        params={{ answerId, itemType }}
110
+        beforeSearchSubmit={beforeSearchSubmit}
111
+        form={{ ignoreRules: false }}
112
+        toolBarRender={() => [
113
+          <Button
114
+            key="1"
115
+            type="primary"
116
+            loading={loading}
117
+            onClick={onExport}
118
+          >
119
+            导出
120
+          </Button>,
121
+        ]}
122
+      />
123
+    </Page>
124
+  )
125
+}

+ 51
- 41
src/pages/checkAnswer/survey/index.jsx 查看文件

@@ -5,7 +5,7 @@ import { queryTable, queryDict } from "@/utils/request";
5 5
 import { ProTable } from "@ant-design/pro-components";
6 6
 import { Button, notification } from "antd";
7 7
 import { getTaCheck } from '@/service/tacheck';
8
-import { getTaCheckAnswer, exportTaCheckAnswer } from '@/service/tacheckanswer';
8
+import { getTaCheckAnswer } from '@/service/tacheckanswer';
9 9
 import useBool from '@/utils/hooks/useBool';
10 10
 
11 11
 const getCheck = queryDict(getTaCheck, { labelKey: 'title', valueKey: 'checkId' });
@@ -17,6 +17,11 @@ export default (props) => {
17 17
   const [loading, startLoading, stopLoading] = useBool();
18 18
   const paramsRef = React.useRef();
19 19
   const [notificationApi, contextHolder] = notification.useNotification();
20
+  const navigate = useNavigate();
21
+
22
+  const goToDetail = (row) => {
23
+    navigate(`/checkAnswer/survey/detail?answerId=${row.answerId}&itemType=survey`)
24
+  }
20 25
 
21 26
   const columns = [
22 27
     {
@@ -31,6 +36,12 @@ export default (props) => {
31 36
         ]
32 37
       }
33 38
     },
39
+    {
40
+      title: "答题时间",
41
+      dataIndex: "createDate",
42
+      valueType: 'date',
43
+      hideInSearch: true,
44
+    },
34 45
     {
35 46
       title: "社区",
36 47
       dataIndex: "communityName",
@@ -39,22 +50,6 @@ export default (props) => {
39 50
       title: "小区",
40 51
       dataIndex: "addr",
41 52
     },
42
-    {
43
-      title: "问题",
44
-      dataIndex: "quTitle",
45
-      hideInSearch: true,
46
-    },
47
-    {
48
-      title: "答案",
49
-      dataIndex: "answer",
50
-      hideInSearch: true,
51
-    },
52
-    {
53
-      title: "答题时间",
54
-      dataIndex: "createDate",
55
-      valueType: 'date',
56
-      hideInSearch: true,
57
-    },
58 53
     {
59 54
       title: "答题人",
60 55
       dataIndex: "userName",
@@ -69,6 +64,21 @@ export default (props) => {
69 64
       title: "年龄段",
70 65
       dataIndex: "age",
71 66
       hideInSearch: true,
67
+    },
68
+    {
69
+      title: "得分",
70
+      dataIndex: "score",
71
+      hideInSearch: true,
72
+    },
73
+    {
74
+      title: '操作',
75
+      hideInSearch: true,
76
+      key: 'options',
77
+      render: (_, row) => {
78
+        return (
79
+          <Button type="link" onClick={() => goToDetail(row)}>详情</Button>
80
+        )
81
+      }
72 82
     }
73 83
   ]
74 84
   
@@ -78,43 +88,43 @@ export default (props) => {
78 88
   }
79 89
 
80 90
   const onExport = () => {
81
-    if (!paramsRef.current) {
82
-      notificationApi.warning({ message: '请先进行条件查询' });
83
-      return
84
-    }
91
+    // if (!paramsRef.current) {
92
+    //   notificationApi.warning({ message: '请先进行条件查询' });
93
+    //   return
94
+    // }
85 95
 
86
-    startLoading();
87
-    exportTaCheckAnswer({
88
-      ...paramsRef.current,
89
-      ...addOnParams,
90
-    }).then(() => {
91
-      stopLoading();
92
-    }).catch(() => {
93
-      stopLoading();
94
-    });
96
+    // startLoading();
97
+    // exportTaCheckAnswer({
98
+    //   ...paramsRef.current,
99
+    //   ...addOnParams,
100
+    // }).then(() => {
101
+    //   stopLoading();
102
+    // }).catch(() => {
103
+    //   stopLoading();
104
+    // });
95 105
   }
96 106
 
97 107
   return (
98 108
     <Page>
99 109
       {contextHolder}
100 110
       <ProTable
101
-        rowKey="answerItemId"
111
+        rowKey="answerId"
102 112
         manualRequest
103 113
         columns={columns}
104 114
         request={getAnswer}
105 115
         params={addOnParams}
106 116
         beforeSearchSubmit={beforeSearchSubmit}
107 117
         form={{ ignoreRules: false }}
108
-        toolBarRender={() => [
109
-          <Button
110
-            key="1"
111
-            type="primary"
112
-            loading={loading}
113
-            onClick={onExport}
114
-          >
115
-            导出
116
-          </Button>,
117
-        ]}
118
+        // toolBarRender={() => [
119
+        //   <Button
120
+        //     key="1"
121
+        //     type="primary"
122
+        //     loading={loading}
123
+        //     onClick={onExport}
124
+        //   >
125
+        //     导出
126
+        //   </Button>,
127
+        // ]}
118 128
       />
119 129
     </Page>
120 130
   )

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

@@ -71,7 +71,7 @@ export default (props) => {
71 71
       <ProTable
72 72
         rowKey="verifyId"
73 73
         search={false}
74
-        params={{issueId}}
74
+        params={{issueId, isAll: true}}
75 75
         columns={columns}
76 76
         request={fetchData}
77 77
         toolBarRender={false}

+ 3
- 3
src/pages/issue/detail/components/Process.jsx 查看文件

@@ -26,9 +26,9 @@ export default (props) => {
26 26
         stopLoading();
27 27
         const records = res.records || [];
28 28
 
29
-        const startRec = records.filter(x => x.processNode == 'start')[0];
30
-        const assignedRec = records.filter(x => x.processNode == 'assigned')[0];
31
-        const endRec = records.filter(x => x.processNode == 'end')[0];
29
+        const startRec = records.filter(x => x.processNode == '01')[0];
30
+        const assignedRec = records.filter(x => x.processNode !== '01' && x.processNode !== '03')[0];
31
+        const endRec = records.filter(x => x.processNode == '03')[0];
32 32
 
33 33
         setItems([
34 34
           { title: '待交办', description: fmDt(startRec?.createDate) },

+ 18
- 0
src/routes/routes.jsx 查看文件

@@ -41,7 +41,9 @@ import Notice from "@/pages/notice";
41 41
 import CheckStandList from "@/pages/checkStand/list";
42 42
 import CheckStandEdit from "@/pages/checkStand/edit";
43 43
 import CheckLocAnswer from "@/pages/checkAnswer/loc";
44
+import CheckLocAnswerDetail from "@/pages/checkAnswer/loc/detail";
44 45
 import CheckSurveyAnswer from "@/pages/checkAnswer/survey";
46
+import CheckSurveyAnswerDetail from "@/pages/checkAnswer/survey/detail";
45 47
 
46 48
 /**
47 49
  * meta 用来扩展自定义数据数据
@@ -129,6 +131,14 @@ export const authRoutes = [
129 131
               icon: <HddOutlined />,
130 132
             },
131 133
           },
134
+          {
135
+            path: "loc/detail",
136
+            element: <CheckLocAnswerDetail />,
137
+            meta: {
138
+              title: "实地答题明细",
139
+              hideInMenu: true
140
+            },
141
+          },
132 142
           {
133 143
             path: "survey",
134 144
             element: <CheckSurveyAnswer />,
@@ -137,6 +147,14 @@ export const authRoutes = [
137 147
               icon: <HddOutlined />,
138 148
             },
139 149
           },
150
+          {
151
+            path: "survey/detail",
152
+            element: <CheckSurveyAnswerDetail />,
153
+            meta: {
154
+              title: "问卷答题明细",
155
+              hideInMenu: true
156
+            },
157
+          },
140 158
         ],
141 159
       },
142 160
     ],

+ 3
- 1
src/service/tacheckanswer.js 查看文件

@@ -5,6 +5,8 @@ import request from '@/utils/request';
5 5
  */
6 6
 export const getTaCheckAnswer = (params) => request('/api/taCheckAnswer', { params });
7 7
 
8
+export const getTaCheckAnswerDetail = (params) => request(`/api/taCheckAnswer/${params.answerId}/detail`, { params });
9
+
8 10
 /*
9 11
  * 新增数据
10 12
  */
@@ -28,4 +30,4 @@ export const deleteTaCheckAnswer = (id) => request(`/api/taCheckAnswer/${id}`, {
28 30
 /*
29 31
  * 分页查询
30 32
  */
31
-export const exportTaCheckAnswer = (params) => request('/api/taCheckAnswer/export', { params, download: true });
33
+export const exportTaCheckAnswerDetail = (params) => request(`/api/taCheckAnswer/${params.answerId}/detail/export`, { params, download: true });

+ 1
- 0
src/utils/request.js 查看文件

@@ -24,6 +24,7 @@ instance.interceptors.request.use(function (config) {
24 24
     ...config,
25 25
     silent: noTip,
26 26
     headers: {
27
+      'Content-Type': 'application/json;charset=utf-8', // charset 防止乱码
27 28
       ...headers,
28 29
       Authorization: token,
29 30
     },