apply-list.php 7.6 KB

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