diff --git a/src/views/incomePayments/memberManage/StardsMemberProjectDataMaintenance.vue b/src/views/incomePayments/memberManage/StardsMemberProjectDataMaintenance.vue index 200dba4..c5dc01b 100644 --- a/src/views/incomePayments/memberManage/StardsMemberProjectDataMaintenance.vue +++ b/src/views/incomePayments/memberManage/StardsMemberProjectDataMaintenance.vue @@ -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('
') > -1) { + that.messageLineFeed('删除失败', res.message) + } else { + that.$message.warning(res.message) + } + } + }).finally(() => { + that.loading = false + }) + } + }) + } + }, } }