Browse Source

feat: 111

lanjianrong 5 năm trước cách đây
mục cha
commit
ce0b1b15d4

+ 1 - 1
src/pages/Customer/Client/components/AddClient/index.jsx

@@ -28,7 +28,7 @@ const AddClient = props => {
     <ModalDragForm
       {...layout}
       formRef={formRef}
-      modalProps={{ zIndex: 1060, getContainer: false }}
+      modalProps={{ zIndex: 1003, getContainer: false }}
       title="添加客户"
       onVisibleChange={visible => {
         if (visible) {

+ 26 - 18
src/pages/Customer/Client/components/ClientDetail/AddRecord.jsx

@@ -21,7 +21,7 @@ const AddRecord = props => {
 
   return (
     <ModalDragForm
-      modalProps={{ zIndex: 1060, getContainer: false }}
+      modalProps={{ zIndex: 1003, getContainer: false }}
       layout="vertical"
       title="添加服务记录"
       formRef={formRef}
@@ -32,22 +32,19 @@ const AddRecord = props => {
         </Button>
       }
       onFinish={async values => {
-        try {
-          const newVal = { ...values }
-          formRef.current?.resetFields()
-          if (values.date) {
-            newVal.date = dayjsFormat(values.date, 'YYYY-MM-DD')
-          }
-          if (values.remindTime) {
-            newVal.remindTime = dayjsFormat(values.remindTime, 'YYYY-MM-DD')
-          }
-          await onConfirm(newVal)
-          return true
-        } catch (error) {
-          return false
+        const newVal = { ...values }
+        formRef.current?.resetFields()
+        if (values.date) {
+          newVal.date = dayjsFormat(values.date, 'YYYY-MM-DD')
         }
+        if (values.remindTime) {
+          newVal.remindTime = dayjsFormat(values.remindTime, 'YYYY-MM-DD')
+        }
+        await onConfirm(newVal)
+
+        return true
       }}>
-      <Form.Item name="status" rules={[{ required: true, message: '请选择类型' }]}>
+      <Form.Item name="status" label="服务类型" rules={[{ required: true, message: '请选择类型' }]}>
         <Radio.Group>
           <Radio value={1}>上门服务</Radio>
           <Radio value={2}>电话拜访</Radio>
@@ -55,10 +52,18 @@ const AddRecord = props => {
           <Radio value={4}>在线服务</Radio>
         </Radio.Group>
       </Form.Item>
-      <Form.Item name="date" label="服务日期" initialValue={dayjs(new Date())}>
+      <Form.Item
+        name="date"
+        label="服务日期"
+        initialValue={dayjs(new Date())}
+        rules={[{ required: true, message: '请选择服务日期' }]}>
         <DatePicker style={{ width: '100%' }} />
       </Form.Item>
-      <ProFormTextArea name="mark" label="内容" />
+      <ProFormTextArea
+        name="mark"
+        label="内容"
+        rules={[{ required: true, message: '请输入服务内容' }]}
+      />
 
       <div className="pb-5">
         <Switch onChange={onChange} checked={showExtraItem} />
@@ -66,7 +71,10 @@ const AddRecord = props => {
       </div>
       {showExtraItem ? (
         <>
-          <Form.Item name="remindTime" label="备忘日期" required={true}>
+          <Form.Item
+            name="remindTime"
+            label="备忘日期"
+            rules={[{ required: true, message: '请选择备忘日期' }]}>
             <DatePicker style={{ width: '100%' }} disabledDate={disabledDate} />
           </Form.Item>
           <ProFormTextArea name="remarks" label="备忘内容" />

+ 16 - 1
src/pages/Customer/Client/components/ClientDetail/Form.jsx

@@ -1,5 +1,5 @@
 import { Row, Col, Tooltip } from 'antd'
-import React from 'react'
+import React, { useEffect } from 'react'
 import EditableForm from '@/components/EditableForm'
 import ChangeCompanyInput from '@/pages/Customer/Company/components/ChangeCompany'
 import { connect } from 'umi'
@@ -27,6 +27,21 @@ const ContanctForm = props => {
     })
   }
 
+  useEffect(() => {
+    if (!personTags.length) {
+      dispatch({
+        type: 'client/fetchTags',
+        payload: { tagType: TagTypeEnum.PERSONTAG, tagColumn: TagDataTypeEnum.CLIENT }
+      })
+    }
+    if (!teamTags.length) {
+      dispatch({
+        type: 'client/fetchTags',
+        payload: { tagType: TagTypeEnum.TEAMTAG, tagColumn: TagDataTypeEnum.CLIENT }
+      })
+    }
+  }, [])
+
   const columns = [
     {
       dataIndex: 'clientName',

+ 1 - 1
src/pages/Customer/Client/components/ClientDetail/TabList.jsx

@@ -21,7 +21,7 @@ const ContanctTabList = ({ clientId, software }) => {
   const showLongleDrawer = id => {
     toggleDrawer()
     setDrawerProps({
-      zIndex: 1040,
+      zIndex: 1001,
       closable: true,
       onClose: () => toggleDrawer(),
       bodyStyle: {

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

@@ -237,7 +237,7 @@ const Client = props => {
       width: 75,
       search: false,
       ellipsis: true,
-      renderText: text => text?.replaceAll(' / ', ',')
+      renderText: text => text?.replaceAll(' / ', ' , ')
     },
     {
       title: '个人标签',

+ 3 - 3
src/pages/Customer/Company/components/AddCompany/CompanyFormItem.jsx

@@ -41,7 +41,7 @@ const CompanyFormItem = ({ value, onChange }) => {
 
   const showCompanyDrawer = id => {
     setDrawerProps({
-      zIndex: 1060,
+      zIndex: 1003,
       closable: true,
       onClose: () => toggleDrawer(),
       bodyStyle: {
@@ -49,13 +49,13 @@ const CompanyFormItem = ({ value, onChange }) => {
       },
       children: <CompanyDetail dataId={id} />
     })
-    toggleDrawer()
+    toggleDrawer(true)
   }
 
   const { visible, list, inputVal } = state
   return (
     <Popover
-      zIndex={1050}
+      zIndex={1004}
       placement="bottom"
       visible={visible && list && list.length}
       onVisibleChange={e => setState({ ...state, visible: e })}

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

@@ -26,7 +26,7 @@ const AddCompanyModal = ({ reload, dataId, dataType, onConfirm, dispatch, nature
   const [showDataItem, setShowDataItem] = useState(false)
   return (
     <ModalDragForm
-      modalProps={{ zIndex: 1050, getContainer: false }}
+      modalProps={{ zIndex: 1003, getContainer: false }}
       formRef={formRef}
       title="添加新单位"
       {...layout}

+ 7 - 8
src/pages/Customer/Company/components/ChangeCompany/index.jsx

@@ -1,6 +1,6 @@
 import { useModal } from '@/components/Modal'
 import { LinkOne, LinkInterrupt, Switch } from '@icon-park/react'
-import { Card, Tooltip } from 'antd'
+import { Card, Modal, Tooltip } from 'antd'
 import React from 'react'
 import styles from './index.less'
 import SearchModal from '@/pages/Customer/Company/components/ConnectCompany'
@@ -40,7 +40,7 @@ const ChangeCompanyInput = props => {
   }
   const handleConnectCustomer = () => {
     setModalProps({
-      zIndex: 1050,
+      zIndex: 1002,
       width: '60vw',
       modalRender: node => (
         <SearchModal onSelect={refreshClient} node={node} dataId={dataId} preUrl={actionPayload} />
@@ -57,9 +57,10 @@ const ChangeCompanyInput = props => {
   )
 
   const removeCustomer = () => {
-    setModalProps({
+    Modal.confirm({
+      zIndex: 1002,
       title: '确认移除',
-      children: (
+      content: (
         <p>
           为{title}
           <span className="mr-3px ml-3px font-600">{targetName}</span>移除
@@ -69,16 +70,14 @@ const ChangeCompanyInput = props => {
       onOk: async () => {
         await apiDelCustomer(actionPayload, { id: dataId, customerId })
         refreshClient()
-        toggleModal()
-      },
-      onCancel: () => toggleModal()
+      }
     })
-    toggleModal()
   }
 
   const handleCompanyClick = () => {
     toggleDrawer()
     setDrawerProps({
+      zIndex: 1001,
       closable: true,
       onClose: () => toggleDrawer(),
       bodyStyle: {

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

@@ -96,7 +96,7 @@ const SyncClient = ({ customer, client }) => {
         </div> */}
       </Button>
       <Modal
-        zIndex={1060}
+        zIndex={1003}
         width="70%"
         title={`同步 ${customer.companyName} 信息`}
         getContainer={false}

+ 4 - 5
src/pages/Customer/Company/components/CompanyDetail/TabList.jsx

@@ -23,9 +23,8 @@ const CompanyTabList = ({ initData, customerId, client, software, customer }) =>
   })
   // 展示drawer
   const showDrawer = id => {
-    toggleDrawer()
     setDrawerProps({
-      zIndex: 1040,
+      zIndex: 1001,
       closable: true,
       onClose: () => toggleDrawer(),
       bodyStyle: {
@@ -34,13 +33,13 @@ const CompanyTabList = ({ initData, customerId, client, software, customer }) =>
       },
       children: <ContactDetail dataId={id} />
     })
-    toggleDrawer()
+    toggleDrawer(true)
   }
   // 展示软件锁drawer
   const showLongleDrawer = id => {
     toggleDrawer()
     setDrawerProps({
-      zIndex: 1040,
+      zIndex: 1001,
       closable: true,
       onClose: () => toggleDrawer(),
       bodyStyle: {
@@ -49,7 +48,7 @@ const CompanyTabList = ({ initData, customerId, client, software, customer }) =>
       },
       children: <LocksDetail dataId={id} orderIds={state.orderIds} />
     })
-    toggleDrawer()
+    toggleDrawer(true)
   }
   const columns = [
     {

+ 2 - 1
src/pages/Customer/Company/index.jsx

@@ -177,7 +177,7 @@ const Company = props => {
       search: false,
       width: 100,
       ellipsis: true,
-      renderText: text => text?.replaceAll(' / ', ',')
+      renderText: text => text?.replaceAll(' / ', ' , ')
     },
     {
       title: '单位电话',
@@ -324,6 +324,7 @@ const Company = props => {
     {
       title: '软件锁',
       dataIndex: 'longleTotal',
+      search: false,
       width: 50
     }
   ]

+ 2 - 1
src/pages/Product/Lock/Lockstore/components/ChangeClient/index.jsx

@@ -22,6 +22,7 @@ const ChangeClient = props => {
   }
   const handleConnectCustomer = () => {
     setModalProps({
+      zIndex: 1002,
       width: '60vw',
       modalRender: () => (
         <ConnectClient
@@ -33,7 +34,7 @@ const ChangeClient = props => {
       ),
       onCancel: () => toggleModal()
     })
-    toggleModal()
+    toggleModal(true)
   }
   const notValueRender = (
     <div onClick={handleConnectCustomer} className={styles.notCompanyContent}>

+ 22 - 5
src/pages/workbench/Dashboard/components/RatioPanels.jsx

@@ -65,7 +65,7 @@ const ServiceRatioPanels = ({ staffIds, cyclical, dataPermission }) => {
       children = <CompanyDetail dataId={id} orderIds={state.orderIds} />
     }
     setDrawerProps({
-      zIndex: 1040,
+      zIndex: 1001,
       closable: true,
       onClose: () => toggleDrawer(),
       bodyStyle: {
@@ -184,7 +184,7 @@ const RatioPanels = ({ dataType, staffIds, retioCyclical, dataPermission }) => {
   }
   const showDrawer = id => {
     setDrawerProps({
-      zIndex: 1040,
+      zIndex: 1001,
       closable: true,
       onClose: () => toggleDrawer(),
       bodyStyle: {
@@ -198,7 +198,7 @@ const RatioPanels = ({ dataType, staffIds, retioCyclical, dataPermission }) => {
   // 展示单位
   const showDrawerComapny = id => {
     setDrawerProps({
-      zIndex: 1040,
+      zIndex: 1001,
       closable: true,
       onClose: () => toggleDrawer(),
       bodyStyle: {
@@ -232,31 +232,38 @@ const RatioPanels = ({ dataType, staffIds, retioCyclical, dataPermission }) => {
       {
         dataIndex: 'districtName',
         title: '地区',
-        width: '15%'
+        width: '15%',
+        ellipsis: true,
+        renderText: text => text && text?.replaceAll(' / ', ' , ')
       },
       {
         dataIndex: 'phone',
         title: '手机',
+        ellipsis: true,
         width: '5%'
       },
       {
         dataIndex: 'email',
         title: '邮箱',
+        ellipsis: true,
         width: '7%'
       },
       {
         dataIndex: 'qq',
         title: 'QQ',
+        ellipsis: true,
         width: '5%'
       },
       {
         dataIndex: 'staffName',
         title: '创建人',
+        ellipsis: true,
         width: '7%'
       },
       {
         dataIndex: 'createTime',
         title: '创建时间',
+        ellipsis: true,
         width: '7%'
       }
     ],
@@ -276,7 +283,9 @@ const RatioPanels = ({ dataType, staffIds, retioCyclical, dataPermission }) => {
       {
         dataIndex: 'districtName',
         title: '地区',
-        width: '15%'
+        width: '15%',
+        ellipsis: true,
+        renderText: text => text && text?.replaceAll(' / ', ' , ')
       },
       {
         dataIndex: 'nature',
@@ -287,16 +296,19 @@ const RatioPanels = ({ dataType, staffIds, retioCyclical, dataPermission }) => {
       {
         dataIndex: 'phone',
         title: '单位电话',
+        ellipsis: true,
         width: '5%'
       },
       {
         dataIndex: 'staffName',
         title: '创建人',
+        ellipsis: true,
         width: '7%'
       },
       {
         dataIndex: 'createTime',
         title: '创建时间',
+        ellipsis: true,
         width: '7%'
       }
     ],
@@ -309,26 +321,31 @@ const RatioPanels = ({ dataType, staffIds, retioCyclical, dataPermission }) => {
       {
         dataIndex: 'customerName',
         title: '单位名称',
+        ellipsis: true,
         width: '20%'
       },
       {
         dataIndex: 'businessStatusName',
         title: '商机状态',
+        ellipsis: true,
         width: '5%'
       },
       {
         dataIndex: 'price',
         title: '商机金额',
+        ellipsis: true,
         width: '5%'
       },
       {
         dataIndex: 'staffName',
         title: '创建人',
+        ellipsis: true,
         width: '7%'
       },
       {
         dataIndex: 'createTime',
         title: '创建时间',
+        ellipsis: true,
         width: '7%'
       }
     ]

+ 32 - 16
src/pages/workbench/Dashboard/components/ReminderList.jsx

@@ -17,33 +17,39 @@ const ReminderList = props => {
     {
       title: '客户名称',
       dataIndex: 'clientName',
+      ellipsis: true,
       width: '10%'
     },
     {
       title: '地区',
       dataIndex: 'districtName',
-      width: '12%'
+      ellipsis: true,
+      width: '15%',
+      renderText: text => text?.replaceAll(' / ', ' , ')
     },
     {
       title: '手机',
       dataIndex: 'telephone',
+      ellipsis: true,
       width: '10%'
     },
     {
       title: '服务日期',
       dataIndex: 'serviceDate',
-      width: '10%'
+      ellipsis: true,
+      width: '8%'
     },
     {
       title: '服务内容',
       dataIndex: 'serviceContent',
-      width: '27%',
+      width: '26%',
       ellipsis: true
     },
     {
       title: '备忘时间',
       dataIndex: 'memoDate',
-      width: '10%'
+      width: '10%',
+      ellipsis: true
     },
     {
       title: '备忘内容',
@@ -56,38 +62,44 @@ const ReminderList = props => {
     {
       title: '单位名称',
       dataIndex: 'companyName',
-      width: '15%'
+      width: '15%',
+      ellipsis: true
     },
     {
       title: '地区',
       dataIndex: 'districtName',
-      width: '12%'
+      width: '15%',
+      ellipsis: true,
+      renderText: text => text?.replaceAll(' / ', ' , ')
     },
     {
       title: '电话',
       dataIndex: 'phone',
-      width: '10%'
+      width: '10%',
+      ellipsis: true
     },
     {
       title: '服务日期',
       dataIndex: 'serviceDate',
-      width: '10%'
+      width: '8%',
+      ellipsis: true
     },
     {
       title: '服务内容',
       dataIndex: 'serviceContent',
-      width: '25%',
+      width: '24%',
       ellipsis: true
     },
     {
       title: '备忘时间',
       dataIndex: 'memoDate',
-      width: '10%'
+      width: '10%',
+      ellipsis: true
     },
     {
       title: '备忘内容',
       dataIndex: 'memoContent',
-      width: '25%',
+      width: '22%',
       ellipsis: true
     }
   ]
@@ -95,28 +107,32 @@ const ReminderList = props => {
     {
       title: '商机名称',
       dataIndex: 'name',
-      width: '15%'
+      width: '15%',
+      ellipsis: true
     },
     {
       title: '单位名称',
       dataIndex: 'customerName',
-      width: '15%'
+      width: '15%',
+      ellipsis: true
     },
     {
       title: '服务日期',
       dataIndex: 'serviceDate',
-      width: '10%'
+      width: '8%',
+      ellipsis: true
     },
     {
       title: '服务内容',
       dataIndex: 'serviceContent',
-      width: '25%',
+      width: '27%',
       ellipsis: true
     },
     {
       title: '备忘时间',
       dataIndex: 'memoDate',
-      width: '10%'
+      width: '10%',
+      ellipsis: true
     },
     {
       title: '备忘内容',

+ 7 - 3
src/pages/workbench/Dashboard/index.less

@@ -1,7 +1,11 @@
 .dashboard {
-  overflow: -moz-scrollbars-none !important;
-  -ms-overflow-style: none !important;
+  height: calc(100vh - 48px - 48px);
+  overflow-y: scroll;
+
+  :global(.ant-pro-basicLayout-content) {
+    margin: 24px 24px 0 24px !important;
+  }
   &::-webkit-scrollbar {
-    width: 0 !important;
+    display: none;
   }
 }

+ 4 - 1
windi.config.ts

@@ -27,7 +27,10 @@ export default defineConfig({
         card: '0 0 13px 0 rgba(74, 53, 107, 0.08)'
       },
       zIndex: {
-        max: 999
+        max: 999,
+        1060: 1060,
+        1050: 1050,
+        1040: 1040
       }
     }
   }