feat: 档案批量删除
This commit is contained in:
@@ -62,7 +62,7 @@
|
|||||||
<ai-search-bar class="search-bar">
|
<ai-search-bar class="search-bar">
|
||||||
<template #left>
|
<template #left>
|
||||||
<el-button type="primary" icon="iconfont iconAdd" @click="handleAdd">添加</el-button>
|
<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>
|
||||||
<template #right>
|
<template #right>
|
||||||
<ai-import :instance="instance" :dict="dict" type="appintegraluser" name="门店档案"
|
<ai-import :instance="instance" :dict="dict" type="appintegraluser" name="门店档案"
|
||||||
@@ -82,6 +82,7 @@
|
|||||||
style="margin-top: 6px;"
|
style="margin-top: 6px;"
|
||||||
:current.sync="search.current"
|
:current.sync="search.current"
|
||||||
:size.sync="search.size"
|
:size.sync="search.size"
|
||||||
|
@handleSelectionChange="handleSelectionChange"
|
||||||
@getList="getList">
|
@getList="getList">
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="门店照片"
|
label="门店照片"
|
||||||
@@ -143,6 +144,7 @@ export default {
|
|||||||
createTimeEnd: '',
|
createTimeEnd: '',
|
||||||
girdName: ''
|
girdName: ''
|
||||||
},
|
},
|
||||||
|
ids: [],
|
||||||
userList: [],
|
userList: [],
|
||||||
dictList: [],
|
dictList: [],
|
||||||
total: 10,
|
total: 10,
|
||||||
@@ -181,6 +183,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
handleSelectionChange(e) {
|
||||||
|
this.ids = e
|
||||||
|
},
|
||||||
|
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.$emit('change', {
|
this.$emit('change', {
|
||||||
type: 'Add',
|
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) {
|
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}) {
|
toDetail({id}) {
|
||||||
this.$emit('change', {
|
this.$emit('change', {
|
||||||
type: 'Detail',
|
type: 'Detail',
|
||||||
@@ -278,8 +259,18 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleDelete({id}) {
|
handleDelete({id}) {
|
||||||
this.$confirm('确定删除该数据?').then(() => {
|
this.$confirm('确定删除该数据?').then(async () => {
|
||||||
console.log(id)
|
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)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user