diff --git a/src/pages/device/deviceInfo/index.jsx b/src/pages/device/deviceInfo/index.jsx index 51e2ff9..9b89c9b 100644 --- a/src/pages/device/deviceInfo/index.jsx +++ b/src/pages/device/deviceInfo/index.jsx @@ -12,6 +12,7 @@ import { DelDeviceInfo, GetDeviceType, GetDeviceVersions, + CopyDevice } from './services'; import { gettree } from '../../sys/org/service'; const key = 'message'; @@ -115,7 +116,7 @@ const GoodsTypeManage = () => { }else{ datas[i]['disabled']=true; } - + if (datas[i].children) { inittree(datas[i].children); } @@ -273,9 +274,21 @@ const GoodsTypeManage = () => { }} > {' '} - {record.store_Status == 0 ? '正常' :'停用'} + {record.status == 0 ? '停用':'正常'} + , + { + CopyDevice({ id: record.id }).then((r) => { + if (r.data) { + actionRef.current.reload(); + } + }); + }} + > + {' '} + 复制 , - ], }, ]; diff --git a/src/pages/device/deviceInfo/services.js b/src/pages/device/deviceInfo/services.js index f0d1874..c52f69d 100644 --- a/src/pages/device/deviceInfo/services.js +++ b/src/pages/device/deviceInfo/services.js @@ -21,13 +21,20 @@ export async function AddDeviceInfo(data) { }); } - /** 修改 */ +/** 修改 */ export async function UpdateDeviceInfo(data) { return request(`/kitchen/api/Device/UpdateDeviceInfo`, { method: 'POST', data: data, }); } +/** 修改 */ +export async function CopyDevice(data) { + return request(`/kitchen/api/Device/CopyDevice`, { + method: 'POST', + data: data, + }); +} /** 删除 */ export async function DelDeviceInfo(data) { return request(`​​/kitchen/api/Device/DelDeviceInfo`, { @@ -48,4 +55,4 @@ export async function DelDeviceInfo(data) { method: 'post', }); } - + diff --git a/src/pages/device/deviceStock/index.jsx b/src/pages/device/deviceStock/index.jsx index 9a06066..a72069d 100644 --- a/src/pages/device/deviceStock/index.jsx +++ b/src/pages/device/deviceStock/index.jsx @@ -64,7 +64,7 @@ const DeviceStockManager = (props) => { actionRef.current.reload(); return true; } else { - message.success('同步失败'); + message.error('同步失败' + r.errors); actionRef.current.reload(); return false; } @@ -80,7 +80,7 @@ const DeviceStockManager = (props) => { actionRef.current.reload(); return true; } else { - message.success('同步失败'); + message.error('同步失败' + r.errors); actionRef.current.reload(); return false; } @@ -94,7 +94,7 @@ const DeviceStockManager = (props) => { actionRef.current.reload(); return true; } else { - message.success('同步失败'); + message.error('同步失败' + r.errors); actionRef.current.reload(); return false; }