lanjianrong 5 лет назад
Родитель
Сommit
60f173a919
1 измененных файлов с 51 добавлено и 25 удалено
  1. 51 25
      src/pages/Product/Lock/Lockstore/index.jsx

+ 51 - 25
src/pages/Product/Lock/Lockstore/index.jsx

@@ -9,6 +9,7 @@ import ContactDetail from '@/pages/Customer/Client/components/ClientDetail'
 import SoftwareDetail from '@/pages/Product/Lock/LockStore/components/SoftwareDetail'
 import { useModal } from '@/components/Modal'
 import { useTableScroll } from '@/hooks/useAutoTable'
+import CompanyDetail from '@/pages/Customer/Company/components/CompanyDetail'
 
 // 渲染产品标签
 export const ProductLabel = ({ data }) => {
@@ -20,7 +21,7 @@ export const ProductLabel = ({ data }) => {
   return (
     <div>
       {newData.map((item, index) => (
-        <span key={index} className="mb-5px block">
+        <span key={index} className="mr-5px">
           <Tag color="#886ab5">{item}</Tag>
         </span>
       ))}
@@ -61,7 +62,7 @@ const LockStore = () => {
         height: '100vh',
         overflowY: 'hidden'
       },
-      children: <LocksDetail id={id} />
+      children: <LocksDetail id={id} orderIds={state.orderIds} />
     })
     toggleDrawer()
   }
@@ -74,7 +75,7 @@ const LockStore = () => {
         height: '100vh',
         overflowY: 'hidden'
       },
-      children: <ContactDetail dataId={id} orderIds={state.orderIds} />
+      children: <ContactDetail dataId={id} />
     })
     toggleDrawer()
   }
@@ -87,10 +88,25 @@ const LockStore = () => {
         height: '100vh',
         overflowY: 'hidden'
       },
-      children: <SoftwareDetail dataId={id} orderIds={state.orderIds} />
+      children: <SoftwareDetail dataId={id} />
     })
     toggleDrawer()
   }
+
+  // 展示客户详情抽屉
+  const showCompanyDrawer = id => {
+    setDrawerProps({
+      closable: true,
+      onClose: () => toggleDrawer(),
+      bodyStyle: {
+        height: '100vh',
+        overflowY: 'hidden'
+      },
+      children: <CompanyDetail dataId={id} />
+    })
+    toggleDrawer()
+  }
+
   const columns = [
     {
       title: '锁号',
@@ -109,62 +125,72 @@ const LockStore = () => {
       title: '产品',
       dataIndex: 'product',
       key: 'product',
-      width: 350,
+      width: 200,
       render: text => {
-        // const productArr = text.split('+')
         return <ProductLabel data={text} />
       }
     },
     {
-      title: '办事处',
-      dataIndex: 'category',
-      key: 'category',
-      width: 150
-    },
-    {
       title: '出库时间',
       dataIndex: 'makeDay',
       key: 'makeDay',
       width: 150
     },
     {
-      title: '销售/借出/赠送时间',
-      dataIndex: 'allotedTime',
-      key: 'allotedTime',
-      width: 160
+      title: '状态',
+      dataIndex: 'status',
+      key: 'status',
+      width: 150,
+      render: status => <>{longleStatusNum[status]}</>
     },
     {
       title: '责任人',
       dataIndex: 'responsible',
       key: 'responsible',
       width: 150,
-      render: (responsible, record) => (
+      render: (text, record) => (
         <span
           onClick={() => showDrawerResponsible(record.clientId)}
           className="text-primary cursor-pointer hover:text-[#967bbd]">
-          {responsible}
+          {text}
         </span>
       )
     },
     {
-      title: '状态',
-      dataIndex: 'status',
-      key: 'status',
-      width: 150,
-      render: status => <>{longleStatusNum[status]}</>
+      title: '客户',
+      dataIndex: 'customerName',
+      render: (text, record) => (
+        <span
+          onClick={() => showCompanyDrawer(record.customerId)}
+          className="text-primary cursor-pointer hover:text-[#967bbd]">
+          {text}
+        </span>
+      )
     },
     {
       title: '联系人',
       dataIndex: 'client',
       key: 'client',
       width: 150,
-      render: (client, record) => (
+      render: (text, record) => (
         <span
           onClick={() => showDrawerClient(record.clientId)}
           className="text-primary cursor-pointer hover:text-[#967bbd]">
-          {client}
+          {text}
         </span>
       )
+    },
+    {
+      title: '销售/借出/赠送时间',
+      dataIndex: 'allotedTime',
+      key: 'allotedTime',
+      width: 160
+    },
+    {
+      title: '办事处',
+      dataIndex: 'category',
+      key: 'category',
+      width: 150
     }
   ]
   const { getScrollRef, redoHeight } = useTableScroll(columns, selectKeys)