Kaynağa Gözat

feat: 单位下客户tab加上统计

lanjianrong 4 yıl önce
ebeveyn
işleme
bbbd3ccc0c

+ 6 - 3
src/pages/Customer/Company/components/CompanyDetail/TabList.jsx

@@ -13,6 +13,7 @@ import AddRecord from '@/pages/Customer/Client/components/ClientDetail/AddRecord
 import Detail from '@/pages/Customer/Business/components/BusinessDetail'
 import SyncClient from './SyncClient'
 import { longleSellStatusNum } from '@/pages/Product/Lock/LockStore/index'
+import { renderBadge } from '@/pages/Workbench/Dashboard/components/RatioPanels'
 
 const CompanyTabList = ({ initData, customerId, client, software, customer, business }) => {
   const dispatch = useDispatch()
@@ -134,7 +135,8 @@ const CompanyTabList = ({ initData, customerId, client, software, customer, busi
       render: (clientName, record) => (
         <span
           onClick={() => showLongleDrawer(record.id)}
-          className="text-primary cursor-pointer hover:text-[#967bbd]">
+          className="text-primary cursor-pointer hover:text-[#967bbd]"
+        >
           {clientName}
         </span>
       )
@@ -166,7 +168,8 @@ const CompanyTabList = ({ initData, customerId, client, software, customer, busi
       render: (text, record) => (
         <span
           onClick={() => showDrawerBusiness(record.id)}
-          className="text-primary cursor-pointer hover:text-[#967bbd]">
+          className="text-primary cursor-pointer hover:text-[#967bbd]"
+        >
           {text}
         </span>
       )
@@ -231,7 +234,7 @@ const CompanyTabList = ({ initData, customerId, client, software, customer, busi
     <div>
       <div className="pl-15px">
         <Tabs>
-          <TabPane tab="客户" key="客户">
+          <TabPane tab={<span>客户{renderBadge(client.total, true)}</span>} key="客户">
             <div className="sheet-right-panel" ref={tRef}>
               <ProTable
                 size="small"

+ 5 - 3
src/pages/Hr/Employee/index.jsx

@@ -48,7 +48,8 @@ const Employee = props => {
       render: (username, record) => (
         <span
           onClick={() => showDrawer(record.id)}
-          className="text-primary cursor-pointer hover:text-[#967bbd]">
+          className="text-primary cursor-pointer hover:text-[#967bbd]"
+        >
           {username}
         </span>
       )
@@ -113,7 +114,7 @@ const Employee = props => {
   return (
     <div className="h-full w-full flex flex-row">
       <RoleMenu onSelect={onSelect} />
-      <div className="w-max-3/4">
+      <div className="w-full">
         <div className="ml-8 shadow-hex-3e2c5a">
           {/* <div className="absolute right-33 top-3 z-100">
             {hasPerm && state.params.id && (
@@ -155,7 +156,8 @@ const Employee = props => {
                         onText="确认"
                         cancelText="取消"
                         // onConfirm={() => console.log(state.params.id)}
-                        onConfirm={() => handleDelDepartment(state.params.id)}>
+                        onConfirm={() => handleDelDepartment(state.params.id)}
+                      >
                         <Button danger size="small">
                           删除部门
                         </Button>

+ 1 - 1
src/pages/workbench/Dashboard/components/RatioPanels.jsx

@@ -29,7 +29,7 @@ const dataTypeEunm = {
   }
 }
 
-const renderBadge = (count, active = false) => {
+export const renderBadge = (count, active = false) => {
   return active ? (
     <Badge
       count={count}