apply-list.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('apply-edit', dirname(__DIR__) . '/components');
  4. ?>
  5. <div id="app" v-cloak>
  6. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  7. <div class="table-body">
  8. <el-table
  9. v-loading="listLoading"
  10. :data="list"
  11. stripe
  12. style="width: 100%">
  13. <el-table-column
  14. prop="id"
  15. label="ID"
  16. align="center"
  17. width="80">
  18. </el-table-column>
  19. <el-table-column label="基本信息" width="200">
  20. <template slot-scope="scope">
  21. <com-image style="float: left;margin-right: 5px;" mode="aspectFill"
  22. :src="scope.row.user.avatar_url"></com-image>
  23. <div>{{scope.row.user.nickname}}</div>
  24. </template>
  25. </el-table-column>
  26. <el-table-column label="姓名" align="center">
  27. <template slot-scope="scope">
  28. <com-ellipsis :line="1">{{scope.row.realname}}</com-ellipsis>
  29. </template>
  30. </el-table-column>
  31. <el-table-column label="电话" align="center">
  32. <template slot-scope="scope">
  33. <com-ellipsis :line="1">{{scope.row.mobile}}</com-ellipsis>
  34. </template>
  35. </el-table-column>
  36. <el-table-column
  37. label="状态"
  38. width="120"
  39. align="center">
  40. <template slot-scope="scope">
  41. <span v-if="scope.row.status==0">待处理</span>
  42. <span v-if="scope.row.status==1">通过</span>
  43. <span v-if="scope.row.status==2">未通过</span>
  44. </template>
  45. </el-table-column>
  46. <el-table-column
  47. label="操作"
  48. width="180"
  49. align="center">
  50. <template slot-scope="scope">
  51. <el-button v-if="scope.row.status == 0" circle size="mini" type="text" @click="editApply(scope.row)">
  52. <el-tooltip class="item" effect="dark" content="审核" placement="top">
  53. <img style="width: 25px; border-radius:8px;" src="resources/img/common/audit.png" alt="">
  54. </el-tooltip>
  55. </el-button>
  56. <el-button circle size="mini" type="text" @click="applyDelete(scope.row, scope.$index)">
  57. <el-tooltip class="item" effect="dark" content="删除" placement="top">
  58. <img src="resources/img/common/del.png" alt="">
  59. </el-tooltip>
  60. </el-button>
  61. </template>
  62. </el-table-column>
  63. </el-table>
  64. <div style="text-align: right;margin: 20px 0;">
  65. <el-pagination
  66. @current-change="pagination"
  67. background
  68. layout="prev, pager, next"
  69. :page-count="pageCount">
  70. </el-pagination>
  71. </div>
  72. </div>
  73. </el-card>
  74. <apply-edit v-model="edit.show" :value="edit.show" :row="row"></apply-edit>
  75. </div>
  76. <script>
  77. const app = new Vue({
  78. el: '#app',
  79. data() {
  80. return {
  81. list: [],
  82. keyword: '',
  83. listLoading: false,
  84. page: 1,
  85. user_id: 0,
  86. pageCount: 0,
  87. edit:{
  88. show: false,
  89. user_id:0,
  90. },
  91. row:{
  92. user_id:0
  93. }
  94. };
  95. },
  96. mounted: function () {
  97. this.getList();
  98. },
  99. methods: {
  100. search() {
  101. this.page = 1;
  102. this.getList();
  103. },
  104. pagination(currentPage) {
  105. let self = this;
  106. self.page = currentPage;
  107. self.getList();
  108. },
  109. getList() {
  110. let self = this;
  111. self.listLoading = true;
  112. request({
  113. params: {
  114. r: 'circle-distribution/audit/apply',
  115. page: self.page,
  116. keyword: this.keyword
  117. },
  118. method: 'get',
  119. }).then(e => {
  120. self.listLoading = false;
  121. self.list = e.data.data.list;
  122. self.pageCount = e.data.data.page_count;
  123. }).catch(e => {
  124. console.log(e);
  125. });
  126. },
  127. editApply(row) {
  128. this.edit.user_id = row.user_id
  129. this.edit.show = true;
  130. this.row.user_id=row.user_id;
  131. this.row.id=row.id;
  132. },
  133. applyDelete(row, index) {
  134. let self = this;
  135. self.$confirm('删除该经销商等级, 是否继续?', '提示', {
  136. confirmButtonText: '确定',
  137. cancelButtonText: '取消',
  138. type: 'warning'
  139. }).then(() => {
  140. self.listLoading = true;
  141. request({
  142. params: {
  143. r: 'circle-distribution/audit/apply-delete',
  144. },
  145. method: 'post',
  146. data: {
  147. id: row.id,
  148. }
  149. }).then(e => {
  150. self.listLoading = false;
  151. if (e.data.code === 0) {
  152. self.$message.success(e.data.msg);
  153. self.list.splice(index, 1);
  154. } else {
  155. self.$message.error(e.data.msg);
  156. }
  157. }).catch(e => {
  158. console.log(e);
  159. });
  160. }).catch(() => {
  161. self.$message.info('已取消删除')
  162. });
  163. },
  164. }
  165. });
  166. </script>
  167. <style>
  168. .table-body {
  169. padding: 20px;
  170. background-color: #fff;
  171. }
  172. .input-item {
  173. display: inline-block;
  174. width: 250px;
  175. margin: 0 0 20px;
  176. }
  177. .input-item .el-input__inner {
  178. border-right: 0;
  179. }
  180. .input-item .el-input__inner:hover {
  181. border: 1px solid #dcdfe6;
  182. border-right: 0;
  183. outline: 0;
  184. }
  185. .input-item .el-input__inner:focus {
  186. border: 1px solid #dcdfe6;
  187. border-right: 0;
  188. outline: 0;
  189. }
  190. .input-item .el-input-group__append {
  191. background-color: #fff;
  192. border-left: 0;
  193. width: 10%;
  194. padding: 0;
  195. }
  196. .input-item .el-input-group__append .el-button {
  197. padding: 0;
  198. }
  199. .input-item .el-input-group__append .el-button {
  200. margin: 0;
  201. }
  202. .table-body .el-button {
  203. padding: 0 !important;
  204. border: 0;
  205. margin: 0 5px;
  206. }
  207. .el-table th>.cell{
  208. color: #333;
  209. font-weight: bold;
  210. font-size: 14px;
  211. }
  212. .el-table__footer-wrapper, .el-table__header-wrapper{
  213. border-bottom: 1.4px solid #D6D6D6;
  214. }
  215. </style>