|
|
@@ -4,7 +4,7 @@ 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, queryOldLockList } from '@/services/lock'
|
|
|
+import { apiReceiveOldLock, apiReceiveLock, queryOldLockList } from '@/services/lock'
|
|
|
import { ProductLabel } from '../index'
|
|
|
import ProTable from '@ant-design/pro-table'
|
|
|
|
|
|
@@ -17,11 +17,20 @@ const ReceiveLock = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- const receiveLongle = async (name, id) => {
|
|
|
- const { code = -1 } = await apiReceiveOldLock({ id })
|
|
|
- if (code === consts.RET_CODE.SUCCESS) {
|
|
|
- message.success(`锁(${name})接收成功`)
|
|
|
- tRef.current?.reload()
|
|
|
+ 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()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -48,7 +57,9 @@ const ReceiveLock = () => {
|
|
|
dataIndex: 'opreate',
|
|
|
title: '操作',
|
|
|
render: (_, record) => (
|
|
|
- <Button size="small" onClick={() => receiveLongle(record.keyNum, record.id)}>
|
|
|
+ <Button
|
|
|
+ size="small"
|
|
|
+ onClick={() => receiveLongle(record.keyNum, record.id, record.departmentName)}>
|
|
|
接收
|
|
|
</Button>
|
|
|
)
|