Browse Source

feat: 商机应用BasicTable,暂时隐藏负责人功能

lanjianrong 5 years ago
parent
commit
7f824d0152

+ 14 - 14
src/pages/Customer/Business/components/BusinessDetail/Form.jsx

@@ -4,7 +4,7 @@ import EditableForm from '@/components/EditableForm'
 import ChangeCompanyInput, {
   ChangeCompMap
 } from '@/pages/Customer/Company/components/ChangeCompany'
-import ChangeStaff from '../ChangeStaff/index'
+// import ChangeStaff from '../ChangeStaff/index'
 import Step from './Step/index'
 
 const Form = props => {
@@ -19,12 +19,12 @@ const Form = props => {
     title: ChangeCompMap.BUSINESS.title
   }
 
-  const changeStaffOpt = {
-    responsibleId: business.responsibleId,
-    dataId: business.id,
-    actionPayload: ChangeCompMap.BUSINESS.key,
-    text: business.responsible
-  }
+  // const changeStaffOpt = {
+  //   responsibleId: business.responsibleId,
+  //   dataId: business.id,
+  //   actionPayload: ChangeCompMap.BUSINESS.key,
+  //   text: business.responsible
+  // }
   const columns = [
     {
       dataIndex: 'name',
@@ -49,13 +49,13 @@ const Form = props => {
       editCellType: 'datePicker',
       span: 12
     },
-    {
-      dataIndex: 'responsibleId',
-      label: '负责人',
-      editCellType: 'custom',
-      customCell: <ChangeStaff dataSource={changeStaffOpt} />,
-      span: 24
-    },
+    // {
+    //   dataIndex: 'responsibleId',
+    //   label: '负责人',
+    //   editCellType: 'custom',
+    //   customCell: <ChangeStaff dataSource={changeStaffOpt} />,
+    //   span: 24
+    // },
     {
       dataIndex: 'remark',
       label: '备注',

+ 9 - 5
src/pages/Customer/Business/components/BusinessDetail/Step/index.jsx

@@ -58,7 +58,7 @@ const Step = ({ id, statusId, groupStatus = [] }) => {
       className="w-120px"
       onClick={e => {
         if (!op.isSelected) {
-          return message.error('请选择阶段再结束')
+          return message.error('请选择阶段再结束')
         }
         return Modal.confirm({
           title: '提示',
@@ -67,7 +67,8 @@ const Step = ({ id, statusId, groupStatus = [] }) => {
             tryChangeStatus({ id, businessStatusId: e.key })
           }
         })
-      }}>
+      }}
+    >
       {op.otherItems.map(item => (
         <Menu.Item key={item.id}>
           <div className="flex justify-between items-center">
@@ -92,7 +93,8 @@ const Step = ({ id, statusId, groupStatus = [] }) => {
               <p>赢单率{item.percentage}%</p>
             </div>
           }
-          key={item.id}>
+          key={item.id}
+        >
           <div
             onClick={() => {
               if (!op.isEnd) {
@@ -121,7 +123,8 @@ const Step = ({ id, statusId, groupStatus = [] }) => {
                 : op.selectedItemIdx > idx
                 ? 'state-suc'
                 : 'state-undo'
-            }`}>
+            }`}
+          >
             <span className="title ">{item.name}</span>
             {idx === 0 ? (
               <>
@@ -140,7 +143,8 @@ const Step = ({ id, statusId, groupStatus = [] }) => {
       <div
         className={`busi-state-item ${
           op.isEnd ? stateMap[op.otherItems[op.endItemIdx].key].class : 'state-undo'
-        }`}>
+        }`}
+      >
         <span className="title">
           {op.isEnd ? (
             <>

+ 4 - 21
src/pages/Customer/Business/index.jsx

@@ -1,7 +1,6 @@
 import React, { useState, useEffect, useRef } from 'react'
 import { connect } from 'umi'
 import { getBusinessList } from '@/services/customer'
-import ProTable from '@ant-design/pro-table'
 import consts from '@/consts'
 import { Select } from 'antd'
 import AddBusiness from './components/AddBusiness'
@@ -9,8 +8,7 @@ import Detail from './components/BusinessDetail'
 import { useModal } from '@/components/Modal'
 import CompanyDetail from '../Company/components/CompanyDetail'
 import { Funnel } from '@ant-design/charts'
-import PermSelect from '../Company/components/PermSelect'
-import { PermDataTypeEunm } from '../Company/components/PermSelect'
+import BasicTable from '@/components/Table'
 
 const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
   const tRef = useRef(null)
@@ -21,8 +19,6 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
     funnelData: []
   })
 
-  // const { initialState: { permData } = { permData: {} } } = useModel('@@initialState')
-
   useEffect(() => {
     if (!groupList) {
       dispatch({
@@ -131,20 +127,9 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
   const conifg = {
     xField: 'name',
     yField: 'count',
-    // legend: false,
     shape: 'pyramid',
     conversionTag: false
   }
-  // const { getScrollRef, redoHeight } = useTableScroll(columns)
-
-  // 处理权限Select下拉组件OnChange事件
-  const handlePermChange = ({ staffIds = [], dataPermission }) => {
-    if (staffIds?.length) {
-      setState({ ...state, params: { ...state.params, staffIds, dataPermission: null } })
-      return
-    }
-    setState({ ...state, params: { ...state.params, staffIds: null, dataPermission } })
-  }
 
   return (
     <div className="h-full w-full flex flex-row justify-between">
@@ -181,9 +166,10 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
       <div className="w-17/20">
         <div className="ml-8 bg-white shadow-card">
           {state.params.businessGroupId ? (
-            <ProTable
-              bordered
+            <BasicTable
               actionRef={tRef}
+              mainMenuType="customer"
+              columnStateType="BUSINESS"
               params={state.params}
               rowKey={record => record.id}
               columns={columns}
@@ -199,9 +185,6 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
                   total
                 }
               }}
-              headerTitle={
-                <PermSelect onConfirm={handlePermChange} dataType={PermDataTypeEunm.CUSTOMER} />
-              }
               search={false}
               toolbar={{
                 actions: [