|
@@ -1,35 +1,77 @@
|
|
<!-- 活动管理ß -->
|
|
<!-- 活动管理ß -->
|
|
<template>
|
|
<template>
|
|
- <div class='app-container'>
|
|
|
|
|
|
+ <div class="app-container">
|
|
<!-- 搜索 -->
|
|
<!-- 搜索 -->
|
|
<el-form inline size="mini">
|
|
<el-form inline size="mini">
|
|
<el-form-item label="活动名称:">
|
|
<el-form-item label="活动名称:">
|
|
<el-input v-model="form.name" placeholder="请输入活动名称" clearable />
|
|
<el-input v-model="form.name" placeholder="请输入活动名称" clearable />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="当前状态:">
|
|
<el-form-item label="当前状态:">
|
|
- <el-select v-model="form.activityState" placeholder="请选择当前状态" clearable>
|
|
|
|
- <el-option v-for="item in currentOptions" :key="item.value" :value="item.value" :label="item.label" />
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="form.activityState"
|
|
|
|
+ placeholder="请选择当前状态"
|
|
|
|
+ clearable
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in currentOptions"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="上下架状态:">
|
|
<el-form-item label="上下架状态:">
|
|
- <el-select v-model="form.status" placeholder="请选择上下架状态" clearable>
|
|
|
|
- <el-option v-for="item in disabledOptions" :key="item.value" :value="item.value" :label="item.label" />
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="form.status"
|
|
|
|
+ placeholder="请选择上下架状态"
|
|
|
|
+ clearable
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in disabledOptions"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-button type="primary" icon="el-icon-search" @click="getSearch">搜索</el-button>
|
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-search" @click="getSearch"
|
|
|
|
+ >搜索</el-button
|
|
|
|
+ >
|
|
<el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
|
|
<el-button icon="el-icon-refresh" @click="getRefresh">重置</el-button>
|
|
- <el-button type="primary" icon="el-icon-plus" plain @click="getDetail"
|
|
|
|
- v-hasPermi="['operation:activity:add']">新增赠送流量</el-button>
|
|
|
|
- <el-button type="primary" icon="el-icon-plus" plain @click="getDetail"
|
|
|
|
- v-hasPermi="['operation:activity:add']">新增活动</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
+ plain
|
|
|
|
+ @click="showDialog"
|
|
|
|
+ v-hasPermi="['operation:activity:add']"
|
|
|
|
+ >新增赠送流量</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-plus"
|
|
|
|
+ plain
|
|
|
|
+ @click="getDetail"
|
|
|
|
+ v-hasPermi="['operation:activity:add']"
|
|
|
|
+ >新增活动</el-button
|
|
|
|
+ >
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<el-table :data="tableData" v-loading="loading">
|
|
<el-table :data="tableData" v-loading="loading">
|
|
<el-table-column label="序号" align="center" type="index" />
|
|
<el-table-column label="序号" align="center" type="index" />
|
|
- <el-table-column label="活动id" align="center" prop="id" show-overflow-tooltip />
|
|
|
|
- <el-table-column label="活动名称" align="center" prop="name" show-overflow-tooltip />
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="活动id"
|
|
|
|
+ align="center"
|
|
|
|
+ prop="id"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="活动名称"
|
|
|
|
+ align="center"
|
|
|
|
+ prop="name"
|
|
|
|
+ show-overflow-tooltip
|
|
|
|
+ />
|
|
<el-table-column label="活动图片" align="center" width="100px">
|
|
<el-table-column label="活动图片" align="center" width="100px">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-image :src="scope.row.pic" />
|
|
<el-image :src="scope.row.pic" />
|
|
@@ -38,83 +80,249 @@
|
|
<el-table-column label="创建时间" align="center" prop="createTime" />
|
|
<el-table-column label="创建时间" align="center" prop="createTime" />
|
|
<el-table-column label="有效时间" align="center" show-overflow-tooltip>
|
|
<el-table-column label="有效时间" align="center" show-overflow-tooltip>
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- {{ scope.row.timeList.join(' - ') }}
|
|
|
|
|
|
+ {{ scope.row.timeList.join(" - ") }}
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="当前状态" align="center" :formatter="activityFormatter" width="150px" />
|
|
|
|
- <el-table-column label="上下架状态" align="center" :formatter="statusFormatter" width="150px" />
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="当前状态"
|
|
|
|
+ align="center"
|
|
|
|
+ :formatter="activityFormatter"
|
|
|
|
+ width="150px"
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="上下架状态"
|
|
|
|
+ align="center"
|
|
|
|
+ :formatter="statusFormatter"
|
|
|
|
+ width="150px"
|
|
|
|
+ />
|
|
<el-table-column label="操作" align="center">
|
|
<el-table-column label="操作" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button type="text" @click="getDetail(scope.row, true)">查看</el-button>
|
|
|
|
- <el-button type="text" v-if="scope.row.status === 0" @click="getChange(scope.row.id, 1, '下架')"
|
|
|
|
- v-hasPermi="['operation:activity:down']">下架</el-button>
|
|
|
|
|
|
+ <el-button type="text" @click="getDetail(scope.row, true)"
|
|
|
|
+ >查看</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ v-if="scope.row.status === 0"
|
|
|
|
+ @click="getChange(scope.row.id, 1, '下架')"
|
|
|
|
+ v-hasPermi="['operation:activity:down']"
|
|
|
|
+ >下架</el-button
|
|
|
|
+ >
|
|
<span v-else style="margin: 0 10px">
|
|
<span v-else style="margin: 0 10px">
|
|
- <el-button v-if="scope.row.activityState !== 2" type="text" @click="getDetail(scope.row)"
|
|
|
|
- v-hasPermi="['operation:activity:edit']">编辑</el-button>
|
|
|
|
- <el-button v-if="scope.row.activityState !== 2" type="text" @click="getChange(scope.row.id, 0, '上架')"
|
|
|
|
- v-hasPermi="['operation:activity:up']">上架</el-button>
|
|
|
|
- <el-button type="delete" @click="getDelete(scope.row)"
|
|
|
|
- v-hasPermi="['operation:activity:delete']">删除</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.activityState !== 2"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="getDetail(scope.row)"
|
|
|
|
+ v-hasPermi="['operation:activity:edit']"
|
|
|
|
+ >编辑</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="scope.row.activityState !== 2"
|
|
|
|
+ type="text"
|
|
|
|
+ @click="getChange(scope.row.id, 0, '上架')"
|
|
|
|
+ v-hasPermi="['operation:activity:up']"
|
|
|
|
+ >上架</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="delete"
|
|
|
|
+ @click="getDelete(scope.row)"
|
|
|
|
+ v-hasPermi="['operation:activity:delete']"
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
</span>
|
|
</span>
|
|
- <el-button type="text" v-clipboard:copy="scope.row.copyUrl" v-clipboard:success="getCopy"
|
|
|
|
- v-hasPermi="['operation:activity:copy']">复制链接</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ v-clipboard:copy="scope.row.copyUrl"
|
|
|
|
+ v-clipboard:success="getCopy"
|
|
|
|
+ v-hasPermi="['operation:activity:copy']"
|
|
|
|
+ >复制链接</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
- <pagination v-show="total > 0" :total="total" :page.sync="form.pageNum" :limit.sync="form.pageSize"
|
|
|
|
- @pagination="getList" />
|
|
|
|
|
|
+
|
|
|
|
+ <pagination
|
|
|
|
+ v-show="total > 0"
|
|
|
|
+ :total="total"
|
|
|
|
+ :page.sync="form.pageNum"
|
|
|
|
+ :limit.sync="form.pageSize"
|
|
|
|
+ @pagination="getList"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
|
+ :title="dialogTitle"
|
|
|
|
+ width="1000px"
|
|
|
|
+ :before-close="getDialogClose"
|
|
|
|
+ >
|
|
|
|
+ <el-form :model="dialogData" ref="dialogData" label-width="auto">
|
|
|
|
+ <!-- ICCID号 -->
|
|
|
|
+ <el-form-item
|
|
|
|
+ label="ICCID号:"
|
|
|
|
+ prop="iccid"
|
|
|
|
+ :rules="[
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: '请输入要赠送设备的ICCID号',
|
|
|
|
+ trigger: 'blur',
|
|
|
|
+ },
|
|
|
|
+ { max: 30, message: '不可超过30个字符', trigger: 'blur' },
|
|
|
|
+ ]"
|
|
|
|
+ >
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="dialogData.iccid"
|
|
|
|
+ placeholder="请输入要赠送设备的ICCID号"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <!-- 关联活动ID -->
|
|
|
|
+ <el-form-item label="关联活动ID:">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="dialogData.activityId"
|
|
|
|
+ placeholder="请选择关联活动"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in dialogAcitivityIds"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :value="item.id"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <!-- 设备型号 -->
|
|
|
|
+ <el-form-item label="设备型号:">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="dialogData.deviceClientType"
|
|
|
|
+ placeholder="请选择设备型号"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in devOptions"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :value="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer">
|
|
|
|
+ <el-button @click="getDialogClose">取消</el-button>
|
|
|
|
+ <el-button type="primary" @click="getDialogSubmit">确定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { change, list } from '@/api/operation/activity';
|
|
|
|
-import { currentMixin, disabledMixin } from '@/mixin/index';
|
|
|
|
|
|
+import {
|
|
|
|
+allNoDeleteList,
|
|
|
|
+change,
|
|
|
|
+doExchange,
|
|
|
|
+list,
|
|
|
|
+} from "@/api/operation/activity";
|
|
|
|
+import { currentMixin, devMixin, disabledMixin } from "@/mixin/index";
|
|
export default {
|
|
export default {
|
|
- mixins: [currentMixin, disabledMixin],
|
|
|
|
|
|
+ mixins: [devMixin, currentMixin, disabledMixin],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ dialogVisible: false,
|
|
|
|
+ dialogTitle: "新增赠送流量",
|
|
|
|
+ dialogAcitivityIds: [],
|
|
|
|
+ dialogData: {},
|
|
|
|
+
|
|
// 遮罩层
|
|
// 遮罩层
|
|
loading: false,
|
|
loading: false,
|
|
// 表单
|
|
// 表单
|
|
form: {
|
|
form: {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
- pageSize: 10
|
|
|
|
|
|
+ pageSize: 10,
|
|
},
|
|
},
|
|
// 总数据
|
|
// 总数据
|
|
total: 0,
|
|
total: 0,
|
|
// 列表
|
|
// 列表
|
|
- tableData: []
|
|
|
|
- }
|
|
|
|
|
|
+ tableData: [],
|
|
|
|
+ };
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.getList()
|
|
|
|
|
|
+ this.getList();
|
|
|
|
+ this.getAllNoDeleteList();
|
|
|
|
+ this.getDevList();
|
|
},
|
|
},
|
|
|
|
+
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 弹窗
|
|
|
|
+ async showDialog() {
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
+ this.dialogData = {};
|
|
|
|
+ if (this.dialogAcitivityIds.length == 0) {
|
|
|
|
+ this.getAllNoDeleteList();
|
|
|
|
+ }
|
|
|
|
+ if (this.devOptions.length == 0) {
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 提交分类表单
|
|
|
|
+ getDialogSubmit() {
|
|
|
|
+ var iccid = this.dialogData.iccid;
|
|
|
|
+ var activityId = this.dialogData.activityId;
|
|
|
|
+ var deviceClientType = this.dialogData.deviceClientType;
|
|
|
|
+ var param = {
|
|
|
|
+ iccid: iccid,
|
|
|
|
+ activityId: activityId,
|
|
|
|
+ deviceClientType: deviceClientType,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ doExchange(param).then((res) => {
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ this.dialogData = {};
|
|
|
|
+ this.$refs.dialogData.resetFields();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 取消
|
|
|
|
+ getDialogClose() {
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ this.dialogData = {};
|
|
|
|
+ this.$refs.dialogData.resetFields();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ getAllNoDeleteList() {
|
|
|
|
+ // 平台ID:灵活配置多个平台的 0-vip会员 1-联通
|
|
|
|
+ var param = { platformId: 1 };
|
|
|
|
+ allNoDeleteList(param).then((res) => {
|
|
|
|
+ if (res.code === 0) {
|
|
|
|
+ this.dialogAcitivityIds = res.data;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
// 列表
|
|
// 列表
|
|
getList() {
|
|
getList() {
|
|
- this.loading = true
|
|
|
|
- list(this.form).then(res => {
|
|
|
|
|
|
+ this.loading = true;
|
|
|
|
+ list(this.form).then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
- this.tableData = res.data.records
|
|
|
|
- this.total = res.data.total
|
|
|
|
- this.loading = false
|
|
|
|
|
|
+ this.tableData = res.data.records;
|
|
|
|
+ this.total = res.data.total;
|
|
|
|
+ this.loading = false;
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 搜索
|
|
// 搜索
|
|
getSearch() {
|
|
getSearch() {
|
|
- this.form.pageNum = 1
|
|
|
|
- this.getList()
|
|
|
|
|
|
+ this.form.pageNum = 1;
|
|
|
|
+ this.getList();
|
|
},
|
|
},
|
|
|
|
|
|
// 重置
|
|
// 重置
|
|
getRefresh() {
|
|
getRefresh() {
|
|
this.form = {
|
|
this.form = {
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
- pageSize: 10
|
|
|
|
- }
|
|
|
|
- this.getList()
|
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ };
|
|
|
|
+ this.getList();
|
|
},
|
|
},
|
|
|
|
|
|
// 详情
|
|
// 详情
|
|
@@ -124,48 +332,48 @@ export default {
|
|
query: {
|
|
query: {
|
|
id: row.id,
|
|
id: row.id,
|
|
boolean: boolean,
|
|
boolean: boolean,
|
|
- activityState: row.activityState
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ activityState: row.activityState,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 上下架
|
|
// 上下架
|
|
getChange(id, status, title) {
|
|
getChange(id, status, title) {
|
|
- change(id, status).then(res => {
|
|
|
|
|
|
+ change(id, status).then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
- this.$message.success(`${title}成功!`)
|
|
|
|
- this.getList()
|
|
|
|
|
|
+ this.$message.success(`${title}成功!`);
|
|
|
|
+ this.getList();
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 删除
|
|
// 删除
|
|
getDelete(row) {
|
|
getDelete(row) {
|
|
- this.$confirm(`是否删除${row.name}?`, '提示', {
|
|
|
|
- type: 'warning'
|
|
|
|
|
|
+ this.$confirm(`是否删除${row.name}?`, "提示", {
|
|
|
|
+ type: "warning",
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- change(row.id, 2).then(res => {
|
|
|
|
|
|
+ change(row.id, 2).then((res) => {
|
|
if (res.code === 0) {
|
|
if (res.code === 0) {
|
|
- this.$message.success('删除成功!')
|
|
|
|
- this.getList()
|
|
|
|
|
|
+ this.$message.success("删除成功!");
|
|
|
|
+ this.getList();
|
|
}
|
|
}
|
|
- })
|
|
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
// 复制链接
|
|
// 复制链接
|
|
getCopy() {
|
|
getCopy() {
|
|
- this.$message.success('复制成功!')
|
|
|
|
|
|
+ this.$message.success("复制成功!");
|
|
},
|
|
},
|
|
|
|
|
|
// 字典翻译
|
|
// 字典翻译
|
|
activityFormatter(row) {
|
|
activityFormatter(row) {
|
|
- return this.selectDictLabel(this.currentOptions, row.activityState)
|
|
|
|
|
|
+ return this.selectDictLabel(this.currentOptions, row.activityState);
|
|
},
|
|
},
|
|
|
|
|
|
statusFormatter(row) {
|
|
statusFormatter(row) {
|
|
- return this.selectDictLabel(this.disabledOptions, row.status)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
|
|
+ return this.selectDictLabel(this.disabledOptions, row.status);
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
</script>
|
|
</script>
|