更新删除商品 和回收站删除商品的问题

This commit is contained in:
stivepeim
2020-11-20 15:09:18 +08:00
parent 30a90cf45c
commit 138d2a2c62
6 changed files with 29 additions and 21 deletions

View File

@@ -39,10 +39,11 @@ export function productDetailApi(id) {
* 删除商品
* @param pram
*/
export function productDeleteApi(id) {
export function productDeleteApi(id, type) {
return request({
url: `/admin/store/product/delete/${id}`,
method: 'get'
method: 'get',
params:{type:type}
})
}
@@ -245,10 +246,9 @@ export function importProductApi(params) {
* 恢复
* @param pram
*/
export function restoreApi(params) {
export function restoreApi(id) {
return request({
url: `/admin/store/product/importProduct`,
method: 'post',
params
url: `/admin/store/product/restore/${id}`,
method: 'get'
})
}

View File

@@ -254,9 +254,10 @@ export default {
this.getList()
},
// 删除
handleDelete(id, idx) {
this.$modalSure().then(() => {
productDeleteApi(id).then(() => {
handleDelete(id, type) {
this.$modalSure(`删除 id 为 ${id} 的商品`).then(() => {
const deleteFlag = type == 5 ? 'delete':'recycle';
productDeleteApi(id,deleteFlag).then(() => {
this.$message.success('删除成功')
this.getList()
this.goodHeade();