zlisen преди 4 години
родител
ревизия
ca75e1d688
променени са 5 файла, в които са добавени 162 реда и са изтрити 17 реда
  1. 1
    0
      package.json
  2. 0
    6
      src/common/constants.js
  3. 150
    7
      src/pages/Medical/Visit/Edit/index.jsx
  4. 9
    3
      src/pages/Student/School/List/index.jsx
  5. 2
    1
      src/pages/Student/Student/List/index.jsx

+ 1
- 0
package.json Целия файл

@@ -45,6 +45,7 @@
45 45
   ],
46 46
   "dependencies": {
47 47
     "@ant-design/icons": "^4.0.0",
48
+    "@ant-design/pro-card": "^1.11.10",
48 49
     "@ant-design/pro-descriptions": "^1.2.0",
49 50
     "@ant-design/pro-form": "^1.3.0",
50 51
     "@ant-design/pro-layout": "^6.9.0",

+ 0
- 6
src/common/constants.js Целия файл

@@ -1,6 +0,0 @@
1
-const stateOptions = {
2
-  0: { text: '未上架' },
3
-  1: { text: '已上架' },
4
-};
5
-
6
-export { stateOptions };

+ 150
- 7
src/pages/Medical/Visit/Edit/index.jsx Целия файл

@@ -1,19 +1,162 @@
1
-import React from 'react';
2
-import { connect } from 'umi';
1
+import React, { useState } from 'react';
2
+import { connect, history } from 'umi';
3
+import ProCard from '@ant-design/pro-card';
3 4
 import { PageContainer } from '@ant-design/pro-layout';
5
+import Container from '@/components/Container';
6
+import { Input, Select, Form, Button } from 'antd';
7
+import ProForm, { ProFormText, ProFormTextArea, ProFormSelect } from '@ant-design/pro-form';
8
+import request from '@/utils/request';
4 9
 
5
-const VisitList = () => {
10
+const { Option } = Select;
11
+const { Search } = Input;
12
+const VisitEdit = () => {
13
+  const [list, setList] = useState([]);
14
+  const [searchLoading, setSearchLoading] = useState(false);
6 15
 
16
+  const [form] = Form.useForm();
17
+  // state = {
18
+  //   data: [],
19
+  //   value: undefined,
20
+  // };
7 21
 
8
- 
22
+  // const changeStatus = (hospital) => {
23
+  //   // 0 变 1, 1 变 0
24
+  //   // eslint-disable-next-line no-bitwise
25
+  //   const status = hospital.status ^ 1;
26
+  //   const data = { ...hospital, status }
9 27
 
28
+  //   request(`/hospital/${hospital.hospitalId}`, {
29
+  //     method: 'put',
30
+  //     data,
31
+  //   })
32
+  //     .then(() => {
33
+  //       tableRef.current.reload();
34
+  //       notification.success({ message: '操作成功' });
35
+  //     })
36
+  //     .catch((e) => {
37
+  //       notification.error({ message: e.message });
38
+  //     });
39
+
40
+  // };
41
+
42
+  const onSearch = (value) => {
43
+    if (value) {
44
+      request(`/student/${value}`)
45
+        .then((res) => {
46
+          form.setFieldsValue(res)
47
+        })
48
+        .catch((e) => {});
49
+    } else {
50
+      // this.setState({ data: [] });
51
+    }
52
+  };
53
+
54
+  const handleChange = (value) => {
55
+    // this.setState({ value });
56
+  };
57
+  const handleSubmit = (value) => {
58
+    // this.setState({ value });
59
+  };
10 60
   return (
11
-    <PageContainer>
12
-      234
61
+    <PageContainer
62
+      header={{
63
+        extra: [
64
+          <Button key="1" onClick={() => history.go('-1')}>
65
+            返回
66
+          </Button>,
67
+        ],
68
+      }}
69
+    >
70
+      <Container>
71
+        <ProForm form={form} onFinish={handleSubmit}>
72
+          <ProCard.Group title="就诊信息" bodyStyle={{ padding: 20 }}>
73
+            <Search
74
+              placeholder="请输入学号"
75
+              loading={searchLoading}
76
+              style={{ width: 200 }}
77
+              onSearch={onSearch}
78
+            />
79
+
80
+            <ProFormText
81
+              label="姓名"
82
+              placeholder="输入名称"
83
+              name="name"
84
+              rules={[{ required: true, message: '请填写名称' }]}
85
+            />
86
+
87
+            <ProFormSelect
88
+              options={[
89
+                {
90
+                  value: '6',
91
+                  label: '6%',
92
+                },
93
+                {
94
+                  value: '12',
95
+                  label: '12%',
96
+                },
97
+              ]}
98
+              initialValue="6"
99
+              name="taxRate"
100
+              label="性别"
101
+            />
102
+
103
+            <ProFormText
104
+              label="学号"
105
+              placeholder="输入名称"
106
+              name="name"
107
+              rules={[{ required: true, message: '请填写名称' }]}
108
+            />
109
+
110
+            <ProFormText
111
+              label="联系方式"
112
+              placeholder="输入名称"
113
+              name="name"
114
+              rules={[{ required: true, message: '请填写名称' }]}
115
+            />
116
+
117
+            {/* {list.map((d) => (
118
+              <Option key={d.value}>{d.text}</Option>
119
+            ))} */}
120
+            {/* {options} */}
121
+
122
+            {/* <ProFormSelect
123
+                options={[
124
+                  {
125
+                    value: '6',
126
+                    label: '6%',
127
+                  },
128
+                  {
129
+                    value: '12',
130
+                    label: '12%',
131
+                  },
132
+                ]}
133
+                initialValue="6"
134
+                width="xs"
135
+                name="taxRate"
136
+                label="税率"
137
+              /> */}
138
+          </ProCard.Group>
139
+          <ProCard.Group title="诊断" bodyStyle={{ padding: 20 }}>
140
+            <ProFormText
141
+              label="就诊科室"
142
+              placeholder="输入名称"
143
+              name="name"
144
+              rules={[{ required: true, message: '请填写名称' }]}
145
+            />
146
+
147
+            <ProFormTextArea
148
+              label="诊断报告"
149
+              placeholder="输入简介"
150
+              name="desc"
151
+              rules={[{ required: true, message: '请填写简介' }]}
152
+            />
153
+          </ProCard.Group>
154
+        </ProForm>
155
+      </Container>
13 156
     </PageContainer>
14 157
   );
15 158
 };
16 159
 
17 160
 export default connect((s) => ({
18 161
   typeList: s.post.typeList,
19
-}))(VisitList);
162
+}))(VisitEdit);

+ 9
- 3
src/pages/Student/School/List/index.jsx Целия файл

@@ -66,9 +66,15 @@ const SchoolList = () => {
66 66
       align: 'center',
67 67
       // hideInTable: true,
68 68
       valueType: 'select',
69
-      valueEnum: {
70
-        0: { text: '未上架' },
71
-        1: { text: '已上架' },
69
+      valueEnum:{
70
+        0: {
71
+          text: '已下架',
72
+          status: 'Processing',
73
+        },
74
+        1: {
75
+          text: '已上架',
76
+          status: 'Success',
77
+        },
72 78
       },
73 79
     },
74 80
     {

+ 2
- 1
src/pages/Student/Student/List/index.jsx Целия файл

@@ -38,9 +38,10 @@ const StudentList = () => {
38 38
     },
39 39
     {
40 40
       title: '学校',
41
-      dataIndex: 'schoolName',
41
+      dataIndex: 'schoolId',
42 42
 
43 43
       align: 'center',
44
+
44 45
     },
45 46
     {
46 47
       title: '专业',