|
@@ -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);
|