| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- <?php
- /*
- * @Descripttion:
- * @copyright: Copyright (c) 2021 广东七件事集团
- * @Author: lun
- * @Date: 2021-12-28 23:01:04
- */
- ?>
- <style>
- .link_url {
- text-align: left;
- font-size: 14px;
- }
- .showqr .el-dialog__body {
- text-align: center;
- padding-bottom: 10px;
- }
- .el-dialog {
- min-width: 400px;
- }
- </style>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <span>发放统计</span>
- </div>
- <div class="search-box">
- <!-- 搜索 -->
- <el-form :inline="true" :model="searchForm" size="small" class="demo-form-inline">
- <el-form-item label="创建日期">
- <el-date-picker
- size="small"
- v-model="searchForm.create_time"
- type="datetimerange"
- value-format="yyyy-MM-dd HH:mm:ss"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="活动名称">
- <el-input placeholder="请输入活动名称" v-model="searchForm.name"></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="search">搜索</el-button>
- <el-button type="danger" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
- </el-form-item>
- </el-form>
- </div>
- <div class="table-body">
- <el-tabs>
- <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
- <el-table-column prop="id" min-width="30" label="ID" align="center"></el-table-column>
- <el-table-column label="名称" align="center">
- <template slot-scope="scope">
- {{ scope.row.rule.name }}
- </template>
- </el-table-column>
- <el-table-column label="对象类型" min-width="40" align="center">
- <template slot-scope="scope">
- <span v-if="scope.row.grant_object==1"> 全部会员</span>
- <span v-if="scope.row.grant_object==2">会员等级</span>
- <span v-if="scope.row.grant_object==3">会员标签</span>
- <span v-if="scope.row.grant_object==4">会员ID</span>
- </template>
- </el-table-column>
- <el-table-column prop="use_time" label="发放内容" min-width="80" align="center">
- <template slot-scope="scope">
- <span @click="get_setting_data(scope.row)" style="cursor: pointer;">详情</span>
- </template>
- </el-table-column>
- <el-table-column label="发放次数" align="center">
- <template slot-scope="scope">
- {{ scope.row.send_times }}
- </template>
- </el-table-column>
- <el-table-column prop="use_time" label="创建时间" min-width="80" align="center">
- <template slot-scope="scope">
- {{ scope.row.created_at | dateTimeFormat('Y-m-d H:i') }}
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
- </div>
- </el-tabs>
- </div>
- </el-card>
- <!-- 弹框基本信息开始-->
- <el-dialog title="基本信息" width="30%" :visible.sync="setting_data"
- @close="setting_data = false" :modal-append-to-body="false">
- <el-form :model="addForm" ref="addForm" :inline="true" @submit.native.prevent label-width="300px">
- <el-form-item label="" style="width: 100%;margin-bottom:0px;" v-if="detail_one.rule">
- 活动名称:{{detail_one.rule.name}}
- </el-form-item>
- <el-form-item label="" style="width: 100%; margin-bottom:0px;" v-if=" detail_one.redpack_num">
- 红包充值:{{detail_one.redpack_num}}
- </el-form-item>
- <el-form-item label="" style="width: 100%; margin-bottom:0px;" v-if=" detail_one.score_num">
- 积分充值:{{detail_one.score_num}}
- </el-form-item>
- <el-form-item label="" style="width: 100%; margin-bottom:0px;" v-if=" detail_one.balance_num">
- 余额充值:{{detail_one.balance_num}}
- </el-form-item>
- <el-form-item label="" style="width: 100%; margin-bottom:0px;" v-if=" detail_one.coupon_num ">
- 优惠卷:{{detail_one.coupon_num}}张
- </el-form-item>
- <el-form-item label="" style="width: 100%; margin-bottom:0px;" v-if=" detail_one.e_coupon_num">
- 电子劵:{{detail_one.e_coupon_num}}张
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="setting_data = false">取 消</el-button>
- </span>
- </el-dialog>
- <!-- 弹框基本信息结束-->
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data: {
- loading: false,
- btnLoading:false,
- delLoading: false,
- dialogAddgsVisible:false,
- setting_data:false,
- page: 1,
- active_id:'',
- detail_one:[],
- pageCount: 0,
- list: [],
- now_time: 0,
- searchForm:{
- name:null,
- type:null,
- goods_type:null,
- store_type:null,
- status:null,
- code:null,
- },
- addForm:{
- code:'',
- id:'',
- }
- },
- mounted() {
- if(getQuery('active_id')) this.active_id = getQuery('active_id');
- this.getList();
- },
- computed: {
- show_clear_search_btn: function() {
- return this.searchForm.name != null ||
- this.searchForm.type != null ||
- this.searchForm.goods_type != null ||
- this.searchForm.store_type != null ||
- this.searchForm.create_time != null ||
- this.searchForm.status != null ||
- this.searchForm.code != null;
- },
- },
- methods: {
- get_setting_data(row){
- this.detail_one = row;
- this.setting_data = true;
- },
- pagination(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList();
- },
- search() {// 清空查询条件
- this.page = 1;
- this.getList(this.searchForm);
- this.addForm.code = this.searchForm.code;
- },
- handle(type, data = null) {
- switch (type){
- case 'send':
- this.dialogAddgsVisible = true;
- this.addForm.id = data.id;
- break;
- case 'edit':
- navigateTo({r:"issue-coupons/default/edit",id:data.id},true);
- break;
- case 'delecte':
- var param = {id: data.id,status:-1};
- this.$confirm('删除该条数据后不可以恢复, 是否继续?', '警告', {type: 'warning'}).then(() => {this.send('issue-coupons/default/handle',param)})
- break;
- }
- },
- send(url, params, callback = null) {
- let self = this;
- request({
- params: {
- r: url,
- },
- method: 'post',
- data: params
- }).then(e => {
- if (e.data.code == 0) {
- self.$message.success(e.data.msg);
- self.getList();
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- if(callback) return e.data;
- },
- resetSearch() {// 清空查询条件
- this.searchForm = {
- name: null,
- type: null,
- goods_type: null,
- store_type: null,
- status: null,
- create_time:null,
- code:null,
- };
- this.page = 1;
- this.getList();
- },
- getList(search = {}) {
- let self = this;
- self.loading = true;
- let basic_params = {
- page: self.page,
- };
- params = Object.assign(basic_params, search);
- if(this.active_id) { params.active_id = this.active_id;}
- request({
- params: {
- r: 'issue-coupons/statistics/index'
- },
- method: 'post',
- data: params
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- self.list = e.data.data.list;
- self.now_time = e.data.data.now_time;
- self.pageCount = e.data.data.page_count;
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- self.loading = false;
- });
- }
- }
- });
- </script>
- <style>
- /*头像样式 start*/
- .default-avatar{
- width: 50px;
- height: 50px;
- border-radius: 50%;
- }
- .user_img{
- position: relative;
- margin-right: 8px;
- height: 50px;
- width: 50px;
- }
- .el-table_1_column_3 .cell { /*-2 表示在第二行*/
- display: flex;
- }
- /*头像样式 end*/
- .el-tabs__header {
- font-size: 16px;
- }
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- .input-item {
- width: 250px;
- margin: 0 0 20px;
- display: inline-block;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .batch {
- margin: 0 0 20px;
- display: inline-block;
- }
- .batch .el-button {
- padding: 9px 15px !important;
- }
- .el-table th>.cell{
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper, .el-table__header-wrapper{
- border-bottom: 1.4px solid #D6D6D6;
- }
- .search-box {
- padding: 10px 0 0 10px;
- background-color: #fff;
- margin-bottom: 10px;
- }
- </style>
|