update:图库新增删除功能
This commit is contained in:
parent
7df8956af2
commit
e8bc98d91b
@ -207,6 +207,17 @@ export async function saveBatchBarcode(data) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 删除图库
|
||||
export async function deleteBatchPhoto(id) {
|
||||
return request({
|
||||
url:'/admin/shop/libraryProduct/delByLibraryProductId',
|
||||
method:'delete',
|
||||
params:{
|
||||
libraryProductId:id
|
||||
}
|
||||
})
|
||||
}
|
||||
export default {
|
||||
getProductMapperList,
|
||||
getShopList,
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="操作" width="220">
|
||||
<el-table-column label="操作" width="260">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
plain
|
||||
@ -70,6 +70,14 @@
|
||||
>
|
||||
保存条码
|
||||
</el-button>
|
||||
<el-button
|
||||
plain
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDel(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品条码" width="180">
|
||||
@ -165,6 +173,7 @@ import GoodsToolApi from '@/api/goodsTool'
|
||||
import batchEditBarcode from './batchEditBarcode.vue'
|
||||
import imgEdit from './imgEdit.vue'
|
||||
import imgAdd from './imgAdd.vue'
|
||||
import { deleteBatchPhoto } from "@/api/goodsTool";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -330,6 +339,25 @@ export default {
|
||||
handleAdd() {
|
||||
this.$refs.imgAddRef.init();
|
||||
},
|
||||
|
||||
handleDel(row){
|
||||
console.log(row)
|
||||
this.$confirm(`确定将${row.barcode}删除?`, {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
return deleteBatchPhoto(row.id)
|
||||
})
|
||||
.then(() => {
|
||||
this.handleEditSuccess();
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user