fangmingyue 2 年之前
父節點
當前提交
e5948376af
共有 3 個檔案被更改,包括 312 行新增0 行删除
  1. 185
    0
      src/pages/guarantee/edit/index.jsx
  2. 108
    0
      src/pages/guarantee/list/index.jsx
  3. 19
    0
      src/routes/routes.jsx

+ 185
- 0
src/pages/guarantee/edit/index.jsx 查看文件

@@ -0,0 +1,185 @@
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
+          <ProFormFieldSet
83
+            name="addr"
84
+            label="登记年份"
85
+          >
86
+            <ProFormSelect
87
+              width={460}
88
+              valueEnum={{
89
+                taiyuan: '2019',
90
+                hangzho: '2020',
91
+                hangzh: '2021',
92
+                hangz: '2022',
93
+              }}
94
+            />
95
+          </ProFormFieldSet>
96
+          <ProFormText
97
+            name="createPerson"
98
+            label="机构名称"
99
+            width={460}
100
+          />
101
+          <ProFormText
102
+            name="createPerson"
103
+            label="工商注册证号"
104
+            width={460}
105
+          />
106
+          <ProFormText
107
+            name="createPerson"
108
+            label="卫生许可证号"
109
+            width={460}
110
+          />
111
+          <ProFormText
112
+            name="createPerson"
113
+            label="机构名称"
114
+            width={460}
115
+          />
116
+          <ProFormText
117
+            name="createPerson"
118
+            label="供应商联系人"
119
+            width={460}
120
+          />
121
+          <ProFormText
122
+            name="createPerson"
123
+            label="联系电话"
124
+            width={460}
125
+          />
126
+          <ProFormDateRangePicker
127
+            name="timeRange"
128
+            label="签约时间"
129
+            width={460}
130
+          />
131
+          <ProFormSelect
132
+            width={460}
133
+            name="select-multiple"
134
+            label="机构类别"
135
+            valueEnum={{
136
+              red: '生鲜蔬菜类',
137
+              green: '米面粮油类',
138
+              blue: '饮食类',
139
+              reds: '饮水类',
140
+              greens: '住宿类',
141
+              blues: '物资代储类',
142
+              redss: '医疗救助类',
143
+              greenss: '油料类',
144
+              bluess: '道路施救类',
145
+              bluesss: '其他',
146
+            }}
147
+            fieldProps={{
148
+              mode: 'multiple',
149
+            }}
150
+            rules={[
151
+              { type: 'array' },
152
+            ]}
153
+          />
154
+
155
+          <ProFormText
156
+            name="createPerson"
157
+            label="单日机构内膳食供应能力(人次):"
158
+            width={460}
159
+          />
160
+          <ProFormText
161
+            name="createPerson"
162
+            label="单次机构内膳食供应能力(人):"
163
+            width={460}
164
+          />
165
+          <ProFormText
166
+            name="createPerson"
167
+            label="单日远程膳食供应能力(人次):"
168
+            width={460}
169
+          />
170
+          <ProFormText
171
+            name="createPerson"
172
+            label="单次远程膳食供应能力(人):"
173
+            width={460}
174
+          />
175
+          <ProFormText
176
+            name="timeRange"
177
+            label="机构内住宿供应能力(人):"
178
+            width={460}
179
+          />
180
+          <ProFormUploadButton label="机构图片" name="upload" action="upload.do" />
181
+        </ProForm>
182
+      </Card>
183
+    </PageContainer>
184
+  );
185
+};

+ 108
- 0
src/pages/guarantee/list/index.jsx 查看文件

@@ -0,0 +1,108 @@
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 GuaranteeTaskGuarantee = (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: "guaranteeNo",
32
+      search: true,
33
+    },
34
+    {
35
+      title: "机构类别",
36
+      dataIndex: "receiver",
37
+      search: true,
38
+    },
39
+    {
40
+      title: "工商注册证号",
41
+      dataIndex: "dateRange",
42
+      search: false,
43
+    },
44
+    {
45
+      title: "卫生许可证号",
46
+      dataIndex: "address",
47
+      search: false,
48
+    },
49
+    {
50
+      title: "联系人",
51
+      dataIndex: "totalPersonNum",
52
+      search: false,
53
+    },
54
+    {
55
+      title: "联系电话",
56
+      dataIndex: "standard",
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
+          评价
73
+        </Button>,
74
+      ],
75
+    },
76
+  ];
77
+
78
+  return (
79
+    <PageContainer>
80
+      <ProTable
81
+        actionRef={actionRef}
82
+        formRef={formRef}
83
+        postData={(data) => {
84
+          return data.map((x) => ({
85
+            dateRange: [x.startDate, x.endDate],
86
+            ...x,
87
+          }));
88
+        }}
89
+        rowKey="id"
90
+        toolBarRender={() => [
91
+          <Button
92
+            key="2"
93
+            type="primary"
94
+            onClick={() => {
95
+              navigate('/task/guarantee/edit');
96
+            }}
97
+          >
98
+            新增
99
+          </Button>,
100
+        ]}
101
+        // request={queryTable(getGuaranteeTaskList)}
102
+        columns={columns}
103
+      />
104
+    </PageContainer>
105
+  );
106
+};
107
+
108
+export default GuaranteeTaskGuarantee;

+ 19
- 0
src/routes/routes.jsx 查看文件

@@ -18,6 +18,8 @@ import GuaranteeTaskEdit from "@/pages/guaranteeTask/Edit";
18 18
 import GuaranteeTaskPrint from "@/pages/guaranteeTask/print";
19 19
 import GuaranteeTaskEvaluate from "@/pages/evaluate";
20 20
 import GuaranteeTaskEvaluateList from "@/pages/evaluate/evaluateList";
21
+import GuaranteeList from "@/pages/guarantee/list";
22
+import GuaranteeEdit from "@/pages/guarantee/edit";
21 23
 import DishList from "@/pages/dish/list";
22 24
 import DishEdit from "@/pages/dish/edit";
23 25
 import PackageList from "@/pages/package";
@@ -130,6 +132,23 @@ export const authRoutes = [
130 132
           permission: 'guaranteeTask.evaluate.list',
131 133
         },
132 134
       },
135
+      {
136
+        path: "guarantee/list",
137
+        element: <GuaranteeList />,
138
+        meta: {
139
+          title: "社会保障机构",
140
+          // permission: 'guaranteeTask.guarantee',
141
+        },
142
+      },
143
+      {
144
+        path: "guarantee/edit",
145
+        element: <GuaranteeEdit />,
146
+        meta: {
147
+          title: "社会保障机构-信息录入",
148
+          hideInMenu: true,
149
+          // permission: 'guaranteeTask.guarantee',
150
+        },
151
+      },
133 152
     ],
134 153
   },
135 154
   {