|
@@ -147,6 +147,17 @@
|
|
|
@click="batchSend"
|
|
@click="batchSend"
|
|
|
>批量IM发送</el-button>
|
|
>批量IM发送</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="el-icon-lock"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ :disabled="multiple"
|
|
|
|
|
+ @click="handleBatchBlacklist"
|
|
|
|
|
+ v-hasPermi="['user:fsUser:edit']"
|
|
|
|
|
+ >批量拉黑</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
@@ -179,8 +190,8 @@
|
|
|
<el-table-column label="参与营期数量" align="center" prop="partCourseCount" />
|
|
<el-table-column label="参与营期数量" align="center" prop="partCourseCount" />
|
|
|
<el-table-column label="状态" align="center">
|
|
<el-table-column label="状态" align="center">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-tag :type="scope.row.status === 1 ? 'success' : 'danger'">
|
|
|
|
|
- {{ scope.row.status === 1 ? '正常' : '禁止' }}
|
|
|
|
|
|
|
+ <el-tag :type="statusType(scope.row.status)">
|
|
|
|
|
+ {{ statusText(scope.row.status) }}
|
|
|
</el-tag>
|
|
</el-tag>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -295,7 +306,8 @@
|
|
|
<el-form-item label="状态">
|
|
<el-form-item label="状态">
|
|
|
<el-radio-group v-model="form.status">
|
|
<el-radio-group v-model="form.status">
|
|
|
<el-radio :label="1">正常</el-radio>
|
|
<el-radio :label="1">正常</el-radio>
|
|
|
- <el-radio :label="0">禁止</el-radio>
|
|
|
|
|
|
|
+ <el-radio :label="0">小黑屋</el-radio>
|
|
|
|
|
+ <el-radio :label="2">拉黑</el-radio>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
@@ -326,7 +338,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { listUser, getMemberUser, addUser, updateMemberUser, delUser, exportUser, auditUser,myListUser } from "@/api/user/fsUser";
|
|
|
|
|
|
|
+import { listUser, getMemberUser, addUser, updateMemberUser, delUser, exportUser, auditUser,myListUser, batchUpdateUserStatus } from "@/api/user/fsUser";
|
|
|
import {transferUser} from "@/api/users/user";
|
|
import {transferUser} from "@/api/users/user";
|
|
|
import {getUserList} from "@/api/company/companyUser";
|
|
import {getUserList} from "@/api/company/companyUser";
|
|
|
import userDetails from '@/views/store/components/userDetails.vue';
|
|
import userDetails from '@/views/store/components/userDetails.vue';
|
|
@@ -357,6 +369,8 @@ export default {
|
|
|
loading: true,
|
|
loading: true,
|
|
|
// 选中数组
|
|
// 选中数组
|
|
|
ids: [],
|
|
ids: [],
|
|
|
|
|
+ // 选中的会员id数组
|
|
|
|
|
+ memberIds: [],
|
|
|
companyUserId:null,
|
|
companyUserId:null,
|
|
|
companyId:null,
|
|
companyId:null,
|
|
|
// 非单个禁用
|
|
// 非单个禁用
|
|
@@ -432,6 +446,23 @@ export default {
|
|
|
this.getSalesOptions();
|
|
this.getSalesOptions();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+
|
|
|
|
|
+ statusType(status) {
|
|
|
|
|
+ const map = {
|
|
|
|
|
+ 1: 'success',
|
|
|
|
|
+ 2: 'danger',
|
|
|
|
|
+ 0: 'info'
|
|
|
|
|
+ }
|
|
|
|
|
+ return map[status] || 'info'
|
|
|
|
|
+ },
|
|
|
|
|
+ statusText(status) {
|
|
|
|
|
+ const map = {
|
|
|
|
|
+ 1: '正常',
|
|
|
|
|
+ 2: '黑名单',
|
|
|
|
|
+ 0: '小黑屋'
|
|
|
|
|
+ }
|
|
|
|
|
+ return map[status] || '未知'
|
|
|
|
|
+ },
|
|
|
handledetails(row){
|
|
handledetails(row){
|
|
|
this.show.open=true;
|
|
this.show.open=true;
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
@@ -589,10 +620,11 @@ export default {
|
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
|
this.ids = selection.map(item => item.userId);
|
|
this.ids = selection.map(item => item.userId);
|
|
|
|
|
+ this.memberIds = selection.map(item => item.id);
|
|
|
this.single = selection.length !== 1;
|
|
this.single = selection.length !== 1;
|
|
|
this.multiple = !selection.length;
|
|
this.multiple = !selection.length;
|
|
|
- this.companyId = selection[0].companyId;
|
|
|
|
|
- this.companyUserId = selection[0].companyUserId;
|
|
|
|
|
|
|
+ this.companyId = selection[0]?.companyId;
|
|
|
|
|
+ this.companyUserId = selection[0]?.companyUserId;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
@@ -694,6 +726,34 @@ export default {
|
|
|
},
|
|
},
|
|
|
handleClose(){
|
|
handleClose(){
|
|
|
this.dialogVisible = false;
|
|
this.dialogVisible = false;
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 批量拉黑操作 */
|
|
|
|
|
+ handleBatchBlacklist() {
|
|
|
|
|
+ if (this.memberIds.length === 0) {
|
|
|
|
|
+ this.$message.warning("请至少选择一个用户");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.$confirm('是否确认将选中的 ' + this.memberIds.length + ' 个用户拉黑?', "警告", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ const data = {
|
|
|
|
|
+ ids: this.memberIds,
|
|
|
|
|
+ status: 2 // 2表示禁止/拉黑
|
|
|
|
|
+ };
|
|
|
|
|
+ return batchUpdateUserStatus(data);
|
|
|
|
|
+ }).then(response => {
|
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
|
+ this.$message.success("批量拉黑成功");
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(response.msg || "批量拉黑失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ this.$message.info("已取消操作");
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|