update:图库新增删除功能

This commit is contained in:
hufflzp 2026-01-14 18:18:56 +08:00
parent 7df8956af2
commit e8bc98d91b
2 changed files with 40 additions and 1 deletions

View File

@ -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,

View File

@ -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>