更新删除商品 和回收站删除商品的问题
This commit is contained in:
@@ -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'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user