Преглед на файлове

Merge branch 'master' of http://192.168.1.41:3000/outaozhen/cldV2react

outaozhen преди 5 години
родител
ревизия
39776ea163

+ 19 - 8
src/pages/Customer/Business/index.jsx

@@ -11,12 +11,12 @@ import { useTableScroll } from '@/hooks/useAutoTable'
 import CompanyDetail from '../Company/components/CompanyDetail'
 import { Funnel } from '@ant-design/charts'
 
-const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
+const Business = ({ dispatch, groupList, shouldUpdate, permData, loading }) => {
   const tRef = useRef(null)
   const { toggleDrawer, setDrawerProps } = useModal()
   const [state, setState] = useState({
     orderIds: [],
-    businessGroupId: null,
+    params: { businessGroupId: null },
     funnelData: []
   })
   useEffect(() => {
@@ -29,7 +29,7 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
       const group = groupList[0]
       setState({
         ...state,
-        businessGroupId: group.value,
+        params: { ...state.params, businessGroupId: group.value },
         funnelData: group.items
           ?.filter(item => !item.endProcess)
           ?.map(item => ({ ...item, percentage: parseInt(item.percentage, 10) }))
@@ -122,7 +122,7 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
   const conifg = {
     xField: 'name',
     yField: 'count',
-    legend: false,
+    // legend: false,
     shape: 'pyramid',
     conversionTag: false
   }
@@ -161,11 +161,11 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
       </div>
       <div className="w-17/20">
         <div className="ml-8 bg-white shadow-card">
-          {state.businessGroupId ? (
+          {state.params.businessGroupId ? (
             <ProTable
               bordered
               actionRef={tRef}
-              params={{ businessGroupId: state.businessGroupId }}
+              params={state.params}
               rowKey={record => record.id}
               columns={columns}
               onLoadingChange={loadingStatus => {
@@ -184,6 +184,16 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
                   total
                 }
               }}
+              headerTitle={
+                <Select
+                  defaultValue="oneself"
+                  dropdownMatchSelectWidth={false}
+                  onChange={e => {
+                    setState({ ...state, params: { ...state.params, dataPermission: e } })
+                  }}
+                  options={permData?.customer || []}
+                />
+              }
               search={false}
               toolbar={{
                 actions: [
@@ -202,8 +212,9 @@ const Business = ({ dispatch, groupList, shouldUpdate, loading }) => {
   )
 }
 
-export default connect(({ business, refresh, loading }) => ({
+export default connect(({ business, refresh, global, loading }) => ({
   groupList: business.groupList,
   loading: loading.models.business,
-  shouldUpdate: refresh.business
+  shouldUpdate: refresh.business,
+  permData: global.premData
 }))(Business)

+ 4 - 4
src/pages/Customer/Client/components/ContactDetail/ContanctForm.jsx

@@ -137,7 +137,7 @@ const ContanctForm = props => {
           {client.tagIds?.map(item => (
             <Tooltip title={personTags.find(i => i.id === item)?.name} key={client.id + item}>
               <span
-                className="inline-block w-12px h-12px rounded-1\/2 mr-3px"
+                className="inline-block w-12px h-12px rounded-1/2 mr-3px"
                 style={{ backgroundColor: personTagColorMap[item] }}
               />
             </Tooltip>
@@ -146,7 +146,7 @@ const ContanctForm = props => {
             dataId={client.id}
             tagIds={client.tagIds}
             tagType={TagTypeEnum.PERSONTAG}
-            tagColumn={TagDataTypeEnum.CONTACT}
+            tagColumn={TagDataTypeEnum.CLIENT}
             checkCallBack={refreshClient}
             modeType={LabelModeType.column}>
             <Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />
@@ -164,7 +164,7 @@ const ContanctForm = props => {
           {client.tagCooperationIds?.map(item => (
             <Tooltip title={teamTags.find(i => i.id === item)?.name} key={client.id + item}>
               <span
-                className="inline-block w-12px p-12px mr-3px"
+                className="inline-block w-12px h-12px mr-3px"
                 style={{ backgroundColor: teamTagColorMap[item] }}
               />
             </Tooltip>
@@ -173,7 +173,7 @@ const ContanctForm = props => {
             dataId={client.id}
             tagIds={client.tagCooperationIds}
             tagType={TagTypeEnum.TEAMTAG}
-            tagColumn={TagDataTypeEnum.CONTACT}
+            tagColumn={TagDataTypeEnum.CLIENT}
             checkCallBack={refreshClient}
             modeType={LabelModeType.column}>
             <Add theme="filled" size="20" fill="#868e96" className="cursor-pointer" />

+ 11 - 7
src/pages/Customer/Client/index.jsx

@@ -253,7 +253,7 @@ const Client = props => {
           {record.tagIds.map(item => (
             <Tooltip title={personTags.find(i => i.id === item)?.name} key={record.id + item}>
               <span
-                className="inline-block w-12px h-12px rounded-1\/2 mr-3px"
+                className="inline-block w-12px h-12px rounded-1/2 mr-3px"
                 style={{ backgroundColor: personTagColorMap[item] }}
               />
             </Tooltip>
@@ -566,12 +566,16 @@ const Client = props => {
         search={{ filterType: 'light' }}
         toolbar={{
           search: (
-            <Input.Search
-              style={{ width: '300px' }}
-              allowClear={true}
-              placeholder="输入联系人、客户名称、电话邮箱等"
-              onSearch={handleSearch}
-            />
+            <Tooltip placement="bottom" title="输入联系人、客户名称、电话邮箱等">
+              <Input.Search
+                style={{ width: '300px' }}
+                allowClear={true}
+                placeholder={`在${
+                  permData?.customer.find(item => item.value === state.params.dataPermission)?.label
+                }下搜索`}
+                onSearch={handleSearch}
+              />
+            </Tooltip>
           ),
           // search: {
           //   allowClear: true,

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

@@ -103,7 +103,7 @@ const CompanyForm = props => {
           {customer.tagIds?.map(item => (
             <Tooltip title={personTags.find(i => i.id === item)?.name} key={customer.id + item}>
               <span
-                className="inline-block w-12px h-12px rounded-1\/2 mr-3px"
+                className="inline-block w-12px h-12px rounded-1/2 mr-3px"
                 style={{ backgroundColor: personTagColorMap[item] }}
               />
             </Tooltip>

+ 14 - 10
src/pages/Customer/Company/index.jsx

@@ -74,7 +74,7 @@ const Company = props => {
 
   const [state, setState] = useState({
     id: '',
-    params: {},
+    params: { dataPermission: 'oneself' },
     visible: false,
     orderIds: []
   })
@@ -254,21 +254,21 @@ const Company = props => {
       width: 80
     },
     {
-      title: '公司性质',
+      title: '客户性质',
       dataIndex: 'nature',
       key: 'nature',
       search: false,
       width: 80
     },
     {
-      title: '公司地址',
+      title: '客户地址',
       dataIndex: 'address',
       key: 'address',
       search: false,
       width: 80
     },
     {
-      title: '公司传真',
+      title: '客户传真',
       dataIndex: 'fax',
       key: 'fax',
       search: false,
@@ -449,12 +449,16 @@ const Company = props => {
         search={{ filterType: 'light' }}
         toolbar={{
           search: (
-            <Input.Search
-              style={{ width: '300px' }}
-              allowClear={true}
-              placeholder="输入客户名称、公司性质等"
-              onSearch={handleSearch}
-            />
+            <Tooltip placement="bottom" title="输入客户名称、客户性质等">
+              <Input.Search
+                style={{ width: '300px' }}
+                allowClear={true}
+                placeholder={`在${
+                  permData?.customer.find(item => item.value === state.params.dataPermission)?.label
+                }下搜索`}
+                onSearch={handleSearch}
+              />
+            </Tooltip>
           ),
           actions: [
             <LazyCascader