settlement-list.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <span>提成明细</span>
  5. </div>
  6. <div class="table-body">
  7. <div class="input-item">
  8. <el-input @keyup.enter.native="loadData" size="small" placeholder="输入用户ID搜索" v-model="search.keyword" clearable @clear="toSearch">
  9. <el-button slot="append" icon="el-icon-search" @click="toSearch"></el-button>
  10. </el-input>
  11. </div>
  12. <!-- <div style="float: right">-->
  13. <!-- <el-button type="primary" size="small" :loading="jobLoading" style="padding: 9px 15px !important;" @click="runBossJob">手动执行分红</el-button>-->
  14. <!-- </div>-->
  15. <el-tabs v-model="activeName" @tab-click="handleClick">
  16. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
  17. <el-table-column prop="id" width="100" label="ID" align="center"></el-table-column>
  18. <el-table-column label="股东信息">
  19. <template slot-scope="scope">
  20. <com-image style="float: left;margin-right: 5px;" model="aspectFill" :src="scope.row.user.avatar_url"></com-image>
  21. <div>ID:{{scope.row.user.id}}</div>
  22. <div>{{scope.row.user.nickname}}</div>
  23. </template>
  24. </el-table-column>
  25. <el-table-column label="奖励类型">
  26. <template slot-scope="scope">
  27. <div>{{ commonission_type[scope.row.type] }}</div>
  28. </template>
  29. </el-table-column>
  30. <el-table-column label="结算周期" align="left">
  31. <template slot-scope="scope">
  32. <div>{{ compute_period[scope.row.compute_period] }}</div>
  33. <div>{{ scope.row.start_time }}~{{ scope.row.end_time }}</div>
  34. </template>
  35. </el-table-column>
  36. <el-table-column label="结算金额(元)" prop="amounts" align="center"></el-table-column>
  37. <el-table-column label="佣金金额(元)" prop="commission" align="center"></el-table-column>
  38. <el-table-column label="操作">
  39. <template slot-scope="scope">
  40. <el-button type="text" @click="handle('detail',scope.row)">分红明细</el-button>
  41. </template>
  42. </el-table-column>
  43. </el-table>
  44. </el-tabs>
  45. <div style="text-align: right;margin: 20px 0;">
  46. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  47. </div>
  48. </div>
  49. </el-card>
  50. </div>
  51. <script>
  52. const app = new Vue({
  53. el: '#app',
  54. data: {
  55. loading: false,
  56. jobLoading: false,
  57. activeName: '-1',
  58. list: [],
  59. commonission_type: [],
  60. compute_period: [],
  61. page: 1,
  62. pageCount: 0,
  63. search: {}
  64. },
  65. mounted() {
  66. this.loadData();
  67. },
  68. methods: {
  69. loadData() {
  70. let self = this;
  71. self.loading = true;
  72. let basic_params = {
  73. page: self.page,
  74. };
  75. basic_params = Object.assign(basic_params, this.search);
  76. request({
  77. params: {
  78. r: 'store/client/store-boss/settlement-list'
  79. },
  80. data: basic_params,
  81. method: 'post',
  82. }).then(e => {
  83. this.loading = false;
  84. if (e.data.code == 0) {
  85. self.list = e.data.data.list.list;
  86. self.commonission_type = e.data.data.commonission_type;
  87. self.compute_period = e.data.data.compute_period;
  88. self.pageCount = e.data.data.list.page_count;
  89. } else {
  90. self.$message.error(e.data.msg);
  91. }
  92. }).catch(e => {
  93. self.loading = false;
  94. });
  95. },
  96. // 操作处理
  97. handle(type, data = null) {
  98. switch (type) {
  99. case 'detail':// 编辑
  100. params = {
  101. r: 'store/client/store-boss/income-list'
  102. };
  103. params = Object.assign(params, {
  104. id: data.user_id,
  105. type: data.type,
  106. start_time: data.start_time,
  107. end_time: data.end_time,
  108. });
  109. navigateTo(params);
  110. break;
  111. }
  112. },
  113. runBossJob() {
  114. this.jobLoading = true;
  115. let params = {
  116. //r: 'plugin/boss/mall/boss/run-boss-job'
  117. };
  118. request({
  119. params: params,
  120. method: 'post',
  121. }).then(e => {
  122. this.jobLoading = false;
  123. if (e.data.code == 0) {
  124. this.$message.success(e.data.msg);
  125. this.search.page = 1;
  126. this.loadData();
  127. } else {
  128. this.jobLoading = false;
  129. this.$message.error(e.data.msg);
  130. }
  131. });
  132. },
  133. pagination(currentPage) {
  134. let self = this;
  135. self.page = currentPage;
  136. self.loadData();
  137. },
  138. handleClick(tab, event) {
  139. this.search.page = 1;
  140. this.search.status = this.activeName;
  141. this.loadData()
  142. },
  143. toSearch() {
  144. this.search.page = 1;
  145. this.loadData();
  146. },
  147. }
  148. });
  149. </script>
  150. <style>
  151. .el-tabs__header {
  152. font-size: 16px;
  153. }
  154. .table-body {
  155. padding: 20px;
  156. background-color: #fff;
  157. }
  158. .table-body .el-button {
  159. padding: 0 !important;
  160. border: 0;
  161. margin: 0 5px;
  162. }
  163. .input-item {
  164. width: 250px;
  165. margin: 0 0 20px;
  166. display: inline-block;
  167. }
  168. .input-item .el-input__inner {
  169. border-right: 0;
  170. }
  171. .input-item .el-input__inner:hover {
  172. border: 1px solid #dcdfe6;
  173. border-right: 0;
  174. outline: 0;
  175. }
  176. .input-item .el-input__inner:focus {
  177. border: 1px solid #dcdfe6;
  178. border-right: 0;
  179. outline: 0;
  180. }
  181. .input-item .el-input-group__append {
  182. background-color: #fff;
  183. border-left: 0;
  184. width: 10%;
  185. padding: 0;
  186. }
  187. .input-item .el-input-group__append .el-button {
  188. padding: 0;
  189. }
  190. .input-item .el-input-group__append .el-button {
  191. margin: 0;
  192. }
  193. .batch {
  194. margin: 0 0 20px;
  195. display: inline-block;
  196. }
  197. .batch .el-button {
  198. padding: 9px 15px !important;
  199. }
  200. .el-table th>.cell{
  201. color: #333;
  202. font-weight: bold;
  203. font-size: 14px;
  204. }
  205. .el-table__footer-wrapper, .el-table__header-wrapper{
  206. border-bottom: 1.4px solid #D6D6D6;
  207. }
  208. </style>