index.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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="会员ID">
  23. <el-input placeholder="会员ID" v-model="searchForm.user_id"></el-input>
  24. </el-form-item>
  25. <el-form-item label="会员昵称">
  26. <el-input placeholder="昵称/手机号" v-model="searchForm.user_name"></el-input>
  27. </el-form-item>
  28. <el-form-item label="电子券名称">
  29. <el-input placeholder="请输入电子券名称" v-model="searchForm.coupon_name"></el-input>
  30. </el-form-item>
  31. <!-- <el-form-item label="电子券类型">-->
  32. <!-- <el-select v-model="searchForm.coupon_type" placeholder="请选择电子券类型">-->
  33. <!-- <el-option v-for="(name, index) in type_option" :label="name" :value="index" :key="index"></el-option>-->
  34. <!-- </el-select>-->
  35. <!-- </el-form-item>-->
  36. <el-form-item label="领取时间">
  37. <el-date-picker
  38. size="small"
  39. v-model="searchForm.receive_time"
  40. type="datetimerange"
  41. value-format="yyyy-MM-dd HH:mm:ss"
  42. range-separator="至"
  43. start-placeholder="开始日期"
  44. end-placeholder="结束日期">
  45. </el-date-picker>
  46. </el-form-item>
  47. <el-form-item>
  48. <el-button type="primary" @click="search">搜索</el-button>
  49. <el-button type="danger" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
  50. </el-form-item>
  51. </el-form>
  52. </div>
  53. <div class="table-body">
  54. <el-tabs>
  55. <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
  56. <el-table-column prop="id" label="序号" align="center"></el-table-column>
  57. <el-table-column prop="e_coupon_id" label="电子券ID" align="center"></el-table-column>
  58. <el-table-column
  59. label="会员"
  60. min-width="120">
  61. <template slot-scope="scope">
  62. <div style="display: flex;align-items: center;" v-if="scope.row.user">
  63. <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>
  64. <div>
  65. <div>{{scope.row.user.nickname}}</div>
  66. <div>ID {{scope.row.user.id}}</div>
  67. </div>
  68. </div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="手机号" align="center" width="105px">
  72. <template slot-scope="scope">
  73. {{scope.row.user.mobile}}
  74. </template>
  75. </el-table-column>
  76. <el-table-column label="专有券" align="center" width="65px">
  77. <template slot-scope="scope">
  78. <span v-if="scope.row.is_proper == 1">是</span>
  79. <span v-else>否</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column prop="e_coupon.name" label="电子券名称" align="center"></el-table-column>
  83. <el-table-column label="领取时间" min-width="90" align="center">
  84. <template slot-scope="scope">
  85. {{ scope.row.last_receive_time | dateTimeFormat('Y-m-d H:i') }}
  86. </template>
  87. </el-table-column>
  88. <!-- <el-table-column prop="user_level" label="电子券类型" min-width="90" align="center">-->
  89. <!-- <template slot-scope="scope">-->
  90. <!-- <span v-if="scope.row.price > 0">激活券</span>-->
  91. <!-- <span v-else>免费券</span>-->
  92. <!-- </template>-->
  93. <!-- </el-table-column>-->
  94. <el-table-column prop="price" label="激活金额" align="center"></el-table-column>
  95. <el-table-column prop="receive_amount" label="未激活" min-width="90" align="center"></el-table-column>
  96. <el-table-column prop="active_amount" label="已激活" min-width="90" align="center"></el-table-column>
  97. <el-table-column prop="used_amount" label="已兑换" min-width="90" align="center"></el-table-column>
  98. <el-table-column
  99. label="专有者"
  100. min-width="120">
  101. <template slot-scope="scope" v-if="scope.row.properUser">
  102. <div style="display: flex;align-items: center;">
  103. <el-image fit="cover" :src="scope.row.properUser.avatar_url ? scope.row.properUser.avatar_url : 'resources/img/common/default-avatar.png'" style="width: 40px;height: 40px;display: block;margin-right: 5px;flex-shrink: 0;"></el-image>
  104. <div>
  105. <div>{{scope.row.properUser.nickname}}</div>
  106. <div>ID {{scope.row.properUser.id}}</div>
  107. </div>
  108. </div>
  109. </template>
  110. </el-table-column>
  111. <el-table-column
  112. label="赠送者"
  113. min-width="120">
  114. <template slot-scope="scope">
  115. <div style="display: flex;align-items: center;" v-if="scope.row.giver">
  116. <el-image fit="cover" :src="scope.row.giver.avatar_url ? scope.row.giver.avatar_url : 'resources/img/common/default-avatar.png'" style="width: 40px;height: 40px;display: block;margin-right: 5px;flex-shrink: 0;"></el-image>
  117. <div>
  118. <div>{{scope.row.giver.nickname}}</div>
  119. <div>ID {{scope.row.giver.id}}</div>
  120. </div>
  121. </div>
  122. </template>
  123. </el-table-column>
  124. <el-table-column prop="goods.goods_name" label="所购商品" min-width="90" align="center"></el-table-column>
  125. </el-table>
  126. <div style="text-align: right;margin: 20px 0;">
  127. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  128. </div>
  129. </el-tabs>
  130. </div>
  131. </el-card>
  132. </div>
  133. <script>
  134. const app = new Vue({
  135. el: '#app',
  136. data: {
  137. loading: false,
  138. page: 1,
  139. pageCount: 0,
  140. list: [],
  141. type_option: {
  142. 0: '全部',
  143. 1: '免费券',
  144. 2: '激活券'
  145. },
  146. searchForm:{
  147. e_coupon_id: null,
  148. user_id: null,
  149. user_name: null,
  150. coupon_name: null,
  151. receive_time: null,
  152. coupon_type: null,
  153. },
  154. },
  155. mounted() {
  156. this.searchForm.e_coupon_id = getQuery('e_coupon_id');
  157. this.getList(this.searchForm);
  158. },
  159. computed: {
  160. show_clear_search_btn: function() {
  161. return this.searchForm.user_id != null ||
  162. this.searchForm.user_name != null ||
  163. this.searchForm.coupon_name != null ||
  164. this.searchForm.receive_time != null ||
  165. this.searchForm.coupon_type != null;
  166. },
  167. },
  168. methods: {
  169. pagination(currentPage) {
  170. let self = this;
  171. self.page = currentPage;
  172. self.getList();
  173. },
  174. search() {// 清空查询条件
  175. this.page = 1;
  176. this.getList(this.searchForm);
  177. },
  178. resetSearch() {// 清空查询条件
  179. this.searchForm = {
  180. user_id: null,
  181. user_name: null,
  182. coupon_name: null,
  183. receive_time:null,
  184. coupon_type:null,
  185. };
  186. this.page = 1;
  187. this.getList();
  188. },
  189. getList(search = {}) {
  190. let self = this;
  191. self.loading = true;
  192. let basic_params = {
  193. page: self.page,
  194. };
  195. let params = Object.assign(basic_params, search);
  196. request({
  197. params: {
  198. r: 'electron-coupon/user-coupon/index'
  199. },
  200. method: 'post',
  201. data: params
  202. }).then(e => {
  203. self.loading = false;
  204. if (e.data.code == 0) {
  205. self.list = e.data.data.page_data.list;
  206. self.pageCount = e.data.data.page_data.page_count;
  207. } else {
  208. self.$message.error(e.data.msg);
  209. }
  210. }).catch(e => {
  211. self.loading = false;
  212. });
  213. },
  214. }
  215. });
  216. </script>
  217. <style>
  218. .el-tabs__header {
  219. font-size: 16px;
  220. }
  221. .table-body {
  222. padding: 20px;
  223. background-color: #fff;
  224. }
  225. .table-body .el-button {
  226. padding: 0 !important;
  227. border: 0;
  228. margin: 0 5px;
  229. }
  230. .input-item {
  231. width: 250px;
  232. margin: 0 0 20px;
  233. display: inline-block;
  234. }
  235. .input-item .el-input__inner {
  236. border-right: 0;
  237. }
  238. .input-item .el-input__inner:hover {
  239. border: 1px solid #dcdfe6;
  240. border-right: 0;
  241. outline: 0;
  242. }
  243. .input-item .el-input__inner:focus {
  244. border: 1px solid #dcdfe6;
  245. border-right: 0;
  246. outline: 0;
  247. }
  248. .input-item .el-input-group__append {
  249. background-color: #fff;
  250. border-left: 0;
  251. width: 10%;
  252. padding: 0;
  253. }
  254. .input-item .el-input-group__append .el-button {
  255. padding: 0;
  256. }
  257. .input-item .el-input-group__append .el-button {
  258. margin: 0;
  259. }
  260. .batch {
  261. margin: 0 0 20px;
  262. display: inline-block;
  263. }
  264. .batch .el-button {
  265. padding: 9px 15px !important;
  266. }
  267. .el-table th>.cell{
  268. color: #333;
  269. font-weight: bold;
  270. font-size: 14px;
  271. }
  272. .el-table__footer-wrapper, .el-table__header-wrapper{
  273. border-bottom: 1.4px solid #D6D6D6;
  274. }
  275. .search-box {
  276. padding: 10px 0 0 10px;
  277. background-color: #fff;
  278. margin-bottom: 10px;
  279. }
  280. </style>