|
@@ -24,6 +24,7 @@
|
|
|
<!-- </div>-->
|
|
|
<div class="toolbar-btns">
|
|
|
<el-button v-if="part_view" type="primary" size="mini" @click="handleAddMember">新增</el-button>
|
|
|
+ <el-button v-if="part_view" type="danger" size="mini" @click="batchDelete">批量删除</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<el-pagination
|
|
@@ -209,6 +210,7 @@ import ButtonCellRender from '@/components/AgGridCellRender/ButtonCellRender'
|
|
|
import AgGridImg from '@/components/AgGridImg/AgGridImg'
|
|
|
import ImageViewer from 'element-ui/packages/image/src/image-viewer'
|
|
|
import RadioFilter from '@/components/AgGridCustomFilter/RadioFilter'
|
|
|
+import * as API_User from "@/api/user";
|
|
|
let prevOverflow = ''
|
|
|
|
|
|
export default {
|
|
@@ -482,19 +484,31 @@ export default {
|
|
|
},
|
|
|
/** 批量数据删除处理(删除选中的行) */
|
|
|
batchDelete: function() {
|
|
|
- if (this.multipleSelection.length === 0) {
|
|
|
- this.$alert('没有选择任何记录!', '系统提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- callback: action => {
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- const ids = []
|
|
|
- this.multipleSelection.forEach(function(item) {
|
|
|
- ids.push(item.member_id)
|
|
|
- })
|
|
|
- this.handlerDelete(ids.join(','))
|
|
|
+ const rows = this.gridApi.getSelectedRows()
|
|
|
+ if (rows.length === 0) {
|
|
|
+ this.$message({ type: 'info', message: '请先勾选需要删除的数据' })
|
|
|
+ return
|
|
|
}
|
|
|
+ const ids = []
|
|
|
+ const uids = []
|
|
|
+ let isFounder = 0
|
|
|
+ rows.forEach(function(item) {
|
|
|
+ if (item.founder === 1) {
|
|
|
+ isFounder = 1
|
|
|
+ return
|
|
|
+ }
|
|
|
+ ids.push(item.clerk_id)
|
|
|
+ uids.push(item.member_id)
|
|
|
+ })
|
|
|
+ if (isFounder === 1) {
|
|
|
+ this.$message({ type: 'info', message: '不能删除机构负责人' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.handlerDelete(ids.join(','))
|
|
|
+ this.deleteMembers(uids) // 同时删除用户
|
|
|
+ },
|
|
|
+ async deleteMembers(ids) {
|
|
|
+ API_User.remove(ids)
|
|
|
},
|
|
|
/** 性别格式化 */
|
|
|
formatterSex(row) {
|
|
@@ -524,15 +538,12 @@ export default {
|
|
|
if (params.member_id) {
|
|
|
if (this.roleZzId === params.role_id) {
|
|
|
const addIds = this.newCheckList.filter(function(val) { return _this.oldCheckList.indexOf(val) === -1 })
|
|
|
- console.log('addIds=', addIds)
|
|
|
const delIds = this.oldCheckList.filter(function(val) { return _this.newCheckList.indexOf(val) === -1 })
|
|
|
- console.log('delIds=', delIds)
|
|
|
const data = {
|
|
|
clerkId: params.clerk_id,
|
|
|
addIds: addIds.join(','),
|
|
|
delIds: delIds.join(',')
|
|
|
}
|
|
|
- console.log('data==', data)
|
|
|
clerk_API.updateParentById(data)
|
|
|
}
|
|
|
clerk_API.update(params.clerk_id, params).then(response => {
|