|
|
@@ -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
|