index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px" @submit.native.prevent>
  4. <el-form-item label="关键词" prop="keyword">
  5. <el-input
  6. style="width:220px"
  7. v-model="queryParams.keyword"
  8. placeholder="请输入微信名称/手机号"
  9. clearable
  10. size="small"
  11. @keyup.enter.native="handleQuery"
  12. />
  13. </el-form-item>
  14. <el-form-item>
  15. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  16. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  17. </el-form-item>
  18. </el-form>
  19. <!-- <el-row :gutter="10" class="mb8">-->
  20. <!-- <el-button-->
  21. <!-- size="mini"-->
  22. <!-- type="primary"-->
  23. <!-- style="margin-left: 5px"-->
  24. <!-- :disabled="ids.length === 0"-->
  25. <!-- @click="handleUpdateBatch"-->
  26. <!-- v-hasPermi="['store:user:enabledUsers']"-->
  27. <!-- >批量启用</el-button>-->
  28. <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
  29. <!-- </el-row>-->
  30. <el-table height="500" border v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
  31. <el-table-column type="selection" width="55" align="center" />
  32. <el-table-column label="用户id" align="center" prop="userId" />
  33. <el-table-column label="项目" align="center" prop="projectName" />
  34. <el-table-column label="用户昵称" align="center" prop="nickname" />
  35. <el-table-column label="用户头像" align="center" prop="avatar">
  36. <template slot-scope="scope">
  37. <el-popover trigger="hover" placement="top">
  38. <el-image :src="scope.row.avatar" style="width: 200px;height: 200px"/>
  39. <div slot="reference" class="name-wrapper">
  40. <el-avatar shape="square" size="large" :src="scope.row.avatar"/>
  41. </div>
  42. </el-popover>
  43. </template>
  44. </el-table-column>
  45. <el-table-column label="手机号码" align="center" prop="phone" width="160px"/>
  46. <el-table-column label="注册时间" align="center" prop="createTime" width="160px"/>
  47. <!-- <el-table-column label="看课数量" align="center" prop="watchCourseCount" />-->
  48. <!-- <el-table-column label="缺课数量" align="center" prop="missCourseCount" />-->
  49. <!-- <el-table-column label="缺课状态" align="center" prop="missCourseStatus">-->
  50. <!-- <template slot-scope="scope">-->
  51. <!-- <el-tag effect="dark" type="danger" v-if="scope.row.missCourseStatus === 1">已缺课</el-tag>-->
  52. <!-- <el-tag effect="dark" type="success" v-else>未缺课</el-tag>-->
  53. <!-- </template>-->
  54. <!-- </el-table-column>-->
  55. <!-- <el-table-column label="参与营期数量" align="center" prop="partCourseCount" width="100px"/>-->
  56. <el-table-column label="最后一次看课时间" align="center" prop="lastWatchDate" width="160px"/>
  57. <el-table-column label="用户状态" align="center" prop="courseCountStatus">
  58. <template slot-scope="scope">
  59. <el-tag effect="dark" type="success" v-if="scope.row.courseCountStatus === 1">正常</el-tag>
  60. <el-tag effect="dark" type="info" v-else-if="scope.row.courseCountStatus === 2">停止</el-tag>
  61. <el-tag effect="dark" type="danger" v-else>未看</el-tag>
  62. </template>
  63. </el-table-column>
  64. <!-- <el-table-column label="停课天数" align="center" prop="stopWatchDays" />-->
  65. <!-- <el-table-column label="完播时间" align="center" prop="completeWatchDate" width="160px"/>-->
  66. <el-table-column label="标签名称" align="center" prop="tag" />
  67. <el-table-column label="所属销售名称" align="center" prop="companyUserNickName" width="120px"/>
  68. <el-table-column label="备注" align="center" prop="remark" />
  69. <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
  70. <!-- <template slot-scope="scope">-->
  71. <!-- <el-button-->
  72. <!-- size="mini"-->
  73. <!-- type="text"-->
  74. <!-- @click="handleUpdate(scope.row)"-->
  75. <!-- v-hasPermi="['store:user:darkRoomList']"-->
  76. <!-- v-if="scope.row.isRepeatFans !== 1"-->
  77. <!-- >启用</el-button>-->
  78. <!-- </template>-->
  79. <!-- </el-table-column>-->
  80. </el-table>
  81. <pagination
  82. v-show="total>0"
  83. :total="total"
  84. :page.sync="queryParams.pageNum"
  85. :limit.sync="queryParams.pageSize"
  86. @pagination="getList"
  87. />
  88. </div>
  89. </template>
  90. <script>
  91. import { blacklist,enabledBlackUsers } from "@/api/his/user";
  92. export default {
  93. name: "blacklist",
  94. data() {
  95. return {
  96. // 遮罩层
  97. loading: true,
  98. // 选中数组
  99. ids: [],
  100. // 非单个禁用
  101. single: true,
  102. // 非多个禁用
  103. multiple: true,
  104. // 显示搜索条件
  105. showSearch: true,
  106. // 总条数
  107. total: 0,
  108. // 用户列表数据
  109. userList: [],
  110. // 查询参数
  111. queryParams: {
  112. pageNum: 1,
  113. pageSize: 10,
  114. keyword: null,
  115. status: 2
  116. },
  117. };
  118. },
  119. created() {
  120. this.getList();
  121. },
  122. methods: {
  123. /** 查询客户列表 */
  124. getList() {
  125. this.loading = true;
  126. blacklist(this.queryParams).then(response => {
  127. this.userList = response.rows;
  128. this.total = response.total;
  129. this.loading = false;
  130. });
  131. },
  132. /** 搜索按钮操作 */
  133. handleQuery() {
  134. this.queryParams.pageNum = 1;
  135. this.getList();
  136. },
  137. /** 重置按钮操作 */
  138. resetQuery() {
  139. this.resetForm("queryForm");
  140. this.handleQuery();
  141. },
  142. // 多选框选中数据
  143. handleSelectionChange(selection) {
  144. this.ids = selection.map(item => item.userId)
  145. this.single = selection.length!==1
  146. this.multiple = !selection.length
  147. },
  148. // 启用
  149. handleUpdate(row) {
  150. enabledBlackUsers([row.userId]).then(response => {
  151. if (response.code === 200) {
  152. this.msgSuccess("取消禁用成功");
  153. this.getList();
  154. } else {
  155. this.msgError(response.msg);
  156. }
  157. });
  158. },
  159. // 启用
  160. handleUpdateBatch() {
  161. enabledBlackUsers(this.ids).then(response => {
  162. if (response.code === 200) {
  163. this.msgSuccess("取消禁用成功");
  164. this.getList();
  165. } else {
  166. this.msgError(response.msg);
  167. }
  168. });
  169. }
  170. }
  171. };
  172. </script>
  173. <style scoped>
  174. .app-container {
  175. height: 87.5vh;
  176. }
  177. </style>