diff --git a/src/views/mall/product/containergoods/index.vue b/src/views/mall/product/containergoods/index.vue index 824c8e74..c449fc22 100644 --- a/src/views/mall/product/containergoods/index.vue +++ b/src/views/mall/product/containergoods/index.vue @@ -489,18 +489,18 @@ const getTabsCount = async () => { /** 添加到仓库 / 回收站的状态 */ const handleStatus02Change = async (row: any, newStatus: number) => { + const text = newStatus === ProductSpuStatusEnum.RECYCLE.status ? '加入到回收站' : '恢复到仓库' try { - // 二次确认 - const text = newStatus === ProductSpuStatusEnum.RECYCLE.status ? '加入到回收站' : '恢复到仓库' await message.confirm(`确认要"${row.name}"${text}吗?`) - // TODO: 新 API 中暂无此接口,暂时注释 - // await DeviceSpuApi.updateStatus({ id: row.id, status: newStatus }) + await DeviceSpuApi.updateStatus({ id: row.id, status: newStatus }) message.success(text + '成功') - // 刷新 tabs 数据 await getTabsCount() - // 刷新列表 await getList() - } catch {} + } catch (e) { + if (e !== 'cancel') { + message.error(text + '失败,请稍后重试') + } + } } /** 更新上架/下架状态 */