index.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <style>
  2. .link_url {
  3. text-align: left;
  4. font-size: 14px;
  5. }
  6. .showqr .el-dialog__body {
  7. text-align: center;
  8. padding-bottom: 10px;
  9. }
  10. .el-dialog {
  11. min-width: 400px;
  12. }
  13. </style>
  14. <div id="app" v-cloak>
  15. <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  16. <div slot="header">
  17. <span>收益明细</span>
  18. </div>
  19. <div class="search-box">
  20. <!-- 搜索 -->
  21. <el-form :inline="true" :model="searchForm" size="small" class="demo-form-inline">
  22. <el-form-item label="收益时间">
  23. <el-date-picker
  24. size="small"
  25. v-model="searchForm.profit_time"
  26. type="datetimerange"
  27. value-format="yyyy-MM-dd HH:mm:ss"
  28. range-separator="至"
  29. start-placeholder="开始日期"
  30. end-placeholder="结束日期">
  31. </el-date-picker>
  32. </el-form-item>
  33. <el-form-item label="会员ID">
  34. <el-input placeholder="会员ID" v-model="searchForm.user_id"></el-input>
  35. </el-form-item>
  36. <el-form-item label="会员昵称">
  37. <el-input placeholder="昵称/手机号" v-model="searchForm.user_name"></el-input>
  38. </el-form-item>
  39. <el-form-item>
  40. <el-button type="primary" @click="search">搜索</el-button>
  41. <el-button type="danger" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
  42. </el-form-item>
  43. </el-form>
  44. </div>
  45. <div class="table-body">
  46. <el-tabs>
  47. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
  48. <el-table-column prop="id" label="序号" align="center"></el-table-column>
  49. <el-table-column
  50. label="会员"
  51. min-width="120">
  52. <template slot-scope="scope">
  53. <div style="display: flex;align-items: center;">
  54. <el-image fit="cover" :src="scope.row.user.avatar_url ? scope.row.user.avatar_url : 'resources/img/common/default-avatar.png'" style="width: 40px;height: 40px;display: block;margin-right: 5px;flex-shrink: 0;"></el-image>
  55. <div>
  56. <div>{{scope.row.user.nickname}}</div>
  57. <div>ID {{scope.row.user.id}}</div>
  58. </div>
  59. </div>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="身份类型" min-width="90" align="center">
  63. <template slot-scope="scope">
  64. <span v-if="scope.row.user_id == scope.row.clerk_user_id">核销员</span>
  65. <span v-else-if="scope.row.coupon.is_proper == 1">专有者</span>
  66. <span v-else>使用者</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column label="电子券名称" min-width="90" prop="e_coupon_name" align="center"></el-table-column>
  70. <el-table-column label="专有券" min-width="90" align="center">
  71. <template slot-scope="scope">
  72. <span v-if="scope.row.coupon.is_proper == 1">是</span>
  73. <span v-else>否</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="收益类型" min-width="90" align="center">
  77. <template slot-scope="scope">
  78. <span v-if="scope.row.price_type == 1">积分</span>
  79. <span v-else>佣金</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="收益明细" min-width="90" align="center" prop="commission"></el-table-column>
  83. <el-table-column label="收益时间" min-width="90" align="center">
  84. <template slot-scope="scope">
  85. {{ scope.row.created_at | dateTimeFormat('Y-m-d H:i') }}
  86. </template>
  87. </el-table-column>
  88. </el-table>
  89. <div style="text-align: right;margin: 20px 0;">
  90. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  91. </div>
  92. </el-tabs>
  93. </div>
  94. </el-card>
  95. </div>
  96. <script>
  97. const app = new Vue({
  98. el: '#app',
  99. data: {
  100. loading: false,
  101. page: 1,
  102. pageCount: 0,
  103. list: [],
  104. searchForm:{
  105. profit_time: null,
  106. user_id: null,
  107. user_name: null,
  108. },
  109. },
  110. mounted() {
  111. this.getList();
  112. },
  113. computed: {
  114. show_clear_search_btn: function() {
  115. return this.searchForm.profit_time != null ||
  116. this.searchForm.user_id != null ||
  117. this.searchForm.user_name != null;
  118. },
  119. },
  120. methods: {
  121. pagination(currentPage) {
  122. let self = this;
  123. self.page = currentPage;
  124. self.getList();
  125. },
  126. search() {// 清空查询条件
  127. this.page = 1;
  128. this.getList(this.searchForm);
  129. },
  130. resetSearch() {// 清空查询条件
  131. this.searchForm = {
  132. profit_time: null,
  133. user_id: null,
  134. user_name: null,
  135. };
  136. this.page = 1;
  137. this.getList();
  138. },
  139. getList(search = {}) {
  140. let self = this;
  141. self.loading = true;
  142. let basic_params = {
  143. page: self.page,
  144. };
  145. let params = Object.assign(basic_params, search);
  146. request({
  147. params: {
  148. r: 'electron-coupon/income-log/index'
  149. },
  150. method: 'post',
  151. data: params
  152. }).then(e => {
  153. self.loading = false;
  154. if (e.data.code == 0) {
  155. self.list = e.data.data.page_data.list;
  156. self.pageCount = e.data.data.page_data.page_count;
  157. } else {
  158. self.$message.error(e.data.msg);
  159. }
  160. }).catch(e => {
  161. self.loading = false;
  162. });
  163. }
  164. }
  165. });
  166. </script>
  167. <style>
  168. .el-tabs__header {
  169. font-size: 16px;
  170. }
  171. .table-body {
  172. padding: 20px;
  173. background-color: #fff;
  174. }
  175. .table-body .el-button {
  176. padding: 0 !important;
  177. border: 0;
  178. margin: 0 5px;
  179. }
  180. .input-item {
  181. width: 250px;
  182. margin: 0 0 20px;
  183. display: inline-block;
  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. .batch {
  211. margin: 0 0 20px;
  212. display: inline-block;
  213. }
  214. .batch .el-button {
  215. padding: 9px 15px !important;
  216. }
  217. .el-table th>.cell{
  218. color: #333;
  219. font-weight: bold;
  220. font-size: 14px;
  221. }
  222. .el-table__footer-wrapper, .el-table__header-wrapper{
  223. border-bottom: 1.4px solid #D6D6D6;
  224. }
  225. .search-box {
  226. padding: 10px 0 0 10px;
  227. background-color: #fff;
  228. margin-bottom: 10px;
  229. }
  230. </style>