Browse Source

feat: 目录调整

lanjianrong 5 years ago
parent
commit
275afb9876

+ 76 - 76
config/routes.js

@@ -50,85 +50,85 @@ export default [
                     icon: 'icon-building',
                     component: './customer/Company',
                     authority: ['admin', 'company_access']
+                  },
+                  {
+                    path: '/customer/business',
+                    name: 'business',
+                    icon: 'icon-usd-circle',
+                    component: './customer/Business'
+                  }
+                ]
+              },
+              {
+                path: '/product',
+                name: 'product',
+                icon: 'icon-box',
+                routes: [
+                  {
+                    path: '/product',
+                    redirect: '/product/lock'
+                  },
+                  {
+                    path: '/product/lock',
+                    name: 'lock',
+                    icon: 'icon-magic',
+                    routes: [
+                      {
+                        path: '/product/lock',
+                        redirect: '/product/lock/lockstore'
+                      },
+                      {
+                        path: '/product/lock/lockstore',
+                        name: 'lockstore',
+                        component: './product/lock/Lockstore'
+                      },
+                      {
+                        path: '/product/lock/lockcount',
+                        name: 'lockcount',
+                        component: './product/lock/Lockcount'
+                      }
+                    ]
+                  },
+                  {
+                    path: '/product/cloud',
+                    name: 'cloud',
+                    icon: 'icon-cloud',
+                    routes: [
+                      {
+                        path: '/product/cloud',
+                        redirect: '/product/cloud/building'
+                      },
+                      {
+                        path: '/product/cloud/building',
+                        name: 'build',
+                        component: './product/cloud/Building'
+                      },
+                      {
+                        path: '/product/cloud/curing',
+                        name: 'curing',
+                        component: './product/cloud/Curing'
+                      }
+                    ]
+                  }
+                ]
+              },
+              {
+                path: '/staff',
+                name: 'staff',
+                icon: 'icon-users',
+                routes: [
+                  {
+                    path: '/staff',
+                    redirect: '/staff/employee'
+                  },
+                  {
+                    path: '/staff/employee',
+                    name: 'employee',
+                    icon: 'icon-users',
+                    component: './staff/Employee'
                   }
-                  // {
-                  //   path: '/customer/finance',
-                  //   name: 'finance',
-                  //   icon: 'icon-usd-circle',
-                  //   component: './customer/Finance'
-                  // }
                 ]
               }
-              // {
-              //   path: '/product',
-              //   name: 'product',
-              //   icon: 'icon-box',
-              //   routes: [
-              //     {
-              //       path: '/product',
-              //       redirect: '/product/lock'
-              //     },
-              //     {
-              //       path: '/product/lock',
-              //       name: 'lock',
-              //       icon: 'icon-magic',
-              //       routes: [
-              //         {
-              //           path: '/product/lock',
-              //           redirect: '/product/lock/lockstore'
-              //         },
-              //         {
-              //           path: '/product/lock/lockstore',
-              //           name: 'lockstore',
-              //           component: './product/lock/Lockstore'
-              //         },
-              //         {
-              //           path: '/product/lock/lockcount',
-              //           name: 'lockcount',
-              //           component: './product/lock/Lockcount'
-              //         }
-              //       ]
-              //     },
-              //     {
-              //       path: '/product/cloud',
-              //       name: 'cloud',
-              //       icon: 'icon-cloud',
-              //       routes: [
-              //         {
-              //           path: '/product/cloud',
-              //           redirect: '/product/cloud/building'
-              //         },
-              //         {
-              //           path: '/product/cloud/building',
-              //           name: 'build',
-              //           component: './product/cloud/Building'
-              //         },
-              //         {
-              //           path: '/product/cloud/curing',
-              //           name: 'curing',
-              //           component: './product/cloud/Curing'
-              //         }
-              //       ]
-              //     }
-              //   ]
-              // },
-              // {
-              //   path: '/staff',
-              //   name: 'staff',
-              //   icon: 'icon-users',
-              //   routes: [
-              //     {
-              //       path: '/staff',
-              //       redirect: '/staff/employee'
-              //     },
-              //     {
-              //       path: '/staff/employee',
-              //       name: 'employee',
-              //       icon: 'icon-users',
-              //       component: './staff/Employee'
-              //     }
-              //   ]
-              // }
             ]
           }
         ]

+ 1 - 1
src/locales/zh-CN/menu.js

@@ -9,7 +9,7 @@ export default {
   'menu.customer': '客户',
   'menu.customer.contact': '联系人',
   'menu.customer.company': '客户',
-  'menu.customer.finance': '商机',
+  'menu.customer.business': '商机',
   'menu.customer.test': '测试',
   'menu.product': '产品',
   'menu.product.lock': '软件锁',

+ 1 - 1
src/models/customer.js

@@ -1,5 +1,5 @@
 import consts from '@/consts'
-import { queryNatures } from '@/services/contact'
+import { queryNatures } from '@/services/customer'
 
 export default {
   namespace: 'customer',

+ 1 - 1
src/models/district.js

@@ -1,5 +1,5 @@
 import consts from '@/consts'
-import { queryDistrict } from '@/services/district'
+import { queryDistrict } from '@/services/common'
 
 export default {
   namespace: 'district',

+ 17 - 0
src/pages/Customer/Business/index.jsx

@@ -0,0 +1,17 @@
+import React from 'react'
+import { Select } from 'antd'
+
+const Business = () => {
+  return (
+    <div className="h-full w-full flex flex-row">
+      <div className="h-full w-max-234px rounded-4px shadow-card">
+        <div className="p-4 border-b-1 border-solid border-black border-opacity-10 bg-[#f7f9fa] justify-around text-left">
+          <span>商机漏斗</span>
+          <Select />
+        </div>
+      </div>
+    </div>
+  )
+}
+
+export default Business

+ 1 - 2
src/pages/Customer/Company/components/CompanyDetail/CompanyTabList.jsx

@@ -3,12 +3,11 @@ import React, { useRef } from 'react'
 import { Tabs, message } from 'antd'
 // import SvgIcon from '@/components/SvgIcon'
 import AddContact from '@/pages/customer/Contact/components/AddContact'
-import { apiAddClient } from '@/services/contact'
+import { apiAddClient } from '@/services/customer'
 import { formatValues } from '@/components/LazyCascader'
 import consts from '@/consts'
 import ProTable from '@ant-design/pro-table'
 import { useModal } from '@/components/Modal'
-// import { queryContact } from '@/services/contact'
 
 const CompanyTabList = ({ initData, customerId, client, software }) => {
   const { toggleDrawer, setDrawerProps } = useModal()

+ 1 - 1
src/pages/Customer/Company/components/CompanyDetail/index.jsx

@@ -1,7 +1,7 @@
 import React, { useState, useEffect } from 'react'
 import { Row, Col, Spin, Tooltip } from 'antd'
 import consts from '@/consts'
-import { apiCompanyDetail } from '@/services/company'
+import { apiCompanyDetail } from '@/services/customer'
 import CompanyForm from './CompanyForm'
 import CompanyLowerList from './CompanyLowerList'
 import CompanyTabList from './CompanyTabList'

+ 1 - 1
src/pages/Customer/Company/index.jsx

@@ -4,7 +4,7 @@ import { useTableScroll } from '@/hooks/useAutoTable'
 import { Button, message, Tooltip } from 'antd'
 import { connect } from 'dva'
 import consts from '@/consts'
-import { queryCompany, apiAddCompany } from '@/services/company'
+import { queryCompany, apiAddCompany } from '@/services/customer'
 import LazyCascader from '@/components/LazyCascader'
 import CompanyDetail from '@/pages/customer/Company/components/CompanyDetail'
 import AddCompany from '@/pages/customer/Company/components/AddCompany'

+ 1 - 1
src/pages/Customer/Contact/components/ChangeCompany/index.jsx

@@ -4,7 +4,7 @@ import { Card, Tooltip } from 'antd'
 import React from 'react'
 import styles from './index.less'
 import SearchModal from '@/pages/customer/Contact/components/CustomerModal'
-import { apiDelCustomer } from '@/services/contact'
+import { apiDelCustomer } from '@/services/customer'
 import { useDispatch } from 'dva'
 import consts from '@/consts'
 import CompanyDetail from '@/pages/customer/Company/components/CompanyDetail'

+ 1 - 1
src/pages/Customer/Contact/components/ContactDetail/ContanctTabList.jsx

@@ -2,7 +2,7 @@ import { message, Tabs, Button } from 'antd'
 import React, { useEffect, useState, useRef } from 'react'
 import consts from '@/consts'
 import SvgIcon from '@/components/SvgIcon'
-import { apiAddService } from '@/services/contact'
+import { apiAddService } from '@/services/customer'
 import AddRecord from './AddRecord'
 import { useDispatch } from 'dva'
 import ProTable from '@ant-design/pro-table'

+ 1 - 1
src/pages/Customer/Contact/components/ContactDetail/index.jsx

@@ -3,7 +3,7 @@ import React, { useState, useEffect } from 'react'
 import ContanctForm from './ContanctForm.jsx'
 import ContanctTabList from './ContanctTabList.jsx'
 import ContanctLowerList from './ContanctLowerList.jsx'
-import { apiContactDetail } from '@/services/contact'
+import { apiContactDetail } from '@/services/customer'
 import consts from '@/consts'
 import { connect } from 'dva'
 import { Up, Down } from '@icon-park/react'

+ 1 - 1
src/pages/Customer/Contact/components/CustomerModal/index.jsx

@@ -8,7 +8,7 @@ import AddCustomerModal from '../AddCustomerModal'
 import { createCustomer, queryCustomers } from '@/services/customer'
 import consts from '@/basic/consts'
 import { formatValues } from '@/components/LazyCascader'
-import { apiChangeCustomer } from '@/services/contact'
+import { apiChangeCustomer } from '@/services/customer'
 
 const SearchModal = ({ clientId, onSelect }) => {
   const dispatch = useDispatch()

+ 1 - 1
src/pages/Customer/Contact/index.jsx

@@ -17,7 +17,7 @@ import {
 } from '../Company/components/PersonLabel/const'
 import { Add, Down, Check } from '@icon-park/react'
 import { useTableScroll } from '@/hooks/useAutoTable'
-import { apiAddClient, queryContact } from '@/services/contact'
+import { apiAddClient, queryContact } from '@/services/customer'
 import { apiBatchLink } from '@/services/customer'
 import styles from './index.less'
 

+ 0 - 7
src/pages/Customer/Finance/index.jsx

@@ -1,7 +0,0 @@
-import React from 'react'
-
-const index = () => {
-  return <div>商机</div>
-}
-
-export default index

+ 2 - 3
src/pages/Product/Lock/Lockstore/components/LocksDetail/LockModal.jsx

@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from 'react'
 import { Modal, Form, Select, Input, Spin, Button, Radio } from 'antd'
 import styles from './index.less'
 import { SearchOutlined } from '@ant-design/icons'
-import { queryContact } from '@/services/contact'
+import { queryContact } from '@/services/customer'
 import { queryLock } from '@/services/lock'
 import consts from '@/basic/consts'
 import { useDebounceFn } from 'ahooks'
@@ -111,8 +111,7 @@ const LockModal = props => {
 
   const handleonOk = () => {
     form.validateFields().then(values => {
-      values.status = type
-      onConfirm(values)
+      onConfirm({ ...values, status: type })
     })
   }
 

+ 2 - 2
src/pages/Staff/Employee/components/RoleMenu/index.jsx

@@ -1,4 +1,4 @@
-import React, { useState, useEffect } from 'react'
+import React, { useEffect } from 'react'
 import { Button, message, Tree, TreeSelect, Form } from 'antd'
 import { PlusOutlined } from '@ant-design/icons'
 import consts from '@/consts'
@@ -48,7 +48,7 @@ const RoleMenu = props => {
   const onExpand = () => {}
 
   return (
-    <div className="h-full w-max-234px rounded-4px roleMenu">
+    <div className="h-full w-max-234px rounded-4px">
       <div className="p-4 pb-3 border-b-1 border-solid border-black border-opacity-10 bg-[#f7f9fa] flex justify-around items-center">
         <span className="text-[0.9375rem]">组织架构</span>
         <ModalForm

+ 18 - 11
src/services/common.js

@@ -1,11 +1,18 @@
-import request from "@/basic/utils/request"
-
-/**
- * 编辑表单提交
- * @param {*} payload 载荷
- */
- export async function editFormApi(url, payload) {
-    const data = await request.post(url, { data: { ...payload } })
-    return data
-  }
-  
+import request from '@/basic/utils/request'
+
+/**
+ * 编辑表单提交
+ * @param {*} payload 载荷
+ */
+export async function editFormApi(url, payload) {
+  const data = await request.post(url, { data: { ...payload } })
+  return data
+}
+
+/** 获取级联数据 */
+export async function queryDistrict(payload) {
+  const data = await request('/district', {
+    params: { ...payload }
+  })
+  return data
+}

+ 0 - 31
src/services/company.js

@@ -1,31 +0,0 @@
-import request from '@/basic/utils/request'
-
-/**
- * 请求客户列表
- * @param {*} payload 载荷
- */
-export async function queryCompany(params) {
-  const data = await request.post('/customer/list', {
-    data: { current: 1, ...params }
-  })
-  return data
-}
-
-/**
- * 获取客户详情
- * @param {string} id 联系人记录id
- */
-export async function apiCompanyDetail(id) {
-  const params = { id }
-  const data = await request('/customer/detail', { params })
-  return data
-}
-
-/**
- * 新增客户
- * @param {string} data
- */
-export async function apiAddCompany(payload) {
-  const data = await request.post('/customer/add', { data: payload })
-  return data
-}

+ 0 - 69
src/services/contact.js

@@ -1,69 +0,0 @@
-import request from '@/basic/utils/request'
-
-/**
- * 请求联系人列表
- * @param {*} payload 载荷
- */
-export async function queryContact(payload) {
-  const data = await request.post('/client/list', {
-    data: payload
-  })
-  return data
-}
-
-/**
- * 获取联系人详情
- * @param {string} id 联系人记录id
- */
-export async function apiContactDetail(id) {
-  const params = { id }
-  const data = await request('/client/detail', { params })
-  return data
-}
-
-/**
- * 新增联系人
- * @param {*} payload 载荷
- */
-export async function apiAddClient(payload) {
-  const data = await request.post('/client/add', { data: { ...payload } })
-  return data
-}
-
-/**
- * 新增服务日志
- * @param {*} payload 载荷
- */
-export async function apiAddService(payload) {
-  const data = await request.post('/serviceLog/add', { data: { ...payload } })
-  return data
-}
-
-/**
- * 联系人更换客户
- * @param {*} payload
- * @returns
- */
-export async function apiChangeCustomer(payload) {
-  const data = await request.post('/client/change/customer', { data: { ...payload } })
-  return data
-}
-
-/**
- * 移除联系人的客户关系
- * @param {*} payload
- * @returns
- */
-export async function apiDelCustomer(payload) {
-  const data = await request.post('/client/customer/delete', { data: { ...payload } })
-  return data
-}
-
-/**
- * 获取客户性质列表
- * @returns
- */
-export async function queryNatures() {
-  const data = await request('/customer/nature')
-  return data
-}

+ 98 - 0
src/services/customer.js

@@ -67,3 +67,101 @@ export async function apiBatchLink(payload) {
   const data = await request.post('/tag/batch/link', { data: payload })
   return data
 }
+
+/**
+ * 请求联系人列表
+ * @param {*} payload 载荷
+ */
+export async function queryContact(payload) {
+  const data = await request.post('/client/list', {
+    data: payload
+  })
+  return data
+}
+
+/**
+ * 获取联系人详情
+ * @param {string} id 联系人记录id
+ */
+export async function apiContactDetail(id) {
+  const params = { id }
+  const data = await request('/client/detail', { params })
+  return data
+}
+
+/**
+ * 新增联系人
+ * @param {*} payload 载荷
+ */
+export async function apiAddClient(payload) {
+  const data = await request.post('/client/add', { data: { ...payload } })
+  return data
+}
+
+/**
+ * 新增服务日志
+ * @param {*} payload 载荷
+ */
+export async function apiAddService(payload) {
+  const data = await request.post('/serviceLog/add', { data: { ...payload } })
+  return data
+}
+
+/**
+ * 联系人更换客户
+ * @param {*} payload
+ * @returns
+ */
+export async function apiChangeCustomer(payload) {
+  const data = await request.post('/client/change/customer', { data: { ...payload } })
+  return data
+}
+
+/**
+ * 移除联系人的客户关系
+ * @param {*} payload
+ * @returns
+ */
+export async function apiDelCustomer(payload) {
+  const data = await request.post('/client/customer/delete', { data: { ...payload } })
+  return data
+}
+
+/**
+ * 获取客户性质列表
+ * @returns
+ */
+export async function queryNatures() {
+  const data = await request('/customer/nature')
+  return data
+}
+
+/**
+ * 请求客户列表
+ * @param {*} payload 载荷
+ */
+export async function queryCompany(params) {
+  const data = await request.post('/customer/list', {
+    data: { current: 1, ...params }
+  })
+  return data
+}
+
+/**
+ * 获取客户详情
+ * @param {string} id 联系人记录id
+ */
+export async function apiCompanyDetail(id) {
+  const params = { id }
+  const data = await request('/customer/detail', { params })
+  return data
+}
+
+/**
+ * 新增客户
+ * @param {string} data
+ */
+export async function apiAddCompany(payload) {
+  const data = await request.post('/customer/add', { data: payload })
+  return data
+}

+ 0 - 8
src/services/district.js

@@ -1,8 +0,0 @@
-import request from '@/basic/utils/request'
-
-export async function queryDistrict(payload) {
-  const data = await request('/district', {
-    params: { ...payload }
-  })
-  return data
-}