diff --git a/src/pages/device/deviceInfo/components/StockMaterial.jsx b/src/pages/device/deviceInfo/components/StockMaterial.jsx index 001b388..2ba034c 100644 --- a/src/pages/device/deviceInfo/components/StockMaterial.jsx +++ b/src/pages/device/deviceInfo/components/StockMaterial.jsx @@ -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={() => [ + { + const response = await CheckStockAdjust(props.device.id); + if (response.data) { + message.success('获取实时库存会成功!'); + actionRef.current.reload(); + } else { + message.error(response.errors || '获取实时库存会失败!'); + } + }} + > + + , + { + const response = await PushStockAsync(props.device.id); + if (response.data) { + message.success('同步成功!'); + actionRef.current.reload(); + } else { + message.error(response.errors || '同步失败!'); + } + }} + > + + , , + ]} request={async (params) => { const response = await GetDeviceStorePage(params); diff --git a/src/pages/device/deviceInfo/components/StockMaterialForm.jsx b/src/pages/device/deviceInfo/components/StockMaterialForm.jsx index e658dd5..5146c84 100644 --- a/src/pages/device/deviceInfo/components/StockMaterialForm.jsx +++ b/src/pages/device/deviceInfo/components/StockMaterialForm.jsx @@ -81,7 +81,7 @@ const StockMaterialForm = (props) => { 取消 , { { title: '菜谱名称', dataIndex: 'name', - valueType: 'textarea', }, { title: '菜谱编码', dataIndex: 'code', - valueType: 'textarea', + }, + { + title: '排序', + dataIndex: 'sort', }, { title: '操作',