Browse Source

feat: 商机详情服务记录列表

lanjianrong 5 years atrás
parent
commit
386ddbcb9e

+ 10 - 16
src/pages/Customer/Business/components/BusinessDetail/LowerList.jsx

@@ -2,21 +2,15 @@ import { Tabs, List, Row, Col } from 'antd'
 import React from 'react'
 import { dayjsFormat } from '@/utils/utils'
 
-const ContanctLowerList = props => {
+const LowerList = props => {
   const {
     log: { log: logs = [] },
-    serviceLog: { serviceLog: serviceLogs = [] }
+    serviceLog = []
   } = props
-  const servicelogEnum = {
-    1: '上门服务',
-    2: '电话拜访',
-    3: '其他事项',
-    4: '在线服务'
-  }
   const { TabPane } = Tabs
   return (
     <div>
-      <div className="zh-pd-left-15">
+      <div className="pl-15px">
         <Tabs>
           <TabPane tab="服务记录" key="服务记录">
             <div className="sheet-panel-record">
@@ -25,18 +19,18 @@ const ContanctLowerList = props => {
                 <Col span="16">服务内容</Col>
               </Row>
               <List
-                dataSource={serviceLogs}
+                dataSource={serviceLog.service}
                 split={false}
                 renderItem={item => (
                   <List.Item>
-                    <Row className="zh-width-100P">
+                    <Row className="w-full">
                       <Col span="8">
-                        <a className="zh-mg-right-3">@{item.staffName}</a>
-                        {servicelogEnum[item.status]}
-                        <List.Item.Meta description={dayjsFormat(item.date, 'MM-DD HH:mm:ss')} />
+                        <a className="mr-3px">@{item.staffName}</a>
+                        {item.serviceName}
+                        <List.Item.Meta description={dayjsFormat(item.date, 'MM-DD')} />
                       </Col>
                       <Col span="16" className="whitespace-pre-line">
-                        {item.mark}
+                        {item.serviceContent}
                       </Col>
                     </Row>
                   </List.Item>
@@ -69,4 +63,4 @@ const ContanctLowerList = props => {
   )
 }
 
-export default ContanctLowerList
+export default LowerList

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

@@ -65,26 +65,16 @@ const ContanctTabList = ({ businessId, clientList }) => {
       dataIndex: 'qq'
     }
   ]
-  const [addService, setAddService] = useState({
-    visible: false,
-    loading: false
-  })
 
   const handleAddService = async values => {
-    setAddService({ ...addService, loading: true })
     const { code = -1 } = await apiAddBusiService({ ...values, businessId })
     if (code === consts.RET_CODE.SUCCESS) {
       message.success('新增成功')
-      setState({ ...state, data: values })
+      dispatch({
+        type: 'refresh/commitAction',
+        payload: ChangeCompMap.BUSINESS.key
+      })
     }
-    // 请求完了
-    setAddService({ ...addService, loading: false, visible: false })
-    // 刷新数据
-    dispatch({
-      type: 'refresh/commitAction',
-      payload: ChangeCompMap.BUSINESS.key
-    })
-    // await initData()
   }
   useEffect(() => {
     setState({ ...state, params: { ...state.params, businessId } })

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

@@ -66,6 +66,7 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
     {
       dataIndex: 'name',
       title: '商机名称',
+      width: '10%',
       render: (text, record) => (
         <span
           onClick={() => showDrawer(record.id)}
@@ -173,7 +174,6 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
               }}
               scroll={getScrollRef}
               request={async (params, sort, filter) => {
-                console.log('params', params)
                 const {
                   code = -1,
                   data: { business = [], total = 0 }

+ 1 - 1
src/pages/workbench/Dashboard/index.jsx

@@ -237,7 +237,7 @@ const Dashboard = () => {
   }
   return (
     <div>
-      <div>
+      <div className="shadow-card">
         <ProTable
           bordered
           rowKey={record => record.day15 + Date.now()}