lanjianrong 4 лет назад
Родитель
Сommit
09fc299811

+ 2 - 7
src/pages/Customer/Business/components/ChangeStaff/index.jsx

@@ -42,12 +42,7 @@ const ChangeStaff = props => {
           {text}
         </div>
         <div className="max-w-55px">
-          <Tooltip
-            placement="right"
-            title="更换负责人"
-            className="ml-5px"
-            onClick={handleConnectCustomer}
-          >
+          <Tooltip placement="right" title="更换负责人" className="ml-5px" onClick={handleConnectCustomer}>
             <span className={styles.switchIcon}>
               <Switch />
             </span>
@@ -58,7 +53,7 @@ const ChangeStaff = props => {
   )
   return (
     <div className={styles.businessInput}>
-      {responsibleId !== consts.ENCRYPTION_ZERO ? normalValueRender : notValueRender}
+      {responsibleId && responsibleId !== consts.ENCRYPTION_ZERO ? normalValueRender : notValueRender}
     </div>
   )
 }

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

@@ -17,8 +17,16 @@ import { useModal } from '@/components/ModalStore'
 import { Plus } from '@icon-park/react'
 const Client = props => {
   const dispatchModal = useModal()
-  const { personTagColorMap, teamTagColorMap, personTags, teamTags, dispatch, shouldUpdate, loading, sourceList } =
-    props
+  const {
+    personTagColorMap,
+    teamTagColorMap,
+    personTags,
+    teamTags,
+    dispatch,
+    shouldUpdate,
+    loading,
+    sourceList
+  } = props
 
   const { initialState: { permData } = { permData: {} } } = useModel('@@initialState')
   const hasAddPerm = useAccess()?.validatePermByType('client_add') || false
@@ -58,7 +66,10 @@ const Client = props => {
       teamTagMap[item.id] = {
         text: (
           <>
-            <span className="w-12px h-12px inline-block mr-3px" style={{ backgroundColor: teamTagColorMap[item.id] }} />
+            <span
+              className="w-12px h-12px inline-block mr-3px"
+              style={{ backgroundColor: teamTagColorMap[item.id] }}
+            />
             <span>{item.name}</span>
           </>
         )
@@ -143,15 +154,15 @@ const Client = props => {
       width: 200,
       // ellipsis: true,
       render: (companyName, record) =>
-        record.companyId !== consts.ENCRYPTION_ZERO ? (
+        record.companyId ? (
           <span
-            onClick={() =>
+            onClick={() => {
               dispatchModal('D_COMPANY_DETAIL', {
                 updateKey: 'client',
                 dataId: record.companyId,
                 orderIds: state.orderIds
               })
-            }
+            }}
             className="text-primary cursor-pointer hover:text-hex-967bbd"
           >
             {companyName}
@@ -555,7 +566,8 @@ const Client = props => {
                 style={{ width: '250px' }}
                 allowClear={true}
                 placeholder={`在${
-                  permData[PermDataTypeEunm.CUSTOMER]?.find(item => item.value === defaultPermAuthCache)?.label
+                  permData[PermDataTypeEunm.CUSTOMER]?.find(item => item.value === defaultPermAuthCache)
+                    ?.label
                 }下搜索`}
                 onSearch={handleSearch}
               />

+ 2 - 7
src/pages/Hr/Employee/components/ChangeSupervisor/index.jsx

@@ -70,12 +70,7 @@ const ChangeSupervisor = props => {
               <LinkInterrupt />
             </span>
           </Tooltip>
-          <Tooltip
-            placement="right"
-            title="更换上司"
-            className="ml-5px"
-            onClick={handleConnectStaff}
-          >
+          <Tooltip placement="right" title="更换上司" className="ml-5px" onClick={handleConnectStaff}>
             <span className={styles.switchIcon}>
               <Switch />
             </span>
@@ -86,7 +81,7 @@ const ChangeSupervisor = props => {
   )
   return (
     <div className={styles.companyInput}>
-      {staffId !== consts.ENCRYPTION_ZERO ? normalValueRender : notValueRender}
+      {staffId && staffId !== consts.ENCRYPTION_ZERO ? normalValueRender : notValueRender}
     </div>
   )
 }

+ 4 - 13
src/pages/Product/Lock/LockStore/components/ChangeClient/index.jsx

@@ -7,10 +7,7 @@ import { isEmpty, isNullOrUnDef } from '@/utils/is'
 import styles from './index.less'
 import { useModal } from '@/components/ModalStore'
 
-const ChangeClient = ({
-  actionPayload,
-  dataSource: { clientName = '', longleId, clientId }
-} = {}) => {
+const ChangeClient = ({ actionPayload, dataSource: { clientName = '', longleId, clientId } } = {}) => {
   const dispatchModal = useModal()
   const dispatch = useDispatch()
   if (isNullOrUnDef(clientName) || isEmpty(clientName)) return null
@@ -42,17 +39,11 @@ const ChangeClient = ({
       <div className="flex justify-between">
         <div
           className={styles.nameContent}
-          onClick={() => dispatchModal('D_CLIENT_DETAIL', { dataId: clientId })}
-        >
+          onClick={() => dispatchModal('D_CLIENT_DETAIL', { dataId: clientId })}>
           {clientName}
         </div>
         <div className="max-w-55px">
-          <Tooltip
-            placement="right"
-            title="更换客户"
-            className="ml-5px"
-            onClick={openConnectClientModal}
-          >
+          <Tooltip placement="right" title="更换客户" className="ml-5px" onClick={openConnectClientModal}>
             <span className={styles.switchIcon}>
               <Switch />
             </span>
@@ -63,7 +54,7 @@ const ChangeClient = ({
   )
   return (
     <div className={styles.companyInput}>
-      {clientId !== consts.ENCRYPTION_ZERO ? normalValueRender : notValueRender}
+      {clientId && clientId !== consts.ENCRYPTION_ZERO ? normalValueRender : notValueRender}
     </div>
   )
 }

+ 9 - 21
src/pages/Product/Lock/LockStore/index.jsx

@@ -89,11 +89,8 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       fixed: 'left',
       render: (keyNum, record) => (
         <span
-          onClick={() =>
-            dispatchModal('D_LOCK_DETAIL', { dataId: record.id, orderIds: state.orderIds })
-          }
-          className="text-primary cursor-pointer hover:text-hex-967bbd"
-        >
+          onClick={() => dispatchModal('D_LOCK_DETAIL', { dataId: record.id, orderIds: state.orderIds })}
+          className="text-primary cursor-pointer hover:text-hex-967bbd">
           {keyNum}
         </span>
       )
@@ -207,11 +204,8 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       width: 150,
       render: (text, record) => (
         <span
-          onClick={() =>
-            dispatchModal('D_CLIENT_DETAIL', { updateKey: 'longle', dataId: record.clientId })
-          }
-          className="text-primary cursor-pointer hover:text-hex-967bbd"
-        >
+          onClick={() => dispatchModal('D_CLIENT_DETAIL', { updateKey: 'longle', dataId: record.clientId })}
+          className="text-primary cursor-pointer hover:text-hex-967bbd">
           {text}
         </span>
       )
@@ -225,10 +219,10 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       render: (text, record) => (
         <span
           onClick={() =>
+            record.customerId &&
             dispatchModal('D_COMPANY_DETAIL', { updateKey: 'longle', dataId: record.customerId })
           }
-          className="text-primary cursor-pointer hover:text-hex-967bbd"
-        >
+          className="text-primary cursor-pointer hover:text-hex-967bbd">
           {text}
         </span>
       )
@@ -245,8 +239,7 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
               dataId: record.responsibleId
             })
           }
-          className="text-primary cursor-pointer hover:text-hex-967bbd"
-        >
+          className="text-primary cursor-pointer hover:text-hex-967bbd">
           {text}
         </span>
       )
@@ -321,10 +314,7 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
         //   </Button>
         // </Dropdown>
         state.totalOld ? (
-          <Button
-            type="primary"
-            onClick={() => dispatchModal('M_RECEIVE_LOCK', { refresh: refreshData })}
-          >
+          <Button type="primary" onClick={() => dispatchModal('M_RECEIVE_LOCK', { refresh: refreshData })}>
             接收旧锁({state.totalOld})
           </Button>
         ) : null
@@ -336,9 +326,7 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
               style={{ width: '300px' }}
               allowClear={true}
               placeholder={`在${
-                permData[PermDataTypeEunm.PRODUCT]?.find(
-                  item => item.value === defaultPermAuthCache
-                )?.label
+                permData[PermDataTypeEunm.PRODUCT]?.find(item => item.value === defaultPermAuthCache)?.label
               }下搜索`}
               onSearch={handleSearch}
             />