浏览代码

Merge branch 'v2' of http://git.ycjcjy.com/yunzhi/crm_pc into v2

fangmingyue 1年前
父节点
当前提交
2bbf0d7af7
共有 1 个文件被更改,包括 33 次插入32 次删除
  1. 33
    32
      src/pages/custom/index.jsx

+ 33
- 32
src/pages/custom/index.jsx 查看文件

1
-import React from 'react'
2
-import { useNavigate } from 'react-router-dom'
3
-import { Button, Popconfirm, message } from 'antd'
4
-import { ProTable } from '@ant-design/pro-components'
5
-import { queryTable } from '@/utils/request'
6
-import { getTaCustom, deleteTaCustom } from '@/services/taCustom'
7
-import Page from '@/components/Page'
1
+import React, { useEffect } from "react";
2
+import { useNavigate } from "react-router-dom";
3
+import { Button, Popconfirm, message } from "antd";
4
+import { ProTable } from "@ant-design/pro-components";
5
+import { queryTable } from "@/utils/request";
6
+import { getTaCustom, deleteTaCustom } from "@/services/taCustom";
7
+import Page from "@/components/Page";
8
 
8
 
9
-const customList = queryTable(getTaCustom)
9
+const customList = queryTable(getTaCustom);
10
 
10
 
11
 export default (props) => {
11
 export default (props) => {
12
-  const actionRef = React.useRef()
13
-  const navigate = useNavigate()
12
+  const actionRef = React.useRef();
13
+  const navigate = useNavigate();
14
 
14
 
15
   const handleDelete = (id) => {
15
   const handleDelete = (id) => {
16
     if (id) {
16
     if (id) {
17
       deleteTaCustom(id).then((res) => {
17
       deleteTaCustom(id).then((res) => {
18
-        actionRef.current.reload()
19
-      })
18
+        actionRef.current.reload();
19
+      });
20
     }
20
     }
21
-  }
21
+  };
22
+
22
 
23
 
23
   const columns = [
24
   const columns = [
24
     {
25
     {
27
       ellipsis: true,
28
       ellipsis: true,
28
     },
29
     },
29
     {
30
     {
30
-      title: '税号',
31
-      dataIndex: 'dutyParagraph',
31
+      title: "税号",
32
+      dataIndex: "dutyParagraph",
32
       ellipsis: true,
33
       ellipsis: true,
33
       search: false,
34
       search: false,
34
     },
35
     },
35
     {
36
     {
36
-      title: '开户行',
37
-      dataIndex: 'openingBank',
37
+      title: "开户行",
38
+      dataIndex: "openingBank",
38
       ellipsis: true,
39
       ellipsis: true,
39
     },
40
     },
40
     {
41
     {
41
-      title: '账号',
42
-      dataIndex: 'account',
42
+      title: "账号",
43
+      dataIndex: "account",
43
       ellipsis: true,
44
       ellipsis: true,
44
     },
45
     },
45
     {
46
     {
46
-      title: '联系人姓名',
47
-      dataIndex: 'contactsName',
47
+      title: "联系人姓名",
48
+      dataIndex: "contactsName",
48
       ellipsis: true,
49
       ellipsis: true,
49
     },
50
     },
50
     {
51
     {
59
     //   ellipsis: true,
60
     //   ellipsis: true,
60
     // },
61
     // },
61
     {
62
     {
62
-      title: '联系人手机',
63
-      dataIndex: 'contactsPhone',
63
+      title: "联系人手机",
64
+      dataIndex: "contactsPhone",
64
       ellipsis: true,
65
       ellipsis: true,
65
     },
66
     },
66
     {
67
     {
67
-      title: '联系人邮箱',
68
-      dataIndex: 'contactsEmail',
68
+      title: "联系人邮箱",
69
+      dataIndex: "contactsEmail",
69
       search: false,
70
       search: false,
70
       ellipsis: true,
71
       ellipsis: true,
71
     },
72
     },
91
     //   search: false,
92
     //   search: false,
92
     // },
93
     // },
93
     {
94
     {
94
-      title: '操作',
95
-      valueType: 'option',
95
+      title: "操作",
96
+      valueType: "option",
96
       width: 200,
97
       width: 200,
97
       render: (_, record) => [
98
       render: (_, record) => [
98
         <Button
99
         <Button
100
           style={{ padding: 0 }}
101
           style={{ padding: 0 }}
101
           type="link"
102
           type="link"
102
           onClick={() => {
103
           onClick={() => {
103
-            navigate(`/custom/edit?id=${record.customId}`)
104
+            navigate(`/custom/edit?id=${record.customId}`);
104
           }}
105
           }}
105
         >
106
         >
106
           编辑
107
           编辑
118
         </Popconfirm>,
119
         </Popconfirm>,
119
       ],
120
       ],
120
     },
121
     },
121
-  ]
122
+  ];
122
 
123
 
123
   return (
124
   return (
124
     <Page>
125
     <Page>
130
             key="1"
131
             key="1"
131
             type="primary"
132
             type="primary"
132
             onClick={() => {
133
             onClick={() => {
133
-              navigate('/custom/edit')
134
+              navigate("/custom/edit");
134
             }}
135
             }}
135
           >
136
           >
136
             新增
137
             新增
140
         columns={columns}
141
         columns={columns}
141
       />
142
       />
142
     </Page>
143
     </Page>
143
-  )
144
-}
144
+  );
145
+};