li-guang
2021-04-07 050ff0dfc04d4ca2a33ac0e97c98f042b9f95df6
zq-erp/src/main/resources/templates/views/admin/activity/activity-list.html
@@ -93,8 +93,19 @@
                        <el-table-column
                                label="状态">
                            <template slot-scope="scope">
                                <span v-if="scope.row.actStatus == 1">未发布</span>
                                <span v-if="scope.row.actStatus == 2">未开始</span>
                                <div v-if="scope.row.actType == 4">
                                    <span v-if="scope.row.actStatus == 1">未发布</span>
                                </div>
                                <div v-if="scope.row.actType != 4">
                                    <span v-if="scope.row.actStatus == 1">开启</span>
                                </div>
                                <div v-if="scope.row.actType == 4">
                                    <span v-if="scope.row.actStatus == 2">未开始</span>
                                </div>
                                <div v-if="scope.row.actType != 4">
                                    <span v-if="scope.row.actStatus == 2">关闭</span>
                                </div>
                                <span v-if="scope.row.actStatus == 3">进行中</span>
                                <span v-if="scope.row.actStatus == 4">已结束</span>
                                <span v-if="scope.row.actStatus == 5">已删除</span>
@@ -129,6 +140,12 @@
                                    <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="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>
                                <el-row style="display:flex;" v-if="scope.row.actType != 4">
                                    <el-button type="primary" @click="openEdit(scope.row)" size="mini">编辑</el-button>
                                    <el-button type="primary" @click="activityStatistics(scope.row)" size="mini">活动统计</el-button>
                                    <el-button type="primary" @click="closeAct(scope.row)" size="mini">关闭</el-button>
                                    <el-button type="danger" @click="delAct(scope.row)" size="mini">删除</el-button>
                                </el-row>
                            </template>
                        </el-table-column>
@@ -197,6 +214,127 @@
                let _this = this;
                _this.loadActivitysList();
            },
            //删除
            delAct(row){
                let _this = this;
                _this.$confirm('确认删除活动吗?', '删除', {
                    distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    type: 'info'
                }).then(() => {
                    //通过
                    let id = row.id;
                    $.AjaxProxy().invoke(basePath + "/admin/shopActivities/del?keys="+id, function(loj) {
                        if (loj[0].result.status == '200') {
                            _this.loadActivitysList();
                        }
                    });
                }).catch(action => {
                    //不通过
                    if(action === 'cancel'){
                        console.log("cancel");
                    }else{
                        //关闭按钮
                        console.log("close");
                    }
                });
            },
            //关闭
            closeAct(row){
                let _this = this;
                _this.$confirm('确认关闭活动吗?', '关闭', {
                    distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    type: 'info'
                }).then(() => {
                    //通过
                    let id = row.id;
                    $.AjaxProxy().invoke(basePath + "/admin/shopActivities/closeAct?id="+id, function(loj) {
                        if (loj[0].result.status == '200') {
                            layer.msg(loj[0].result.info, {
                                icon: 1
                            });
                        }
                    });
                    _this.loadActivitysList();
                }).catch(action => {
                    //不通过
                    if(action === 'cancel'){
                        console.log("cancel");
                    }else{
                        //关闭按钮
                        console.log("close");
                    }
                });
            },
            // 活动统计
            activityStatistics(row) {
                let type = row.actType;
                let id = row.id;
                let name = row.actName;
                console.log("-------");
                if (type == 2) {
                    layer.full(layer.open({
                        type : 2,
                        title : name + "-活动统计",
                        area : [ MUI.SIZE_L, MUI.SIZE_L ],
                        maxmin : true,
                        content : [ basePath+'/admin/redirect/shop/activities/shopActivitiesSecKill-list?id=' + id]
                    }));
                }
                if (type == 1) {
                    layer.full(layer.open({
                        type : 2,
                        title : name + "-活动统计",
                        area : [ MUI.SIZE_L, MUI.SIZE_L ],
                        maxmin : true,
                        content : [ basePath+'/admin/redirect/shop/activities/shopActivitiesGroupBuy-list?id=' + id]
                    }));
                }
                if (type == 3) {
                    layer.full(layer.open({
                        type : 2,
                        title : name + "-活动统计",
                        area : [ MUI.SIZE_L, MUI.SIZE_L ],
                        maxmin : true,
                        content : [ basePath+'/admin/redirect/shop/activities/shopActivitiesSalon-list?id=' + id]
                    }));
                }
            },
            //打开编辑界面
            openEdit(row) {
                let type = row.actType;
                let id = row.id;
                if (type == 1) {
                    layer.full(layer.open({
                        type : 2,
                        title : "编辑拼团",
                        area : [ MUI.SIZE_L, MUI.SIZE_L ],
                        maxmin : true,
                        content : [ basePath+'/admin/redirect/shop/activities/activitiesGroupBuy-form?id=' + id]
                    }));
                } else if (type == 2) {
                    layer.full(layer.open({
                        type : 2,
                        title : "编辑秒杀",
                        area : [ MUI.SIZE_L, MUI.SIZE_L ],
                        maxmin : true,
                        content : [ basePath+'/admin/redirect/shop/activities/activitiesSecKill-form?id=' + id]
                    }));
                } else if (type == 3) {
                    layer.full(layer.open({
                        type : 2,
                        title : "编辑沙龙",
                        area : [ MUI.SIZE_L, MUI.SIZE_L ],
                        maxmin : true,
                        content : [ basePath+'/admin/redirect/shop/activities/activitiesSalon-form?id=' + id]
                    }));
                }
            },
            //修改
            beUpdate(row){
                layer.full(layer.open({