lanjianrong %!s(int64=5) %!d(string=hai) anos
pai
achega
47aaeb8386

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

@@ -491,18 +491,20 @@ const Company = props => {
             onChange={e => {
               if (e === 'custom') {
                 setModalProps({
+                  width: '60vw',
                   modalRender: () => (
                     <CustomPerm
                       onConfirm={staffIds =>
                         setState({ ...state, params: { ...state.params, staffIds } })
                       }
                     />
-                  )
+                  ),
+                  onCancel: toggleModal
                 })
                 toggleModal()
                 return
               }
-              setState({ ...state, params: { ...state.params, dataPermission: e } })
+              setState({ ...state, params: { ...state.params, dataPermission: e, staffIds: null } })
             }}
             options={[...(permData?.customer || []), { value: 'custom', label: '自定义' }]}
           />

+ 14 - 20
src/pages/Product/Lock/Lockstore/components/ReceiveLock.jsx

@@ -4,9 +4,10 @@ import React, { useRef } from 'react'
 import styles from '@/pages/Customer/Company/components/ConnectCompany/index.less'
 import { CloseOutlined } from '@ant-design/icons'
 import consts from '@/basic/consts'
-import { apiReceiveOldLock, apiReceiveLock, queryOldLockList } from '@/services/lock'
+import { apiReceiveOldLock, queryOldLockList } from '@/services/lock'
 import { ProductLabel } from '../index'
 import ProTable from '@ant-design/pro-table'
+import DragModal from '@/components/DragModal'
 
 const ReceiveLock = () => {
   const dispatch = useDispatch()
@@ -17,20 +18,11 @@ const ReceiveLock = () => {
     })
   }
 
-  const receiveLongle = async (name, id, departmentName) => {
-    if (departmentName !== null) {
-      const { code = -1 } = await apiReceiveLock({ id })
-      if (code === consts.RET_CODE.SUCCESS) {
-        message.success(`锁(${name})接收成功`)
-        tRef.current?.reload()
-      }
-    }
-    if (departmentName === null) {
-      const { code = -1 } = await apiReceiveOldLock({ id })
-      if (code === consts.RET_CODE.SUCCESS) {
-        message.success(`锁(${name})接收成功`)
-        tRef.current?.reload()
-      }
+  const receiveLongle = async (name, id, departmentIsNull) => {
+    const { code = -1 } = await apiReceiveOldLock(departmentIsNull, { id })
+    if (code === consts.RET_CODE.SUCCESS) {
+      message.success(`锁(${name})接收成功`)
+      tRef.current?.reload()
     }
   }
 
@@ -59,7 +51,7 @@ const ReceiveLock = () => {
       render: (_, record) => (
         <Button
           size="small"
-          onClick={() => receiveLongle(record.keyNum, record.id, record.departmentName)}>
+          onClick={() => receiveLongle(record.keyNum, record.id, !record.departmentName)}>
           接收
         </Button>
       )
@@ -69,10 +61,12 @@ const ReceiveLock = () => {
   return (
     <div className={['ant-modal-content', styles.modalContainer].join(' ')}>
       <div className={styles.modalHeader}>
-        <p>以下锁为系统升级前未接收的锁,请及时接收;新系统生成的锁,将在列表中按“本部门”展示。</p>
-        <span className={styles.closeIcon}>
-          <CloseOutlined onClick={closeModal} />
-        </span>
+        <DragModal title="以下锁为系统升级前未接收的锁,请及时接收;新系统生成的锁,将在列表中按“本部门”展示。" />
+        <div className="ant-modal-close">
+          <span className="ant-modal-close-x">
+            <CloseOutlined onClick={closeModal} />
+          </span>
+        </div>
       </div>
       <div className={styles.modalContent}>
         <ProTable

+ 6 - 7
src/pages/workbench/Dashboard/components/ReminderList/index.jsx

@@ -1,18 +1,18 @@
-import React, { useState, useEffect } from 'react'
+import React from 'react'
 import { Button } from 'antd'
 import consts from '@/consts'
 import { useDispatch, connect } from 'umi'
 import ProTable from '@ant-design/pro-table'
 import { queryReminderList } from '@/services/dashboard'
 import { CloseOutlined } from '@ant-design/icons'
-import styles from './index.less'
+import styles from '@/pages/Customer/Company/components/ConnectCompany/index.less'
 
 const ReminderList = props => {
   const dispatch = useDispatch()
   const { dataType, reminderCyclical } = props
-  const [state, setState] = useState({
-    params: { dataType, reminderCyclical }
-  })
+  // const [state, setState] = useState({
+  //   params: { dataType, reminderCyclical }
+  // })
   const clientColumns = [
     {
       title: '联系人名称',
@@ -132,8 +132,7 @@ const ReminderList = props => {
           size="small"
           rowKey={record => record.id}
           columns={dataMap[dataType].columns}
-          // dataSource={state.client}
-          params={state.params}
+          params={{ dataType, reminderCyclical }}
           request={async params => {
             const { code = -1, data } = await queryReminderList({ ...params })
             return {

+ 0 - 15
src/pages/workbench/Dashboard/components/ReminderList/index.less

@@ -1,15 +0,0 @@
-.modalContainer {
-  width: 90vw;
-  .modalHeader {
-    position: relative;
-    padding: 1.5rem;
-    .closeIcon {
-      position: absolute;
-      top: 5px;
-      right: 7px;
-    }
-  }
-  .modalFooter {
-    padding: 1.5rem;
-  }
-}

+ 7 - 0
src/pages/workbench/Dashboard/consts.js

@@ -50,3 +50,10 @@ export const cyclicalOp = [
     title: '较前年'
   }
 ]
+
+export const cardTypeMap = {
+  CLIENT: 0, // 联系人
+  COMPANY: 1, // 客户
+  BUSINESS: 2, // 商机
+  SERVICE: 3 // 服务记录
+}

+ 6 - 9
src/services/lock.js

@@ -37,15 +37,12 @@ export async function queryOldLockList(params) {
 }
 
 /** 接收旧锁 */
-export async function apiReceiveOldLock(params) {
-  return request.post('/software/receiveOld', {
-    data: params
-  })
-}
-
-/** 接收新锁 */
-export async function apiReceiveLock(params) {
-  return request.post('/software/receive', {
+export async function apiReceiveOldLock(departmentIsNull, params) {
+  let url = '/software/receiveOld'
+  if (!departmentIsNull) {
+    url = '/software/receive'
+  }
+  return request.post(url, {
     data: params
   })
 }