Преглед изворни кода

fix: 客户联系人列表数据源错误

lanjianrong пре 5 година
родитељ
комит
5bb20fdef6

+ 1 - 1
src/pages/Customer/Company/components/CompanyDetail/CompanyTabList.jsx

@@ -86,7 +86,7 @@ const CompanyTabList = ({ initData, customerId, client, software }) => {
                 size="small"
                 columns={columns}
                 search={false}
-                dataSource={client}
+                dataSource={client.client}
                 toolBarRender={false}
                 rowKey={record => record.id}
                 pagination={false}

+ 4 - 3
src/pages/Customer/Company/components/CompanyDetail/index.jsx

@@ -13,12 +13,13 @@ const Index = props => {
     loading: false,
     customer: {},
     log: [],
-    software: {}
+    software: {},
+    client: {}
   })
   const initData = async () => {
     setState({ ...state, loading: true })
     const {
-      data: { customer = {}, log = [], software = {} },
+      data: { customer = {}, log = [], software = {}, client = {} },
       code = -1
     } = await apiCompanyDetail(id)
     if (code === consts.RET_CODE.SUCCESS) {
@@ -28,7 +29,7 @@ const Index = props => {
           payload: 'company'
         })
       }
-      setState({ ...state, customer, log, software, loading: false })
+      setState({ ...state, customer, log, software, loading: false, client })
     }
   }
   useEffect(() => {