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

+ 56 - 57
src/pages/Customer/Company/index.jsx

@@ -1,7 +1,7 @@
 import React, { useState, useEffect, useRef, useMemo } from 'react'
 import ProTable from '@ant-design/pro-table'
 import { useTableScroll } from '@/hooks/useAutoTable'
-import { Input, Button, message, Select, Space, Tooltip } from 'antd'
+import { Input, Button, message, Select, Tooltip } from 'antd'
 import { connect } from 'dva'
 import consts from '@/consts'
 import { queryCompany, apiAddCompany } from '@/services/customer'
@@ -15,6 +15,7 @@ import { TagTypeEnum, TagDataTypeEnum, LabelModeType } from './components/Person
 import { Add, Down, Check } from '@icon-park/react'
 import { apiBatchLink } from '@/services/customer'
 import { getPermDataList } from '@/utils/auth'
+import styles from './index.less'
 
 const Company = props => {
   const {
@@ -426,70 +427,68 @@ const Company = props => {
   }
 
   return (
-    <ProTable
-      rowKey={record => record.id}
-      actionRef={tRef}
-      params={state.params}
-      request={async (params, sort, filter) => {
-        const { code = -1, data: { customer = [], total = 0 } = { customer: [], total: 0 } } =
-          await queryCompany({ ...params, ...sort, ...filter })
-        setState({ ...state, orderIds: customer.map(item => item.id) })
-        return {
-          data: customer,
-          success: code === consts.RET_CODE.SUCCESS,
-          total
-        }
-      }}
-      bordered
-      search={{ filterType: 'light' }}
-      toolbar={{
-        search: (
-          <Input.Search
-            style={{ width: '300px' }}
-            allowClear={true}
-            placeholder="输入客户名称、公司性质等"
-            onSearch={handleSearch}
-          />
-        ),
-        actions: [
-          <LazyCascader
-            onChange={onDistrictChange}
-            changeOnSelect={true}
-            key="lazyCascader"
-            className="hover:bg-[rgba(0,0,0,0.1)]"
-            bordered={false}
-          />,
-          <AddCompany onConfirm={handleAddCompany} key="addCompanyBtn" />
-        ]
-      }}
-      headerTitle={
-        <Space>
-          <span className="text-lg font-medium">客户</span>
+    <div className={styles.companyContent}>
+      <ProTable
+        rowKey={record => record.id}
+        actionRef={tRef}
+        params={state.params}
+        request={async (params, sort, filter) => {
+          const { code = -1, data: { customer = [], total = 0 } = { customer: [], total: 0 } } =
+            await queryCompany({ ...params, ...sort, ...filter })
+          setState({ ...state, orderIds: customer.map(item => item.id) })
+          return {
+            data: customer,
+            success: code === consts.RET_CODE.SUCCESS,
+            total
+          }
+        }}
+        bordered
+        search={{ filterType: 'light' }}
+        toolbar={{
+          search: (
+            <Input.Search
+              style={{ width: '300px' }}
+              allowClear={true}
+              placeholder="输入客户名称、公司性质等"
+              onSearch={handleSearch}
+            />
+          ),
+          actions: [
+            <LazyCascader
+              onChange={onDistrictChange}
+              changeOnSelect={true}
+              key="lazyCascader"
+              className="hover:bg-[rgba(0,0,0,0.1)]"
+              bordered={false}
+            />,
+            <AddCompany onConfirm={handleAddCompany} key="addCompanyBtn" />
+          ]
+        }}
+        headerTitle={
           <Select
             defaultValue="oneself"
             dropdownMatchSelectWidth={false}
-            bordered={false}
             onChange={e => {
               setState({ ...state, params: { ...state.params, dataPermission: e } })
             }}
             options={getPermDataList()?.customer || []}
           />
-        </Space>
-      }
-      rowSelection={{
-        onChange: hanleRowSelectChange,
-        type: 'checkbox',
-        columnWidth: 25
-      }}
-      onLoadingChange={loadingStatus => {
-        loadingStatus && redoHeight()
-      }}
-      tableAlertRender={renderTableAlert}
-      scroll={getScrollRef}
-      columnsStateMap={columnsStateMap}
-      onColumnsStateChange={map => setColumnsStateMap(map)}
-      columns={columns}
-    />
+        }
+        rowSelection={{
+          onChange: hanleRowSelectChange,
+          type: 'checkbox',
+          columnWidth: 25
+        }}
+        onLoadingChange={loadingStatus => {
+          loadingStatus && redoHeight()
+        }}
+        tableAlertRender={renderTableAlert}
+        scroll={getScrollRef}
+        columnsStateMap={columnsStateMap}
+        onColumnsStateChange={map => setColumnsStateMap(map)}
+        columns={columns}
+      />
+    </div>
   )
 }
 

+ 7 - 0
src/pages/Customer/Company/index.less

@@ -0,0 +1,7 @@
+.companyContent {
+  :global(.ant-cascader-input.ant-input) {
+    &::-webkit-input-placeholder {
+      color: rgba(0, 0, 0, 0.85);
+    }
+  }
+}

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

@@ -203,7 +203,7 @@ const ContanctForm = props => {
         dataSource={client}
         columns={columns}
         tartgetUrl="/client/update"
-        type="contact"
+        type="client"
       />
     </div>
   )

+ 9 - 13
src/pages/Customer/Contact/index.jsx

@@ -2,7 +2,7 @@ import ContactDetail from '@/pages/customer/Contact/components/ContactDetail'
 import CompanyDetail from '@/pages/customer/Company/components/CompanyDetail'
 import AddContact from '@/pages/customer/Contact/components/AddContact'
 import ProTable from '@ant-design/pro-table'
-import { Input, Button, message, Tooltip, Space, Select } from 'antd'
+import { Input, Button, message, Tooltip, Select } from 'antd'
 import { connect } from 'dva'
 import React, { useEffect, useState, useRef, useMemo } from 'react'
 import consts from '@/consts'
@@ -594,18 +594,14 @@ const Contact = props => {
           ]
         }}
         headerTitle={
-          <Space>
-            <span className="text-lg font-medium">联系人</span>
-            <Select
-              defaultValue="oneself"
-              dropdownMatchSelectWidth={false}
-              bordered={false}
-              onChange={e => {
-                setState({ ...state, params: { ...state.params, dataPermission: e } })
-              }}
-              options={getPermDataList()?.customer || []}
-            />
-          </Space>
+          <Select
+            defaultValue="oneself"
+            dropdownMatchSelectWidth={false}
+            onChange={e => {
+              setState({ ...state, params: { ...state.params, dataPermission: e } })
+            }}
+            options={getPermDataList()?.customer || []}
+          />
         }
         onLoadingChange={loadingStatus => {
           loadingStatus && redoHeight()