|
|
@@ -1,8 +1,8 @@
|
|
|
import React, { useState } from 'react'
|
|
|
-import { Row, Col, List, Tabs, message, Button } from 'antd'
|
|
|
+import { Row, Col, List, Tabs, message, Button, Popconfirm } from 'antd'
|
|
|
import { dayjsFormat } from '@/utils/utils'
|
|
|
import consts from '@/consts'
|
|
|
-import { apiSoftwareAddLonglelog } from '@/services/product'
|
|
|
+import { apiSoftwareAddLonglelog, apiDelLonglelog } from '@/services/product'
|
|
|
import { ProductLabel } from '@/pages/Product/Lock/LockStore'
|
|
|
import LockModal, { lockTypeEnum } from './LockModal'
|
|
|
import ClientDetail from '@/pages/Customer/Client/components/ClientDetail'
|
|
|
@@ -25,7 +25,16 @@ const RenderLongleCon = ({ longleService }) => {
|
|
|
}
|
|
|
|
|
|
const LockTabList = props => {
|
|
|
- const { longleLog, longleId, keyNum, clientId, logStatus, upgradeProduct, sellStatus } = props
|
|
|
+ const {
|
|
|
+ longleLog,
|
|
|
+ longleId,
|
|
|
+ keyNum,
|
|
|
+ clientId,
|
|
|
+ logStatus,
|
|
|
+ upgradeProduct,
|
|
|
+ logStockStatus,
|
|
|
+ logSellStatus
|
|
|
+ } = props
|
|
|
const { toggleDrawer, setDrawerProps } = useModal()
|
|
|
const dispatch = useDispatch()
|
|
|
const { TabPane } = Tabs
|
|
|
@@ -69,6 +78,20 @@ const LockTabList = props => {
|
|
|
toggleDrawer()
|
|
|
}
|
|
|
|
|
|
+ // 删除软件锁日志
|
|
|
+ const delLonglelog = async id => {
|
|
|
+ const { code = -1 } = await apiDelLonglelog({
|
|
|
+ id
|
|
|
+ })
|
|
|
+ if (code === consts.RET_CODE.SUCCESS) {
|
|
|
+ message.success('删除成功')
|
|
|
+ dispatch({
|
|
|
+ type: 'refresh/commitAction',
|
|
|
+ payload: 'longle'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return (
|
|
|
<div>
|
|
|
<div className="pl-4">
|
|
|
@@ -103,6 +126,20 @@ const LockTabList = props => {
|
|
|
</Col>
|
|
|
<Col span="16">
|
|
|
<RenderLongleCon longleService={item} />
|
|
|
+ {item.status === 3 ||
|
|
|
+ item.status === 4 ||
|
|
|
+ item.status === 5 ||
|
|
|
+ item.status === 9 ? (
|
|
|
+ <Popconfirm
|
|
|
+ title="确认删除"
|
|
|
+ onConfirm={() => delLonglelog(item.longleId)}
|
|
|
+ okText="确认"
|
|
|
+ cancelText="取消">
|
|
|
+ <Button className="mt-2" type="primary" ghost size="small" danger>
|
|
|
+ 删除
|
|
|
+ </Button>
|
|
|
+ </Popconfirm>
|
|
|
+ ) : null}
|
|
|
</Col>
|
|
|
</Row>
|
|
|
</List.Item>
|
|
|
@@ -113,28 +150,41 @@ const LockTabList = props => {
|
|
|
</Tabs>
|
|
|
</div>
|
|
|
<div className="sheet-btns pl-4 pt-4 flex">
|
|
|
+ {logStockStatus !== 2 ? (
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ ghost
|
|
|
+ size="small"
|
|
|
+ className="mr-3px"
|
|
|
+ onClick={() =>
|
|
|
+ setAddLonglelog({ ...setAddLonglelog, visible: true, type: lockTypeEnum.RECEIVE })
|
|
|
+ }>
|
|
|
+ 接收
|
|
|
+ </Button>
|
|
|
+ ) : null}
|
|
|
+ {logStockStatus === 2 && logSellStatus === 0 ? (
|
|
|
+ <Button
|
|
|
+ type="primary"
|
|
|
+ ghost
|
|
|
+ size="small"
|
|
|
+ className="mr-3px"
|
|
|
+ onClick={() =>
|
|
|
+ setAddLonglelog({ ...setAddLonglelog, visible: true, type: lockTypeEnum.SALE })
|
|
|
+ }>
|
|
|
+ 借销赠
|
|
|
+ </Button>
|
|
|
+ ) : null}
|
|
|
<Button
|
|
|
type="primary"
|
|
|
ghost
|
|
|
size="small"
|
|
|
- className="mr-3px"
|
|
|
- onClick={() =>
|
|
|
- setAddLonglelog({ ...setAddLonglelog, visible: true, type: lockTypeEnum.SALE })
|
|
|
- }>
|
|
|
- 借销赠
|
|
|
- </Button>
|
|
|
- {/* <Button
|
|
|
- type="primary"
|
|
|
- ghost
|
|
|
- size="small"
|
|
|
className="mr-1"
|
|
|
onClick={() =>
|
|
|
setAddLonglelog({ ...setAddLonglelog, visible: true, type: lockTypeEnum.UPDATE })
|
|
|
- }
|
|
|
- >
|
|
|
+ }>
|
|
|
升级
|
|
|
- </Button> */}
|
|
|
- {sellStatus !== 0 ? (
|
|
|
+ </Button>
|
|
|
+ {logSellStatus === 0 ? (
|
|
|
<Button
|
|
|
type="primary"
|
|
|
ghost
|