//删除
goDel(ids) {
let str = ids.length == 1 ? '此条' : '选中'
this.$JcMsgBox(
'此操作将删除' + str + '记录,是否继续',
'warning',
'温馨提示'
)
.then(() => {
this.loading = true
this.$http
.post('zdtdfsx/deleteZdtdfsx', ids)
.then(res => {
this.loading = false
this.$message({
dangerouslyUseHTMLString: true,
type: res.code == 200 ? 'success' : 'warning',
message: res.message
})
// 删除完当页数据返回上一页
// totalPage =取整总数减去删除数除每页显示条数
// currentPage =当前页是否大于剩余页,是就显示剩余页
// pageNum =剩余页是否小于1.小于1显示第一页,否则显示当前剩余页
let totalPage = Math.ceil((this.total - ids.length) / this.pageSize)
let currentPage = this.pageNum > totalPage ? totalPage : this.pageNum
this.pageNum = currentPage < 1 ? 1 : currentPage;
this.queryList();
})
.catch(e => {
this.loading = false
this.$alert(e, { type: 'error', dangerouslyUseHTMLString: true })
})
})
.catch(() => {
this.loading = false
})
},
//批量删除
plDel() {
let getSelection = this.$refs.multipleTable.selection
console.log(getSelection)
if (!getSelection.length) {
return this.$message.warning('请至少选择一个项目')
}
let ids = getSelection.map(item => {
return item.zdtdfskzxid
})
this.goDel(ids)
},