reward-log.blade.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. @extends('layouts.base')
  2. @section('title', "奖励记录")
  3. @section('content')
  4. <style xmlns:v-bind="http://www.w3.org/1999/xhtml">
  5. .rightlist #app .rightlist-head{padding:15px 0;line-height:50px;}
  6. .rightlist #app{margin-left:30px;}
  7. .rightlist-head-con{float:left;padding-right:20px;font-size:16px;color:#888;}
  8. .el-form-item__label{padding-right:30px;}
  9. .mouse-active{cursor:pointer;border:1px dotted #409EFF;border-radius: 4px;}
  10. /* 滑块选择小白点 */
  11. .el-switch.is-checked .el-switch__core::after {left: 100%;margin-left: -17px;}
  12. .el-switch__core::after {content: "";position: absolute;top: 1px;left: 1px;border-radius: 100%;transition: all .3s;width: 16px;height: 16px;background-color: #fff;}
  13. </style>
  14. <div class="rightlist">
  15. <div id="app" v-loading="submit_loading">
  16. <link rel="stylesheet" href="//at.alicdn.com/t/font_913727_zrmdutznqpd.css">
  17. <div class="rightlist-head">
  18. <div class="rightlist-head-con">奖励记录</div>
  19. </div>
  20. <el-form :inline="true" :model="search_form" ref="search_form">
  21. <el-row>
  22. <el-col :span="24">
  23. <el-form-item>
  24. <el-input v-model="search_form.uid" placeholder="请输入会员ID"></el-input>
  25. </el-form-item>
  26. <el-form-item>
  27. <el-input v-model="search_form.member" placeholder="请输入会员昵称/姓名/手机号" style="width:250px"></el-input>
  28. </el-form-item>
  29. <el-form-item>
  30. <el-input v-model="search_form.order_sn" placeholder="订单号" style="width:250px"></el-input>
  31. </el-form-item>
  32. <el-form-item>
  33. <el-select v-model="search_form.status" placeholder="奖励状态">
  34. <el-option v-for="(item,index) in status_list" :key="item" :label="item" :value="index"></el-option>
  35. </el-select>
  36. </el-form-item>
  37. <el-form-item>
  38. <el-select v-model="search_form.type" placeholder="奖励类型">
  39. <el-option v-for="(item,index) in type_list" :key="item" :label="item" :value="index"></el-option>
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item label="奖励时间">
  43. <template>
  44. <div class="block">
  45. <span class="demonstration"></span>
  46. <el-date-picker
  47. v-model="search_form.create_time"
  48. type="datetimerange"
  49. range-separator="至"
  50. start-placeholder="开始日期"
  51. end-placeholder="结束日期"
  52. align="right">
  53. </el-date-picker>
  54. </div>
  55. </template>
  56. </el-form-item>
  57. <el-form-item>
  58. <a href="#">
  59. <el-button type="primary" icon="el-icon-search" @click="search()">搜索</el-button>
  60. </a>
  61. </el-form-item>
  62. </el-col>
  63. </el-row>
  64. </el-form>
  65. <template>
  66. <el-table :data="list" style="width: 100%" v-loading="table_loading">
  67. <el-table-column prop="id" label="ID" width="auto" align="center"></el-table-column>
  68. <el-table-column prop="created_at" label="时间" width="auto" align="center"></el-table-column>
  69. <el-table-column prop="order_sn" label="订单号" width="auto" align="center"></el-table-column>
  70. <el-table-column label="股东" width="auto" align="center">
  71. <template slot-scope="scope">
  72. <img style='width:40px;height:40px' :src=scope.row.member.avatar v-if="scope.row.member" style="max-width:100px">
  73. <div>[[scope.row.member?scope.row.member.nickname:'未更新']]</div>
  74. </template>
  75. </el-table-column>
  76. <el-table-column prop="price" label="订单金额" width="auto" align="center"></el-table-column>
  77. <el-table-column prop="type_name" label="奖励类型" width="auto" align="center"></el-table-column>
  78. <el-table-column prop="amount" label="奖励金额" width="auto" align="center"></el-table-column>
  79. <el-table-column prop="status_name" label="奖励状态" width="auto" align="center"></el-table-column>
  80. </el-table>
  81. <el-row>
  82. <el-col :span="24" align="right" style="padding:15px 5% 15px 0">
  83. <el-pagination layout="prev, pager, next" @current-change="currentChange" :total="page_total" :page-size="page_size" background v-loading="loading"></el-pagination>
  84. </el-col>
  85. </el-row>
  86. </template>
  87. </div>
  88. </div>
  89. <script>
  90. var vm = new Vue({
  91. el:"#app",
  92. delimiters: ['[[', ']]'],
  93. data() {
  94. let data = JSON.parse('{!! $pageList ?: "{}" !!}');
  95. return{
  96. list:data.data,
  97. loading:false,
  98. table_loading:false,
  99. submit_loading:false,
  100. page_total:data.total,
  101. page_size:data.per_page,
  102. current_page:data.current_page,
  103. search_form:{},
  104. status_list : {
  105. 0 : '未奖励',
  106. 1 : '已奖励',
  107. '-1' : '失效',
  108. },
  109. type_list : {
  110. 1 : '股东奖励',
  111. 2 : '平级奖励',
  112. },
  113. }
  114. },
  115. methods: {
  116. search(){
  117. this.search_loading=true;
  118. if(this.search_form.create_time){
  119. this.search_form.create_time[0] = Math.round(this.search_form.create_time[0]/1000).valueOf();
  120. this.search_form.create_time[1] = Math.round(this.search_form.create_time[1]/1000).valueOf();
  121. }
  122. this.$http.post('{!! yzWebFullUrl('plugin.partner-reward.admin.controllers.reward-log.search') !!}',{search_form:this.search_form}
  123. ).then(function (response) {
  124. if (response.data.result){
  125. this.list = response.data.data.data;
  126. this.search_loading = false;
  127. }
  128. else {
  129. this.$message({message: response.data.msg,type: 'error'});
  130. }
  131. this.search_loading = false;
  132. },function (response) {
  133. this.search_loading = false;
  134. this.$message({message: response.data.msg,type: 'error'});
  135. }
  136. );
  137. },
  138. currentChange(val) {
  139. this.loading = true;
  140. this.$http.post('{!! yzWebFullUrl('plugin.partner-reward.admin.controllers.reward-log.search') !!}',{page:val}).then(function (response){
  141. let datas = response.data.data;
  142. this.page_total = datas.total;
  143. this.list = datas.data;
  144. this.page_size = datas.per_page;
  145. this.current_page = datas.current_page;
  146. this.loading = false;
  147. },function (response) {
  148. this.loading = false;
  149. }
  150. );
  151. }
  152. },
  153. });
  154. </script>
  155. @endsection