index.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <style>
  2. .header {
  3. padding: 18px 20px;
  4. background: #fff;
  5. margin-bottom: 10px;
  6. border-radius: 5px;
  7. border: 1px solid #EBEEF5;
  8. }
  9. .el-card {
  10. box-shadow: none !important;
  11. }
  12. .inquires_box {
  13. flex-wrap: wrap;
  14. }
  15. .condition {
  16. width: 450px;
  17. }
  18. .condition2 {
  19. margin-right: 30px;
  20. margin-bottom: 20px;
  21. }
  22. .operat_btn_list .el-button {
  23. padding: 8px 20px;
  24. }
  25. .table_box {
  26. margin-top: 30px;
  27. }
  28. .give_btn {
  29. border-radius: 5px;
  30. background: #fff;
  31. padding: 2px 0;
  32. border: 1px solid #DCDFE6;
  33. width: 80px;
  34. cursor: pointer;
  35. }
  36. .el-table .cell {
  37. display: flex;
  38. justify-content: center;
  39. }
  40. .operat1 {
  41. color: #3399FF;
  42. margin-right: 20px;
  43. cursor: pointer;
  44. }
  45. .operat2 {
  46. color: #FF336E;
  47. cursor: pointer;
  48. }
  49. .pagination_box {
  50. margin-top: 30px;
  51. justify-content: flex-end;
  52. }
  53. .types {
  54. cursor: pointer;
  55. }
  56. .coupon_type_list_box {
  57. flex-wrap: wrap;
  58. }
  59. .coupon_type_list {
  60. background: #F4F4F4;
  61. border-radius: 4px;
  62. padding: 8px 6px;
  63. width: 110px;
  64. margin-bottom: 15px;
  65. margin-right: 15px;
  66. }
  67. /* .coupon_type_list:last-child */
  68. .coupon_type_list_box :nth-child(5n) {
  69. margin-right: 0px;
  70. }
  71. .coupon_type_title {
  72. font-size: 16px;
  73. margin-bottom: 10px;
  74. }
  75. .coupon_type_content {
  76. font-size: 12px;
  77. margin-bottom: 4px;
  78. }
  79. .el-dialog__body {
  80. padding: 20px 20px 10px;
  81. }
  82. .date_item {
  83. margin-right: 20px;
  84. }
  85. .flex .el-date-editor--daterange.el-input__inner {
  86. width: 420px;
  87. }
  88. /* 公共样式 */
  89. .flex {
  90. display: -webkit-box;
  91. display: -webkit-flex;
  92. /* #ifndef APP-NVUE */
  93. display: flex;
  94. /* #endif */
  95. }
  96. .flex-x-center {
  97. display: -webkit-box;
  98. display: -webkit-flex;
  99. /* #ifndef APP-NVUE */
  100. display: flex;
  101. /* #endif */
  102. -webkit-box-pack: center;
  103. -webkit-justify-content: center;
  104. -ms-flex-pack: center;
  105. justify-content: center;
  106. }
  107. .flex-x-between {
  108. display: -webkit-box;
  109. display: -webkit-flex;
  110. /* #ifndef APP-NVUE */
  111. display: flex;
  112. /* #endif */
  113. -webkit-box-pack: space-between;
  114. -webkit-justify-content: space-between;
  115. -ms-flex-pack: space-between;
  116. justify-content: space-between;
  117. }
  118. .flex-y-center {
  119. display: -webkit-box;
  120. display: -webkit-flex;
  121. /* #ifndef APP-NVUE */
  122. display: flex;
  123. /* #endif */
  124. -webkit-box-align: center;
  125. -webkit-align-items: center;
  126. -ms-flex-align: center;
  127. -ms-grid-row-align: center;
  128. align-items: center;
  129. }
  130. /* 溢出隐藏 */
  131. .over1 {
  132. text-overflow: -o-ellipsis-lastline;
  133. overflow: hidden;
  134. text-overflow: ellipsis;
  135. display: -webkit-box;
  136. -webkit-line-clamp: 1;
  137. -webkit-box-orient: vertical;
  138. }
  139. .over2 {
  140. text-overflow: -o-ellipsis-lastline;
  141. overflow: hidden;
  142. text-overflow: ellipsis;
  143. display: -webkit-box;
  144. -webkit-line-clamp: 2;
  145. -webkit-box-orient: vertical;
  146. }
  147. </style>
  148. <div id='app' v-cloak>
  149. <div class="header">规则统计</div>
  150. <el-card v-loading='loading'>
  151. <!-- 表格 -->
  152. <div class="table_box">
  153. <el-table :data="list" stripe style="width: 100%;font-size:13px">
  154. <el-table-column label="序号" width="80" align="center">
  155. <template slot-scope="scope">
  156. <div>{{ scope.row.id }}</div>
  157. </template>
  158. </el-table-column>
  159. <el-table-column label="礼包类型" width="160" align="center">
  160. <template slot-scope="scope">
  161. <div>{{ gift_type_arr[scope.row.gift_type] }}</div>
  162. </template>
  163. </el-table-column>
  164. <el-table-column label="优惠券" align="center">
  165. <template slot-scope="scope">
  166. <div style="padding: 10px 0px;" v-if="scope.row.coupon_num == 0 && scope.row.actual_coupon_num == 0">应发总数:{{ scope.row.coupon_num }},实发总数:{{ scope.row.actual_coupon_num }}</div>
  167. <el-tooltip v-else placement="top" effect="light">
  168. <div slot="content">
  169. <div v-for="(item, index) in scope.row.coupon">
  170. 券名:{{ item.title || '-' }},数量:{{ item.num || '-' }}
  171. </div>
  172. </div>
  173. <el-button type="text">应发总数:{{ scope.row.coupon_num || '-' }},实发总数:{{ scope.row.actual_coupon_num || '-' }}</el-button>
  174. </el-tooltip>
  175. </template>
  176. </el-table-column>
  177. <el-table-column prop="address" label="积分" align="center">
  178. <template slot-scope="scope">
  179. <div>应发总数:{{ scope.row.score || '-' }},</div>
  180. <div>实发总数:{{ scope.row.actual_score || '-' }}</div>
  181. </template>
  182. </el-table-column>
  183. <el-table-column prop="address" label="余额" align="center">
  184. <template slot-scope="scope">
  185. <div>应发总数:{{ scope.row.balance ? '¥'+scope.row.balance : '-' }},</div>
  186. <div>实发总数:{{ scope.row.actual_balance ? '¥'+scope.row.actual_balance : '-' }}</div>
  187. </template>
  188. </el-table-column>
  189. <el-table-column prop="grant_num" width="100" label="发放总人数" align="center"></el-table-column>
  190. </el-table>
  191. </div>
  192. <!-- 分页 -->
  193. <div class="pagination_box flex">
  194. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
  195. </div>
  196. </el-card>
  197. </div>
  198. <script>
  199. new Vue({
  200. el: '#app',
  201. data() {
  202. return {
  203. loading: false,
  204. gift_type_arr: {},
  205. list: [],
  206. page: 1,
  207. pageCount: 0,
  208. searchForm:{
  209. gift_type:null,
  210. },
  211. }
  212. },
  213. mounted() {
  214. this.getList();
  215. },
  216. computed: {
  217. show_clear_search_btn: function() {
  218. return !isEmpty(this.searchForm.gift_type);
  219. },
  220. },
  221. methods: {
  222. search() {// 清空查询条件
  223. this.page = 1;
  224. this.getList(this.searchForm);
  225. },
  226. resetSearch() {// 清空查询条件
  227. this.searchForm = {
  228. gift_type: null,
  229. };
  230. this.page = 1;
  231. this.getList();
  232. },
  233. pagination(currentPage) {
  234. let self = this;
  235. self.page = currentPage;
  236. self.getList();
  237. },
  238. getList(search = null) {
  239. let self = this;
  240. self.loading = true;
  241. let basic_params = {
  242. r: 'user-gift/statistics/index',
  243. page: self.page,
  244. };
  245. var params = Object.assign(basic_params, search);
  246. request({
  247. params: params,
  248. method: 'get',
  249. }).then(e => {
  250. this.loading = false;
  251. if (e.data.code == 0) {
  252. self.list = e.data.data.list.list;
  253. if (self.list.length > 0) {
  254. self.list.forEach(function (item, index) {
  255. self.list[index].coupon = JSON.parse(item.coupon);
  256. });
  257. }
  258. self.gift_type_arr = e.data.data.gift_type_arr;
  259. self.pageCount = e.data.data.list.page_count;
  260. } else {
  261. this.$message.error(e.data.msg);
  262. }
  263. })
  264. },
  265. }
  266. })
  267. </script>