selectUser.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="用户昵称" prop="nickName">
  5. <el-input
  6. style="width:220px"
  7. v-model="queryParams.nickName"
  8. placeholder="请输入用户昵称"
  9. clearable
  10. size="small"
  11. @keyup.enter.native="handleQuery"
  12. />
  13. </el-form-item>
  14. <el-form-item label="手机号码" prop="phone">
  15. <el-input
  16. style="width:220px"
  17. v-model="queryParams.phone"
  18. placeholder="请输入手机号码"
  19. clearable
  20. size="small"
  21. @keyup.enter.native="handleQuery"
  22. />
  23. </el-form-item>
  24. <el-form-item>
  25. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  26. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  27. </el-form-item>
  28. </el-form>
  29. <el-table height="500" border v-loading="loading" :data="customerList" ref="customerList" >
  30. <el-table-column label="用户ID" align="center" prop="userId" />
  31. <el-table-column label="企微客户头像" align="center" prop="avatar" width="100px">
  32. <template slot-scope="scope">
  33. <el-popover
  34. placement="right"
  35. title=""
  36. trigger="hover">
  37. <img slot="reference" :src="scope.row.avatar" width="60px">
  38. <img :src="scope.row.avatar" style="max-width: 200px;">
  39. </el-popover>
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="用户昵称" align="center" prop="nickName" />
  43. <el-table-column label="手机号码" align="center" prop="phone" />
  44. <el-table-column label="操作" align="center" fixed="right" width="120px" class-name="small-padding fixed-width">
  45. <template slot-scope="scope">
  46. <el-button
  47. size="medium"
  48. type="primary"
  49. plain
  50. @click="handleBind(scope.row)"
  51. >绑定</el-button>
  52. </template>
  53. </el-table-column>
  54. </el-table>
  55. <pagination
  56. v-show="total>0"
  57. :total="total"
  58. :page.sync="queryParams.pageNum"
  59. :limit.sync="queryParams.pageSize"
  60. @pagination="getList"
  61. />
  62. </div>
  63. </template>
  64. <script>
  65. import { getMiniProgramCustomer} from "@/api/qw/externalContact";
  66. export default {
  67. name: "miniCustomer",
  68. components: {},
  69. data() {
  70. return {
  71. // 遮罩层
  72. loading: true,
  73. // 显示搜索条件
  74. showSearch: true,
  75. // 总条数
  76. total: 0,
  77. // 客户表格数据
  78. customerList: [],
  79. // 弹出层标题
  80. title: "",
  81. // 是否显示弹出层
  82. open: false,
  83. // 查询参数
  84. queryParams: {
  85. pageNum: 1,
  86. pageSize: 10,
  87. userId: null,
  88. nickName: null,
  89. phone: null,
  90. },
  91. // 表单参数
  92. form: {
  93. },
  94. // 表单校验
  95. rules: {
  96. },
  97. };
  98. },
  99. created() {
  100. this.getList();
  101. },
  102. methods: {
  103. /** 查询客户列表 */
  104. getList() {
  105. this.loading = true;
  106. getMiniProgramCustomer(this.queryParams).then(response => {
  107. this.customerList = response.rows;
  108. this.total = response.total;
  109. this.loading = false;
  110. });
  111. },
  112. //绑定选择
  113. handleBind(row){
  114. this.$emit("bindMiniCustomerId",row.userId)
  115. this.$refs.customerList.clearSelection();
  116. },
  117. // 取消按钮
  118. cancel() {
  119. this.open = false;
  120. this.reset();
  121. },
  122. /** 搜索按钮操作 */
  123. handleQuery() {
  124. this.queryParams.pageNum = 1;
  125. this.getList();
  126. },
  127. /** 重置按钮操作 */
  128. resetQuery() {
  129. this.resetForm("queryForm");
  130. this.handleQuery();
  131. },
  132. }
  133. };
  134. </script>
  135. <style>
  136. .el-tag + .el-tag {
  137. margin-left: 10px;
  138. }
  139. .button-new-tag {
  140. margin-left: 10px;
  141. height: 32px;
  142. line-height: 30px;
  143. padding-top: 0;
  144. padding-bottom: 0;
  145. }
  146. .input-new-tag {
  147. width: 90px;
  148. margin-left: 10px;
  149. vertical-align: bottom;
  150. }
  151. .el-dialog__wrapper{
  152. z-index: 100000;
  153. }
  154. </style>