|
@@ -1,13 +1,14 @@
|
1
|
|
-import { queryTable } from "@/utils/request";
|
|
1
|
+import { queryTable, queryDict } from "@/utils/request";
|
2
|
2
|
import { PageContainer, ProTable } from "@ant-design/pro-components";
|
3
|
3
|
import { useNavigate, useSearchParams } from "react-router-dom";
|
4
|
4
|
import {
|
5
|
5
|
getCooperationPersonList,
|
6
|
6
|
deletetCooperationPerson,
|
|
7
|
+ getCooperationUnitsList,
|
7
|
8
|
} from "@/services/cooperationUnits";
|
8
|
9
|
|
9
|
10
|
import { Button, message, Popconfirm } from "antd";
|
10
|
|
-import { useRef, useState } from "react";
|
|
11
|
+import { useRef, useEffect } from "react";
|
11
|
12
|
|
12
|
13
|
const GuaranteePersonnelList = (props) => {
|
13
|
14
|
const [searchParams] = useSearchParams();
|
|
@@ -17,19 +18,34 @@ const GuaranteePersonnelList = (props) => {
|
17
|
18
|
const actionRef = useRef();
|
18
|
19
|
const formRef = useRef();
|
19
|
20
|
|
20
|
|
- const handleDelete = (id) => {
|
|
21
|
+ useEffect(() => {
|
21
|
22
|
if (id) {
|
22
|
|
- deletetCooperationPerson(id).then((res) => {
|
23
|
|
- actionRef.current.reload();
|
24
|
|
- });
|
|
23
|
+ console.log(formRef, "formRefformRef");
|
|
24
|
+ formRef?.current?.setFieldValue('orgId', Number(id));
|
|
25
|
+ formRef?.current?.submit();
|
|
26
|
+
|
|
27
|
+ // setTimeout(()=>{
|
|
28
|
+ // actionRef.current.reload();
|
|
29
|
+ // },1000)
|
25
|
30
|
}
|
|
31
|
+ }, [id]);
|
|
32
|
+
|
|
33
|
+ const handleDelete = (id) => {
|
|
34
|
+ console.log(formRef, "formRefformRef");
|
|
35
|
+ // if (id) {
|
|
36
|
+ // deletetCooperationPerson(id).then((res) => {
|
|
37
|
+ // actionRef.current.reload();
|
|
38
|
+ // });
|
|
39
|
+ // }
|
26
|
40
|
};
|
27
|
41
|
|
28
|
42
|
const columns = [
|
29
|
43
|
{
|
30
|
44
|
title: "机构名称",
|
31
|
|
- dataIndex: "orgIdName",
|
32
|
|
- search: false,
|
|
45
|
+ dataIndex: "orgId",
|
|
46
|
+ valueType: "select",
|
|
47
|
+ request: () => queryDict(getCooperationUnitsList)(),
|
|
48
|
+ // search: false,
|
33
|
49
|
},
|
34
|
50
|
{
|
35
|
51
|
title: "姓名",
|
|
@@ -105,10 +121,11 @@ const GuaranteePersonnelList = (props) => {
|
105
|
121
|
<ProTable
|
106
|
122
|
actionRef={actionRef}
|
107
|
123
|
formRef={formRef}
|
108
|
|
- params={{ orgId: id }}
|
|
124
|
+ manualRequest={id}
|
|
125
|
+ // params={{ orgId: id }}
|
109
|
126
|
rowKey="id"
|
110
|
127
|
toolBarRender={() => [
|
111
|
|
- id ? (
|
|
128
|
+
|
112
|
129
|
<Button
|
113
|
130
|
key="2"
|
114
|
131
|
type="primary"
|
|
@@ -118,7 +135,6 @@ const GuaranteePersonnelList = (props) => {
|
118
|
135
|
>
|
119
|
136
|
新增
|
120
|
137
|
</Button>
|
121
|
|
- ) : null,
|
122
|
138
|
]}
|
123
|
139
|
request={queryTable(getCooperationPersonList)}
|
124
|
140
|
columns={columns}
|