| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- <style>
- .header {
- padding: 18px 20px;
- background: #fff;
- margin-bottom: 10px;
- border-radius: 5px;
- border: 1px solid #EBEEF5;
- }
- .el-card {
- box-shadow: none !important;
- }
- .inquires_box {
- flex-wrap: wrap;
- }
- .condition {
- width: 450px;
- }
- .condition2 {
- margin-right: 30px;
- margin-bottom: 20px;
- }
- .operat_btn_list .el-button {
- padding: 8px 20px;
- }
- .table_box {
- margin-top: 30px;
- }
- .give_btn {
- border-radius: 5px;
- background: #fff;
- padding: 2px 0;
- border: 1px solid #DCDFE6;
- width: 80px;
- cursor: pointer;
- }
- .el-table .cell {
- display: flex;
- justify-content: center;
- }
- .operat1 {
- color: #3399FF;
- margin-right: 20px;
- cursor: pointer;
- }
- .operat2 {
- color: #FF336E;
- cursor: pointer;
- }
- .pagination_box {
- margin-top: 30px;
- justify-content: flex-end;
- }
- .types {
- cursor: pointer;
- }
- .coupon_type_list_box {
- flex-wrap: wrap;
- }
- .coupon_type_list {
- background: #F4F4F4;
- border-radius: 4px;
- padding: 8px 6px;
- width: 110px;
- margin-bottom: 15px;
- margin-right: 15px;
- }
- /* .coupon_type_list:last-child */
- .coupon_type_list_box :nth-child(5n) {
- margin-right: 0px;
- }
- .coupon_type_title {
- font-size: 16px;
- margin-bottom: 10px;
- }
- .coupon_type_content {
- font-size: 12px;
- margin-bottom: 4px;
- }
- .el-dialog__body {
- padding: 20px 20px 10px;
- }
- .date_item {
- margin-right: 20px;
- }
- .flex .el-date-editor--daterange.el-input__inner {
- width: 420px;
- }
- /* 公共样式 */
- .flex {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- }
- .flex-x-center {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
- justify-content: center;
- }
- .flex-x-between {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-pack: space-between;
- -webkit-justify-content: space-between;
- -ms-flex-pack: space-between;
- justify-content: space-between;
- }
- .flex-y-center {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-align: center;
- -webkit-align-items: center;
- -ms-flex-align: center;
- -ms-grid-row-align: center;
- align-items: center;
- }
- /* 溢出隐藏 */
- .over1 {
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- }
- .over2 {
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- </style>
- <div id='app' v-cloak>
- <div class="header">规则统计</div>
- <el-card v-loading='loading'>
- <!-- 表格 -->
- <div class="table_box">
- <el-table :data="list" stripe style="width: 100%;font-size:13px">
- <el-table-column label="序号" width="80" align="center">
- <template slot-scope="scope">
- <div>{{ scope.row.id }}</div>
- </template>
- </el-table-column>
- <el-table-column label="礼包类型" width="160" align="center">
- <template slot-scope="scope">
- <div>{{ gift_type_arr[scope.row.gift_type] }}</div>
- </template>
- </el-table-column>
- <el-table-column label="优惠券" align="center">
- <template slot-scope="scope">
- <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>
- <el-tooltip v-else placement="top" effect="light">
- <div slot="content">
- <div v-for="(item, index) in scope.row.coupon">
- 券名:{{ item.title || '-' }},数量:{{ item.num || '-' }}
- </div>
- </div>
- <el-button type="text">应发总数:{{ scope.row.coupon_num || '-' }},实发总数:{{ scope.row.actual_coupon_num || '-' }}</el-button>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column prop="address" label="积分" align="center">
- <template slot-scope="scope">
- <div>应发总数:{{ scope.row.score || '-' }},</div>
- <div>实发总数:{{ scope.row.actual_score || '-' }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="address" label="余额" align="center">
- <template slot-scope="scope">
- <div>应发总数:{{ scope.row.balance ? '¥'+scope.row.balance : '-' }},</div>
- <div>实发总数:{{ scope.row.actual_balance ? '¥'+scope.row.actual_balance : '-' }}</div>
- </template>
- </el-table-column>
- <el-table-column prop="grant_num" width="100" label="发放总人数" align="center"></el-table-column>
- </el-table>
- </div>
- <!-- 分页 -->
- <div class="pagination_box flex">
- <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
- </div>
- </el-card>
- </div>
- <script>
- new Vue({
- el: '#app',
- data() {
- return {
- loading: false,
- gift_type_arr: {},
- list: [],
- page: 1,
- pageCount: 0,
- searchForm:{
- gift_type:null,
- },
- }
- },
- mounted() {
- this.getList();
- },
- computed: {
- show_clear_search_btn: function() {
- return !isEmpty(this.searchForm.gift_type);
- },
- },
- methods: {
- search() {// 清空查询条件
- this.page = 1;
- this.getList(this.searchForm);
- },
- resetSearch() {// 清空查询条件
- this.searchForm = {
- gift_type: null,
- };
- this.page = 1;
- this.getList();
- },
- pagination(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList();
- },
- getList(search = null) {
- let self = this;
- self.loading = true;
- let basic_params = {
- r: 'user-gift/statistics/index',
- page: self.page,
- };
- var params = Object.assign(basic_params, search);
- request({
- params: params,
- method: 'get',
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- self.list = e.data.data.list.list;
- if (self.list.length > 0) {
- self.list.forEach(function (item, index) {
- self.list[index].coupon = JSON.parse(item.coupon);
- });
- }
- self.gift_type_arr = e.data.data.gift_type_arr;
- self.pageCount = e.data.data.list.page_count;
- } else {
- this.$message.error(e.data.msg);
- }
- })
- },
- }
- })
- </script>
|