diff --git a/src/pages/device/deviceStock/index.jsx b/src/pages/device/deviceStock/index.jsx index 7dfcb80..9a06066 100644 --- a/src/pages/device/deviceStock/index.jsx +++ b/src/pages/device/deviceStock/index.jsx @@ -13,7 +13,8 @@ import { CheckStockAdjust, removeSingleStockAdjust, PushDeviceTMC, - CheckStockTMCAdjust + CheckStockTMCAdjust, + PushDeviceTMC_MT } from './services'; const key = 'message'; @@ -54,7 +55,23 @@ const DeviceStockManager = (props) => { const pushStock = async (id) => { try { message.loading('正在同步', key); - if (props.isbom) { + if (props.values.deviceTypeKey == "TMC_MT") { + await PushDeviceTMC_MT(id).then((r) => { + message.destroy(key); + if (r.data) { + setSelectedRows([]); + message.success('同步成功'); + actionRef.current.reload(); + return true; + } else { + message.success('同步失败'); + actionRef.current.reload(); + return false; + } + } + ); + } + else if (props.isbom) { await PushDeviceTMC(id).then((r) => { message.destroy(key); if (r.data) { diff --git a/src/pages/device/deviceStock/services.js b/src/pages/device/deviceStock/services.js index d125816..1d1609d 100644 --- a/src/pages/device/deviceStock/services.js +++ b/src/pages/device/deviceStock/services.js @@ -22,6 +22,13 @@ export async function PushStockAsync(data) { }); } +/** 同步库存 */ +export async function PushDeviceTMC_MT(data) { + return request(`/kitchen/api/Device/PushDeviceTMC_MT?DeviceId=${data}`, { + method: 'post', + }); +} + /** 获取实时库存 */ export async function CheckStockAdjust(data) { return request(`/kitchen/api/Device/CheckStockAdjust?DeviceId=${data}`, {