xiaoyong931011
2021-04-28 443d98b6e7c96e0309e9520b4fb5c1197409cabe
20210428  抽奖
1 files added
3 files modified
297 ■■■■■ changed files
zq-erp/src/main/java/com/matrix/system/activity/vo/SignReceiveListVo.java 4 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml 2 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/activity/activity-list.html 12 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/activity/activity-luckdraw-receive.html 279 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/activity/vo/SignReceiveListVo.java
@@ -12,7 +12,9 @@
     * 主键
     */
    private Long  id;
    //活动类型
    private int  actType;
    @ApiModelProperty(value = "用户")
    private String nickName;
    
zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml
@@ -16,11 +16,13 @@
        c.award_name awardName,
        c.coupon_name couponName,
        c.score_cnt scoreCnt,
        d.act_type actType,
        c.award_rule awardRule
        FROM
        activity_sign_receive_record a
        LEFT JOIN sys_vip_info b ON a.user_id = b.id
        LEFT JOIN activity_sign_award_set c ON a.award_id = c.id
        LEFT JOIN shop_activities d ON a.award_id = d.id
        <where>
            a.company_id = #{record.companyId}
            and a.activity_id = #{record.actId}
zq-erp/src/main/resources/templates/views/admin/activity/activity-list.html
@@ -146,7 +146,7 @@
                                    <el-button type="primary" v-if="scope.row.actStatus == 1" size="mini" @click="beReady(scope.row)">发布</el-button>
                                    <el-button type="primary" v-if="[1,2,3].includes(scope.row.actStatus)" @click="beUpdateLuckdraw(scope.row)" size="mini">修改</el-button>
                                    <el-button type="primary" v-if="scope.row.actStatus == 3" size="mini">推广</el-button>
                                    <el-button type="primary" v-if="[3,4,5].includes(scope.row.actStatus)" @click="openSignReceive(scope.row)" size="mini">活动统计</el-button>
                                    <el-button type="primary" v-if="[3,4,5].includes(scope.row.actStatus)" @click="openLuckdrawReceive(scope.row)" size="mini">活动统计</el-button>
                                    <el-button type="primary" v-if="scope.row.actStatus == 3" @click="beClose(scope.row)" size="mini">关闭</el-button>
                                    <el-button type="danger" v-if="scope.row.actStatus != 5" size="mini" @click="delRow(scope.row)">删除</el-button>
                                </el-row>
@@ -375,6 +375,16 @@
                    content : [ basePath + '/admin/redirect/activity/activity-sign-receive?actId=' + row.id]
                }));
            },
            //活动统计
            openLuckdrawReceive(row){
                layer.full(layer.open({
                    type: 2,
                    title: "活动统计",
                    maxmin: true,
                    area: [MUI.SIZE_L, '500px'],
                    content : [ basePath + '/admin/redirect/activity/activity-luckdraw-receive?actId=' + row.id]
                }));
            },
            //发布
            beReady(row){
                let _this = this;
zq-erp/src/main/resources/templates/views/admin/activity/activity-luckdraw-receive.html
New file
@@ -0,0 +1,279 @@
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!-- 本框架基本脚本和样式 -->
    <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script>
    <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">
    <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}">
    <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/>
    <!-- 富文本编辑器 -->
    <script type="text/javascript" charset="utf-8"
            th:src="@{/plugin/beditor/ueditor.config.js}"></script>
    <script type="text/javascript" charset="utf-8"
            th:src="@{/plugin/beditor/ueditor.all.js}">
    </script>
    <script type="text/javascript" charset="utf-8"
            th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script>
    <style>
        .panel-body{
            overflow: hidden;
        }
        .paginationStyle{
            background: #ffffff;
            padding: 10px 10px;
            margin: 0px 0px 10px 0px;
            text-align: right;
        }
    </style>
</head>
<body>
<div class="panel-body" id="app" v-cloak>
    <el-row>
        <el-row justify="space-between" type="flex">
            <el-col>
                <el-form ref="form" :model="form" inline >
                    <el-form-item label="用户名称" prop="yhmc" >
                        <el-input v-model="form.yhmc" placeholder="用户名称"></el-input>
                    </el-form-item>
                    <el-form-item prop="qdsj" label="签到时间">
                        <el-date-picker
                                v-model="form.qdsj"
                                type="datetimerange"
                                :picker-options="pickerOptions"
                                range-separator="至"
                                start-placeholder="开始日期"
                                end-placeholder="结束日期"
                                align="right">
                        </el-date-picker>
                    </el-form-item>
                    <el-button type="primary" @click="searchFormSignReceive" >搜索</el-button>
                    <el-button @click="resetFormSignReceive('form')">重置</el-button>
                </el-form>
            </el-col>
        </el-row>
        <el-row class="table-style" >
            <el-table ref="multipleTable"
                      :data="signReceiveList.rows"
                      :height="height"
                      stripe:true
                      @sort-change="sortChange"
                      @selection-change="handleSelectionChange">
                <el-table-column
                        type="selection">
                </el-table-column>
                <el-table-column
                        prop="nickName"
                        label="用户"
                        show-overflow-tooltip>
                </el-table-column>
                <el-table-column
                        prop="reciveTime"
                        label="抽奖时间"
                        show-overflow-tooltip>
                </el-table-column>
                <el-table-column
                        label="状态"
                        show-overflow-tooltip>
                    <template slot-scope="scope">
                        <span v-if="scope.row.state == 1">待领取</span>
                        <span v-if="scope.row.state == 2">已领取</span>
                        <span v-if="scope.row.state == 3">待配送</span>
                        <span v-if="scope.row.state == 4">待收货</span>
                        <span v-if="scope.row.state == 5">已失效</span>
                    </template>
                </el-table-column>
                <el-table-column
                        label="奖品类型">
                    <template slot-scope="scope">
                        <span v-if="scope.row.awardType == 1">自定义礼品</span>
                        <span v-if="scope.row.awardType == 2">积分</span>
                        <span v-if="scope.row.awardType == 3">优惠券</span>
                        <span v-if="scope.row.awardType == 4">店铺商品</span>
                    </template>
                </el-table-column>
                <el-table-column
                        prop="awardName"
                        label="获得奖励"
                        show-overflow-tooltip>
                </el-table-column>
                <el-table-column
                        label="奖励名称"
                        show-overflow-tooltip>
                    <template slot-scope="scope">
                        {{scope.row.awardName}}
                        <span v-if="scope.row.awardType == 3">({{scope.row.couponName}})</span>
                        <span v-if="scope.row.awardType == 2">(*{{scope.row.scoreCnt}})</span>
                    </template>
                </el-table-column>
            </el-table>
        </el-row>
        <el-row class="paginationStyle"  >
            <el-pagination background
                           @size-change="changePageSignReceive"
                           @current-change="changeCurrentPageSignReceive"
                           :current-page="signReceiveList.currentPage"
                           :page-sizes="[10, 20, 30, 50]"
                           :page-size="signReceiveList.pageSize"
                           layout="total, sizes, prev, pager, next, jumper"
                           :total="signReceiveList.total">
            </el-pagination>
        </el-row>
    </el-row>
</div>
</body>
<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script>
<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script>
<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script>
<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
<script>
    //获取传输的活动对象
    var actId = $.query.get("actId");
    var app = new Vue({
        el: '#app',
        data: {
            height:'calc(100vh - 200px)',
            //--时间选择
            pickerOptions: {
                shortcuts: [{
                    text: '最近一周',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近一个月',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                        picker.$emit('pick', [start, end]);
                    }
                }, {
                    text: '最近三个月',
                    onClick(picker) {
                        const end = new Date();
                        const start = new Date();
                        start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                        picker.$emit('pick', [start, end]);
                    }
                }]
            },
            // 条件查询
            form:{
                yhmc:'',
                qdsj:'',
                order:'',
                sort:''
            },
            //活动列表
            signReceiveList:{
                rows:[],
                total:0,
                pageSize:10,
                currentPage:1,
            },
        },
        created: function () {
            this.loadInfo();
        },
        mounted: function () {
        },
        methods: {
            //加载分类
            loadInfo() {
                let _this = this;
                _this.loadSignReceiveList();
            },
            //--列表
            loadSignReceiveList() {
                let _this = this;
                let data=_this.getRequestParamSignReceive();
                data.pageSize=_this.signReceiveList.pageSize;
                data.pageNum=_this.signReceiveList.currentPage;
                AjaxProxy.requst({
                    app: _this,
                    data:data,
                    url: basePath + '/admin/activitySignAwardSet/findSignReceiveList',
                    callback: function (data) {
                        _this.signReceiveList.rows = data.rows;
                        _this.signReceiveList.total = data.total;
                    }
                });
            },//查询参数
            getRequestParamSignReceive(){
                let _this = this;
                let startTime = '';
                let endTime = '';
                if(_this.form.qdsj.length > 0){
                    startTime = _this.form.qdsj[0];
                    endTime = _this.form.qdsj[1];
                }
                return   {
                    yhmc:_this.form.yhmc,
                    startTime:startTime,
                    endTime:endTime,
                    actId:actId,
                    order:_this.form.order,
                    sort:_this.form.sort,
                }
            },
            //查询
            searchFormSignReceive:function(){
                this.signReceiveList.currentPage=1;
                this.loadSignReceiveList();
            },
            //重置
            resetFormSignReceive(formName) {
                this.$refs[formName].resetFields();
            },
            changePageSignReceive(val) {
                this.signReceiveList.pageSize = val;
                this.loadSignReceiveList();
            },
            changeCurrentPageSignReceive(val) {
                this.signReceiveList.currentPage = val;
                this.loadSignReceiveList();
            },
            //排序
            sortChange:function (column){
                if(column.order){
                    if(column.order.indexOf("desc")){
                        this.form.order="desc";
                    }else{
                        this.form.order="asc";
                    }
                    this.form.sort=column.prop;
                    this.loadInfo();
                }
            },
            //选择
            handleSelectionChange(val) {
                let _this = this;
                _this.multipleSelection = val;
            },
        }
    })
</script>
</body>
</html>