|
@@ -7,6 +7,7 @@ import { Input, Form, Button, notification } from 'antd';
|
7
|
7
|
import ProForm, { ProFormText, ProFormTextArea, ProFormSelect } from '@ant-design/pro-form';
|
8
|
8
|
import request from '@/utils/request';
|
9
|
9
|
import School from '@/components/School';
|
|
10
|
+import Specialty from '@/components/Specialty'
|
10
|
11
|
|
11
|
12
|
const { Search } = Input;
|
12
|
13
|
const VisitEdit = (props) => {
|
|
@@ -14,6 +15,7 @@ const VisitEdit = (props) => {
|
14
|
15
|
|
15
|
16
|
const [searchLoading, setSearchLoading] = useState(false);
|
16
|
17
|
const [school, setSchool] = useState();
|
|
18
|
+ const [specialtyId, setSpecialtyId] = useState()
|
17
|
19
|
const [searchValue, setSearchValue] = useState();
|
18
|
20
|
|
19
|
21
|
const [form] = Form.useForm();
|
|
@@ -63,7 +65,12 @@ const VisitEdit = (props) => {
|
63
|
65
|
};
|
64
|
66
|
|
65
|
67
|
const handleSubmit = (value) => {
|
66
|
|
- request('/medicalLog', { method: 'post', data: { schoolId:school, ...value } })
|
|
68
|
+ if (!specialtyId) {
|
|
69
|
+ notification.warn({ message: '请选择专业' })
|
|
70
|
+ return;
|
|
71
|
+ }
|
|
72
|
+
|
|
73
|
+ request('/medicalLog', { method: 'post', data: { schoolId: school, specialtyId, ...value } })
|
67
|
74
|
.then(() => {
|
68
|
75
|
notification.success({ message: '新建成功' });
|
69
|
76
|
history.go('-1');
|
|
@@ -77,7 +84,6 @@ const VisitEdit = (props) => {
|
77
|
84
|
setSchool(value)
|
78
|
85
|
setSearchValue('')
|
79
|
86
|
form.resetFields()
|
80
|
|
-
|
81
|
87
|
};
|
82
|
88
|
|
83
|
89
|
return (
|
|
@@ -106,6 +112,16 @@ const VisitEdit = (props) => {
|
106
|
112
|
</ProForm.Group>
|
107
|
113
|
)}
|
108
|
114
|
<ProForm.Group layout="inline" title="就诊信息">
|
|
115
|
+ <Form.Item label="专业" required>
|
|
116
|
+ <Specialty
|
|
117
|
+ value={specialtyId}
|
|
118
|
+ schoolid={schoolId || school}
|
|
119
|
+ onChange={(x) => setSpecialtyId(x)}
|
|
120
|
+ style={{ minWidth: '150px' }}
|
|
121
|
+ placeholder="请选择专业"
|
|
122
|
+ />
|
|
123
|
+ </Form.Item>
|
|
124
|
+
|
109
|
125
|
<ProFormText
|
110
|
126
|
label="姓名"
|
111
|
127
|
placeholder="输入名称"
|