|
@@ -20,7 +20,7 @@
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button type="danger" plain icon="el-icon-circle-close" size="mini" :disabled="multiple"
|
|
|
- @click="handleDelete" v-hasPermi="['doc:groupUser:remove']">批量取消分配</el-button>
|
|
|
+ @click="cancelGroupUserAll" v-hasPermi="['doc:groupUser:remove']">删除成员</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button type="warning" plain icon="el-icon-close" size="mini" @click="handleClose">关闭</el-button>
|
|
@@ -30,15 +30,19 @@
|
|
|
|
|
|
<el-table v-loading="loading" :data="groupUserList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="分组ID" align="center" prop="groupId" />
|
|
|
- <el-table-column label="用户ID" align="center" prop="userId" />
|
|
|
- <el-table-column label="用户姓名" align="center" prop="userName" />
|
|
|
+ <el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="状态" align="center" prop="status">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['doc:groupUser:edit']">修改</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['doc:groupUser:remove']">删除</el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-circle-close" @click="cancelGroupUser(scope.row)"
|
|
|
+ v-hasPermi="['doc:groupUser:remove']">删除成员</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -55,11 +59,13 @@
|
|
|
getGroupUser,
|
|
|
delGroupUser,
|
|
|
addGroupUser,
|
|
|
- updateGroupUser
|
|
|
+ updateGroupUser,
|
|
|
+ groupUserCancelAll
|
|
|
} from "@/api/doc/groupUser";
|
|
|
import selectUser from "./selectUser";
|
|
|
export default {
|
|
|
name: "GroupUser",
|
|
|
+ dicts: ['sys_normal_disable'],
|
|
|
components: {
|
|
|
selectUser
|
|
|
},
|
|
@@ -146,7 +152,7 @@
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.groupId)
|
|
|
+ this.ids = selection.map(item => item.userId)
|
|
|
this.single = selection.length !== 1
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
@@ -154,16 +160,6 @@
|
|
|
handleAdd() {
|
|
|
this.$refs.select.show();
|
|
|
},
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- const groupId = row.groupId || this.ids
|
|
|
- getGroupUser(groupId).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.open = true;
|
|
|
- this.title = "修改分组成员";
|
|
|
- });
|
|
|
- },
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
@@ -185,21 +181,33 @@
|
|
|
});
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- const groupIds = row.groupId || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除分组成员编号为"' + groupIds + '"的数据项?').then(function() {
|
|
|
- return delGroupUser(groupIds);
|
|
|
+ cancelGroupUserAll(row) {
|
|
|
+ const groupId = this.queryParams.groupId;
|
|
|
+ const userIds = this.ids.join(",");
|
|
|
+ this.$modal.confirm('是否确认删除选中的分组成员?').then(function() {
|
|
|
+ return groupUserCancelAll({
|
|
|
+ groupId: groupId,
|
|
|
+ userIds: userIds
|
|
|
+ });
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- this.download('doc/groupUser/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `groupUser_${new Date().getTime()}.xlsx`)
|
|
|
- }
|
|
|
- }
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ cancelGroupUser(row) {
|
|
|
+ const groupId = this.queryParams.groupId;
|
|
|
+ const userIds = row.userId
|
|
|
+ this.$modal.confirm('是否确认删除分组成员"' + row.userName + '"的数据项?').then(function() {
|
|
|
+ return groupUserCancelAll({
|
|
|
+ groupId: groupId,
|
|
|
+ userIds: userIds
|
|
|
+ });
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
-</script>
|
|
|
+</script>
|