zlisen 4 år sedan
förälder
incheckning
610886a34b

+ 2
- 2
src/components/Specialty/index.jsx Visa fil

@@ -20,9 +20,9 @@ export default (props) => {
20 20
 
21 21
   useEffect(() => {
22 22
     if (props.value !== value) {
23
-      console.log('---------');
23
+      console.log(props.value,value,'---------');
24 24
       if (!value) {
25
-        setValue();
25
+        setValue(value);
26 26
       } else {
27 27
         setValue(props.value);
28 28
       }

+ 2
- 117
src/pages/Medical/Test/Edit/index.js Visa fil

@@ -185,7 +185,6 @@ const TestEdit = (props) => {
185 185
             name="attchment"
186 186
             label="体检报告"
187 187
             placeholder="请选择体检报告"
188
-            extra="支持pdf文件"
189 188
             // valuePropName="fileList"
190 189
             rules={[{ required: true, message: '请上传体检报告' }]}
191 190
           >
@@ -210,126 +209,12 @@ const TestEdit = (props) => {
210 209
             >
211 210
               <Button icon={<UploadOutlined />}>点击上传</Button>
212 211
             </Upload>
213
-            {/* <UploadImage /> */}
212
+    
214 213
           </Form.Item>
215 214
 
216
-          {/* <ProFormTextArea
217
-            label="诊断报告"
218
-            placeholder="输入诊断报告"
219
-            name="attchment"
220
-            fieldProps={{ readOnly: !!id, rows: 10 }}
221
-            rules={[{ required: true, message: '请填写诊断报告' }]}
222
-            style={{ width: '100%' }}
223
-          /> */}
224 215
         </ProForm>
225 216
       </Container>
226
-      {/* <Container>
227
-        <ProForm form={form} onFinish={handleSubmit}>
228
-          <ProFormText
229
-            label="姓名"
230
-            placeholder="输入姓名"
231
-            name="title"
232
-            rules={[{ required: true, message: '请填写姓名' }]}
233
-          />
234
-
235
-          <ProFormSelect
236
-            options={[
237
-              {
238
-                value: 1,
239
-                label: '男',
240
-              },
241
-              {
242
-                value: 2,
243
-                label: '女',
244
-              },
245
-            ]}
246
-            name="sex"
247
-            label="性别"
248
-            fieldProps={{ bordered: !id, open: id ? false : undefined }}
249
-            rules={[{ required: true, message: '请选择性别' }]}
250
-          />
251
-
252
-          <ProFormSelect
253
-            label="学校"
254
-            placeholder="请选择学校"
255
-            name="schoolId"
256
-            showSearch
257
-            request={async ({ keyWords }) => {
258
-              // if (keyWords) {
259
-              return request('/school', {
260
-                method: 'get',
261
-                params: { name: keyWords, pageNum: 1, pageSize: 1000 },
262
-              })
263
-                .then((res) => {
264
-                  return res?.records?.map((x) => {
265
-                    return { label: x.name, value: x.schoolId };
266
-                  });
267
-                })
268
-                .catch((e) => {
269
-                  notification.error({ message: e.message });
270
-                  return Promise.reject(e.message);
271
-                });
272
-              // }
273
-            }}
274
-          />
275
-
276
-
277
-          <ProFormDependency name={['schoolId']}>
278
-            {({ schoolId }) => {
279
-              return (
280
-                <ProFormSelect
281
-                  label="专业"
282
-                  placeholder="请选择专业"
283
-                  name="specialtyId"
284
-                  dependencies={['schoolId']}
285
-                  showSearch
286
-                  params={{ schoolId }}
287
-                  disabled={!schoolId}
288
-                  options={specialtyOptions}
289
-                  request={async ({ keyWords, ...params }) => {
290
-                    console.log({ params });
291
-                    if (schoolId) {
292
-                      return request('/specialty', {
293
-                        method: 'get',
294
-                        params: { name: keyWords, ...params, pageNum: 1, pageSize: 1000 },
295
-                      })
296
-                        .then((res) => {
297
-                          return res?.records?.map((x) => {
298
-                            return { label: x.name, value: x.specialtyId };
299
-                          });
300
-                        })
301
-                        .catch((e) => {
302
-                          notification.error({ message: e.message });
303
-                          return Promise.reject(e.message);
304
-                        });
305
-                    }
306
-                  }}
307
-                />
308
-              );
309
-            }}
310
-          </ProFormDependency>
311
-
312
-          
313
-          <ProFormText
314
-            label="学号"
315
-            placeholder="输入学号"
316
-            name="studentNo"
317
-            fieldProps={{ bordered: !id, readOnly: !!id }}
318
-            rules={[{ required: true, message: '请填写学号' }]}
319
-          />
320
-
321
-          <Form.Item
322
-            name="image"
323
-            label="体检报告"
324
-            placeholder="请选择体检报告"
325
-            extra="支持pdf文件"
326
-            rules={[{ required: true, message: '请上传体检报告' }]}
327
-          >
328
-            <UploadImage />
329
-          </Form.Item>
330
-        </ProForm>
331
-      
332
-      </Container> */}
217
+    
333 218
     </PageContainer>
334 219
   );
335 220
 };

+ 16
- 5
src/pages/Medical/Test/List/index.jsx Visa fil

@@ -48,9 +48,16 @@ const VisitList = () => {
48 48
       title: '学校',
49 49
       dataIndex: 'schoolId',
50 50
       align: 'center',
51
-      render: (_, row) => row.schoolName,
52
-      renderFormItem,
51
+      render: (_, row) => row.schoolName||"-",
52
+      renderFormItem: (item, config, form) => (
53
+        <School
54
+          autoDefault={false}
55
+          onChange={(schoolId) => {form.resetFields(['specialtyId']);form.setFieldsValue({ schoolId });}}
56
+          allowClear
57
+        ></School>
58
+      ),
53 59
     },
60
+   
54 61
 
55 62
     {
56 63
       title: '学号',
@@ -67,9 +74,13 @@ const VisitList = () => {
67 74
     },
68 75
     {
69 76
       title: '性别',
70
-      dataIndex: 'sex',
77
+      dataIndex: 'status',
71 78
       align: 'center',
72 79
       hideInSearch: true,
80
+      valueEnum: {
81
+        1: { text: '男' },
82
+        2: { text: '女' },
83
+      },
73 84
     },
74 85
     {
75 86
       title: '专业',
@@ -86,7 +97,7 @@ const VisitList = () => {
86 97
       dataIndex: 'createDate',
87 98
       align: 'center',
88 99
       hideInSearch: true,
89
-      valueType: 'date',
100
+      valueType: 'dateTime',
90 101
     },
91 102
     
92 103
     {
@@ -107,7 +118,7 @@ const VisitList = () => {
107 118
     <PageContainer>
108 119
       <ProTable
109 120
         columns={columns}
110
-        
121
+        params={{}}
111 122
         request={queryTable('/testLog')}
112 123
         formRef={ref}
113 124
         rowKey="serialNo"

+ 1
- 1
src/pages/Medical/Visit/Edit/index.jsx Visa fil

@@ -63,7 +63,7 @@ const VisitEdit = (props) => {
63 63
   };
64 64
 
65 65
   const handleSubmit = (value) => {
66
-    request('/medicalLog', { method: 'post', data: { schoolId, ...value } })
66
+    request('/medicalLog', { method: 'post', data: { schoolId:school, ...value } })
67 67
       .then(() => {
68 68
         notification.success({ message: '新建成功' });
69 69
         history.go('-1');

+ 42
- 27
src/pages/Medical/Visit/List/index.jsx Visa fil

@@ -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="就诊列表"

+ 7
- 1
src/pages/Student/Student/List/index.jsx Visa fil

@@ -38,7 +38,13 @@ const StudentList = () => {
38 38
       dataIndex: 'schoolId',
39 39
       align: 'center',
40 40
       render: (_, row) => row.schoolName||"-",
41
-      renderFormItem: () => <School autoDefault={false} allowClear></School>,
41
+      renderFormItem: (item, config, form) => (
42
+        <School
43
+          autoDefault={false}
44
+          onChange={(schoolId) => {form.resetFields(['specialtyId']);form.setFieldsValue({ schoolId });}}
45
+          allowClear
46
+        ></School>
47
+      ),
42 48
     },
43 49
     {
44 50
       title: '专业',