zlisen 4 лет назад
Родитель
Сommit
610886a34b

+ 2
- 2
src/components/Specialty/index.jsx Просмотреть файл

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

+ 2
- 117
src/pages/Medical/Test/Edit/index.js Просмотреть файл

185
             name="attchment"
185
             name="attchment"
186
             label="体检报告"
186
             label="体检报告"
187
             placeholder="请选择体检报告"
187
             placeholder="请选择体检报告"
188
-            extra="支持pdf文件"
189
             // valuePropName="fileList"
188
             // valuePropName="fileList"
190
             rules={[{ required: true, message: '请上传体检报告' }]}
189
             rules={[{ required: true, message: '请上传体检报告' }]}
191
           >
190
           >
210
             >
209
             >
211
               <Button icon={<UploadOutlined />}>点击上传</Button>
210
               <Button icon={<UploadOutlined />}>点击上传</Button>
212
             </Upload>
211
             </Upload>
213
-            {/* <UploadImage /> */}
212
+    
214
           </Form.Item>
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
         </ProForm>
215
         </ProForm>
225
       </Container>
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
     </PageContainer>
218
     </PageContainer>
334
   );
219
   );
335
 };
220
 };

+ 16
- 5
src/pages/Medical/Test/List/index.jsx Просмотреть файл

48
       title: '学校',
48
       title: '学校',
49
       dataIndex: 'schoolId',
49
       dataIndex: 'schoolId',
50
       align: 'center',
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
       title: '学号',
63
       title: '学号',
67
     },
74
     },
68
     {
75
     {
69
       title: '性别',
76
       title: '性别',
70
-      dataIndex: 'sex',
77
+      dataIndex: 'status',
71
       align: 'center',
78
       align: 'center',
72
       hideInSearch: true,
79
       hideInSearch: true,
80
+      valueEnum: {
81
+        1: { text: '男' },
82
+        2: { text: '女' },
83
+      },
73
     },
84
     },
74
     {
85
     {
75
       title: '专业',
86
       title: '专业',
86
       dataIndex: 'createDate',
97
       dataIndex: 'createDate',
87
       align: 'center',
98
       align: 'center',
88
       hideInSearch: true,
99
       hideInSearch: true,
89
-      valueType: 'date',
100
+      valueType: 'dateTime',
90
     },
101
     },
91
     
102
     
92
     {
103
     {
107
     <PageContainer>
118
     <PageContainer>
108
       <ProTable
119
       <ProTable
109
         columns={columns}
120
         columns={columns}
110
-        
121
+        params={{}}
111
         request={queryTable('/testLog')}
122
         request={queryTable('/testLog')}
112
         formRef={ref}
123
         formRef={ref}
113
         rowKey="serialNo"
124
         rowKey="serialNo"

+ 1
- 1
src/pages/Medical/Visit/Edit/index.jsx Просмотреть файл

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

+ 42
- 27
src/pages/Medical/Visit/List/index.jsx Просмотреть файл

12
   const ref = useRef();
12
   const ref = useRef();
13
   const [school, setSchool] = useState({});
13
   const [school, setSchool] = useState({});
14
 
14
 
15
-  const handleMedicalClick = (id) => {
15
+  const handleMedicalClick = (row) => {
16
     console.log(school, 'school');
16
     console.log(school, 'school');
17
     history.push(
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
     </Button>,
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
   const columns = [
55
   const columns = [
56
     {
56
     {
67
     //   valueType: 'select',
67
     //   valueType: 'select',
68
     //   renderFormItem,
68
     //   renderFormItem,
69
     // },
69
     // },
70
+    // {
71
+    //   title: '学校',
72
+    //   dataIndex: 'schoolId',
73
+    //   align: 'center',
74
+    //   render: (_, row) => row.schoolName,
75
+    //   renderFormItem,
76
+    // },
70
     {
77
     {
71
       title: '学校',
78
       title: '学校',
72
       dataIndex: 'schoolId',
79
       dataIndex: 'schoolId',
73
       align: 'center',
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
       align: 'center',
117
       align: 'center',
105
       render: (_, row) => row.specialtyName||'-',
118
       render: (_, row) => row.specialtyName||'-',
106
       renderFormItem: (item, config, form) => {
119
       renderFormItem: (item, config, form) => {
120
+     
107
         const schoolId = form.getFieldValue('schoolId');
121
         const schoolId = form.getFieldValue('schoolId');
122
+    
108
         return <Specialty schoolid={schoolId} disabled={!schoolId}></Specialty>;
123
         return <Specialty schoolid={schoolId} disabled={!schoolId}></Specialty>;
109
       },
124
       },
110
     },
125
     },
123
     // },
138
     // },
124
     {
139
     {
125
       title: '就诊时间',
140
       title: '就诊时间',
126
-      dataIndex: 'recordDate',
141
+      dataIndex: 'createDate',
127
       align: 'center',
142
       align: 'center',
128
       hideInSearch: true,
143
       hideInSearch: true,
129
-      valueType: 'date',
144
+      valueType: 'dateTime',
130
     },
145
     },
131
 
146
 
132
     {
147
     {
136
       hideInSearch: true,
151
       hideInSearch: true,
137
       render: (text, record) => (
152
       render: (text, record) => (
138
         <Space size="middle">
153
         <Space size="middle">
139
-          <a onClick={() => handleMedicalClick(record.serialNo)}>查看报告</a>
154
+          <a onClick={() => handleMedicalClick(record)}>查看报告</a>
140
         </Space>
155
         </Space>
141
       ),
156
       ),
142
     },
157
     },
146
     <PageContainer>
161
     <PageContainer>
147
       <ProTable
162
       <ProTable
148
         columns={columns}
163
         columns={columns}
149
-        request={queryFunc}
164
+        request={queryTable('/medicalLog')}
150
         formRef={ref}
165
         formRef={ref}
151
         rowKey="serialNo"
166
         rowKey="serialNo"
152
         headerTitle="就诊列表"
167
         headerTitle="就诊列表"

+ 7
- 1
src/pages/Student/Student/List/index.jsx Просмотреть файл

38
       dataIndex: 'schoolId',
38
       dataIndex: 'schoolId',
39
       align: 'center',
39
       align: 'center',
40
       render: (_, row) => row.schoolName||"-",
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
       title: '专业',
50
       title: '专业',