award-log-list.php 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;min-width: 1000px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <div>
  5. <span>推荐奖励</span>
  6. </div>
  7. </div>
  8. <div class="table-body">
  9. 订单编号:
  10. <div class="input-item">
  11. <el-input @keyup.enter.native="search" size="small" placeholder="请输入订单编号" v-model="searchData.order_no" clearable @clear="search"></el-input>
  12. </div>
  13. 会员ID:
  14. <div class="input-item">
  15. <el-input @keyup.enter.native="search" size="small" placeholder="请输入会员ID" v-model="searchData.user_id" clearable @clear="search"></el-input>
  16. </div>
  17. 会员昵称:
  18. <div class="input-item">
  19. <el-input @keyup.enter.native="search" size="small" placeholder="用户昵称" v-model="searchData.nickname" clearable @clear="search"></el-input>
  20. </div>
  21. 拼团等级:
  22. <div class="input-item">
  23. <el-select v-model="searchData.level" placeholder="拼团等级">
  24. <el-option
  25. v-for="(item,key) in level_arr"
  26. :label="item"
  27. :value="key">
  28. </el-option>
  29. </el-select>
  30. </div>
  31. <br />
  32. 创建时间段:
  33. <el-date-picker size="small" v-model="date" type="datetimerange" value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期" @change="selectDateTime" end-placeholder="结束日期">
  34. </el-date-picker>
  35. 奖励类型:
  36. <div class="input-item">
  37. <el-select v-model="searchData.prize_type" placeholder="奖励类型">
  38. <el-option
  39. v-for="(item,key) in prize_type_arr"
  40. :label="item"
  41. :value="key">
  42. </el-option>
  43. </el-select>
  44. </div>
  45. <div style="display: inline-block;margin-left: 10px;">
  46. <el-button type="primary" size="small" @click="search">查询</el-button>
  47. <el-button type="primary" size="small" @click="resetForm" style=" margin-left: 0px;background-color: #ef1818;border-color: #ef1818;">重置</el-button>
  48. </div>
  49. <el-table class="table-info" :data="form" stripe style="width: 100%" v-loading="listLoading">
  50. <el-table-column prop="id" label="ID" width="60" align="center"></el-table-column>
  51. <el-table-column label="会员" width="180">
  52. <template slot-scope="scope">
  53. <div style="display: flex;align-items: center;">
  54. <com-image style="margin-right: 5px;display: block;flex-shrink: 0;border-radius:5px" mode="aspectFill" :src="scope.row.avatar_url ? scope.row.avatar_url : ''"></com-image>
  55. <div v-if="scope.row" style="line-height: 18px;">
  56. <div v-if="scope.row.nickname">{{scope.row.nickname}}</div>
  57. </div>
  58. </div>
  59. </template>
  60. </el-table-column>
  61. <el-table-column prop="mobile" label="手机号" align="center">
  62. <template slot-scope="scope">{{scope.row.mobile ? scope.row.mobile :'--'}}</template>
  63. </el-table-column>
  64. <el-table-column prop="" label="拼团等级" align="center">
  65. <template slot-scope="scope">
  66. <el-tag>{{scope.row.level}}</el-tag>
  67. </template>
  68. </el-table-column>
  69. </el-table-column>
  70. <el-table-column prop="money" label="奖励金额金额" align="center">
  71. <template slot-scope="scope">
  72. {{scope.row.money.toFixed(2)}}
  73. </template>
  74. </el-table-column>
  75. <el-table-column prop="prize_type" label="奖励类型" align="center">
  76. </el-table-column>
  77. <el-table-column prop="desc" width="300" label="描述" align="center">
  78. </el-table-column>
  79. <el-table-column prop="created_at" label="奖励时间" width="160px" align="center">
  80. <template slot-scope="scope">
  81. {{scope.row.created_at}}
  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"></el-pagination>
  87. </div>
  88. </div>
  89. </el-card>
  90. </div>
  91. <script>
  92. const app = new Vue({
  93. el: '#app',
  94. data() {
  95. return {
  96. searchData: {
  97. user_id: '',
  98. nickname: '',
  99. mobile: '',
  100. start_date: '',
  101. end_date: '',
  102. prize_type:'',
  103. level:''
  104. },
  105. level_arr:[],
  106. prize_type_arr:[],
  107. date: '',
  108. form: [],
  109. member: [],
  110. pageCount: 0,
  111. page: 1,
  112. member_page: 1,
  113. currentPage: null,
  114. listLoading: false,
  115. btnLoading: false,
  116. // 导出
  117. exportList: [],
  118. };
  119. },
  120. methods: {
  121. openId(index) {
  122. let item = this.form;
  123. item[index].is_open_id = !item[index].is_open_id;
  124. this.form = JSON.parse(JSON.stringify(this.form));
  125. },
  126. //搜索
  127. search() {
  128. this.page = 1;
  129. this.getList();
  130. },
  131. pagination(currentPage) {
  132. this.page = currentPage;
  133. this.getList();
  134. },
  135. getList() {
  136. this.listLoading = true;
  137. request({
  138. params: {
  139. r: 'lucky-group/bill/reward-amount-award-log',
  140. page: this.page,
  141. user_id: this.searchData.user_id,
  142. nickname: this.searchData.nickname,
  143. start_date: this.searchData.start_date,
  144. end_date: this.searchData.end_date,
  145. prize_type: this.searchData.prize_type,
  146. level: this.searchData.level,
  147. pagesize: 10
  148. },
  149. }).then(e => {
  150. if (e.data.code === 0) {
  151. this.form = e.data.data.list;
  152. this.prize_type_arr = e.data.data.prize_type_arr;
  153. this.level_arr = e.data.data.level_arr;
  154. this.pageCount = e.data.data.page_count;
  155. this.currentPage = e.data.data.current_page;
  156. } else {
  157. this.$message.error(e.data.msg);
  158. }
  159. this.listLoading = false;
  160. }).catch(e => {
  161. this.listLoading = false;
  162. });
  163. },
  164. // 时间搜索触发
  165. selectDateTime(e) {
  166. if (e != null) {
  167. this.searchData.start_date = e[0];
  168. this.searchData.end_date = e[1];
  169. } else {
  170. this.searchData.start_date = '';
  171. this.searchData.end_date = '';
  172. }
  173. this.page = 1;
  174. this.search();
  175. },
  176. //重置
  177. resetForm() {
  178. this.searchData.user_id = '';
  179. this.searchData.nickname = '';
  180. this.searchData.mobile = '';
  181. this.searchData.start_date = '';
  182. this.searchData.end_date = '';
  183. this.searchData.prize_type = '';
  184. this.searchData.level = '';
  185. this.date = '';
  186. },
  187. },
  188. mounted: function() {
  189. this.page = getQuery('page') ? getQuery('page') : 1;
  190. this.getList();
  191. }
  192. });
  193. </script>
  194. <style>
  195. .table-body {
  196. padding: 20px;
  197. background-color: #fff;
  198. }
  199. /* .table-info .el-button {
  200. padding: 0 !important;
  201. border: 0;
  202. margin: 0 5px;
  203. } */
  204. .input-item {
  205. display: inline-block;
  206. width: 150px;
  207. margin: 0 0 20px;
  208. }
  209. .input-item .el-input__inner {
  210. border-right: 1px solid #dcdfe6;
  211. }
  212. .input-item .el-input__inner:hover {
  213. border: 1px solid #dcdfe6;
  214. border-right: 0;
  215. outline: 0;
  216. }
  217. .input-item .el-input__inner:focus {
  218. border: 1px solid #dcdfe6;
  219. border-right: 0;
  220. outline: 0;
  221. }
  222. .input-item .el-input-group__append {
  223. background-color: #fff;
  224. border-left: 0;
  225. width: 10%;
  226. padding: 0;
  227. }
  228. .input-item .el-input-group__append .el-button {
  229. padding: 0;
  230. }
  231. .input-item .el-input-group__append .el-button {
  232. margin: 0;
  233. }
  234. .select {
  235. float: left;
  236. width: 100px;
  237. margin-right: 10px;
  238. }
  239. .el-table th>.cell {
  240. color: #333;
  241. font-weight: bold;
  242. font-size: 14px;
  243. }
  244. .el-table__footer-wrapper,
  245. .el-table__header-wrapper {
  246. border-bottom: 1.4px solid #D6D6D6;
  247. }
  248. </style>