Yansen 2 年之前
父節點
當前提交
be996ee962

+ 9
- 0
src/pages/check/components/LocTable.jsx 查看文件

@@ -4,6 +4,7 @@ import { Table, Space, Button, Row, Col, Card } from 'antd';
4 4
 import { getTaCheckItem } from '@/service/tacheckitem';
5 5
 import QuList from './QuList';
6 6
 import LocForm from './LocForm';
7
+import styles from './style.module.less';
7 8
 
8 9
 export default (props) => {
9 10
   const { checkId } = props;
@@ -63,6 +64,13 @@ export default (props) => {
63 64
     setList(newList);
64 65
   }
65 66
 
67
+  const getRowClassName = (row) => {
68
+    return [
69
+      styles['yz-table-row'],
70
+      (row.itemId == curItem?.itemId) ? styles.active : false,
71
+    ].filter(Boolean).join(' ');
72
+  }
73
+
66 74
   React.useEffect(() => {
67 75
     if (checkId) {
68 76
       startLoading();
@@ -85,6 +93,7 @@ export default (props) => {
85 93
             columns={columns}
86 94
             dataSource={list}
87 95
             pagination={false}
96
+            rowClassName={getRowClassName}
88 97
             onRow={(row) => ({
89 98
               onClick: () => setCurItem(row),
90 99
             })}

+ 94
- 47
src/pages/check/components/QuForm.jsx 查看文件

@@ -4,7 +4,8 @@ import {
4 4
   ProFormText,
5 5
   ProFormSelect,
6 6
   ProFormDigit,
7
-  ProFormList
7
+  ProFormList,
8
+  ProFormDependency
8 9
 } from '@ant-design/pro-components';
9 10
 import { Form, Row, Col } from 'antd';
10 11
 import WangEditor from '@/components/Wangeditor';
@@ -127,7 +128,7 @@ export default (props) => {
127 128
             ]}
128 129
           />
129 130
         </Col>
130
-        <Col span={12}>
131
+        <Col span={6}>
131 132
           <ProFormSelect
132 133
             name="computeType"
133 134
             label="计分方式"
@@ -146,9 +147,7 @@ export default (props) => {
146 147
             ]}
147 148
           />
148 149
         </Col>
149
-      </Row>
150
-      <Row gutter={24}>
151
-        <Col span={12}>
150
+        <Col span={6}>
152 151
           <ProFormDigit
153 152
             name="maxScore"
154 153
             label="最 高 分"
@@ -162,19 +161,44 @@ export default (props) => {
162 161
             ]}
163 162
           />
164 163
         </Col>
164
+      </Row>
165
+      <Row gutter={24}>
165 166
         <Col span={12}>
166
-          <ProFormDigit
167
-            name="anScore"
168
-            label="单项计分"
169
-            min={0}
170
-            fieldProps={{ precision: 2 }}
171
-            rules={[
172
-              {
173
-                required: true,
174
-                message: '请设置单项计分',
175
-              },
176
-            ]}
177
-          />
167
+          <ProFormDependency name={['quType']}>
168
+            {
169
+              ({quType}) => (
170
+                quType != 'fill' ? null : (
171
+                  <ProFormDigit
172
+                    name="anScore"
173
+                    label="单项计分"
174
+                    min={0}
175
+                    fieldProps={{ precision: 2 }}
176
+                    rules={[
177
+                      {
178
+                        required: true,
179
+                        message: '请设置单项计分',
180
+                      },
181
+                    ]}
182
+                  />
183
+                )
184
+              )
185
+            }
186
+          </ProFormDependency>
187
+        </Col>
188
+        <Col span={12}>
189
+          <ProFormDependency name={['quType']}>
190
+            {
191
+              ({quType}) => (
192
+                quType != 'fill' ? null : (
193
+                  <ProFormText
194
+                    name="fillUnit"
195
+                    label="填空单位"
196
+                    placeholder="表示填空数字的单位"
197
+                  />
198
+                )
199
+              )
200
+            }
201
+          </ProFormDependency>
178 202
         </Col>
179 203
       </Row>
180 204
       {
@@ -201,36 +225,59 @@ export default (props) => {
201 225
           </Form.Item>
202 226
         )
203 227
       }
204
-      <ProFormList
205
-        name="answerList"
206
-        label="选项列表"
207
-        copyIconProps={false}
208
-      >
209
-        <Row gutter={24} style={{ width: '730px' }}>
210
-          <Col span={6}>
211
-            <ProFormText
212
-              name="answerCode"
213
-              label="选项"
214
-              help="类似 A, B, C, D"
215
-            />
216
-          </Col>
217
-          <Col span={6}>
218
-            <ProFormDigit
219
-              name="score"
220
-              label="计分"
221
-              min={0}
222
-              fieldProps={{ precision: 2 }}
223
-            />
224
-          </Col>
225
-          <Col span={12}>
226
-            <ProFormText
227
-              name="answer"
228
-              label="答案"
229
-              placeholder="具体选项内容"
230
-            />
231
-          </Col>
232
-        </Row>
233
-      </ProFormList>
228
+      
229
+      <ProFormDependency name={['quType']}>
230
+        {
231
+          ({quType}) => (
232
+            quType == 'fill' ? null : (
233
+              <ProFormList
234
+                name="answerList"
235
+                label="选项列表"
236
+                copyIconProps={false}
237
+              >
238
+                <Row gutter={24} style={{ width: '730px' }}>
239
+                  <Col span={6}>
240
+                    <ProFormText
241
+                      name="answerCode"
242
+                      label="选项"
243
+                      help="类似 A, B, C, D"
244
+                    />
245
+                  </Col>
246
+                  <Col span={6}>
247
+                    <ProFormDigit
248
+                      name="score"
249
+                      label="计分"
250
+                      help="计分"
251
+                      min={0}
252
+                      fieldProps={{ precision: 2 }}
253
+                    />
254
+                  </Col>
255
+                  <Col span={6}>
256
+                    <ProFormSelect
257
+                      name="reportIssue"
258
+                      label="上报问题"
259
+                      help="上报问题"
260
+                      placeholder="是否上报问题"
261
+                      valueEnum={{
262
+                        0: '不上报',
263
+                        1: '上报',
264
+                      }}
265
+                    />
266
+                  </Col>
267
+                  <Col span={6}>
268
+                    <ProFormText
269
+                      name="answer"
270
+                      label="答案"
271
+                      help="答案"
272
+                      placeholder="具体选项内容"
273
+                    />
274
+                  </Col>
275
+                </Row>
276
+              </ProFormList>
277
+            )
278
+          )
279
+        }
280
+      </ProFormDependency>
234 281
     </DrawerForm>
235 282
   )
236 283
 }

+ 12
- 0
src/pages/check/components/style.module.less 查看文件

@@ -0,0 +1,12 @@
1
+
2
+.yz-table-row {
3
+  & > td:first-child {
4
+    border-left: 2px solid transparent;
5
+  }
6
+
7
+  &.active {
8
+    & > td:first-child {
9
+      border-left-color: #1677ff;
10
+    }
11
+  }
12
+}

+ 33
- 14
src/pages/check/index.jsx 查看文件

@@ -1,10 +1,10 @@
1 1
 import React from 'react';
2 2
 import Page from '@/components/Page';
3
-import { useNavigate } from 'react-router-dom';
3
+import { useNavigate, Link } from 'react-router-dom';
4 4
 import { queryTable } from "@/utils/request";
5 5
 import { ProTable } from "@ant-design/pro-components";
6 6
 import { Button, message, Popconfirm } from "antd";
7
-import { getTaCheck, deleteTaCheck, putTaCheck } from '@/service/tacheck';
7
+import { getTaCheck, deleteTaCheck, putTaCheck, calcScoreTaCheck } from '@/service/tacheck';
8 8
 
9 9
 const queryList = queryTable(getTaCheck);
10 10
 
@@ -25,10 +25,17 @@ export default (props) => {
25 25
     })
26 26
   }
27 27
 
28
+  const onCalc = (row) => {
29
+    calcScoreTaCheck(row.checkId).then(() => {
30
+      actionRef.current.reload();
31
+    });
32
+  }
33
+
28 34
   const columns = [
29 35
     {
30 36
       title: "测评名称",
31 37
       dataIndex: "title",
38
+      render: (_, row) => !row.title ? '-' : <Link to={`/check/edit?id=${row.checkId}`}>{row.title}</Link>,
32 39
     },
33 40
     {
34 41
       title: "测评日期",
@@ -49,6 +56,16 @@ export default (props) => {
49 56
       dataIndex: "endDate",
50 57
       hideInSearch: true,
51 58
     },
59
+    {
60
+      title: "实地测评得分",
61
+      dataIndex: "locScore",
62
+      hideInSearch: true,
63
+    },
64
+    {
65
+      title: "调查问卷得分",
66
+      dataIndex: "surveyScore",
67
+      hideInSearch: true,
68
+    },
52 69
     {
53 70
       title: "状态",
54 71
       dataIndex: "status",
@@ -67,7 +84,7 @@ export default (props) => {
67 84
     {
68 85
       title: "操作",
69 86
       valueType: "option",
70
-      width: 200,
87
+      width: 240,
71 88
       render: (_, record) => [
72 89
         <Button
73 90
           key={1}
@@ -79,16 +96,6 @@ export default (props) => {
79 96
         >
80 97
           {record.status === 1 ? "禁用" : "启用"}
81 98
         </Button>,
82
-        <Button
83
-          key={2}
84
-          style={{ padding: 0 }}
85
-          type="link"
86
-          onClick={() => {
87
-            navigate(`/check/edit?id=${record.checkId}`);
88
-          }}
89
-        >
90
-          编辑
91
-        </Button>,
92 99
         <Popconfirm
93 100
           key={3}
94 101
           title="您是否确认删除 ?"
@@ -97,10 +104,22 @@ export default (props) => {
97 104
           cancelText="取消"
98 105
         >
99 106
           {/* manualPush */}
100
-          <Button style={{ padding: 0 }} type="link">
107
+          <Button style={{ padding: 0 }} danger type="link">
101 108
             删除
102 109
           </Button>
103 110
         </Popconfirm>,
111
+        <Popconfirm
112
+          key={4}
113
+          title="系统计算可能需要1分钟的时间"
114
+          onConfirm={() => onCalc(record)}
115
+          okText="确定"
116
+          cancelText="取消"
117
+        >
118
+          {/* manualPush */}
119
+          <Button style={{ padding: 0 }} type="link">
120
+            计算分数
121
+          </Button>
122
+        </Popconfirm>,
104 123
       ],
105 124
     },
106 125
   ]

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

@@ -5,6 +5,7 @@ import { getTaIssueApply } from '@/service/taissueapply';
5 5
 import { getSysOrg } from '@/service/sysorg';
6 6
 import { queryTable, queryDict } from '@/utils/request';
7 7
 import useBool from '@/utils/hooks/useBool';
8
+import { processEnum } from '@/utils/biz';
8 9
 
9 10
 const fetchOrg = queryDict(getSysOrg, { labelKey: 'orgId', valueKey: 'name' });
10 11
 const fetchData = queryTable(getTaIssueApply);
@@ -21,20 +22,7 @@ export default (props) => {
21 22
     {
22 23
       title: "申请类别",
23 24
       dataIndex: "applyType",
24
-      valueEnum: {
25
-        verify: {
26
-          text: '问题单审核',
27
-        },
28
-        reject: {
29
-          text: '驳回申请',
30
-        },
31
-        delay: {
32
-          text: '延期申请',
33
-        },
34
-        end: {
35
-          text: '销单申请',
36
-        },
37
-      }
25
+      valueEnum: processEnum
38 26
     },
39 27
     {
40 28
       title: "申请人",
@@ -53,6 +41,10 @@ export default (props) => {
53 41
       title: "审批结果",
54 42
       dataIndex: "verifyStatus",
55 43
       valueEnum: {
44
+        ready: {
45
+          text: '未审批',
46
+          status: 'Default',
47
+        },
56 48
         pass: {
57 49
           text: '通过',
58 50
           status: 'Success',

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

@@ -1,13 +1,15 @@
1 1
 import React from 'react';
2
-import { Card, Descriptions, Image } from 'antd';
2
+import { Card, Descriptions, Badge } from 'antd';
3 3
 import dayjs from 'dayjs';
4 4
 import useBool from '@/utils/hooks/useBool';
5 5
 import { getTaIssueById } from '@/service/taissue';
6 6
 import { getSysOrgById } from '@/service/sysorg';
7
+import { processStatus } from '@/utils/biz';
7 8
 import AttachList from './AttachList';
8 9
 
10
+const today = (new Date()).toJSON().substring(0, 10);
9 11
 const fmDate = dt => !dt ? '-' : dayjs(dt).format('YYYY-MM-DD');
10
-const getStatusLabel = status => ({start: '待交办', assigned: '处理中', end: '已办结'})[status];
12
+const getStatusLabel = val => (processStatus.filter(x => x.value == val)[0])?.label;
11 13
 
12 14
 export default (props) => {
13 15
 
@@ -16,6 +18,17 @@ export default (props) => {
16 18
   const [loading, startLoading, stopLoading] = useBool();
17 19
   const [detail, setDetail] = React.useState();
18 20
 
21
+  const [
22
+    isExpire,
23
+    status,
24
+  ] = React.useMemo(() => {
25
+    if (!detail) return [];
26
+    return [
27
+      detail.processNode != '03' && today >= detail.expireDate,
28
+      processStatus.filter(x => x.value == detail.processNode)[0],
29
+    ]
30
+  }, [detail]);
31
+
19 32
   React.useEffect(() => {
20 33
     if (issueId) {
21 34
       startLoading();
@@ -53,7 +66,11 @@ export default (props) => {
53 66
         <Descriptions.Item label="上报时间">{fmDate(detail?.createDate)}</Descriptions.Item>
54 67
         <Descriptions.Item label="上报人">{detail?.userName}</Descriptions.Item>
55 68
         <Descriptions.Item label="问题类型">{detail?.typeName}</Descriptions.Item>
56
-        <Descriptions.Item label="流程状态">{getStatusLabel(detail?.processNode)}</Descriptions.Item>
69
+        <Descriptions.Item label="流程状态">
70
+          {
71
+            isExpire ? <Badge status="error" text="已逾期" /> : <Badge status={status?.badge} text={status?.label} />
72
+          }
73
+        </Descriptions.Item>
57 74
         <Descriptions.Item label="截止日期">{fmDate(detail?.expireDate)}</Descriptions.Item>
58 75
         <Descriptions.Item label="责任单位" span={2}>{detail?.orgName}</Descriptions.Item>
59 76
         <Descriptions.Item label="问题描述" span={3}>

+ 6
- 38
src/pages/issue/index.jsx 查看文件

@@ -6,6 +6,7 @@ import { getTaIssue } from '@/service/taissue';
6 6
 import { getTdLocType } from '@/service/tdloctype';
7 7
 import { getSysOrg } from '@/service/sysorg';
8 8
 import { queryDict } from '@/utils/request';
9
+import { processEnum, processStatus } from '@/utils/biz';
9 10
 
10 11
 const queryOrg = queryDict(getSysOrg, { labelKey: 'name', valueKey: 'orgId' });
11 12
 const queryLocType = queryDict(getTdLocType, { labelKey: 'name', valueKey: 'typeId' });
@@ -50,46 +51,13 @@ export default (props) => {
50 51
       title: "流程状态",
51 52
       dataIndex: "bizStatus",
52 53
       valueType: 'select',
53
-      valueEnum: {
54
-        start: {
55
-          text: "待交办",
56
-          status: "Default",
57
-        },
58
-        assigned: {
59
-          text: "已交办",
60
-          status: "Processing",
61
-        },
62
-        end: {
63
-          text: "已办结",
64
-          status: "Success",
65
-        },
66
-        expired: {
67
-          text: "已逾期",
68
-          status: "Error",
69
-        },
70
-        reject: {
71
-          text: "已打回",
72
-          status: "Warning",
73
-        },
74
-      },
54
+      valueEnum: processEnum,
75 55
       render: (_, row) => {
76
-        if (row.processNode == 'end') {
77
-          return <Badge status="success" text="已办结" />;
56
+        if (row.processNode != '03' && today >= row.expireDate) {
57
+          return <Badge status="error" text="已逾期" />;
78 58
         } else {
79
-
80
-          if (today >= row.expireDate) {
81
-            return <Badge status="error" text="已逾期" />;
82
-          }
83
-
84
-          if ('reject' == row.processStatus) {
85
-            return <Badge status="warning" text="已打回" />;
86
-          }
87
-
88
-          if (row.processNode == 'assigned') {
89
-            return <Badge status="processing" text="已交办" />;
90
-          }
91
-
92
-          return <Badge status="default" text="待交办" />;
59
+          const st = processStatus.filter(x => x.value == row.processNode)[0];
60
+          return <Badge status={st?.badge} text={st?.label} />;
93 61
         }
94 62
       }
95 63
     },

+ 5
- 0
src/service/tacheck.js 查看文件

@@ -24,3 +24,8 @@ export const putTaCheck = (id, data) => request(`/api/taCheck/${id}`, { data, me
24 24
  * 通过主键删除数据
25 25
  */
26 26
 export const deleteTaCheck = (id) => request(`/api/taCheck/${id}`, { method: 'delete' });
27
+
28
+/*
29
+ * 计算分数
30
+ */
31
+export const calcScoreTaCheck = (id) => request(`/api/taCheck/${id}/score`, { method: 'put' });

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

@@ -0,0 +1,22 @@
1
+
2
+import { Badge } from 'antd';
3
+
4
+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
+]
14
+
15
+export const processEnum = processStatus.reduce((acc, it) => {
16
+  return {
17
+    ...acc,
18
+    [it.value]: {
19
+      text: it.label,
20
+    }
21
+  }
22
+}, {});