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

fix: 客户弹窗提交关闭异常

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

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

@@ -1,18 +1,20 @@
 import React, { useRef } from 'react'
 import { Tabs, Button, message } from 'antd'
 // import SvgIcon from '@/components/SvgIcon'
-import Addcontact from '@/pages/customer/Contact/components/AddContact'
+import AddContact from '@/pages/customer/Contact/components/AddContact'
 import { apiAddClient } from '@/services/contact'
 import { formatValues } from '@/components/LazyCascader'
 import consts from '@/consts'
 
-const CompanyTabList = () => {
+const CompanyTabList = ({ initData }) => {
   const { TabPane } = Tabs
-  const tRef = useRef()
-  const initData = () => {
-    tRef.current.reset()
-  }
+  // const tRef = useRef()
+  // const initData = () => {
+  //   tRef.current.reset()
+  // }
   const handleAddClient = async values => {
+    // 客户id
+
     const payload = formatValues(values)
     const { code = -1, msg = '新增失败' } = await apiAddClient(payload)
     if (code === consts.RET_CODE.SUCCESS) {
@@ -47,7 +49,7 @@ const CompanyTabList = () => {
         >
           <SvgIcon type="icon-plus" /> 添加联系人
         </Button> */}
-        <Addcontact onConfirm={handleAddClient} key="addContactBtn" />
+        <AddContact onConfirm={handleAddClient} key="addContactBtn" />
       </div>
     </div>
   )

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

@@ -50,7 +50,7 @@ const Index = props => {
             </div>
           </Col>
           <Col span={12} flex={{ flexDirection: 'column' }}>
-            <CompanyTabList />
+            <CompanyTabList initData={initData} />
             <CompanyLowerList log={state.log} />
           </Col>
         </Row>