Yansen 2 년 전
부모
커밋
be996ee962

+ 9
- 0
src/pages/check/components/LocTable.jsx 파일 보기

4
 import { getTaCheckItem } from '@/service/tacheckitem';
4
 import { getTaCheckItem } from '@/service/tacheckitem';
5
 import QuList from './QuList';
5
 import QuList from './QuList';
6
 import LocForm from './LocForm';
6
 import LocForm from './LocForm';
7
+import styles from './style.module.less';
7
 
8
 
8
 export default (props) => {
9
 export default (props) => {
9
   const { checkId } = props;
10
   const { checkId } = props;
63
     setList(newList);
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
   React.useEffect(() => {
74
   React.useEffect(() => {
67
     if (checkId) {
75
     if (checkId) {
68
       startLoading();
76
       startLoading();
85
             columns={columns}
93
             columns={columns}
86
             dataSource={list}
94
             dataSource={list}
87
             pagination={false}
95
             pagination={false}
96
+            rowClassName={getRowClassName}
88
             onRow={(row) => ({
97
             onRow={(row) => ({
89
               onClick: () => setCurItem(row),
98
               onClick: () => setCurItem(row),
90
             })}
99
             })}

+ 94
- 47
src/pages/check/components/QuForm.jsx 파일 보기

4
   ProFormText,
4
   ProFormText,
5
   ProFormSelect,
5
   ProFormSelect,
6
   ProFormDigit,
6
   ProFormDigit,
7
-  ProFormList
7
+  ProFormList,
8
+  ProFormDependency
8
 } from '@ant-design/pro-components';
9
 } from '@ant-design/pro-components';
9
 import { Form, Row, Col } from 'antd';
10
 import { Form, Row, Col } from 'antd';
10
 import WangEditor from '@/components/Wangeditor';
11
 import WangEditor from '@/components/Wangeditor';
127
             ]}
128
             ]}
128
           />
129
           />
129
         </Col>
130
         </Col>
130
-        <Col span={12}>
131
+        <Col span={6}>
131
           <ProFormSelect
132
           <ProFormSelect
132
             name="computeType"
133
             name="computeType"
133
             label="计分方式"
134
             label="计分方式"
146
             ]}
147
             ]}
147
           />
148
           />
148
         </Col>
149
         </Col>
149
-      </Row>
150
-      <Row gutter={24}>
151
-        <Col span={12}>
150
+        <Col span={6}>
152
           <ProFormDigit
151
           <ProFormDigit
153
             name="maxScore"
152
             name="maxScore"
154
             label="最 高 分"
153
             label="最 高 分"
162
             ]}
161
             ]}
163
           />
162
           />
164
         </Col>
163
         </Col>
164
+      </Row>
165
+      <Row gutter={24}>
165
         <Col span={12}>
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
         </Col>
202
         </Col>
179
       </Row>
203
       </Row>
180
       {
204
       {
201
           </Form.Item>
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
     </DrawerForm>
281
     </DrawerForm>
235
   )
282
   )
236
 }
283
 }

+ 12
- 0
src/pages/check/components/style.module.less 파일 보기

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
 import React from 'react';
1
 import React from 'react';
2
 import Page from '@/components/Page';
2
 import Page from '@/components/Page';
3
-import { useNavigate } from 'react-router-dom';
3
+import { useNavigate, Link } from 'react-router-dom';
4
 import { queryTable } from "@/utils/request";
4
 import { queryTable } from "@/utils/request";
5
 import { ProTable } from "@ant-design/pro-components";
5
 import { ProTable } from "@ant-design/pro-components";
6
 import { Button, message, Popconfirm } from "antd";
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
 const queryList = queryTable(getTaCheck);
9
 const queryList = queryTable(getTaCheck);
10
 
10
 
25
     })
25
     })
26
   }
26
   }
27
 
27
 
28
+  const onCalc = (row) => {
29
+    calcScoreTaCheck(row.checkId).then(() => {
30
+      actionRef.current.reload();
31
+    });
32
+  }
33
+
28
   const columns = [
34
   const columns = [
29
     {
35
     {
30
       title: "测评名称",
36
       title: "测评名称",
31
       dataIndex: "title",
37
       dataIndex: "title",
38
+      render: (_, row) => !row.title ? '-' : <Link to={`/check/edit?id=${row.checkId}`}>{row.title}</Link>,
32
     },
39
     },
33
     {
40
     {
34
       title: "测评日期",
41
       title: "测评日期",
49
       dataIndex: "endDate",
56
       dataIndex: "endDate",
50
       hideInSearch: true,
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
       title: "状态",
70
       title: "状态",
54
       dataIndex: "status",
71
       dataIndex: "status",
67
     {
84
     {
68
       title: "操作",
85
       title: "操作",
69
       valueType: "option",
86
       valueType: "option",
70
-      width: 200,
87
+      width: 240,
71
       render: (_, record) => [
88
       render: (_, record) => [
72
         <Button
89
         <Button
73
           key={1}
90
           key={1}
79
         >
96
         >
80
           {record.status === 1 ? "禁用" : "启用"}
97
           {record.status === 1 ? "禁用" : "启用"}
81
         </Button>,
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
         <Popconfirm
99
         <Popconfirm
93
           key={3}
100
           key={3}
94
           title="您是否确认删除 ?"
101
           title="您是否确认删除 ?"
97
           cancelText="取消"
104
           cancelText="取消"
98
         >
105
         >
99
           {/* manualPush */}
106
           {/* manualPush */}
100
-          <Button style={{ padding: 0 }} type="link">
107
+          <Button style={{ padding: 0 }} danger type="link">
101
             删除
108
             删除
102
           </Button>
109
           </Button>
103
         </Popconfirm>,
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
 import { getSysOrg } from '@/service/sysorg';
5
 import { getSysOrg } from '@/service/sysorg';
6
 import { queryTable, queryDict } from '@/utils/request';
6
 import { queryTable, queryDict } from '@/utils/request';
7
 import useBool from '@/utils/hooks/useBool';
7
 import useBool from '@/utils/hooks/useBool';
8
+import { processEnum } from '@/utils/biz';
8
 
9
 
9
 const fetchOrg = queryDict(getSysOrg, { labelKey: 'orgId', valueKey: 'name' });
10
 const fetchOrg = queryDict(getSysOrg, { labelKey: 'orgId', valueKey: 'name' });
10
 const fetchData = queryTable(getTaIssueApply);
11
 const fetchData = queryTable(getTaIssueApply);
21
     {
22
     {
22
       title: "申请类别",
23
       title: "申请类别",
23
       dataIndex: "applyType",
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
       title: "申请人",
28
       title: "申请人",
53
       title: "审批结果",
41
       title: "审批结果",
54
       dataIndex: "verifyStatus",
42
       dataIndex: "verifyStatus",
55
       valueEnum: {
43
       valueEnum: {
44
+        ready: {
45
+          text: '未审批',
46
+          status: 'Default',
47
+        },
56
         pass: {
48
         pass: {
57
           text: '通过',
49
           text: '通过',
58
           status: 'Success',
50
           status: 'Success',

+ 20
- 3
src/pages/issue/detail/components/BasicProfile.jsx 파일 보기

1
 import React from 'react';
1
 import React from 'react';
2
-import { Card, Descriptions, Image } from 'antd';
2
+import { Card, Descriptions, Badge } from 'antd';
3
 import dayjs from 'dayjs';
3
 import dayjs from 'dayjs';
4
 import useBool from '@/utils/hooks/useBool';
4
 import useBool from '@/utils/hooks/useBool';
5
 import { getTaIssueById } from '@/service/taissue';
5
 import { getTaIssueById } from '@/service/taissue';
6
 import { getSysOrgById } from '@/service/sysorg';
6
 import { getSysOrgById } from '@/service/sysorg';
7
+import { processStatus } from '@/utils/biz';
7
 import AttachList from './AttachList';
8
 import AttachList from './AttachList';
8
 
9
 
10
+const today = (new Date()).toJSON().substring(0, 10);
9
 const fmDate = dt => !dt ? '-' : dayjs(dt).format('YYYY-MM-DD');
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
 export default (props) => {
14
 export default (props) => {
13
 
15
 
16
   const [loading, startLoading, stopLoading] = useBool();
18
   const [loading, startLoading, stopLoading] = useBool();
17
   const [detail, setDetail] = React.useState();
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
   React.useEffect(() => {
32
   React.useEffect(() => {
20
     if (issueId) {
33
     if (issueId) {
21
       startLoading();
34
       startLoading();
53
         <Descriptions.Item label="上报时间">{fmDate(detail?.createDate)}</Descriptions.Item>
66
         <Descriptions.Item label="上报时间">{fmDate(detail?.createDate)}</Descriptions.Item>
54
         <Descriptions.Item label="上报人">{detail?.userName}</Descriptions.Item>
67
         <Descriptions.Item label="上报人">{detail?.userName}</Descriptions.Item>
55
         <Descriptions.Item label="问题类型">{detail?.typeName}</Descriptions.Item>
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
         <Descriptions.Item label="截止日期">{fmDate(detail?.expireDate)}</Descriptions.Item>
74
         <Descriptions.Item label="截止日期">{fmDate(detail?.expireDate)}</Descriptions.Item>
58
         <Descriptions.Item label="责任单位" span={2}>{detail?.orgName}</Descriptions.Item>
75
         <Descriptions.Item label="责任单位" span={2}>{detail?.orgName}</Descriptions.Item>
59
         <Descriptions.Item label="问题描述" span={3}>
76
         <Descriptions.Item label="问题描述" span={3}>

+ 6
- 38
src/pages/issue/index.jsx 파일 보기

6
 import { getTdLocType } from '@/service/tdloctype';
6
 import { getTdLocType } from '@/service/tdloctype';
7
 import { getSysOrg } from '@/service/sysorg';
7
 import { getSysOrg } from '@/service/sysorg';
8
 import { queryDict } from '@/utils/request';
8
 import { queryDict } from '@/utils/request';
9
+import { processEnum, processStatus } from '@/utils/biz';
9
 
10
 
10
 const queryOrg = queryDict(getSysOrg, { labelKey: 'name', valueKey: 'orgId' });
11
 const queryOrg = queryDict(getSysOrg, { labelKey: 'name', valueKey: 'orgId' });
11
 const queryLocType = queryDict(getTdLocType, { labelKey: 'name', valueKey: 'typeId' });
12
 const queryLocType = queryDict(getTdLocType, { labelKey: 'name', valueKey: 'typeId' });
50
       title: "流程状态",
51
       title: "流程状态",
51
       dataIndex: "bizStatus",
52
       dataIndex: "bizStatus",
52
       valueType: 'select',
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
       render: (_, row) => {
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
         } else {
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
  * 通过主键删除数据
24
  * 通过主键删除数据
25
  */
25
  */
26
 export const deleteTaCheck = (id) => request(`/api/taCheck/${id}`, { method: 'delete' });
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 파일 보기

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
+}, {});