settlement-detail.php 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-image');
  4. ?>
  5. <div id="app" v-cloak>
  6. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  7. <div slot="header">
  8. <span style="color: #409EFF;cursor: pointer" @click="$navigate({r:'boss/pool-prize/settlement-list'})">
  9. 奖金池结算列表
  10. </span>
  11. <span>/</span>
  12. <span>结算明细</span>
  13. </div>
  14. <div class="table-body">
  15. <div class="input-item">
  16. <el-input @keyup.enter.native="getList" size="small" placeholder="请输入用户ID" v-model="search.user_id" clearable @clear="toSearch">
  17. <el-button slot="append" icon="el-icon-search" @click="toSearch"></el-button>
  18. </el-input>
  19. </div>
  20. <div class="input-item">
  21. <el-input @keyup.enter.native="getList" size="small" placeholder="请输入搜索会员昵称" v-model="search.keyword" clearable @clear="toSearch">
  22. <el-button slot="append" icon="el-icon-search" @click="toSearch"></el-button>
  23. </el-input>
  24. </div>
  25. <el-tabs v-model="activeName" @tab-click="handleClick">
  26. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;" @selection-change="handleSelectionChange">
  27. <el-table-column prop="user_id" label="用户ID" align="center"></el-table-column>
  28. <el-table-column label="基本信息" align="center">
  29. <template slot-scope="scope">
  30. <template v-if="scope.row.user">
  31. <div style="display:flex;justify-content:center;">
  32. <com-image mode="aspectFill" :src="scope.row.user.avatar_url?scope.row.user.avatar_url:'/resources/img/common/default-avatar.png'"></com-image>
  33. <div style="padding-left:8px">
  34. <div style="text-align:left;margin-top:10px">{{scope.row.user.nickname}}</div>
  35. </div>
  36. </div>
  37. </template>
  38. <template v-else>
  39. --
  40. </template>
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="个人团队业绩" prop="personal_performance" align="center">
  44. </el-table-column>
  45. <el-table-column label="团队总业绩" prop="total_performance" align="center">
  46. </el-table-column>
  47. <el-table-column label="分红金额" prop="amount" align="center">
  48. </el-table-column>
  49. </el-table>
  50. <div style="text-align: right;margin: 20px 0;" v-if="list.length > 0">
  51. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  52. </div>
  53. </el-tabs>
  54. </div>
  55. </el-card>
  56. </div>
  57. <script>
  58. const app = new Vue({
  59. el: '#app',
  60. data: {
  61. activeName: '',
  62. bossDialog: false,
  63. loading: false,
  64. page: 1,
  65. pageCount: 0,
  66. list: [],
  67. exportList: [],
  68. choose_list: [],
  69. search: {},
  70. bossLevelName: '',
  71. bossForm: {
  72. mobile: null,
  73. level: null,
  74. },
  75. job_id: null,
  76. },
  77. mounted() {
  78. this.job_id = getQuery('job_id')
  79. this.getList();
  80. },
  81. methods: {
  82. // 操作处理
  83. handle(type, data = null) {
  84. let id = data ? parseInt(data.id) : '';
  85. let params = {};
  86. switch (type) {
  87. case 'destroy':
  88. params = {
  89. user_id: data.user_id,
  90. status: -1
  91. };
  92. this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {
  93. type: 'warning'
  94. }).then(() => {
  95. this.send(params, 'boss/default/edit')
  96. })
  97. break;
  98. }
  99. },
  100. send(params, url, callback) {
  101. let self = this;
  102. request({
  103. params: {
  104. r: url,
  105. },
  106. method: 'post',
  107. data: params
  108. }).then(e => {
  109. if (e.data.code == 0) {
  110. self.$message.success(e.data.msg);
  111. self.getList();
  112. } else {
  113. self.$message.error(e.data.msg);
  114. }
  115. if (callback) callback(e.data);
  116. }).catch(e => {
  117. console.log(e);
  118. });
  119. },
  120. getList() {
  121. let self = this;
  122. self.loading = true;
  123. let params = {
  124. r: 'boss/pool-prize/settlement-detail',
  125. page: self.page,
  126. job_id: this.job_id,
  127. };
  128. params = Object.assign(params, this.search);
  129. request({
  130. params: params,
  131. method: 'get',
  132. }).then(e => {
  133. self.loading = false;
  134. if (e.data.code == 0) {
  135. self.list = e.data.data.list.list;
  136. self.pageCount = e.data.data.list.page_count;
  137. } else {
  138. self.$message.error(e.data.msg);
  139. }
  140. }).catch(e => {
  141. self.loading = false;
  142. });
  143. },
  144. pagination(currentPage) {
  145. let self = this;
  146. self.page = currentPage;
  147. self.search.page = currentPage;
  148. self.getList();
  149. },
  150. handleClick(tab, event) {
  151. this.search.page = 1;
  152. this.search.status = this.activeName;
  153. this.getList()
  154. },
  155. toSearch() {
  156. this.search.page = 1;
  157. this.getList();
  158. },
  159. handleSelectionChange(val) {
  160. let self = this;
  161. self.choose_list = [];
  162. val.forEach(function(item) {
  163. self.choose_list.push(item.id);
  164. })
  165. },
  166. querySearchAsync(queryString, cb) {
  167. if (!queryString) return;
  168. let self = this;
  169. request({
  170. params: {
  171. r: 'boss/default/select-user',
  172. },
  173. method: 'post',
  174. data: {
  175. keyword: queryString
  176. }
  177. }).then(e => {
  178. if (e.data.code == 0) {
  179. let select = [];
  180. e.data.data.forEach(function(item) {
  181. item.value = String(item.mobile);
  182. select.push(item);
  183. });
  184. cb(select);
  185. } else {
  186. self.$message.error(e.data.msg);
  187. }
  188. }).catch(e => {
  189. console.log(e);
  190. });
  191. },
  192. handleSelect(item) {
  193. this.bossForm.mobile = item.value;
  194. },
  195. }
  196. });
  197. </script>
  198. <style>
  199. .el-tabs__header {
  200. font-size: 16px;
  201. }
  202. .table-body {
  203. padding: 20px;
  204. background-color: #fff;
  205. }
  206. .table-body .el-button {
  207. padding: 0 !important;
  208. border: 0;
  209. margin: 0 5px;
  210. }
  211. .input-item {
  212. width: 250px;
  213. margin: 0 0 20px;
  214. display: inline-block;
  215. }
  216. .input-item .el-input__inner {
  217. border-right: 0;
  218. }
  219. .input-item .el-input__inner:hover {
  220. border: 1px solid #dcdfe6;
  221. border-right: 0;
  222. outline: 0;
  223. }
  224. .input-item .el-input__inner:focus {
  225. border: 1px solid #dcdfe6;
  226. border-right: 0;
  227. outline: 0;
  228. }
  229. .input-item .el-input-group__append {
  230. background-color: #fff;
  231. border-left: 0;
  232. width: 10%;
  233. padding: 0;
  234. }
  235. .input-item .el-input-group__append .el-button {
  236. padding: 0;
  237. }
  238. .input-item .el-input-group__append .el-button {
  239. margin: 0;
  240. }
  241. .batch {
  242. margin: 0 0 20px;
  243. display: inline-block;
  244. }
  245. .batch .el-button {
  246. padding: 9px 15px !important;
  247. }
  248. .el-table th>.cell {
  249. color: #333;
  250. font-weight: bold;
  251. font-size: 14px;
  252. }
  253. .el-table__footer-wrapper,
  254. .el-table__header-wrapper {
  255. border-bottom: 1.4px solid #D6D6D6;
  256. }
  257. .com-image img {
  258. border-radius: 50%;
  259. }
  260. </style>