|
@@ -12,12 +12,12 @@ const VisitList = () => {
|
12
|
12
|
const ref = useRef();
|
13
|
13
|
const [school, setSchool] = useState({});
|
14
|
14
|
|
15
|
|
- const handleMedicalClick = (id) => {
|
|
15
|
+ const handleMedicalClick = (row) => {
|
16
|
16
|
console.log(school, 'school');
|
17
|
17
|
history.push(
|
18
|
|
- id
|
19
|
|
- ? `/medical/visit/edit?id=${id}&schoolId=${school?.schoolId}`
|
20
|
|
- : `/medical/visit/edit?schoolId=${school?.schoolId}`,
|
|
18
|
+ row
|
|
19
|
+ ? `/medical/visit/edit?id=${row?.serialNo}&schoolId=${row?.schoolId}`
|
|
20
|
+ : `/medical/visit/edit`,
|
21
|
21
|
);
|
22
|
22
|
};
|
23
|
23
|
|
|
@@ -32,25 +32,25 @@ const VisitList = () => {
|
32
|
32
|
</Button>,
|
33
|
33
|
];
|
34
|
34
|
|
35
|
|
- const queryFunc = (params, page, sort, filter) => {
|
36
|
|
- if (!school.schoolId) {
|
37
|
|
- return Promise.resolve({ data: [], success: true, total: 0 });
|
38
|
|
- }
|
39
|
|
- console.log(school, 'queryFunc');
|
40
|
|
- const newParams = { ...params, schoolId: school.schoolId };
|
41
|
|
- return queryTable('/medicalLog')(newParams, page, sort, filter);
|
42
|
|
- };
|
|
35
|
+ // const queryFunc = (params, page, sort, filter) => {
|
|
36
|
+ // if (!school.schoolId) {
|
|
37
|
+ // return Promise.resolve({ data: [], success: true, total: 0 });
|
|
38
|
+ // }
|
|
39
|
+ // console.log(school, 'queryFunc');
|
|
40
|
+ // const newParams = { ...params, schoolId: school.schoolId };
|
|
41
|
+ // return queryTable('/medicalLog')(newParams, page, sort, filter);
|
|
42
|
+ // };
|
43
|
43
|
|
44
|
|
- const renderFormItem = (item, config, form) => {
|
45
|
|
- const handleSchoolChange = (schoolId, schoolInfo) => {
|
46
|
|
- form.setFieldsValue({ schoolId });
|
47
|
|
- form.submit();
|
48
|
|
- console.log(schoolInfo, 'schoolInfo');
|
49
|
|
- setSchool({ ...schoolInfo });
|
50
|
|
- };
|
|
44
|
+ // const renderFormItem = (item, config, form) => {
|
|
45
|
+ // const handleSchoolChange = (schoolId, schoolInfo) => {
|
|
46
|
+ // form.setFieldsValue({ schoolId });
|
|
47
|
+ // form.submit();
|
|
48
|
+ // console.log(schoolInfo, 'schoolInfo');
|
|
49
|
+ // setSchool({ ...schoolInfo });
|
|
50
|
+ // };
|
51
|
51
|
|
52
|
|
- return <School onChange={handleSchoolChange} allowClear />;
|
53
|
|
- };
|
|
52
|
+ // return <School onChange={handleSchoolChange} allowClear />;
|
|
53
|
+ // };
|
54
|
54
|
|
55
|
55
|
const columns = [
|
56
|
56
|
{
|
|
@@ -67,12 +67,25 @@ const VisitList = () => {
|
67
|
67
|
// valueType: 'select',
|
68
|
68
|
// renderFormItem,
|
69
|
69
|
// },
|
|
70
|
+ // {
|
|
71
|
+ // title: '学校',
|
|
72
|
+ // dataIndex: 'schoolId',
|
|
73
|
+ // align: 'center',
|
|
74
|
+ // render: (_, row) => row.schoolName,
|
|
75
|
+ // renderFormItem,
|
|
76
|
+ // },
|
70
|
77
|
{
|
71
|
78
|
title: '学校',
|
72
|
79
|
dataIndex: 'schoolId',
|
73
|
80
|
align: 'center',
|
74
|
|
- render: (_, row) => row.schoolName,
|
75
|
|
- renderFormItem,
|
|
81
|
+ render: (_, row) => row.schoolName||"-",
|
|
82
|
+ renderFormItem: (item, config, form) => (
|
|
83
|
+ <School
|
|
84
|
+ autoDefault={false}
|
|
85
|
+ onChange={(schoolId) => {form.resetFields(['specialtyId']);form.setFieldsValue({ schoolId });}}
|
|
86
|
+ allowClear
|
|
87
|
+ ></School>
|
|
88
|
+ ),
|
76
|
89
|
},
|
77
|
90
|
|
78
|
91
|
{
|
|
@@ -104,7 +117,9 @@ const VisitList = () => {
|
104
|
117
|
align: 'center',
|
105
|
118
|
render: (_, row) => row.specialtyName||'-',
|
106
|
119
|
renderFormItem: (item, config, form) => {
|
|
120
|
+
|
107
|
121
|
const schoolId = form.getFieldValue('schoolId');
|
|
122
|
+
|
108
|
123
|
return <Specialty schoolid={schoolId} disabled={!schoolId}></Specialty>;
|
109
|
124
|
},
|
110
|
125
|
},
|
|
@@ -123,10 +138,10 @@ const VisitList = () => {
|
123
|
138
|
// },
|
124
|
139
|
{
|
125
|
140
|
title: '就诊时间',
|
126
|
|
- dataIndex: 'recordDate',
|
|
141
|
+ dataIndex: 'createDate',
|
127
|
142
|
align: 'center',
|
128
|
143
|
hideInSearch: true,
|
129
|
|
- valueType: 'date',
|
|
144
|
+ valueType: 'dateTime',
|
130
|
145
|
},
|
131
|
146
|
|
132
|
147
|
{
|
|
@@ -136,7 +151,7 @@ const VisitList = () => {
|
136
|
151
|
hideInSearch: true,
|
137
|
152
|
render: (text, record) => (
|
138
|
153
|
<Space size="middle">
|
139
|
|
- <a onClick={() => handleMedicalClick(record.serialNo)}>查看报告</a>
|
|
154
|
+ <a onClick={() => handleMedicalClick(record)}>查看报告</a>
|
140
|
155
|
</Space>
|
141
|
156
|
),
|
142
|
157
|
},
|
|
@@ -146,7 +161,7 @@ const VisitList = () => {
|
146
|
161
|
<PageContainer>
|
147
|
162
|
<ProTable
|
148
|
163
|
columns={columns}
|
149
|
|
- request={queryFunc}
|
|
164
|
+ request={queryTable('/medicalLog')}
|
150
|
165
|
formRef={ref}
|
151
|
166
|
rowKey="serialNo"
|
152
|
167
|
headerTitle="就诊列表"
|