index.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <div id="app" class="contents" v-cloak>
  2. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;" style="min-width: 1000px;">
  3. <div slot="header">
  4. <div>
  5. <span>提成明细</span>
  6. <div style="float:right;margin:-6px 0px">
  7. </div>
  8. </div>
  9. </div>
  10. <el-row :gutter="10" style="margin-bottom: 10px">
  11. <el-col :span="8">
  12. <el-card shadow="hover">
  13. <div slot="header">
  14. 总提成金额
  15. </div>
  16. <div>
  17. ¥<strong style="font-size: 24px">{{total_commission | amount}}</strong>
  18. </div>
  19. </el-card>
  20. </el-col>
  21. <el-col :span="8">
  22. <el-card shadow="hover">
  23. <div slot="header">
  24. 今日提成金额
  25. </div>
  26. <div>
  27. ¥<strong style="font-size: 24px">{{today_commission | amount}}</strong>
  28. </div>
  29. </el-card>
  30. </el-col>
  31. </el-row>
  32. <div class="table-body">
  33. <el-form size="small" :inline="true" flex="dir:left cross:center">
  34. <div class="item-box" flex="dir:left cross:center">
  35. <el-date-picker @change="selectedDateTime" size="small"
  36. v-model="selectTime" type="daterange" value-format="yyyy-MM-dd"
  37. range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
  38. </el-date-picker>
  39. </div>
  40. <div class="item-box" flex="dir:left cross:center" style="padding-left: 10px">
  41. <el-input size="small" style="width: 200px" v-model="searchData.member" placeholder="请输入会员昵称/ID"></el-input>
  42. </div>
  43. <div class="item-box" flex="dir:left cross:center">
  44. <el-button size="small" type="primary" style="padding: 9px 15px !important;margin-right: 5px; margin-left: 25px;" @click="search">搜索
  45. </el-button>
  46. </div>
  47. <div class="item-box" flex="dir:left cross:center" v-if="searchData.date_start || searchData.date_end || searchData.member">
  48. <el-button size="small" type="warning" style="padding: 9px 15px !important;" @click="clearSearch">清除搜索条件
  49. </el-button>
  50. </div>
  51. </el-form>
  52. <el-table v-loading=" listLoading" :data="list" stripe style="width: 100%">
  53. <el-table-column label="序号" prop="id" width="100"> </el-table-column>
  54. <el-table-column label="会员信息" width="200">
  55. <template slot-scope="scope">
  56. <div class="table-info-img-text">
  57. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  58. <div slot="error" class="image-slot">
  59. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  60. </div>
  61. </el-image>
  62. <div class="table-info-text">
  63. <div style="color:#000;">{{scope.row.user.nickname}}</div>
  64. <div style="font-size: 12px;">id:{{scope.row.user.id}}</div>
  65. </div>
  66. </div>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="提成金额" align="center" width="200">
  70. <template slot-scope="scope">
  71. <span>{{scope.row.commission | amount}}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="提成说明" align="left">
  75. <template slot-scope="scope">
  76. <span>{{scope.row.intro}}</span>
  77. </template>
  78. </el-table-column>
  79. <el-table-column label="更新时间" align="center" width="200">
  80. <template slot-scope="scope">
  81. {{scope.row.updated_at|dateTimeFormat('Y-m-d H:i:s')}}
  82. </template>
  83. </el-table-column>
  84. </el-table>
  85. <div style="text-align: right;margin: 20px 0;">
  86. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount">
  87. </el-pagination>
  88. </div>
  89. </div>
  90. </el-card>
  91. </div>
  92. <script>
  93. const app = new Vue({
  94. el: '#app',
  95. data: {
  96. list: [],
  97. listLoading: false,
  98. page: 1,
  99. level: 1,
  100. pageCount: 0,
  101. page_size: 15,
  102. searchData: {
  103. date_start: '',
  104. date_end: '',
  105. member: ''
  106. },
  107. selectTime: [],
  108. // 导出
  109. exportList: [],
  110. statusMap: [],
  111. today_commission: 0,
  112. total_commission: 0
  113. },
  114. mounted: function() {
  115. this.getList();
  116. },
  117. methods: {
  118. //搜索
  119. search() {
  120. this.page = 1;
  121. this.getList();
  122. },
  123. clearSearch() {
  124. this.searchData.memeber = '';
  125. this.searchData.date_end = '';
  126. this.searchData.date_start = '';
  127. this.selectTime = [];
  128. this.getList();
  129. },
  130. // 时间搜索触发
  131. selectedDateTime(params) {
  132. if (params != null) {
  133. this.searchData.date_start = params[0];
  134. this.searchData.date_end = params[1];
  135. } else {
  136. this.searchData.date_start = '';
  137. this.searchData.date_end = '';
  138. }
  139. this.getList()
  140. },
  141. pagination(currentPage) {
  142. let self = this;
  143. self.page = currentPage;
  144. self.getList();
  145. },
  146. getList() {
  147. this.listLoading = true;
  148. request({
  149. params: {
  150. r: 'business-activity/commission/index',
  151. pagesize: 10,
  152. page: this.page,
  153. ...this.searchData,
  154. },
  155. method: 'get',
  156. }).then(e => {
  157. this.listLoading = false;
  158. if (e.data.code == 0) {
  159. this.statusMap = e.data.data.status_map;
  160. this.list = e.data.data.list;
  161. this.pageCount = e.data.data.page_count;
  162. this.total_commission = e.data.data.total_commission
  163. this.today_commission = e.data.data.today_commission
  164. } else {
  165. this.$message.error(e.data.msg)
  166. }
  167. }).catch(e => {
  168. console.log(e);
  169. });
  170. }
  171. },
  172. filters: {
  173. amount: function(val) {
  174. return parseFloat(val / 100).toFixed(2)
  175. }
  176. }
  177. });
  178. </script>
  179. <style>
  180. .table-body {
  181. padding: 20px;
  182. background-color: #fff;
  183. }
  184. .input-item {
  185. display: inline-block;
  186. width: 250px;
  187. margin: 0 0 20px;
  188. }
  189. .input-item .el-input__inner {
  190. border-right: 0;
  191. }
  192. .input-item .el-input__inner:hover {
  193. border: 1px solid #dcdfe6;
  194. border-right: 0;
  195. outline: 0;
  196. }
  197. .input-item .el-input__inner:focus {
  198. border: 1px solid #dcdfe6;
  199. border-right: 0;
  200. outline: 0;
  201. }
  202. .input-item .el-input-group__append {
  203. background-color: #fff;
  204. border-left: 0;
  205. width: 10%;
  206. padding: 0;
  207. }
  208. .input-item .el-input-group__append .el-button {
  209. padding: 0;
  210. }
  211. .input-item .el-input-group__append .el-button {
  212. margin: 0;
  213. }
  214. /* .table-body .el-button {
  215. padding: 0 !important;
  216. border: 0;
  217. margin: 0 5px;
  218. }
  219. */
  220. .el-table th>.cell {
  221. color: #333;
  222. font-weight: bold;
  223. font-size: 14px;
  224. }
  225. .el-table__footer-wrapper,
  226. .el-table__header-wrapper {
  227. border-bottom: 1.4px solid #D6D6D6;
  228. }
  229. .el-button--mini.is-circle {
  230. padding: 3px;
  231. }
  232. .contents .el-button+.el-button {
  233. margin-left: 0px;
  234. }
  235. </style>