Compare commits

...

3 Commits

4 changed files with 66 additions and 18 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 { export default {
getProductMapperList, getProductMapperList,
getShopList, getShopList,

View File

@ -51,7 +51,7 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column label="操作" width="220"> <el-table-column label="操作" width="260">
<template #default="scope"> <template #default="scope">
<el-button <el-button
plain plain
@ -70,6 +70,14 @@
> >
保存条码 保存条码
</el-button> </el-button>
<el-button
plain
size="mini"
type="danger"
@click="handleDel(scope.row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="商品条码" width="180"> <el-table-column label="商品条码" width="180">
@ -165,6 +173,7 @@ import GoodsToolApi from '@/api/goodsTool'
import batchEditBarcode from './batchEditBarcode.vue' import batchEditBarcode from './batchEditBarcode.vue'
import imgEdit from './imgEdit.vue' import imgEdit from './imgEdit.vue'
import imgAdd from './imgAdd.vue' import imgAdd from './imgAdd.vue'
import { deleteBatchPhoto } from "@/api/goodsTool";
export default { export default {
components: { components: {
@ -330,6 +339,25 @@ export default {
handleAdd() { handleAdd() {
this.$refs.imgAddRef.init(); 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> </script>

View File

@ -38,6 +38,8 @@ export default {
children: { children: {
align: 'center', align: 'center',
headerAlign: 'center', headerAlign: 'center',
type:'form',
index:false,
rowAdd: (done) => { rowAdd: (done) => {
if (this.form.imgs.length >= 5) { if (this.form.imgs.length >= 5) {
this.$message.error('批次每次最多五条'); this.$message.error('批次每次最多五条');
@ -55,11 +57,15 @@ export default {
message: '商品名称必须填写', message: '商品名称必须填写',
}, },
], ],
span:16,
row:true,
}, },
{ {
label: '条形码', label: '条形码',
prop: "barcode", prop: "barcode",
tip: '如有条形码请记得添加', tip: '如有条形码请记得添加',
span:16,
row:true,
}, },
{ {
label: '商品主图', label: '商品主图',
@ -99,22 +105,6 @@ export default {
}, },
prop: 'product_image_list', prop: 'product_image_list',
}, },
{
label: '商品简称',
prop: "sname",
},
{
label: '商品标题',
prop: "title",
},
{
label: '一级分类',
prop: "category_1st",
},
{
label: '二级分类',
prop: "category_2nd",
},
], ],
}, },
} }

View File

@ -97,7 +97,7 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="250"> <el-table-column label="操作" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -106,6 +106,13 @@
> >
编辑 编辑
</el-button> </el-button>
<el-button
size="mini"
type="success"
@click="openCopyDrawer(scope.row)"
>
复制
</el-button>
<el-button <el-button
size="mini" size="mini"
type="danger" type="danger"
@ -265,6 +272,18 @@
this.$refs.storeConfDrawerRef.open() this.$refs.storeConfDrawerRef.open()
}, },
//
openCopyDrawer(row) {
this.isEditMode = false
this.currentFormData = { ...row } //
this.currentFormData.storeName = ''
this.currentFormData.storeId = null
this.currentFormData.id = null
this.currentFormData.createTime = null
this.currentFormData.updateTime = null
this.$refs.storeConfDrawerRef.open()
},
// //
async handleSave(data) { async handleSave(data) {
let res = null let res = null