index.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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="order_price" align="center"></el-table-column>
  37. <el-table-column label="金额" prop="amounts" align="center"></el-table-column>
  38. <el-table-column label="结算金额(元)" prop="settle_price" align="center"></el-table-column>
  39. <el-table-column label="佣金金额(元)" prop="commission" align="center"></el-table-column>
  40. <el-table-column label="操作">
  41. <template slot-scope="scope">
  42. <el-button type="text" @click="handle('detail',scope.row)">分红明细</el-button>
  43. </template>
  44. </el-table-column>
  45. </el-table>
  46. </el-tabs>
  47. <div style="text-align: right;margin: 20px 0;">
  48. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  49. </div>
  50. </div>
  51. </el-card>
  52. </div>
  53. <script>
  54. const app = new Vue({
  55. el: '#app',
  56. data: {
  57. loading: false,
  58. jobLoading: false,
  59. activeName: '-1',
  60. list: [],
  61. commonission_type: [],
  62. compute_period: [],
  63. page: 1,
  64. pageCount: 0,
  65. search: {}
  66. },
  67. mounted() {
  68. this.loadData();
  69. },
  70. methods: {
  71. loadData() {
  72. let self = this;
  73. self.loading = true;
  74. let basic_params = {
  75. page: self.page,
  76. };
  77. basic_params = Object.assign(basic_params, this.search);
  78. request({
  79. params: {
  80. r: 'boss-weight/commission/index'
  81. },
  82. data: basic_params,
  83. method: 'post',
  84. }).then(e => {
  85. this.loading = false;
  86. if (e.data.code == 0) {
  87. self.list = e.data.data.list.list;
  88. self.commonission_type = e.data.data.commonission_type;
  89. self.compute_period = e.data.data.compute_period;
  90. self.pageCount = e.data.data.list.page_count;
  91. } else {
  92. self.$message.error(e.data.msg);
  93. }
  94. }).catch(e => {
  95. self.loading = false;
  96. });
  97. },
  98. // 操作处理
  99. handle(type, data = null) {
  100. switch (type) {
  101. case 'detail':// 编辑
  102. params = {
  103. r: 'boss-weight/commission/reward-log'
  104. };
  105. params = Object.assign(params, {
  106. id: data.user_id,
  107. commission_id: data.id,
  108. type: data.type,
  109. start_time: data.start_time,
  110. end_time: data.end_time,
  111. });
  112. navigateTo(params);
  113. break;
  114. }
  115. },
  116. runBossJob() {
  117. this.jobLoading = true;
  118. let params = {
  119. r: 'plugin/boss-weight/mall/boss-weight/run-boss-job'
  120. };
  121. request({
  122. params: params,
  123. method: 'post',
  124. }).then(e => {
  125. this.jobLoading = false;
  126. if (e.data.code == 0) {
  127. this.$message.success(e.data.msg);
  128. this.search.page = 1;
  129. this.loadData();
  130. } else {
  131. this.jobLoading = false;
  132. this.$message.error(e.data.msg);
  133. }
  134. });
  135. },
  136. pagination(currentPage) {
  137. let self = this;
  138. self.page = currentPage;
  139. self.loadData();
  140. },
  141. handleClick(tab, event) {
  142. this.search.page = 1;
  143. this.search.status = this.activeName;
  144. this.loadData()
  145. },
  146. toSearch() {
  147. this.search.page = 1;
  148. this.loadData();
  149. },
  150. }
  151. });
  152. </script>
  153. <style>
  154. .el-tabs__header {
  155. font-size: 16px;
  156. }
  157. .table-body {
  158. padding: 20px;
  159. background-color: #fff;
  160. }
  161. .table-body .el-button {
  162. padding: 0 !important;
  163. border: 0;
  164. margin: 0 5px;
  165. }
  166. .input-item {
  167. width: 250px;
  168. margin: 0 0 20px;
  169. display: inline-block;
  170. }
  171. .input-item .el-input__inner {
  172. border-right: 0;
  173. }
  174. .input-item .el-input__inner:hover {
  175. border: 1px solid #dcdfe6;
  176. border-right: 0;
  177. outline: 0;
  178. }
  179. .input-item .el-input__inner:focus {
  180. border: 1px solid #dcdfe6;
  181. border-right: 0;
  182. outline: 0;
  183. }
  184. .input-item .el-input-group__append {
  185. background-color: #fff;
  186. border-left: 0;
  187. width: 10%;
  188. padding: 0;
  189. }
  190. .input-item .el-input-group__append .el-button {
  191. padding: 0;
  192. }
  193. .input-item .el-input-group__append .el-button {
  194. margin: 0;
  195. }
  196. .batch {
  197. margin: 0 0 20px;
  198. display: inline-block;
  199. }
  200. .batch .el-button {
  201. padding: 9px 15px !important;
  202. }
  203. .el-table th>.cell{
  204. color: #333;
  205. font-weight: bold;
  206. font-size: 14px;
  207. }
  208. .el-table__footer-wrapper, .el-table__header-wrapper{
  209. border-bottom: 1.4px solid #D6D6D6;
  210. }
  211. </style>