Explorar el Código

联系人下的软件锁

outaozhen hace 5 años
padre
commit
6785aa9418

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

@@ -32,7 +32,6 @@ const ContanctLowerList = props => {
                     <Row className="zh-width-100P">
                       <Col span="8">
                         <a className="zh-mg-right-3">@{item.staffName}</a>
-                        {/* {item.status} */}
                         {servicelogEnum[item.status]}
                         <List.Item.Meta description={dayjsFormat(item.date, 'MM-DD HH:mm:ss')} />
                       </Col>

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

@@ -1,18 +1,38 @@
-import { message, Tabs, Button, Table } from 'antd'
-import React, { useEffect, useState } from 'react'
+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, apiContactDetail } from '@/services/contact'
 import AddRecord from './AddRecord'
 import { useDispatch } from 'dva'
-// import { connect } from 'umi'
+import ProTable from '@ant-design/pro-table'
 
 const ContanctTabList = ({ clientId }) => {
   // console.log(clientId)
   const dispatch = useDispatch()
   const [state, setState] = useState({
+    params: {},
     visible: false
   })
+  const tRef = useRef()
+  const columns = [
+    {
+      title: '锁号',
+      dataIndex: 'keyNum'
+    },
+    {
+      title: '产品',
+      dataIndex: 'product'
+    },
+    {
+      title: '状态',
+      dataIndex: 'statusT'
+    },
+    {
+      title: '责任人',
+      dataIndex: 'client'
+    }
+  ]
   const [addService, setAddService] = useState({
     visible: false,
     loading: false
@@ -34,28 +54,51 @@ const ContanctTabList = ({ clientId }) => {
     })
     // await initData()
   }
-  useEffect(() => {}, [])
+  useEffect(() => {
+    setState({ ...state, params: { ...state.params, clientId } })
+  }, [clientId])
   const { TabPane } = Tabs
   return (
     <div>
       <div className="zh-pd-left-15">
         {/* <Tabs onChange={callback} type="card"> */}
         <Tabs>
-          <TabPane tab="养护云造价" key="养护云造价">
+          {/* <TabPane tab="养护云造价" key="养护云造价">
             <div className="sheet-right-panel">
               养护云造价
-              {/* <Table columns={curingcolumns} dataSource={curinglist} pagination={false} /> */}
+              <Table columns={curingcolumns} dataSource={curinglist} pagination={false} />
             </div>
           </TabPane>
           <TabPane tab="大司空云计价" key="大司空云计价">
             <div className="sheet-right-panel">大司空云计价</div>
-          </TabPane>
+          </TabPane> */}
           <TabPane tab="软件锁" key="软件锁">
-            <div className="sheet-right-panel">软件锁</div>
+            <div className="sheet-right-panel">
+              <ProTable
+                columns={columns}
+                search={false}
+                toolBarRender={false}
+                params={state.params}
+                actionRef={tRef}
+                rowKey={record => record.id}
+                request={async (params, sort, filter) => {
+                  const {
+                    code = -1,
+                    data: { software = {}, total = 0 }
+                  } = await apiContactDetail({ ...params, ...sort, ...filter })
+                  return {
+                    data: software,
+                    success: code === consts.RET_CODE.SUCCESS,
+                    total
+                  }
+                }}
+                pagination={false}
+              />
+            </div>
           </TabPane>
-          <TabPane tab="通行账号" key="通行账号">
+          {/* <TabPane tab="通行账号" key="通行账号">
             <div className="sheet-right-panel">通行账号</div>
-          </TabPane>
+          </TabPane> */}
         </Tabs>
       </div>
       <div className="sheet-btns zh-pd-left-15 zh-pd-top-15">

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

@@ -14,13 +14,14 @@ const ContactDetail = props => {
     loading: false,
     client: {},
     log: [],
-    serviceLog: []
+    serviceLog: [],
+    software: {}
   })
 
   const initData = async () => {
     setState({ ...state, loading: true })
     const {
-      data: { client = {}, log = [], serviceLog = [] },
+      data: { client = {}, log = [], serviceLog = [], software = {} },
       code = -1
     } = await apiContactDetail(dataId)
     if (code === consts.RET_CODE.SUCCESS) {
@@ -30,7 +31,7 @@ const ContactDetail = props => {
           payload: 'contact'
         })
       }
-      setState({ ...state, client, log, serviceLog, loading: false })
+      setState({ ...state, client, log, serviceLog, software, loading: false })
     }
   }
   useEffect(() => {
@@ -55,7 +56,7 @@ const ContactDetail = props => {
             </div>
           </Col>
           <Col span={12}>
-            <ContanctTabList clientId={state.client.id} />
+            <ContanctTabList clientId={state.client.id} software={state.software} />
             <ContanctLowerList log={state.log} servicelist={state.serviceLog} />
           </Col>
         </Row>