|
@@ -13,6 +13,7 @@ import {
|
13
|
13
|
savetCooperationUnits,
|
14
|
14
|
updatetCooperationUnits,
|
15
|
15
|
} from "@/services/cooperationUnits";
|
|
16
|
+import UploadFileList from "@/components/UploadFileList";
|
16
|
17
|
|
17
|
18
|
export default (props) => {
|
18
|
19
|
const [searchParams] = useSearchParams();
|
|
@@ -27,35 +28,41 @@ export default (props) => {
|
27
|
28
|
...res,
|
28
|
29
|
timeRange: [res.startDate, res.endDate],
|
29
|
30
|
orgType: res?.orgType?.split(","),
|
|
31
|
+ fileList:
|
|
32
|
+ res?.fileList?.map((x) => ({
|
|
33
|
+ url: x.fileAddr,
|
|
34
|
+ name: x.fileName,
|
|
35
|
+ uid: x.id,
|
|
36
|
+ ...x,
|
|
37
|
+ })) || null,
|
30
|
38
|
});
|
31
|
39
|
});
|
32
|
40
|
}
|
33
|
41
|
}, [id]);
|
34
|
42
|
|
35
|
43
|
const onFinish = async (values) => {
|
36
|
|
- console.log(values);
|
37
|
44
|
|
38
|
|
- if (id) {
|
39
|
|
- updatetCooperationUnits(id, {
|
40
|
|
- ...values,
|
|
45
|
+ const { timeRange = [], ...otherValues } = values;
|
41
|
46
|
|
42
|
|
- orgType: values.orgType ? values.orgType?.join(",") : null,
|
43
|
|
- startDate: values.timeRange ? values.timeRange[0] : null,
|
44
|
|
- endDate: values.timeRange ? values.timeRange[1] : null,
|
45
|
|
- }).then((res) => {
|
46
|
|
- navigate(-1);
|
47
|
|
- });
|
48
|
|
- } else {
|
49
|
|
- savetCooperationUnits({
|
50
|
|
- ...values,
|
|
47
|
+ savetCooperationUnits({
|
|
48
|
+ ...otherValues,
|
51
|
49
|
|
52
|
|
- orgType: values.orgType ? values.orgType?.join(",") : null,
|
53
|
|
- startDate: values.timeRange ? values.timeRange[0] : null,
|
54
|
|
- endDate: values.timeRange ? values.timeRange[1] : null,
|
55
|
|
- }).then((res) => {
|
56
|
|
- navigate(-1);
|
57
|
|
- });
|
58
|
|
- }
|
|
50
|
+ orgType: values.orgType ? values.orgType?.join(",") : null,
|
|
51
|
+ startDate: timeRange[0] ? timeRange[0] : null,
|
|
52
|
+ endDate: timeRange[1] ? timeRange[1] : null,
|
|
53
|
+ fileList:
|
|
54
|
+ values?.fileList?.length > 0
|
|
55
|
+ ? values?.fileList?.map((x) => ({
|
|
56
|
+ fileName: x?.name,
|
|
57
|
+ fileAddr: x?.url,
|
|
58
|
+ id:x.id||null,
|
|
59
|
+ orgId:id ? Number(id) : null,
|
|
60
|
+ }))
|
|
61
|
+ : null,
|
|
62
|
+ id: id ? Number(id) : null,
|
|
63
|
+ }).then((res) => {
|
|
64
|
+ navigate(-1);
|
|
65
|
+ });
|
59
|
66
|
};
|
60
|
67
|
|
61
|
68
|
return (
|
|
@@ -84,12 +91,16 @@ export default (props) => {
|
84
|
91
|
},
|
85
|
92
|
}}
|
86
|
93
|
>
|
87
|
|
- <ProFormText name="name" label="机构名称" width={460} rules={[{ required: true, message: '请输入机构名称' }]}/>
|
|
94
|
+ <ProFormText
|
|
95
|
+ name="name"
|
|
96
|
+ label="机构名称"
|
|
97
|
+ width={460}
|
|
98
|
+ rules={[{ required: true, message: "请输入机构名称" }]}
|
|
99
|
+ />
|
88
|
100
|
<ProFormText
|
89
|
101
|
name="businessLicense"
|
90
|
102
|
label="工商注册证号"
|
91
|
103
|
width={460}
|
92
|
|
-
|
93
|
104
|
/>
|
94
|
105
|
<ProFormText name="hygieneLicense" label="卫生许可证号" width={460} />
|
95
|
106
|
|
|
@@ -145,6 +156,9 @@ export default (props) => {
|
145
|
156
|
label="机构内住宿供应能力(人)"
|
146
|
157
|
width={460}
|
147
|
158
|
/>
|
|
159
|
+ <ProForm.Item name="fileList" label="文件">
|
|
160
|
+ <UploadFileList preview={true} multiple={true}></UploadFileList>
|
|
161
|
+ </ProForm.Item>
|
148
|
162
|
</ProForm>
|
149
|
163
|
</Card>
|
150
|
164
|
</PageContainer>
|