Bläddra i källkod

Merge branch 'master' of http://git.ycjcjy.com/medical-plat/pc-admin

Your Name 4 år sedan
förälder
incheckning
93032ebd85

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

14
     history.push(id ? `/medical/Test/edit?id=${id}` : '/medical/Test/edit');
14
     history.push(id ? `/medical/Test/edit?id=${id}` : '/medical/Test/edit');
15
   }, []);
15
   }, []);
16
 
16
 
17
-  const actions = [   
18
-    <Button key="button" icon={<PlusOutlined />} type="primary" onClick={() => handleMedicalClick()}>
19
-      新建
20
-    </Button>,
21
-  ];
17
+  // const actions = [   
18
+  //   <Button key="button" icon={<PlusOutlined />} type="primary" onClick={() => handleMedicalClick()}>
19
+  //     新建
20
+  //   </Button>,
21
+  // ];
22
   const columns = [
22
   const columns = [
23
     {
23
     {
24
       title: '就诊编号',
24
       title: '就诊编号',
35
 
35
 
36
     {
36
     {
37
       title: '学号',
37
       title: '学号',
38
-      dataIndex: 'd',
38
+      dataIndex: 'studentNo',
39
       align: 'center',
39
       align: 'center',
40
      
40
      
41
     },
41
     },
42
     {
42
     {
43
       title: '姓名',
43
       title: '姓名',
44
-      dataIndex: 'status',
44
+      dataIndex: 'name',
45
       align: 'center',
45
       align: 'center',
46
       hideInSearch: true,
46
       hideInSearch: true,
47
       // hideInTable: true,
47
       // hideInTable: true,
48
     },
48
     },
49
     {
49
     {
50
       title: '性别',
50
       title: '性别',
51
-      dataIndex: 'status',
51
+      dataIndex: 'sex',
52
       align: 'center',
52
       align: 'center',
53
       hideInSearch: true,
53
       hideInSearch: true,
54
     },
54
     },
55
     {
55
     {
56
       title: '专业',
56
       title: '专业',
57
-      dataIndex: 'status',
57
+      dataIndex: 'specialtyName',
58
       align: 'center',
58
       align: 'center',
59
       // hideInTable: true,
59
       // hideInTable: true,
60
     },
60
     },
61
     {
61
     {
62
       title: '医生',
62
       title: '医生',
63
-      dataIndex: 'createDate',
63
+      dataIndex: 'doctorName',
64
       align: 'center',
64
       align: 'center',
65
       hideInSearch: true,
65
       hideInSearch: true,
66
       valueType: 'date',
66
       valueType: 'date',
67
     },
67
     },
68
-    {
69
-      title: '就诊科室',
70
-      dataIndex: 'createDate',
71
-      align: 'center',
72
-      hideInSearch: true,
68
+    // {
69
+    //   title: '就诊科室',
70
+    //   dataIndex: 'createDate',
71
+    //   align: 'center',
72
+    //   hideInSearch: true,
73
 
73
 
74
-    },
74
+    // },
75
     {
75
     {
76
       title: '创建时间',
76
       title: '创建时间',
77
       dataIndex: 'createDate',
77
       dataIndex: 'createDate',
105
         search={{
105
         search={{
106
           labelWidth: '4em',
106
           labelWidth: '4em',
107
         }}
107
         }}
108
-        toolBarRender={() => actions}
108
+        // toolBarRender={() => actions}
109
       />
109
       />
110
     </PageContainer>
110
     </PageContainer>
111
   );
111
   );

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

6
 import { Input, Form, Button, notification } from 'antd';
6
 import { Input, Form, Button, notification } from 'antd';
7
 import ProForm, { ProFormText, ProFormTextArea, ProFormSelect } from '@ant-design/pro-form';
7
 import ProForm, { ProFormText, ProFormTextArea, ProFormSelect } from '@ant-design/pro-form';
8
 import request from '@/utils/request';
8
 import request from '@/utils/request';
9
+import School from '@/components/School';
9
 
10
 
10
 const { Search } = Input;
11
 const { Search } = Input;
11
 const VisitEdit = (props) => {
12
 const VisitEdit = (props) => {
12
   const { id, schoolId } = props.location.query;
13
   const { id, schoolId } = props.location.query;
13
 
14
 
14
   const [searchLoading, setSearchLoading] = useState(false);
15
   const [searchLoading, setSearchLoading] = useState(false);
15
-
16
+  const [school, setSchool] = useState();
16
   const [form] = Form.useForm();
17
   const [form] = Form.useForm();
17
 
18
 
19
+  // eslint-disable-next-line no-shadow
18
   const getData = (id) => {
20
   const getData = (id) => {
19
     if (id) {
21
     if (id) {
20
-      request(`/student-no/${id}`)
22
+      request(`/student-no/${id}`,{params:{schoolId:school}})
21
         .then((res) => {
23
         .then((res) => {
22
           form.setFieldsValue(res);
24
           form.setFieldsValue(res);
23
           setSearchLoading(false);
25
           setSearchLoading(false);
24
         })
26
         })
25
         .catch((e) => {
27
         .catch((e) => {
26
           setSearchLoading(false);
28
           setSearchLoading(false);
29
+          notification.error({ message: '未找到该学生' })
30
+          form.resetFields()
27
         });
31
         });
28
     } else {
32
     } else {
29
       // this.setState({ data: [] });
33
       // this.setState({ data: [] });
66
         notification.error({ message: e.message });
70
         notification.error({ message: e.message });
67
       });
71
       });
68
   };
72
   };
73
+
74
+  const handleSchoolChange = (value) => {
75
+    setSchool(value)
76
+    console.log(value)
77
+    // request('/medicalLog', { method: 'post', data: { schoolId, ...value } })
78
+    //   .then(() => {
79
+    //     notification.success({ message: '新建成功' });
80
+    //     history.go('-1');
81
+    //   })
82
+    //   .catch((e) => {
83
+    //     notification.error({ message: e.message });
84
+    //   });
85
+  };
86
+
69
   return (
87
   return (
70
     <PageContainer
88
     <PageContainer
71
       header={{
89
       header={{
79
       <Container>
97
       <Container>
80
         <ProForm form={form} submitter={!id} onFinish={handleSubmit}>
98
         <ProForm form={form} submitter={!id} onFinish={handleSubmit}>
81
           {!id && (
99
           {!id && (
82
-            <Search
83
-              placeholder="请输入学号"
84
-              loading={searchLoading}
85
-              style={{ width: 200, marginBottom: '20px' }}
86
-              onSearch={onSearch}
87
-            />
100
+            <ProForm.Group layout="inline">
101
+              <School value={school} onChange={handleSchoolChange} style={{ width: 200, marginBottom: '20px' }} allowClear />
102
+              <Search
103
+                placeholder="请输入学号"
104
+                loading={searchLoading}
105
+                style={{ width: 200, marginBottom: '20px' }}
106
+                onSearch={onSearch}
107
+              />
108
+            </ProForm.Group>
88
           )}
109
           )}
89
           <ProForm.Group layout="inline" title="就诊信息">
110
           <ProForm.Group layout="inline" title="就诊信息">
90
             <ProFormText
111
             <ProFormText

+ 4
- 2
src/pages/Student/Student/Edit/index.jsx Visa fil

45
 
45
 
46
             <Descriptions title="学生信息" style={{ marginBottom: 32 }}>
46
             <Descriptions title="学生信息" style={{ marginBottom: 32 }}>
47
               <Descriptions.Item label="姓名">{data.name}</Descriptions.Item>
47
               <Descriptions.Item label="姓名">{data.name}</Descriptions.Item>
48
-              <Descriptions.Item label="性别">{data.sex === 1 ? '男':'女'}</Descriptions.Item>
48
+              <Descriptions.Item label="性别">
49
+                {data.sex === 1 ? '男' : (data.sex === 2  ?'女':'未知')}
50
+              </Descriptions.Item>
49
               <Descriptions.Item label="积分">{data.personData?.pointNum}</Descriptions.Item>
51
               <Descriptions.Item label="积分">{data.personData?.pointNum}</Descriptions.Item>
50
               <Descriptions.Item label="联系方式">{data.phone}</Descriptions.Item>
52
               <Descriptions.Item label="联系方式">{data.phone}</Descriptions.Item>
51
               <Descriptions.Item label="邮箱">{data.email}</Descriptions.Item>
53
               <Descriptions.Item label="邮箱">{data.email}</Descriptions.Item>
57
             <Descriptions.Item label="学校">{data.schoolName}</Descriptions.Item>
59
             <Descriptions.Item label="学校">{data.schoolName}</Descriptions.Item>
58
             <Descriptions.Item label="专业">{data.specialtyName}</Descriptions.Item>
60
             <Descriptions.Item label="专业">{data.specialtyName}</Descriptions.Item>
59
             <Descriptions.Item label="学界">{data.schoolBatch}</Descriptions.Item>
61
             <Descriptions.Item label="学界">{data.schoolBatch}</Descriptions.Item>
60
-            <Descriptions.Item label="学号">{data.studentId}</Descriptions.Item>
62
+            <Descriptions.Item label="学号">{data.studentNo}</Descriptions.Item>
61
           </Descriptions>
63
           </Descriptions>
62
         </Card>
64
         </Card>
63
       </Container>
65
       </Container>

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

37
       title: '学校',
37
       title: '学校',
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: () => <School autoDefault={false} allowClear></School>,
42
     },
42
     },
43
     {
43
     {
44
       title: '专业',
44
       title: '专业',
45
       dataIndex: 'specialtyId',
45
       dataIndex: 'specialtyId',
46
       align: 'center',
46
       align: 'center',
47
-      render: (_, row) => row.specialtyName,
47
+      render: (_, row) => row.specialtyName||'-',
48
       renderFormItem: (item, config, form) => {
48
       renderFormItem: (item, config, form) => {
49
         const schoolId = form.getFieldValue('schoolId');
49
         const schoolId = form.getFieldValue('schoolId');
50
         return <Specialty schoolid={schoolId} disabled={!schoolId}></Specialty>;
50
         return <Specialty schoolid={schoolId} disabled={!schoolId}></Specialty>;
52
     },
52
     },
53
     {
53
     {
54
       title: '学号',
54
       title: '学号',
55
-      dataIndex: 'studentId',
55
+      dataIndex: 'studentNo',
56
       align: 'center',
56
       align: 'center',
57
     },
57
     },
58
     {
58
     {