修改下架loading
This commit is contained in:
1 parent
bf5135c6b9
commit
7e145ee5b0
1 file changed
+13
-6
@@ -340,13 +340,20 @@ const deleteGoods = async (v: any) => {
|
|||||||
if (!v.spuId) return useMessage().error("商品id不存在")
|
if (!v.spuId) return useMessage().error("商品id不存在")
|
||||||
ElMessageBox.confirm("确定下架吗?", "商品下架", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }).then(
|
ElMessageBox.confirm("确定下架吗?", "商品下架", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning" }).then(
|
||||||
async () => {
|
async () => {
|
||||||
loading.value = true
|
try {
|
||||||
const res = await unPutaway({ id: v.id, hardSpuId: v.spuId }).finally(() => (loading.value = false))
|
loading.value = true
|
||||||
if (res.code == 0) {
|
const res = await unPutaway({ id: v.id, hardSpuId: v.spuId })
|
||||||
useMessage().success("下架成功")
|
if (res.code == 0) {
|
||||||
return getCabinet(state.curActivedTabIndex)
|
useMessage().success("下架成功")
|
||||||
|
await getCabinet(state.curActivedTabIndex)
|
||||||
|
} else {
|
||||||
|
useMessage().error(res.msg || "下架失败")
|
||||||
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
useMessage().error(error.msg)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
}
|
}
|
||||||
useMessage().error(res.msg || "下架失败")
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user