|
@@ -0,0 +1,288 @@
|
|
1
|
+import React, { useState, useEffect } from "react";
|
|
2
|
+import { useNavigate } from "react-router-dom";
|
|
3
|
+import {
|
|
4
|
+ Button,
|
|
5
|
+ Row,
|
|
6
|
+ Col,
|
|
7
|
+ Form,
|
|
8
|
+ Input,
|
|
9
|
+ InputNumber,
|
|
10
|
+ Card,
|
|
11
|
+ Checkbox,
|
|
12
|
+} from "antd";
|
|
13
|
+import {
|
|
14
|
+ getSupportCapabilityDetail,
|
|
15
|
+ updateSupportCapability,
|
|
16
|
+} from "@/services/supportCapability";
|
|
17
|
+
|
|
18
|
+const configList = [
|
|
19
|
+ {
|
|
20
|
+ //12个
|
|
21
|
+ title: "常规膳食保障",
|
|
22
|
+ children: [
|
|
23
|
+ {
|
|
24
|
+ name: "dietDaily",
|
|
25
|
+ label: "单日整体膳食供应能力(人次)",
|
|
26
|
+ },
|
|
27
|
+ {
|
|
28
|
+ name: "dietSingle",
|
|
29
|
+ label: "单次整体膳食供应能力(人)",
|
|
30
|
+ },
|
|
31
|
+ {
|
|
32
|
+ name: "dietStationDaily",
|
|
33
|
+ label: "单日站内膳食供应能力(人次)",
|
|
34
|
+ },
|
|
35
|
+ {
|
|
36
|
+ name: "dietStationSingle",
|
|
37
|
+ label: "单次站内膳食供应能力(人)",
|
|
38
|
+ },
|
|
39
|
+ {
|
|
40
|
+ name: "dietRemoteDaily",
|
|
41
|
+ label: "单日远程膳食供应能力(人次)",
|
|
42
|
+ },
|
|
43
|
+ {
|
|
44
|
+ name: "dietRemoteSingle",
|
|
45
|
+ label: "单次远程膳食供应能力(人)",
|
|
46
|
+ },
|
|
47
|
+ {
|
|
48
|
+ name: "dietSocializationDaily",
|
|
49
|
+ label: "单日社会化膳食供应能力(人次)",
|
|
50
|
+ },
|
|
51
|
+ {
|
|
52
|
+ name: "dietSocializationSingle",
|
|
53
|
+ label: "单次社会化膳食供应能力(人)",
|
|
54
|
+ },
|
|
55
|
+ {
|
|
56
|
+ name: "dietTempDailyNum",
|
|
57
|
+ label: "单日临时制膳点数量(个)",
|
|
58
|
+ },
|
|
59
|
+ {
|
|
60
|
+ name: "dietTempSingleNum",
|
|
61
|
+ label: "单次临时制膳点数量(个)",
|
|
62
|
+ },
|
|
63
|
+ {
|
|
64
|
+ name: "dietTempDaily",
|
|
65
|
+ label: "单日临时制膳点供应能力(人次)",
|
|
66
|
+ },
|
|
67
|
+ {
|
|
68
|
+ name: "dietTempSingle",
|
|
69
|
+ label: "单次临时制膳点供应能力(人)",
|
|
70
|
+ },
|
|
71
|
+ ],
|
|
72
|
+ },
|
|
73
|
+ {
|
|
74
|
+ title: "应急膳食保障",
|
|
75
|
+ children: [
|
|
76
|
+ {
|
|
77
|
+ name: "dietDailyEmergency",
|
|
78
|
+ label: "应急单日整体膳食供应能力(人次)",
|
|
79
|
+ key: 13,
|
|
80
|
+ },
|
|
81
|
+ {
|
|
82
|
+ name: "dietSingleEmergency",
|
|
83
|
+ label: "应急单次整体膳食供应能力(人)",
|
|
84
|
+ key: 14,
|
|
85
|
+ },
|
|
86
|
+ {
|
|
87
|
+ name: "dietStationDailyEmergency",
|
|
88
|
+ label: "应急单日站内膳食供应能力(人次)",
|
|
89
|
+ key: 15,
|
|
90
|
+ },
|
|
91
|
+ {
|
|
92
|
+ name: "dietStationSingleEmergency",
|
|
93
|
+ label: "应急单次站内膳食供应能力(人)",
|
|
94
|
+ key: 16,
|
|
95
|
+ },
|
|
96
|
+ {
|
|
97
|
+ name: "dietRemoteDailyEmergency",
|
|
98
|
+ label: "应急单日远程膳食供应能力(人次)",
|
|
99
|
+ key: 17,
|
|
100
|
+ },
|
|
101
|
+ {
|
|
102
|
+ name: "dietRemoteSingleEmergency",
|
|
103
|
+ label: "应急单次远程膳食供应能力(人)",
|
|
104
|
+ key: 18,
|
|
105
|
+ },
|
|
106
|
+ {
|
|
107
|
+ name: "dietSocializationDailyEmergency",
|
|
108
|
+ label: "应急单日社会化膳食供应能力(人次)",
|
|
109
|
+ key: 19,
|
|
110
|
+ },
|
|
111
|
+ {
|
|
112
|
+ name: "dietSocializationSingleEmergency",
|
|
113
|
+ label: "应急单次社会化膳食供应能力(人)",
|
|
114
|
+ key: 20,
|
|
115
|
+ },
|
|
116
|
+ {
|
|
117
|
+ name: "dietTempDailyNumEmergency",
|
|
118
|
+ label: "应急单日临时制膳点数量(个)",
|
|
119
|
+ key: 21,
|
|
120
|
+ },
|
|
121
|
+ {
|
|
122
|
+ name: "dietTempSingleNumEmergency",
|
|
123
|
+ label: "应急单次临时制膳点数量(个)",
|
|
124
|
+ key: 22,
|
|
125
|
+ },
|
|
126
|
+ {
|
|
127
|
+ name: "dietTempDailyEmergency",
|
|
128
|
+ label: "应急单日临时制膳点供应能力(人次)",
|
|
129
|
+ key: 23,
|
|
130
|
+ },
|
|
131
|
+ {
|
|
132
|
+ name: "dietTempSingleEmergency",
|
|
133
|
+ label: "应急单次临时制膳点供应能力(人)",
|
|
134
|
+ key: 24,
|
|
135
|
+ },
|
|
136
|
+ ],
|
|
137
|
+ },
|
|
138
|
+ {
|
|
139
|
+ title: "常规住宿保障",
|
|
140
|
+ children: [
|
|
141
|
+ {
|
|
142
|
+ name: "stayCapability",
|
|
143
|
+ label: "整体住宿供应能力(人)",
|
|
144
|
+ key: 25,
|
|
145
|
+ },
|
|
146
|
+ {
|
|
147
|
+ name: "stayStation",
|
|
148
|
+ label: "站内住宿供应能力(人)",
|
|
149
|
+ key: 26,
|
|
150
|
+ },
|
|
151
|
+ {
|
|
152
|
+ name: "staySocialization",
|
|
153
|
+ label: "社会化住宿供应能力(人)",
|
|
154
|
+ key: 27,
|
|
155
|
+ },
|
|
156
|
+ ],
|
|
157
|
+ },
|
|
158
|
+ {
|
|
159
|
+ title: "应急住宿保障",
|
|
160
|
+ children: [
|
|
161
|
+ {
|
|
162
|
+ name: "stayCapabilityEmergency",
|
|
163
|
+ label: "应急整体住宿供应能力(人)",
|
|
164
|
+ key: 28,
|
|
165
|
+ },
|
|
166
|
+ {
|
|
167
|
+ name: "stayStationEmergency",
|
|
168
|
+ label: "应急站内住宿供应能力(人)",
|
|
169
|
+ key: 29,
|
|
170
|
+ },
|
|
171
|
+ {
|
|
172
|
+ name: "staySocializationEmergency",
|
|
173
|
+ label: "应急社会化住宿供应能力(人)",
|
|
174
|
+ key: 30,
|
|
175
|
+ },
|
|
176
|
+ ],
|
|
177
|
+ },
|
|
178
|
+ {
|
|
179
|
+ title: "运输送出保障车辆",
|
|
180
|
+ children: [
|
|
181
|
+ {
|
|
182
|
+ name: "cartNum",
|
|
183
|
+ label: "车辆总数(台)",
|
|
184
|
+ key: 31,
|
|
185
|
+ },
|
|
186
|
+ {
|
|
187
|
+ name: "cookingCart",
|
|
188
|
+ label: "野外自行式炊事车(台)",
|
|
189
|
+ key: 32,
|
|
190
|
+ },
|
|
191
|
+ {
|
|
192
|
+ name: "transportVehicle",
|
|
193
|
+ label: "送餐车(台)",
|
|
194
|
+ key: 33,
|
|
195
|
+ },
|
|
196
|
+ ],
|
|
197
|
+ },
|
|
198
|
+ {
|
|
199
|
+ title: "物资保障",
|
|
200
|
+ children: [
|
|
201
|
+ {
|
|
202
|
+ name: "supportCapability",
|
|
203
|
+ label: "物资供应能力(人)",
|
|
204
|
+ key: 34,
|
|
205
|
+ },
|
|
206
|
+ ],
|
|
207
|
+ },
|
|
208
|
+];
|
|
209
|
+
|
|
210
|
+export default (props) => {
|
|
211
|
+
|
|
212
|
+ const [form] = Form.useForm();
|
|
213
|
+
|
|
214
|
+ const [loading, setLoading] = useState(false);
|
|
215
|
+
|
|
216
|
+ const onFinish = (values) => {
|
|
217
|
+ setLoading(true);
|
|
218
|
+ updateSupportCapability(1, {
|
|
219
|
+ ...values,
|
|
220
|
+ serviceCapability: values.serviceCapability
|
|
221
|
+ ? values.serviceCapability?.join(",")
|
|
222
|
+ : null,
|
|
223
|
+ })
|
|
224
|
+ .then((res) => {
|
|
225
|
+ setLoading(false);
|
|
226
|
+ })
|
|
227
|
+ .catch(() => {});
|
|
228
|
+ };
|
|
229
|
+
|
|
230
|
+ useEffect(() => {
|
|
231
|
+ getSupportCapabilityDetail(1).then((res) => {
|
|
232
|
+ console.log(res, "getSupportCapabilityDetail");
|
|
233
|
+ if (res) {
|
|
234
|
+ form.setFieldsValue({
|
|
235
|
+ ...res,
|
|
236
|
+ serviceCapability: res.serviceCapability
|
|
237
|
+ ? res.serviceCapability?.split(",")
|
|
238
|
+ : null,
|
|
239
|
+ });
|
|
240
|
+ }
|
|
241
|
+ });
|
|
242
|
+ }, [form]);
|
|
243
|
+
|
|
244
|
+ return (
|
|
245
|
+ <Card>
|
|
246
|
+ <Form layout="vertical" form={form} onFinish={onFinish}>
|
|
247
|
+ {configList?.map((x, index1) => (
|
|
248
|
+ <div key={index1}>
|
|
249
|
+ <h3 style={{ marginBottom: "1.5em", fontWeight: 700 }}>
|
|
250
|
+ {x.title}
|
|
251
|
+ </h3>
|
|
252
|
+ <Row gutter={48}>
|
|
253
|
+ {x?.children?.map((item, index2) => (
|
|
254
|
+ <Col span={6} key={index2}>
|
|
255
|
+ <Form.Item label={item.label} name={item.name}>
|
|
256
|
+ <InputNumber style={{ width: "100%" }} precision={0} />
|
|
257
|
+ </Form.Item>
|
|
258
|
+ </Col>
|
|
259
|
+ ))}
|
|
260
|
+ </Row>
|
|
261
|
+ </div>
|
|
262
|
+ ))}
|
|
263
|
+ <h3 style={{ marginBottom: "1.5em", fontWeight: 700 }}>服务能力</h3>
|
|
264
|
+ <Form.Item name="serviceCapability">
|
|
265
|
+ <Checkbox.Group
|
|
266
|
+ options={[
|
|
267
|
+ "洗澡",
|
|
268
|
+ "WIFI",
|
|
269
|
+ "电脑",
|
|
270
|
+ "报纸/图书",
|
|
271
|
+ "手机充电",
|
|
272
|
+ "代购",
|
|
273
|
+ "休息",
|
|
274
|
+ ]}
|
|
275
|
+ />
|
|
276
|
+ </Form.Item>
|
|
277
|
+ <Row gutter={48}>
|
|
278
|
+ <Col offset={6} span={12}>
|
|
279
|
+ <Button type="primary" htmlType="submit" loading={loading}>
|
|
280
|
+ 提交
|
|
281
|
+ </Button>
|
|
282
|
+
|
|
283
|
+ </Col>
|
|
284
|
+ </Row>
|
|
285
|
+ </Form>
|
|
286
|
+ </Card>
|
|
287
|
+ );
|
|
288
|
+};
|