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