123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
- <el-form-item label="关键词" prop="keyword">
- <el-input
- style="width:220px"
- v-model="queryParams.keyword"
- placeholder="请输入微信名称/手机号"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <!-- <el-row :gutter="10" class="mb8">-->
- <!-- <el-button-->
- <!-- size="mini"-->
- <!-- type="primary"-->
- <!-- style="margin-left: 5px"-->
- <!-- :disabled="ids.length === 0"-->
- <!-- @click="handleUpdateBatch"-->
- <!-- v-hasPermi="['store:user:enabledUsers']"-->
- <!-- >批量启用</el-button>-->
- <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
- <!-- </el-row>-->
- <el-table height="500" border v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="用户id" align="center" prop="userId" />
- <el-table-column label="项目" align="center" prop="projectName" />
- <el-table-column label="用户昵称" align="center" prop="nickname" />
- <el-table-column label="用户头像" align="center" prop="avatar">
- <template slot-scope="scope">
- <el-popover trigger="hover" placement="top">
- <el-image :src="scope.row.avatar" style="width: 200px;height: 200px"/>
- <div slot="reference" class="name-wrapper">
- <el-avatar shape="square" size="large" :src="scope.row.avatar"/>
- </div>
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="手机号码" align="center" prop="phone" width="160px"/>
- <el-table-column label="注册时间" align="center" prop="createTime" width="160px"/>
- <!-- <el-table-column label="看课数量" align="center" prop="watchCourseCount" />-->
- <!-- <el-table-column label="缺课数量" align="center" prop="missCourseCount" />-->
- <!-- <el-table-column label="缺课状态" align="center" prop="missCourseStatus">-->
- <!-- <template slot-scope="scope">-->
- <!-- <el-tag effect="dark" type="danger" v-if="scope.row.missCourseStatus === 1">已缺课</el-tag>-->
- <!-- <el-tag effect="dark" type="success" v-else>未缺课</el-tag>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- <!-- <el-table-column label="参与营期数量" align="center" prop="partCourseCount" width="100px"/>-->
- <el-table-column label="最后一次看课时间" align="center" prop="lastWatchDate" width="160px"/>
- <el-table-column label="用户状态" align="center" prop="courseCountStatus">
- <template slot-scope="scope">
- <el-tag effect="dark" type="success" v-if="scope.row.courseCountStatus === 1">正常</el-tag>
- <el-tag effect="dark" type="info" v-else-if="scope.row.courseCountStatus === 2">停止</el-tag>
- <el-tag effect="dark" type="danger" v-else>未看</el-tag>
- </template>
- </el-table-column>
- <!-- <el-table-column label="停课天数" align="center" prop="stopWatchDays" />-->
- <!-- <el-table-column label="完播时间" align="center" prop="completeWatchDate" width="160px"/>-->
- <el-table-column label="标签名称" align="center" prop="tag" />
- <el-table-column label="所属销售名称" align="center" prop="companyUserNickName" width="120px"/>
- <el-table-column label="备注" align="center" prop="remark" />
- <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
- <!-- <template slot-scope="scope">-->
- <!-- <el-button-->
- <!-- size="mini"-->
- <!-- type="text"-->
- <!-- @click="handleUpdate(scope.row)"-->
- <!-- v-hasPermi="['store:user:darkRoomList']"-->
- <!-- v-if="scope.row.isRepeatFans !== 1"-->
- <!-- >启用</el-button>-->
- <!-- </template>-->
- <!-- </el-table-column>-->
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- </template>
- <script>
- import { blacklist,enabledBlackUsers } from "@/api/his/user";
- export default {
- name: "blacklist",
- data() {
- return {
- // 遮罩层
- loading: true,
- // 选中数组
- ids: [],
- // 非单个禁用
- single: true,
- // 非多个禁用
- multiple: true,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 用户列表数据
- userList: [],
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- keyword: null,
- status: 2
- },
- };
- },
- created() {
- this.getList();
- },
- methods: {
- /** 查询客户列表 */
- getList() {
- this.loading = true;
- blacklist(this.queryParams).then(response => {
- this.userList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.handleQuery();
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.userId)
- this.single = selection.length!==1
- this.multiple = !selection.length
- },
- // 启用
- handleUpdate(row) {
- enabledBlackUsers([row.userId]).then(response => {
- if (response.code === 200) {
- this.msgSuccess("取消禁用成功");
- this.getList();
- } else {
- this.msgError(response.msg);
- }
- });
- },
- // 启用
- handleUpdateBatch() {
- enabledBlackUsers(this.ids).then(response => {
- if (response.code === 200) {
- this.msgSuccess("取消禁用成功");
- this.getList();
- } else {
- this.msgError(response.msg);
- }
- });
- }
- }
- };
- </script>
- <style scoped>
- .app-container {
- height: 87.5vh;
- }
- </style>
|