[update] 修改会员管理-其他资料维护

This commit is contained in:
lideqin
2024-02-29 18:05:46 +08:00
parent fff8806476
commit 7770bc7f96
@@ -182,7 +182,7 @@ export default {
title: '确认删除',
content: '确定要删除此条数据吗?',
onOk: () => {
postAction(that.url.delete, {id: id}).then((res) => {
postAction(`${that.url.delete}?id=${id}`).then((res) => {
if (res.success) {
that.$message.success(res.message)
// 判断当前删除的数据是否是最后一页的最后一条数据,如果是的话页码减一
@@ -201,6 +201,50 @@ export default {
}
})
},
batchDel () {
if (!this.url.deleteBatch) {
this.$message.error('请设置url.deleteBatch属性!')
return
}
if (this.selectedRowKeys.length <= 0) {
this.$message.warning('请选择一条记录!')
return
} else {
var ids = ''
for (var a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ','
}
var that = this
this.$confirm({
title: '确认删除',
content: '是否删除选中数据?',
onOk: function () {
that.loading = true
postAction(`${that.url.deleteBatch}?ids=${ids}`).then((res) => {
if (res.success) {
that.$message.success(res.message)
// 判断当前删除的数据是否是最后一页的全部数据,如果是的话页码减一
if (that.ipagination.current > 1 && (that.ipagination.current === Math.ceil(that.ipagination.total / that.ipagination.pageSize)) &&
that.selectedRowKeys.length === that.dataSource.length
) {
that.ipagination.current -= 1
}
that.loadData()
that.onClearSelected()
} else {
if (res.message.indexOf('<br/>') > -1) {
that.messageLineFeed('删除失败', res.message)
} else {
that.$message.warning(res.message)
}
}
}).finally(() => {
that.loading = false
})
}
})
}
},
}
}
</script>