index.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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. </div>
  81. <div class="table-body">
  82. <div size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
  83. <div class="item-box" flex="dir:left cross:center" style="margin-left: 10px;">
  84. <div class="label">支付时间: </div>
  85. <el-date-picker
  86. size="small"
  87. v-model="search.create_time"
  88. type="datetimerange"
  89. value-format="yyyy-MM-dd HH:mm:ss"
  90. range-separator="至"
  91. start-placeholder="开始日期"
  92. end-placeholder="结束日期">
  93. </el-date-picker>
  94. </div>
  95. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  96. <div class="label">会员ID: </div>
  97. <el-input size="small" style="width: 210px" v-model="search.user_id" placeholder="请输入会员ID"></el-input>
  98. </div>
  99. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  100. <div class="label">会员: </div>
  101. <el-input size="small" style="width: 210px" v-model="search.user_keyword" placeholder="会员昵称/手机号码"></el-input>
  102. </div>
  103. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  104. <div class="label">分类: </div>
  105. <el-select size="small" style="width: 120px" v-model="search.cate_id"
  106. placeholder="状态">
  107. <el-option v-for="(name,index) in cate_list" :label="name" :value="index" :key="index"></el-option>
  108. </el-select>
  109. </div>
  110. </div>
  111. <div size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
  112. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  113. <div class="label">卡号: </div>
  114. <el-input size="small" style="width: 210px" v-model="search.name" placeholder="请输入卡号"></el-input>
  115. </div>
  116. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px; margin-left: 20px;">
  117. <div class="label">状态: </div>
  118. <el-select size="small" style="width: 120px" v-model="search.use_status"
  119. placeholder="状态">
  120. <el-option label="未领取" :value="1"></el-option>
  121. <el-option label="已领取" :value="3"></el-option>
  122. </el-select>
  123. </div>
  124. <div class="item-box" flex="dir:left cross:center">
  125. <el-button type="primary" style="padding: 12px 34px !important;" @click="searchs">搜索
  126. </el-button>
  127. <el-button type="danger" style="padding: 12px 34px !important;" size="small" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
  128. </div>
  129. </div>
  130. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  131. <el-table-column prop="id" label="ID" min-width="80" align="center"></el-table-column>
  132. <el-table-column
  133. label="会员ID"
  134. min-width="150"
  135. align="center">
  136. <template slot-scope="scope">
  137. <com-ellipsis :line="1">{{scope.row.user.id}}</com-ellipsis>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="会员" width="180" >
  141. <template slot-scope="scope">
  142. <div class="user_img" v-if="scope.row.user_id>0">
  143. <el-image class="default-avatar" :src="scope.row.user.avatar_url">
  144. <div slot="error" class="image-slot">
  145. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  146. </div>
  147. </el-image>
  148. </div>
  149. <div class="user_img" v-else>
  150. <el-image class="default-avatar" :src="scope.row.user_avatar_url">
  151. <div slot="error" class="image-slot">
  152. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  153. </div>
  154. </el-image>
  155. </div>
  156. <div>
  157. <div style="color:#000;" v-if="scope.row.user_id>0">{{scope.row.user.nickname}}</div>
  158. <div style="color:#000;" v-else>{{scope.row.user_name}}</div>
  159. <div style="font-size: 13px;" v-if="scope.row.user_id>0">{{scope.row.user.mobile}}</div>
  160. </div>
  161. </template>
  162. </el-table-column>
  163. <el-table-column label="分类" min-width="100" align="center">
  164. <template slot-scope="scope">
  165. <com-ellipsis :line="1">{{scope.row.cate.name}}</com-ellipsis>
  166. </template>
  167. </el-table-column>
  168. <el-table-column label="卡号" min-width="100" align="center">
  169. <template slot-scope="scope">
  170. <com-ellipsis :line="1">{{scope.row.cardSecret.name}}</com-ellipsis>
  171. </template>
  172. </el-table-column>
  173. <el-table-column label="状态" min-width="100" align="center">
  174. <template slot-scope="scope">
  175. <span v-if="scope.row.use_status == 2">待领取</span>
  176. <span v-if="scope.row.use_status == 3">已领取</span>
  177. <span v-if="scope.row.use_status == 1">未领取</span>
  178. <span v-if="scope.row.use_status == 4">已失效</span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column prop="scope" width="180" label="创建时间">
  182. <template slot-scope="scope">
  183. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  184. </template>
  185. </el-table-column>
  186. </el-table>
  187. <div style="text-align: right;margin: 20px 0;">
  188. <el-pagination v-if="pagination" :page-size="pagination.pageSize"
  189. style="display: inline-block;float: right;" background @current-change="pageChange"
  190. layout="prev, pager, next" :total="pagination.total_count">
  191. </el-pagination>
  192. </div>
  193. </div>
  194. </el-card>
  195. </div>
  196. <script>
  197. const app = new Vue({
  198. el: '#app',
  199. data() {
  200. return {
  201. list: [],
  202. cate_list:[],
  203. listLoading: false,
  204. btnLoading: false,
  205. pagination:null,
  206. page: 1,
  207. pageCount: 0,
  208. dataList: [],
  209. search: {
  210. user_id:'',
  211. user_keyword:'',
  212. cate_id:'',
  213. name:'',
  214. use_status:'',
  215. create_time:'',
  216. },
  217. // 对话框显示与否
  218. dialogVisible: false,
  219. dataloading: false,
  220. addGroupVisible: false,
  221. };
  222. },
  223. computed: {
  224. show_clear_search_btn: function() {
  225. return !isEmpty(this.search.user_id)
  226. ||!isEmpty(this.search.user_keyword)
  227. ||!isEmpty(this.search.cate_id)
  228. ||!isEmpty(this.search.name)
  229. ||!isEmpty(this.search.use_status)
  230. ||!isEmpty(this.search.create_time)
  231. }
  232. },
  233. methods: {
  234. resetSearch(){
  235. this.search = {
  236. user_id:'',
  237. user_keyword:'',
  238. cate_id:'',
  239. name:'',
  240. use_status:'',
  241. create_time:'',
  242. }
  243. },
  244. searchs() {
  245. this.page = 1;
  246. this.getList();
  247. },
  248. pageChange(currentPage) {
  249. let self = this;
  250. self.page = currentPage; //console.log(currentPage,999999);
  251. self.getList();
  252. },
  253. getList() {
  254. let self = this;
  255. self.listLoading = true;
  256. request({
  257. params: {
  258. r: 'card-secret/card-secret-use/index',
  259. page: self.page,
  260. cate_id: this.search.cate_id,
  261. name: this.search.name,
  262. user_id: this.search.user_id,
  263. user_keyword: this.search.user_keyword,
  264. use_status: this.search.use_status,
  265. create_time: this.search.create_time,
  266. },
  267. method: 'get',
  268. }).then(e => {
  269. self.listLoading = false;
  270. self.list = e.data.data.list;
  271. this.pagination = e.data.data.pagination;
  272. this.pagination.pageSize = e.data.data.page_size;
  273. this.cate_list = e.data.data.cate;
  274. this.pagination.total_count = e.data.data.count;
  275. }).catch(e => {
  276. console.log(e);
  277. });
  278. },
  279. },
  280. mounted: function () {
  281. if(getQuery('cate_id')){
  282. this.search.cate_id = getQuery('cate_id');
  283. }
  284. this.getList();
  285. }
  286. });
  287. </script>