Kaynağa Gözat

feat: 修改员工详情更改部门上司触发的弹窗组件索引

lanjianrong 4 yıl önce
ebeveyn
işleme
f81073470a

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

@@ -30,7 +30,7 @@ const ChangeSupervisor = props => {
     })
   }
   const handleConnectStaff = () => {
-    dispatchModal('M_CONNECT_CLIENT', {
+    dispatchModal('M_CONNECT_STAFF', {
       onSelect: refreshStaff,
       id: clientId,
       preUrl: actionPayload.main

+ 3 - 2
src/pages/Hr/Employee/components/StaffModal/index.jsx

@@ -6,7 +6,7 @@ import { SearchOutlined } from '@ant-design/icons'
 import { queryStaff, apiChangeSupervisor } from '@/services/staff'
 import styles from '@/pages/Customer/Company/components/ConnectCompany/index.less'
 
-const StaffModal = ({ visible, onCancel, id, onSelect, postUrl }) => {
+const StaffModal = ({ visible, onCancel, id, onSelect, preUrl }) => {
   const scrollRef = useRef()
   const [state, setState] = useState({
     loading: true,
@@ -51,7 +51,7 @@ const StaffModal = ({ visible, onCancel, id, onSelect, postUrl }) => {
 
   // 关联上司
   const connectStaff = async dataId => {
-    const { code = -1 } = await apiChangeSupervisor(postUrl, { id, dataId })
+    const { code = -1 } = await apiChangeSupervisor(preUrl, { id, dataId })
     if (code === consts.RET_CODE.SUCCESS) {
       onSelect()
       setTimeout(() => {
@@ -88,6 +88,7 @@ const StaffModal = ({ visible, onCancel, id, onSelect, postUrl }) => {
           onChange={handleInputChange}
         />
       }
+      footer={false}
     >
       <div
         className={styles.modalContent}