index.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <style>
  2. .label{
  3. margin-right: 10px;
  4. }
  5. .table-body {
  6. padding: 20px;
  7. background-color: #fff;
  8. }
  9. .input-item {
  10. display: inline-block;
  11. width: 250px;
  12. margin: 0 0 20px;
  13. }
  14. .input-item .el-input__inner {
  15. border-right: 0;
  16. }
  17. .input-item .el-input__inner:hover {
  18. border: 1px solid #dcdfe6;
  19. border-right: 0;
  20. outline: 0;
  21. }
  22. .input-item .el-input__inner:focus {
  23. border: 1px solid #dcdfe6;
  24. border-right: 0;
  25. outline: 0;
  26. }
  27. .input-item .el-input-group__append {
  28. background-color: #fff;
  29. border-left: 0;
  30. width: 10%;
  31. padding: 0;
  32. }
  33. .input-item .el-input-group__append .el-button {
  34. padding: 0;
  35. }
  36. .input-item .el-input-group__append .el-button {
  37. margin: 0;
  38. }
  39. .table-body .el-button {
  40. padding: 0 !important;
  41. border: 0;
  42. margin: 0 5px;
  43. }
  44. .el-table th > .cell {
  45. color: #333;
  46. font-weight: bold;
  47. font-size: 14px;
  48. }
  49. .el-table__footer-wrapper, .el-table__header-wrapper {
  50. border-bottom: 1.4px solid #D6D6D6;
  51. }
  52. .el-button--primary2 {
  53. color: #FFF;
  54. background-color: #03C5FF;
  55. border-color: #03C5FF;
  56. }
  57. /*头像样式 start*/
  58. .default-avatar{
  59. width: 50px;
  60. height: 50px;
  61. border-radius: 50%;
  62. }
  63. .user_img{
  64. position: relative;
  65. margin-right: 8px;
  66. height: 50px;
  67. width: 50px;
  68. }
  69. .el-table_1_column_3 .cell { /*-2 表示在第二行*/
  70. display: flex;
  71. }
  72. /*头像样式 end*/
  73. </style>
  74. <div id="app" v-cloak>
  75. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  76. <div slot="header">
  77. <div>
  78. <span>认领记录</span>
  79. </div>
  80. </template>
  81. </div>
  82. <div class="table-body">
  83. <div size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
  84. <div class="item-box" flex="dir:left cross:center" style="margin-left: 10px;">
  85. <div class="label">支付时间: </div>
  86. <el-date-picker
  87. size="small"
  88. v-model="search.create_time"
  89. type="datetimerange"
  90. value-format="yyyy-MM-dd HH:mm:ss"
  91. range-separator="至"
  92. start-placeholder="开始日期"
  93. end-placeholder="结束日期">
  94. </el-date-picker>
  95. </div>
  96. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  97. <div class="label">会员ID: </div>
  98. <el-input size="small" style="width: 210px" v-model="search.user_id" placeholder="请输入会员ID"></el-input>
  99. </div>
  100. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  101. <div class="label">会员: </div>
  102. <el-input size="small" style="width: 210px" v-model="search.user_keyword" placeholder="会员昵称/手机号码"></el-input>
  103. </div>
  104. <div class="item-box" flex="dir:left cross:center">
  105. <el-button type="primary" style="padding: 12px 34px !important;" @click="searchs">搜索
  106. </el-button>
  107. <el-button type="danger" style="padding: 12px 34px !important;" size="small" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
  108. </div>
  109. </div>
  110. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  111. <el-table-column prop="id" label="ID" min-width="80" align="center"></el-table-column>
  112. <el-table-column label="会员ID" min-width="150" align="center">
  113. <template slot-scope="scope">
  114. <com-ellipsis :line="1">{{scope.row.user_id}}</com-ellipsis>
  115. </template>
  116. </el-table-column>
  117. <el-table-column label="会员" >
  118. <template slot-scope="scope">
  119. <div class="user_img" v-if="scope.row.user_id>0">
  120. <el-image class="default-avatar" :src="scope.row.user.avatar_url">
  121. <div slot="error" class="image-slot">
  122. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  123. </div>
  124. </el-image>
  125. </div>
  126. <div class="user_img" v-else>
  127. <el-image class="default-avatar" :src="scope.row.user_avatar_url">
  128. <div slot="error" class="image-slot">
  129. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  130. </div>
  131. </el-image>
  132. </div>
  133. <div>
  134. <div style="color:#000;" v-if="scope.row.user_id>0">{{scope.row.user.nickname}}</div>
  135. <div style="color:#000;" v-else>{{scope.row.user_name}}</div>
  136. <div style="font-size: 13px;" v-if="scope.row.user_id>0">{{scope.row.user.mobile}}</div>
  137. </div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="领取证书" min-width="100" align="center">
  141. <template slot-scope="scope">
  142. <com-ellipsis :line="1">{{scope.row.certificate.name}}</com-ellipsis>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="领取编号" min-width="100" align="center">
  146. <template slot-scope="scope">
  147. <com-ellipsis :line="1">{{scope.row.number}}</com-ellipsis>
  148. </template>
  149. </el-table-column>
  150. <el-table-column prop="scope" width="180" label="创建时间">
  151. <template slot-scope="scope">
  152. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  153. </template>
  154. </el-table-column>
  155. </el-table>
  156. <div style="text-align: right;margin: 20px 0;">
  157. <el-pagination v-if="pagination" :page-size="pagination.pageSize"
  158. style="display: inline-block;float: right;" background @current-change="pageChange"
  159. layout="prev, pager, next" :total="pagination.total_count">
  160. </el-pagination>
  161. </div>
  162. </div>
  163. </el-card>
  164. </div>
  165. <script>
  166. const app = new Vue({
  167. el: '#app',
  168. data() {
  169. return {
  170. list: [],
  171. listLoading: false,
  172. pagination:null,
  173. page: 1,
  174. pageCount: 0,
  175. search: {
  176. user_id:'',
  177. user_keyword:'',
  178. create_time:'',
  179. },
  180. };
  181. },
  182. computed: {
  183. show_clear_search_btn: function() {
  184. return !isEmpty(this.search.user_id)
  185. ||!isEmpty(this.search.create_time)
  186. ||!isEmpty(this.search.user_keyword)
  187. }
  188. },
  189. methods: {
  190. resetSearch(){
  191. this.search = {
  192. user_id:'',
  193. create_time:'',
  194. user_keyword:'',
  195. }
  196. },
  197. searchs() {
  198. this.page = 1;
  199. this.getList();
  200. },
  201. pageChange(currentPage) {
  202. let self = this;
  203. self.page = currentPage; //console.log(currentPage,999999);
  204. self.getList();
  205. },
  206. getList() {
  207. let self = this;
  208. self.listLoading = true;
  209. request({
  210. params: {
  211. r: 'certificate/claim/index',
  212. page: self.page,
  213. user_id: this.search.user_id,
  214. create_time: this.search.create_time,
  215. user_keyword:this.search.user_keyword,
  216. },
  217. method: 'get',
  218. }).then(e => {
  219. self.listLoading = false;
  220. self.list = e.data.data.list;
  221. this.pagination = e.data.data.pagination;
  222. this.pagination.pageSize = e.data.data.page_size;
  223. this.pagination.total_count = e.data.data.count;
  224. }).catch(e => {
  225. console.log(e);
  226. });
  227. },
  228. },
  229. mounted: function () {
  230. this.getList();
  231. }
  232. });
  233. </script>