|
|
@@ -1,6 +1,5 @@
|
|
|
import React, { useEffect, useState, useRef } from 'react'
|
|
|
import { Tag, Select, Tooltip, Input, DatePicker, Button } from 'antd'
|
|
|
-import ProTable from '@ant-design/pro-table'
|
|
|
import consts from '@/consts'
|
|
|
import { useModel, connect } from 'umi'
|
|
|
import { queryLock } from '@/services/lock'
|
|
|
@@ -8,13 +7,12 @@ import LocksDetail from '@/pages/Product/Lock/LockStore/components/LocksDetail'
|
|
|
import ContactDetail from '@/pages/Customer/Client/components/ClientDetail'
|
|
|
import SoftwareDetail from '@/pages/Product/Lock/LockStore/components/SoftwareDetail'
|
|
|
import { useModal } from '@/components/Modal'
|
|
|
-import { useTableScroll } from '@/hooks/useAutoTable'
|
|
|
import CompanyDetail from '@/pages/Customer/Company/components/CompanyDetail'
|
|
|
import { refactorSortField } from '@/utils/utils'
|
|
|
import ReceiveLock from './components/ReceiveLock'
|
|
|
import ReceiveNewLock from './components/ReceiveNewLock'
|
|
|
-import PermSelect from '@/pages/Customer/Company/components/PermSelect'
|
|
|
import { PermDataTypeEunm } from '@/pages/Customer/Company/components/PermSelect'
|
|
|
+import BasicTable from '@/components/Table'
|
|
|
|
|
|
// 渲染产品标签
|
|
|
export const ProductLabel = ({ data }) => {
|
|
|
@@ -82,15 +80,13 @@ const longlePreserveStatusNum = {
|
|
|
3: { text: '收回' }
|
|
|
}
|
|
|
|
|
|
-// 刷新
|
|
|
-const refreshData = () => {
|
|
|
- tRef.current.reload()
|
|
|
-}
|
|
|
-
|
|
|
const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
|
|
|
const tRef = useRef()
|
|
|
- const [selectKeys] = useState([])
|
|
|
const { toggleDrawer, setDrawerProps, toggleModal, setModalProps } = useModal()
|
|
|
+ // 刷新
|
|
|
+ const refreshData = () => {
|
|
|
+ tRef.current?.reload()
|
|
|
+ }
|
|
|
const showReceiveLockModal = () => {
|
|
|
setModalProps({
|
|
|
width: '60vw',
|
|
|
@@ -351,28 +347,15 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- const { getScrollRef, redoHeight } = useTableScroll(columns, selectKeys)
|
|
|
-
|
|
|
- // 处理权限Select下拉组件OnChange事件
|
|
|
- const handlePermChange = ({ staffIds = [], dataPermission }) => {
|
|
|
- if (staffIds?.length) {
|
|
|
- setState({ ...state, params: { ...state.params, staffIds, dataPermission: null } })
|
|
|
- return
|
|
|
- }
|
|
|
- setState({ ...state, params: { ...state.params, staffIds: null, dataPermission } })
|
|
|
- }
|
|
|
-
|
|
|
return (
|
|
|
- <ProTable
|
|
|
+ <BasicTable
|
|
|
rowKey={record => record.id}
|
|
|
+ mainMenuType="product"
|
|
|
+ columnStateType="LOCKSTORE"
|
|
|
search={false}
|
|
|
- bordered
|
|
|
actionRef={tRef}
|
|
|
params={state.params}
|
|
|
columns={columns}
|
|
|
- onLoadingChange={loadingStatus => {
|
|
|
- loadingStatus && redoHeight()
|
|
|
- }}
|
|
|
request={async (params, sort, filter) => {
|
|
|
const srotOrder = refactorSortField(sort)
|
|
|
const {
|
|
|
@@ -396,7 +379,6 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
|
|
|
onColumnsStateChange={map => setColumnsStateMap(map)}
|
|
|
headerTitle={
|
|
|
<>
|
|
|
- <PermSelect onConfirm={handlePermChange} dataType={PermDataTypeEunm.PRODUCT} />
|
|
|
{state.totalOld ? (
|
|
|
<Button type="primary" className="ml-4" onClick={() => showReceiveLockModal()}>
|
|
|
待接收锁 ({state.totalOld})
|