index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <div class="common-container my-open-img">
  3. <TitleBar></TitleBar>
  4. <div class="main-container">
  5. <div class="search-container TableSelectMain">
  6. <el-form class="table-select-main" :model="searchForm" label-position="left">
  7. <el-row :gutter="15">
  8. <el-col :span="4">
  9. <el-form-item>
  10. <el-input placeholder="昵称" v-model="searchForm.name"></el-input>
  11. </el-form-item>
  12. </el-col>
  13. <el-col :span="4">
  14. <el-form-item>
  15. <el-input placeholder="真实名" v-model="searchForm.realName"></el-input>
  16. </el-form-item>
  17. </el-col>
  18. <el-col :span="4">
  19. <el-form-item>
  20. <el-input placeholder="手机号" v-model="searchForm.mobile"></el-input>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="4">
  24. <el-form-item>
  25. <el-select v-model="searchForm.userLevel" placeholder="app用户类型">
  26. <el-option
  27. v-for="item in customerTypeList"
  28. :key="item.id"
  29. :label="item.name"
  30. :value="item.id"
  31. ></el-option>
  32. </el-select>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="4">
  36. <el-form-item class="displayRight">
  37. <el-button type="primary" plain round @click="reset">重置</el-button>
  38. <el-button type="primary" plain round @click="query">查询</el-button>
  39. </el-form-item>
  40. </el-col>
  41. </el-row>
  42. </el-form>
  43. </div>
  44. <div class="SearchTitle">
  45. 已选择
  46. <span class="subject-color">{{ ids.length }}</span> 项
  47. </div>
  48. <div class="MaintenanceTable">
  49. <el-table
  50. ref="multipleTable"
  51. :data="tableData"
  52. style="width: 100%"
  53. tooltip-effect="dark"
  54. @selection-change="selectionChange"
  55. class="OutTable"
  56. border
  57. v-loading="listLoading"
  58. >
  59. <el-table-column type="selection"></el-table-column>
  60. <el-table-column prop="name" label="昵称" :show-overflow-tooltip="true"></el-table-column>
  61. <el-table-column
  62. prop="realName"
  63. label="真实名"
  64. min-width="100px;"
  65. :show-overflow-tooltip="true"
  66. ></el-table-column>
  67. <el-table-column label="头像">
  68. <template slot-scope="scope">
  69. <!-- <span @click="imgOpen(scope.row.avatarUrl)"></span> -->
  70. <el-image
  71. :src="scope.row.avatarUrl | pathPipe"
  72. style="width:50px;height:50px;cursor:pointer"
  73. :preview-src-list="[scope.row.avatarUrl]"
  74. ></el-image>
  75. </template>
  76. </el-table-column>
  77. <el-table-column prop="mobile" label="手机号" :show-overflow-tooltip="true"></el-table-column>
  78. <el-table-column
  79. prop="roleName"
  80. label="app用户类型"
  81. :show-overflow-tooltip="true"
  82. ></el-table-column>
  83. <el-table-column prop="companyName" label="关联企业" :show-overflow-tooltip="true"></el-table-column>
  84. <el-table-column label="操作">
  85. <template slot-scope="scope">
  86. <el-button
  87. size="mini"
  88. type="primary"
  89. plain
  90. round
  91. @click="detailsFormShow(scope.row.userId)"
  92. >查看</el-button>
  93. </template>
  94. </el-table-column>
  95. </el-table>
  96. <div class="pagenation">
  97. <PageComponent
  98. :total="total"
  99. @pagination="handlePagination"
  100. :pageSize.sync="page.pageSize"
  101. :pageNum.sync="page.pageNum"
  102. ></PageComponent>
  103. </div>
  104. </div>
  105. </div>
  106. <detailsDialog ref="detailsVisible"></detailsDialog>
  107. </div>
  108. </template>
  109. <script>
  110. import TitleBar from '@/apps/mobile/components/common/TitleBar';
  111. import detailsDialog from './components/detaisDialog';
  112. import { queryPageUser, queryPageCompany, queryCustomerType } from '@/apps/mobile/api/operation/user/index';
  113. // import { queryPage } from '@/apps/mobile/api/template-library-maintenance/index'; //获取公司列表接口
  114. export default {
  115. components: {
  116. TitleBar,
  117. detailsDialog,
  118. },
  119. data() {
  120. return {
  121. searchForm: {},
  122. tableData: [],
  123. page: {
  124. pageNum: 1,
  125. pageSize: 5,
  126. },
  127. total: 5,
  128. listLoading: false,
  129. time: [],
  130. ids: [],
  131. customerTypeList: [],
  132. };
  133. },
  134. created() {
  135. this.queryListData();
  136. this.getCustomerType();
  137. },
  138. methods: {
  139. selectionChange(data) {
  140. this.ids = data.map(item => {
  141. return item.id;
  142. });
  143. },
  144. handlePagination(val) {
  145. this.page = val;
  146. this.queryListData();
  147. },
  148. detailsFormShow(id) {
  149. this.$refs.detailsVisible.open(id);
  150. },
  151. queryListData() {
  152. this.listLoading = true;
  153. let obj = {
  154. ...this.page,
  155. ...this.searchForm,
  156. sort: {
  157. order: 'desc',
  158. orderBy: 'create_time',
  159. },
  160. };
  161. queryPageUser(obj)
  162. .then(res => {
  163. console.log('res.data.records---',res.data.records);
  164. if(res.statusCode == "10"){
  165. this.$router.replace("/login");
  166. }
  167. this.tableData = res.data.records;
  168. this.total = res.data.total;
  169. this.listLoading = false;
  170. })
  171. .catch(() => {
  172. this.listLoading = false;
  173. });
  174. },
  175. // 查询
  176. query() {
  177. for (let k in this.searchForm) {
  178. if (this.searchForm[k] === '') {
  179. delete this.searchForm[k];
  180. }
  181. }
  182. this.page.pageNum = 1;
  183. this.queryListData();
  184. },
  185. // 重置
  186. reset() {
  187. this.searchForm = {};
  188. this.page.pageNum = 1;
  189. this.queryListData();
  190. },
  191. getCustomerType() {
  192. queryCustomerType({})
  193. .then(res => {
  194. this.customerTypeList = res.data.records || [];
  195. })
  196. .catch();
  197. },
  198. imgOpen(imgs){
  199. window.open(imgs);
  200. }
  201. },
  202. };
  203. </script>
  204. <style lang="stylus" scoped>
  205. .my-open-img{
  206. .TableSelectMain .el-date-editor.el-input.el-input--prefix.el-input--suffix.el-date-editor--date {
  207. width: 95%;
  208. }
  209. ::v-deep .el-image{
  210. img{
  211. pointer-events: auto;
  212. }
  213. .el-icon-circle-close {
  214. font-size: 50px;
  215. color: #fff;
  216. }
  217. }
  218. }
  219. </style>