fangmingyue hace 2 años
padre
commit
14ebb0847c

+ 2
- 2
src/pages/guarantee/list/index.jsx Ver fichero

@@ -5,7 +5,7 @@ import { Link, useNavigate } from "react-router-dom";
5 5
 import { Button, message, Popconfirm } from "antd";
6 6
 import { useRef, useState } from "react";
7 7
 
8
-const GuaranteeTaskGuarantee = (props) => {
8
+const GuaranteeList = (props) => {
9 9
   const navigate = useNavigate();
10 10
   const [isOpen, setIsOpen] = useState(false);
11 11
   const [modalData, setModalData] = useState({});
@@ -105,4 +105,4 @@ const GuaranteeTaskGuarantee = (props) => {
105 105
   );
106 106
 };
107 107
 
108
-export default GuaranteeTaskGuarantee;
108
+export default GuaranteeList;

+ 135
- 0
src/pages/guarantee/personnel/edit/index.jsx Ver fichero

@@ -0,0 +1,135 @@
1
+import {
2
+  PageContainer,
3
+  ProForm,
4
+  ProFormSelect,
5
+  ProFormText,
6
+  ProFormFieldSet,
7
+  ProFormDateRangePicker,
8
+  ProFormUploadButton,
9
+} from "@ant-design/pro-components";
10
+import { useNavigate, useSearchParams } from "react-router-dom";
11
+import { Card, Col, Row, Space } from "antd";
12
+import { useEffect, useRef } from "react";
13
+
14
+export default (props) => {
15
+  const [searchParams] = useSearchParams();
16
+  const id = searchParams.get("id");
17
+  const navigate = useNavigate();
18
+
19
+  const formRef = useRef();
20
+  // useEffect(() => {
21
+  //   if (id) {
22
+  //     getPostsDetail(id).then((res) => {
23
+  //       formRef.current.setFieldsValue({
24
+  //         ...res,
25
+  //         filesList: res.filesList?.map((x) => x.fileAddr)[0] || null,
26
+  //       });
27
+  //     });
28
+  //   }
29
+  // }, [id]);
30
+
31
+  // const onFinish = async (values) => {
32
+  //   console.log(values);
33
+
34
+  //   savePosts({
35
+  //     ...values,
36
+  //     type: 'regulation',
37
+  //     filesList: values.filesList
38
+  //       ? [
39
+  //         {
40
+  //           fileAddr: values.filesList,
41
+  //           fileName: values.filesList?.substring(
42
+  //             values.filesList?.lastIndexOf("/") + 1
43
+  //           ),
44
+  //         },
45
+  //       ]
46
+  //       : null,
47
+  //     status: Number(values.status),
48
+  //     ...(id ? { id } : {}),
49
+  //   }).then((res) => {
50
+  //     navigate(-1);
51
+  //   });
52
+
53
+  //   return false;
54
+  // };
55
+
56
+  return (
57
+    <PageContainer>
58
+      <Card>
59
+        <ProForm
60
+          formRef={formRef}
61
+          layout={"horizontal"}
62
+          labelCol={{ span: 8 }}
63
+          wrapperCol={{ span: 12 }}
64
+          // onFinish={onFinish}
65
+          initialValues={{ status: 0 }}
66
+          submitter={{
67
+            searchConfig: {
68
+              resetText: "返回",
69
+            },
70
+            onReset: () => navigate(-1),
71
+            render: (props, doms) => {
72
+              return (
73
+                <Row>
74
+                  <Col span={8} offset={8}>
75
+                    <Space>{doms}</Space>
76
+                  </Col>
77
+                </Row>
78
+              );
79
+            },
80
+          }}
81
+        >
82
+          <ProFormText
83
+            name="createPerson"
84
+            label="姓名"
85
+            width={460}
86
+          />
87
+          <ProFormText
88
+            name="createPerson"
89
+            label="身份证号"
90
+            width={460}
91
+          />
92
+          <ProFormText
93
+            name="createPerson"
94
+            label="名族"
95
+            width={460}
96
+          />
97
+          <ProFormText
98
+            name="createPerson"
99
+            label="政治面貌"
100
+            width={460}
101
+          />
102
+          <ProFormText
103
+            name="createPerson"
104
+            label="联系电话"
105
+            width={460}
106
+          />
107
+          <ProFormSelect
108
+            name="status"
109
+            label="是否有健康证"
110
+            width={460}
111
+            options={[
112
+              {
113
+                value: 0,
114
+                label: "--请选择--",
115
+              },
116
+              {
117
+                value: 1,
118
+                label: "是",
119
+              },
120
+              {
121
+                value: 2,
122
+                label: "否",
123
+              },
124
+            ]}
125
+          />
126
+          <ProFormText
127
+            name="createPerson"
128
+            label="家庭住址"
129
+            width={460}
130
+          />
131
+        </ProForm>
132
+      </Card>
133
+    </PageContainer>
134
+  );
135
+};

+ 107
- 0
src/pages/guarantee/personnel/list/index.jsx Ver fichero

@@ -0,0 +1,107 @@
1
+import { queryTable } from "@/utils/request";
2
+import { PageContainer, ProTable } from "@ant-design/pro-components";
3
+import { Link, useNavigate } from "react-router-dom";
4
+
5
+import { Button, message, Popconfirm } from "antd";
6
+import { useRef, useState } from "react";
7
+
8
+const GuaranteePersonnelList = (props) => {
9
+  const navigate = useNavigate();
10
+  const [isOpen, setIsOpen] = useState(false);
11
+  const [modalData, setModalData] = useState({});
12
+  const actionRef = useRef();
13
+  const formRef = useRef();
14
+
15
+  // const handleDelete = (id) => {
16
+  //   if (id) {
17
+  //     deleteGuaranteeTask(id).then((res) => {
18
+  //       actionRef.current.reload();
19
+  //     });
20
+  //   }
21
+  // };
22
+
23
+  const onCancel = () => {
24
+    setIsOpen(false);
25
+    setModalData({});
26
+  };
27
+
28
+  const columns = [
29
+    {
30
+      title: "机构名称",
31
+      dataIndex: "guaranteeN",
32
+      search: false,
33
+    },
34
+    {
35
+      title: "姓名",
36
+      dataIndex: "receive",
37
+      search: true,
38
+    },
39
+    {
40
+      title: "性别",
41
+      dataIndex: "dateRang",
42
+      search: false,
43
+    },
44
+    {
45
+      title: "名族",
46
+      dataIndex: "addres",
47
+      search: false,
48
+    },
49
+    {
50
+      title: "联系人",
51
+      dataIndex: "aa",
52
+      search: false,
53
+    },
54
+    {
55
+      title: "身份证号",
56
+      dataIndex: "standar",
57
+      search: false,
58
+    },
59
+    {
60
+      title: "操作",
61
+      valueType: "option",
62
+      width: 200,
63
+      render: (_, record) => [
64
+        <Button
65
+          key={2}
66
+          style={{ padding: 0 }}
67
+          type="link"
68
+          onClick={() => {
69
+            // navigate(`/task/evaluate/list?id=${record.id}`);
70
+          }}
71
+        >
72
+        </Button>,
73
+      ],
74
+    },
75
+  ];
76
+
77
+  return (
78
+    <PageContainer>
79
+      <ProTable
80
+        actionRef={actionRef}
81
+        formRef={formRef}
82
+        postData={(data) => {
83
+          return data.map((x) => ({
84
+            dateRange: [x.startDate, x.endDate],
85
+            ...x,
86
+          }));
87
+        }}
88
+        rowKey="id"
89
+        toolBarRender={() => [
90
+          <Button
91
+            key="2"
92
+            type="primary"
93
+            onClick={() => {
94
+              navigate('/task/guarantee/personnel/edit');
95
+            }}
96
+          >
97
+            新增
98
+          </Button>,
99
+        ]}
100
+        // request={queryTable(getGuaranteeTaskList)}
101
+        columns={columns}
102
+      />
103
+    </PageContainer>
104
+  );
105
+};
106
+
107
+export default GuaranteePersonnelList;

+ 19
- 0
src/routes/routes.jsx Ver fichero

@@ -20,6 +20,8 @@ import GuaranteeTaskEvaluate from "@/pages/evaluate";
20 20
 import GuaranteeTaskEvaluateList from "@/pages/evaluate/evaluateList";
21 21
 import GuaranteeList from "@/pages/guarantee/list";
22 22
 import GuaranteeEdit from "@/pages/guarantee/edit";
23
+import GuaranteePersonnelList from "@/pages/guarantee/personnel/list";
24
+import GuaranteePersonnelEdit from "@/pages/guarantee/personnel/edit";
23 25
 import DishList from "@/pages/dish/list";
24 26
 import DishEdit from "@/pages/dish/edit";
25 27
 import PackageList from "@/pages/package";
@@ -150,6 +152,23 @@ export const authRoutes = [
150 152
           // permission: 'guaranteeTask.guarantee',
151 153
         },
152 154
       },
155
+      {
156
+        path: "guarantee/personnel/list",
157
+        element: <GuaranteePersonnelList />,
158
+        meta: {
159
+          title: "社会保障机构-人员管理",
160
+          // permission: 'guaranteeTask.guarantee',
161
+        },
162
+      },
163
+      {
164
+        path: "guarantee/personnel/edit",
165
+        element: <GuaranteePersonnelEdit />,
166
+        meta: {
167
+          title: "人员管理-信息录入",
168
+          hideInMenu: true,
169
+          // permission: 'guaranteeTask.guarantee',
170
+        },
171
+      },
153 172
       {
154 173
         path: "supportability",
155 174
         element: <Supportability />,