|
|
@@ -1,7 +1,7 @@ |
|
|
|
import { Modal, message, Popconfirm, Button } from 'antd'; |
|
|
|
import React, { useEffect, useState, useRef } from 'react'; |
|
|
|
import ProTable from '@ant-design/pro-table'; |
|
|
|
import { GetDeviceStorePage, removeSingleStockAdjust } from '../services'; |
|
|
|
import { GetDeviceStorePage, removeSingleStockAdjust, PushStockAsync, CheckStockAdjust } from '../services'; |
|
|
|
import StockMaterialForm from "./StockMaterialForm"; |
|
|
|
import { PlusOutlined } from '@ant-design/icons'; |
|
|
|
|
|
|
@@ -64,7 +64,7 @@ const StockMaterial = (props) => { |
|
|
|
]; |
|
|
|
|
|
|
|
const handleOk = () => { |
|
|
|
|
|
|
|
props.onOk(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -103,6 +103,52 @@ const StockMaterial = (props) => { |
|
|
|
deviceId: props.device.id, |
|
|
|
}} |
|
|
|
toolBarRender={() => [ |
|
|
|
<Popconfirm |
|
|
|
type="primary" |
|
|
|
key="primary-async-time" |
|
|
|
title="获取实时库存会覆盖本次补货数据" |
|
|
|
okText="是" |
|
|
|
cancelText="否" |
|
|
|
onConfirm={async () => { |
|
|
|
const response = await CheckStockAdjust(props.device.id); |
|
|
|
if (response.data) { |
|
|
|
message.success('获取实时库存会成功!'); |
|
|
|
actionRef.current.reload(); |
|
|
|
} else { |
|
|
|
message.error(response.errors || '获取实时库存会失败!'); |
|
|
|
} |
|
|
|
}} |
|
|
|
> |
|
|
|
<Button |
|
|
|
type="primary" |
|
|
|
key="primary" |
|
|
|
> |
|
|
|
获取实时库存 |
|
|
|
</Button> |
|
|
|
</Popconfirm>, |
|
|
|
<Popconfirm |
|
|
|
type="primary" |
|
|
|
key="primary-async" |
|
|
|
title="确认同步吗?" |
|
|
|
okText="是" |
|
|
|
cancelText="否" |
|
|
|
onConfirm={async () => { |
|
|
|
const response = await PushStockAsync(props.device.id); |
|
|
|
if (response.data) { |
|
|
|
message.success('同步成功!'); |
|
|
|
actionRef.current.reload(); |
|
|
|
} else { |
|
|
|
message.error(response.errors || '同步失败!'); |
|
|
|
} |
|
|
|
}} |
|
|
|
> |
|
|
|
<Button |
|
|
|
type="primary" |
|
|
|
key="primary" |
|
|
|
> |
|
|
|
同步库存 |
|
|
|
</Button> |
|
|
|
</Popconfirm>, |
|
|
|
<Button |
|
|
|
type="primary" |
|
|
|
key="primary" |
|
|
@@ -112,7 +158,7 @@ const StockMaterial = (props) => { |
|
|
|
}} |
|
|
|
> |
|
|
|
<PlusOutlined /> 新增库存原料 |
|
|
|
</Button>, |
|
|
|
</Button> |
|
|
|
]} |
|
|
|
request={async (params) => { |
|
|
|
const response = await GetDeviceStorePage(params); |
|
|
|