Compare commits
3 Commits
7df8956af2
...
d42c198a13
| Author | SHA1 | Date | |
|---|---|---|---|
| d42c198a13 | |||
| d2cdd2af75 | |||
| 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>
|
||||
|
||||
@ -38,6 +38,8 @@ export default {
|
||||
children: {
|
||||
align: 'center',
|
||||
headerAlign: 'center',
|
||||
type:'form',
|
||||
index:false,
|
||||
rowAdd: (done) => {
|
||||
if (this.form.imgs.length >= 5) {
|
||||
this.$message.error('批次每次最多五条');
|
||||
@ -55,11 +57,15 @@ export default {
|
||||
message: '商品名称必须填写',
|
||||
},
|
||||
],
|
||||
span:16,
|
||||
row:true,
|
||||
},
|
||||
{
|
||||
label: '条形码',
|
||||
prop: "barcode",
|
||||
tip: '如有条形码请记得添加',
|
||||
span:16,
|
||||
row:true,
|
||||
},
|
||||
{
|
||||
label: '商品主图',
|
||||
@ -99,22 +105,6 @@ export default {
|
||||
},
|
||||
prop: 'product_image_list',
|
||||
},
|
||||
{
|
||||
label: '商品简称',
|
||||
prop: "sname",
|
||||
},
|
||||
{
|
||||
label: '商品标题',
|
||||
prop: "title",
|
||||
},
|
||||
{
|
||||
label: '一级分类',
|
||||
prop: "category_1st",
|
||||
},
|
||||
{
|
||||
label: '二级分类',
|
||||
prop: "category_2nd",
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
@ -97,7 +97,7 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="250">
|
||||
<el-table-column label="操作" width="300">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -106,6 +106,13 @@
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="success"
|
||||
@click="openCopyDrawer(scope.row)"
|
||||
>
|
||||
复制
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@ -265,6 +272,18 @@
|
||||
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) {
|
||||
let res = null
|
||||
|
||||
Loading…
Reference in New Issue
Block a user