|
@@ -3,15 +3,17 @@ import { connect, history } from 'umi';
|
3
|
3
|
import { PageContainer } from '@ant-design/pro-layout';
|
4
|
4
|
import ProTable from '@ant-design/pro-table';
|
5
|
5
|
import { PlusOutlined, GroupOutlined } from '@ant-design/icons';
|
6
|
|
-import { Button, Space,Image } from 'antd';
|
|
6
|
+import { Button, Space, Popconfirm, message } from 'antd';
|
7
|
7
|
import { queryTable } from '@/utils/request';
|
8
|
8
|
import School from '@/components/School';
|
9
|
9
|
import Specialty from '@/components/Specialty';
|
|
10
|
+import { deleteTestLog } from '@/services/test';
|
10
|
11
|
|
11
|
12
|
const VisitList = () => {
|
12
|
13
|
|
13
|
14
|
const [school, setSchool] = useState({});
|
14
|
15
|
const ref = useRef();
|
|
16
|
+ const actionRef = useRef();
|
15
|
17
|
|
16
|
18
|
const handleMedicalClick = useCallback((id) => {
|
17
|
19
|
history.push(id ? `/medical/Test/edit?id=${id}&schoolId=${school?.schoolId}` : `/medical/Test/edit?schoolId=${school?.schoolId}`);
|
|
@@ -21,6 +23,15 @@ const VisitList = () => {
|
21
|
23
|
history.push('/medical/Test/batch')
|
22
|
24
|
}
|
23
|
25
|
|
|
26
|
+ const handleConfirm = (item) => {
|
|
27
|
+ deleteTestLog(item.serialNo).then(() => {
|
|
28
|
+ actionRef.current.reload()
|
|
29
|
+ message.success("删除成功")
|
|
30
|
+ }).catch(() => {
|
|
31
|
+ message.error("操作失败, 请重试")
|
|
32
|
+ })
|
|
33
|
+ }
|
|
34
|
+
|
24
|
35
|
const actions = [
|
25
|
36
|
<Button key="batch" icon={<GroupOutlined />} type="primary" ghost onClick={handleBatch}>
|
26
|
37
|
批量处理
|
|
@@ -68,7 +79,11 @@ const VisitList = () => {
|
68
|
79
|
title: '学号',
|
69
|
80
|
dataIndex: 'studentNo',
|
70
|
81
|
align: 'center',
|
71
|
|
-
|
|
82
|
+ },
|
|
83
|
+ {
|
|
84
|
+ title: '体检编号',
|
|
85
|
+ dataIndex: 'testNo',
|
|
86
|
+ align: 'center',
|
72
|
87
|
},
|
73
|
88
|
{
|
74
|
89
|
title: '姓名',
|
|
@@ -104,6 +119,10 @@ const VisitList = () => {
|
104
|
119
|
<Space size="middle">
|
105
|
120
|
<a href={record.attchment} target="_blank" rel="noreferrer">查看报告</a>
|
106
|
121
|
{/* <a onClick={()=>setA(record.attchment)}>查看报告</a> */}
|
|
122
|
+ <Popconfirm
|
|
123
|
+ title="确认删除数据?"
|
|
124
|
+ onConfirm={() => handleConfirm(record)}
|
|
125
|
+ ><a href="#">删除</a></Popconfirm>
|
107
|
126
|
</Space>
|
108
|
127
|
),
|
109
|
128
|
},
|
|
@@ -122,6 +141,7 @@ const VisitList = () => {
|
122
|
141
|
labelWidth: '4em',
|
123
|
142
|
}}
|
124
|
143
|
toolBarRender={() => actions}
|
|
144
|
+ actionRef={actionRef}
|
125
|
145
|
/>
|
126
|
146
|
</PageContainer>
|
127
|
147
|
);
|