feat: 档案批量删除

This commit is contained in:
wanglei
2024-06-25 11:37:09 +08:00
parent f0f7f75bf3
commit 2796506449

View File

@@ -62,7 +62,7 @@
<ai-search-bar class="search-bar">
<template #left>
<el-button type="primary" icon="iconfont iconAdd" @click="handleAdd">添加</el-button>
<el-button icon="iconfont iconDelete" @click="handleDelBatch">删除</el-button>
<el-button icon="iconfont iconDelete" :disabled="!ids.length" @click="handleDelBatch">删除</el-button>
</template>
<template #right>
<ai-import :instance="instance" :dict="dict" type="appintegraluser" name="门店档案"
@@ -82,6 +82,7 @@
style="margin-top: 6px;"
:current.sync="search.current"
:size.sync="search.size"
@handleSelectionChange="handleSelectionChange"
@getList="getList">
<el-table-column
label="门店照片"
@@ -143,6 +144,7 @@ export default {
createTimeEnd: '',
girdName: ''
},
ids: [],
userList: [],
dictList: [],
total: 10,
@@ -181,6 +183,10 @@ export default {
},
methods: {
handleSelectionChange(e) {
this.ids = e
},
handleAdd() {
this.$emit('change', {
type: 'Add',
@@ -188,8 +194,20 @@ export default {
})
},
handleDelBatch() {
async handleDelBatch() {
try {
const {code} = await this.instance.post('/app/appshoparchives/delete', null, {
params: {
ids: this.ids.join(',')
}
})
if (code === 0) {
this.$message.success('删除成功')
this.getList()
}
} catch (e) {
console.error(e)
}
},
onGridChange(e) {
@@ -222,43 +240,6 @@ export default {
})
},
push(id) {
MessageBox.confirm('是否将精选内容对全体居民公开,选则否将只对本村/社区居民公开。', '推送精选', {
distinguishCancelAndClose: true,
confirmButtonText: '是',
type: 'warning',
closeOnClickModal: false,
center: true,
customClass: 'AiConfirm',
cancelButtonText: '否'
}).then(() => {
this.instance.post(`/app/appintegraluserapply/pushById?id=${id}&status=1`).then(res => {
if (res.code == 0) {
this.getList()
this.$message.success('推送成功')
}
})
}).catch((e) => {
e === 'cancel' && this.instance.post(`/app/appintegraluserapply/pushById?id=${id}&status=0`).then(res => {
if (res.code == 0) {
this.getList()
this.$message.success('推送成功')
}
})
})
},
remove(id) {
this.$confirm('确定删除该帖子?').then((e) => {
this.instance.post(`/app/appintegraluserapply/delete?id=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
toDetail({id}) {
this.$emit('change', {
type: 'Detail',
@@ -278,8 +259,18 @@ export default {
},
handleDelete({id}) {
this.$confirm('确定删除该数据?').then(() => {
console.log(id)
this.$confirm('确定删除该数据?').then(async () => {
try {
const {code} = await this.instance.post('/app/appshoparchives/delete', null, {
params: {id}
})
if (code === 0) {
this.$message.success("删除成功")
this.getList()
}
} catch (e) {
console.error(e)
}
})
},