Просмотр исходного кода

feat: 大司空企业版企业列表

outaozhen 4 лет назад
Родитель
Сommit
35e62acbd3
2 измененных файлов с 112 добавлено и 4 удалено
  1. 100 3
      src/pages/Product/Road/Enterprise/index.jsx
  2. 12 1
      src/services/product.js

+ 100 - 3
src/pages/Product/Road/Enterprise/index.jsx

@@ -1,9 +1,106 @@
-import React from 'react'
+import BasicTable from '@/components/Table'
+import { queryRoadcompanyList } from '@/services/product'
+import { Button, Input } from 'antd'
+import React, { useState, useRef } from 'react'
+import { generateSortField } from '@/utils/utils'
+import consts from '@/consts'
 
-const Enterprise = () => {
+const Enterprise = props => {
+  const [state, setState] = useState({
+    params: {
+      search: null
+    }
+  })
+  const tRef = useRef()
+  const columns = [
+    {
+      title: '企业名称',
+      dataIndex: 'name',
+      key: 'name',
+      width: 110,
+      fixed: 'left'
+    },
+    {
+      title: '企业管理员',
+      dataIndex: 'managerName',
+      key: 'managerName',
+      width: 110
+    },
+    {
+      title: '电话号码',
+      dataIndex: 'managerPhone',
+      key: 'managerPhone',
+      width: 110
+    },
+    {
+      title: '授权数量',
+      dataIndex: 'numLicenses',
+      key: 'numLicenses',
+      width: 110
+    },
+    {
+      title: 'CLD客户',
+      dataIndex: 'client_name',
+      key: 'client_name',
+      width: 110
+    },
+    {
+      title: 'CLD单位',
+      dataIndex: 'customer_name',
+      key: 'customer_name',
+      width: 110
+    },
+    {
+      title: '最近使用',
+      dataIndex: 'latestUsed',
+      key: 'latestUsed',
+      width: 110
+    },
+    {
+      title: '注册时间',
+      dataIndex: 'registerTime',
+      key: 'registerTime',
+      width: 110
+    }
+  ]
   return (
     <div>
-      <span>企业版</span>
+      <BasicTable
+        rowKey={record => record.client_id}
+        columns={columns}
+        params={state.params}
+        request={async (params, sort, filter) => {
+          const sortOrder = generateSortField(sort)
+          const {
+            code = -1,
+            data: { list = [], total = 0 }
+          } = await queryRoadcompanyList({ ...params, ...sortOrder, ...filter })
+          return {
+            data: list,
+            success: code === consts.RET_CODE.SUCCESS,
+            total
+          }
+        }}
+        toolbar={{
+          search: (
+            <Input.Search
+              style={{ width: '250px' }}
+              allowClear={true}
+              placeholder="请输入手机、QQ进行搜索"
+            />
+          ),
+          actions: [
+            <Button type="primary" key="addClientBtn">
+              创建企业
+            </Button>
+          ]
+        }}
+        search={false}
+        pagination={{
+          pageSize: 20,
+          showSizeChanger: false
+        }}
+      />
     </div>
   )
 }

+ 12 - 1
src/services/product.js

@@ -122,7 +122,6 @@ export async function queryRoadpricingListV2(params) {
     data: params
   })
 }
-
 /** 大司空2.0编办列表 */
 export async function queryCompilationListV2(params) {
   return request('/RoadPricingv2/compilation', {
@@ -157,3 +156,15 @@ export async function apiRoadPricingUnLinkClientV2(params) {
 export async function apiRoadPricingUpgradeV2(payload) {
   return request('/RoadPricingv2/upgrade', { method: 'POST', data: payload })
 }
+
+/** 大司空2.0企业版列表 */
+export async function queryRoadcompanyList(params) {
+  return request('/RoadPricingv2/company', {
+    method: 'POST',
+    data: params
+  })
+}
+/** 大司空2.0企业版详情 */
+export async function apiRoadcompanyDetail(params) {
+  return request('/RoadPricingv2/company/detail', { params })
+}