app-user-list.html 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>移动端账号-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <!-- 所有的 css & js 资源 -->
  8. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="../../static/kj/vue.min.js"></script>
  11. <script src="../../static/kj/element-ui/index.js"></script>
  12. <script src="../../static/kj/httpVueLoader.js"></script>
  13. <script src="../../static/kj/jquery.min.js"></script>
  14. <script src="../../static/kj/layer/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. </head>
  17. <body>
  18. <div class="vue-box" style="display: none;" :style="'display: block;'">
  19. <div class="c-panel">
  20. <!-- ------------- 检索参数 ------------- -->
  21. <div class="c-title">检索参数</div>
  22. <el-form ref="form" :model='p' @submit.native.prevent>
  23. <sa-item type="text" name="手机号码" v-model="p.phone" width="100px"></sa-item>
  24. <sa-item type="text" name="姓名" v-model="p.name"></sa-item>
  25. <sa-item name="类型">
  26. <el-select v-model="p.userType">
  27. <el-option label="全部" value=""></el-option>
  28. <el-option label="边民" value="1"></el-option>
  29. <el-option label="组长" value="2"></el-option>
  30. <el-option label="收购商" value="3"></el-option>
  31. <el-option label="外籍商户" value="5"></el-option>
  32. </el-select>
  33. </sa-item>
  34. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  35. <el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
  36. <el-button v-if="sa.isAuth('app-user-add')" size="mini" type="primary" @click="add()">新增</el-button>
  37. </el-form>
  38. <!-- ------------- 数据列表 ------------- -->
  39. <el-table class="data-table" ref="data-table" :data="dataList" >
  40. <sa-td type="index" name="序号"></sa-td>
  41. <sa-td name="手机号码" prop="phone" width="120" ></sa-td>
  42. <sa-td name="姓名" prop="name" width="100"></sa-td>
  43. <sa-td name="类型" prop="userType" type="enum" :jv="{1: '普通边民', 2: '边民组长', 3: '收购商', 4: '司机', 5: '外籍商户', 6: '合作社'}"></sa-td>
  44. <sa-td name="状态" prop="enable" width="90" align="center">
  45. <template slot-scope="scope">
  46. <el-tag type="primary" v-if="scope.row.status==1">启用</el-tag>
  47. <el-tag type="danger" v-if="scope.row.status==0">禁用</el-tag>
  48. </template>
  49. </sa-td>
  50. <sa-td name="是否认证" prop="enable" width="90" align="center">
  51. <template slot-scope="scope">
  52. <el-tag type="success" v-if="scope.row.auth==1">已认证</el-tag>
  53. <el-tag type="danger" v-if="scope.row.auth==0">未认证</el-tag>
  54. </template>
  55. </sa-td>
  56. <sa-td name="认证时间" prop="authTime" width="160"></sa-td>
  57. <sa-td name="登录次数" prop="loginCount" width="90"></sa-td>
  58. <sa-td name="上次登录时间" prop="lastLoginTime" width="160" ></sa-td>
  59. <sa-td name="创建时间" prop="createTime" width="160" ></sa-td>
  60. <el-table-column label="操作" fixed="right" width="270px">
  61. <template slot-scope="s">
  62. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  63. <el-button v-if="sa.isAuth('app-user-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  64. <el-button v-if="sa.isAuth('app-user-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="pass(s.row)">改密</el-button>
  65. <el-button v-if="sa.isAuth('app-user-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. <!-- ------------- 分页 ------------- -->
  70. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  71. </div>
  72. </div>
  73. <script>
  74. var app = new Vue({
  75. components: {
  76. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  77. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  78. },
  79. el: '.vue-box',
  80. data: {
  81. p: { // 查询参数
  82. phone: '', // 手机号码
  83. name: '', // 姓名
  84. pageNo: 1, // 当前页
  85. pageSize: 10, // 页大小
  86. sortType: 0 // 排序方式
  87. },
  88. dataCount: 0,
  89. dataList: [], // 数据集合
  90. },
  91. methods: {
  92. // 刷新
  93. f5: function() {
  94. sa.ajax('/sp-admin/AppUser/getList', sa.removeNull(this.p), function(res) {
  95. this.dataList = res.data; // 数据
  96. this.dataCount = res.dataCount; // 数据总数
  97. sa.f5TableHeight(); // 刷新表格高度
  98. }.bind(this));
  99. },
  100. // 查看
  101. get: function(data) {
  102. sa.showIframe('数据详情', 'app-user-info.html?id=' + data.id, '1050px', '90%');
  103. },
  104. // 查看 - 根据选中的
  105. getBySelect: function(data) {
  106. var selection = this.$refs['data-table'].selection;
  107. if(selection.length == 0) {
  108. return sa.msg('请选择一条数据')
  109. }
  110. this.get(selection[0]);
  111. },
  112. // 修改
  113. update: function(data) {
  114. sa.showIframe('修改数据', 'app-user-add.html?id=' + data.id, '1000px', '90%');
  115. },
  116. // 改密
  117. pass: function(data) {
  118. sa.showIframe('修改密码', 'app-user-pass.html?id=' + data.id, '500px', '50%');
  119. },
  120. // 新增
  121. add: function(data) {
  122. sa.showIframe('新增数据', 'app-user-add.html?id=-1', '1000px', '90%');
  123. },
  124. // 删除
  125. del: function(data) {
  126. sa.confirm('是否删除,此操作不可撤销', function() {
  127. sa.ajax('/sp-admin/AppUser/delete?id=' + data.id, function(res) {
  128. sa.arrayDelete(this.dataList, data);
  129. sa.ok('删除成功');
  130. sa.f5TableHeight(); // 刷新表格高度
  131. }.bind(this))
  132. }.bind(this));
  133. },
  134. // 批量删除
  135. deleteByIds: function() {
  136. // 获取选中元素的id列表
  137. let selection = this.$refs['data-table'].selection;
  138. let ids = sa.getArrayField(selection, 'id');
  139. if(selection.length == 0) {
  140. return sa.msg('请至少选择一条数据')
  141. }
  142. // 提交删除
  143. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  144. sa.ajax('/sp-admin/AppUser/deleteByIds', {ids: ids.join(',')}, function(res) {
  145. sa.arrayDelete(this.dataList, selection);
  146. sa.ok('删除成功');
  147. sa.f5TableHeight(); // 刷新表格高度
  148. }.bind(this))
  149. }.bind(this));
  150. },
  151. },
  152. created: function() {
  153. this.f5();
  154. sa.onInputEnter();
  155. }
  156. })
  157. </script>
  158. </body>
  159. </html>