新增幸运福袋配置后台

This commit is contained in:
dragon
2024-07-04 20:32:23 +08:00
parent 966cc40b3c
commit 40884b5b21
5 changed files with 2636 additions and 0 deletions

View File

@@ -0,0 +1,173 @@
import request from '@/utils/request';
import { genQueryParam } from '@/utils/maintainer';
// 地区接口
export const listPartitionInfo = query => {
return request({
url: '/partition/listPartitionInfo',
method: 'get',
params: query
});
};
// 福袋列表请求
export const listLuckyBagLinearGift = query => {
return request({
url: '/admin/luckyBagLinearPool/listLuckyBagLinearGift',
method: 'get',
params: query
});
};
// 福袋礼物列表请求
export const getPrizeGroupsInfo = query => {
return request({
url: '/admin/luckyBagLinearPool/getPrizeGroupsInfo',
method: 'get',
params: query
});
};
// 所有礼物列表请求
export const getAll = query => {
return request({
url: '/admin/gift/getAll',
method: 'get',
params: query
});
};
// 所有座驾列表请求
export const carAll = query => {
return request({
url: '/admin/car/goods/total/list',
method: 'get',
params: query
});
};
// 所有头饰列表请求
export const headwearAll = query => {
return request({
url: '/admin/headwear/total/list',
method: 'get',
params: query
});
};
// 所有铭牌列表请求
export const nameplateAll = query => {
return request({
url: '/admin/nameplate/total/list',
method: 'get',
params: query
});
};
// 所有气泡列表请求
export const chatbubbleAll = query => {
return request({
url: '/admin/chatbubble/total/list',
method: 'get',
params: query
});
};
// 所有资料卡列表请求
export const infocard = query => {
return request({
url: '/admin/infocard/total/list',
method: 'get',
params: query
});
};
// 榜单统计-列表接口
export const luckyBagWeekRankList = query => {
return request({
url: '/admin/luckyBagWeekRank/list',
method: 'get',
params: query
});
};
// 榜单统计-详情列表接口
export const luckyBagWeekRankListRank = query => {
return request({
url: '/admin/luckyBagWeekRank/pageRank',
method: 'get',
params: query
});
};
// 榜单统计-总导出
export const exportList = query => {
window.location.href = `/admin/luckyBagWeekRank/exportList?${genQueryParam(query)}`;
return;
};
// 榜单统计-详情导出
export const exportRank = query => {
window.location.href = `/admin/luckyBagWeekRank/exportRank?${genQueryParam(query)}`;
return;
};
// 用户中奖记录-列表
export const getRecordPage = query => {
return request({
url: '/admin/luckyBagFortunate/getRecordPage',
method: 'get',
params: query
});
};
// 用户中奖记录-导出
export const exportForReward = query => {
window.location.href = `/admin/luckyBagFortunate/exportForReward?${genQueryParam(query)}`;
return;
};
// 欧气1+1-导出
export const luckyBagFortunateExport = query => {
window.location.href = `/admin/luckyBagFortunate/export?${genQueryParam(query)}`;
return;
};
// 欧气1+1-列表
export const luckyBagFortunatePage = query => {
return request({
url: '/admin/luckyBagFortunate/page',
method: 'get',
params: query
});
};
// 欧气1+1-保存
export const luckyBagFortunateSave = query => {
return request({
url: '/admin/luckyBagFortunate/save',
method: 'post',
params: query
});
};
// 欧气1+1-上下线
export const luckyBagFortunateUpdateEnabled = query => {
return request({
url: '/admin/luckyBagFortunate/updateEnabled',
method: 'post',
params: query
});
};
// 收藏-列表
export const luckyBagCollectPage = query => {
return request({
url: '/admin/luckyBagCollect/page',
method: 'get',
params: query
});
};
// 收藏-上下线
export const updateEnabled = query => {
return request({
url: '/admin/luckyBagCollect/updateEnabled',
method: 'post',
params: query
});
};
// 收藏-保存
export const luckyBagCollectSave = query => {
return request({
url: '/admin/luckyBagCollect/save',
headers:{"Content-Type": 'application/x-www-form-urlencoded'},
method: 'post',
data: query
});
};
// 收藏-导出
export const luckyBagCollectExport = query => {
window.location.href = `/admin/luckyBagCollect/export?${genQueryParam(query)}`;
return;
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,443 @@
<template>
<div class="box">
<!-- 查询 -->
<!-- 时间选择器 -->
<div class="inquire">
<div class="block">
<span class="demonstration">日期</span>
<el-date-picker
v-model="inquire.time"
type="datetimerange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</div>
<div class="block">
<span class="demonstration">周期</span>
<el-select
filterable
v-model="inquire.rankDateType"
placeholder="请选择"
>
<el-option
v-for="item in inquire.options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<div class="block">
<span class="demonstration">地区</span>
<el-select
filterable
v-model="inquire.partitionId"
placeholder="请选择"
>
<el-option
v-for="item in inquire.options2"
:key="item.id"
:label="item.desc"
:value="item.id"
>
</el-option>
</el-select>
</div>
</div>
<!-- 查询按钮 -->
<el-button class="primary" type="primary" @click="getData()"
>查询</el-button
>
<!-- 导出按钮 -->
<el-button class="primary" type="primary" @click="this.deriveDialog = true"
>导出</el-button
>
</div>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="date" align="center" label="日期" />
<el-table-column prop="count" align="center" label="总人数" />
<el-table-column prop="num" align="center" label="总次数" />
<el-table-column
prop="totalPlatformValue"
align="center"
label="实力代言值"
/>
<el-table-column
prop="totalPlatformValue"
align="center"
label="人气代言值"
/>
<el-table-column align="center" label="操作" width="300">
<template v-slot="scope">
<el-button
@click="
this.detialDialog = true;
this.detialNewObj = scope.row;
this.detialObj.tableData = [];
this.detialObj.value = '';
"
class="primary"
type="primary"
size="default"
>详情</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<!-- 筛选导出弹窗 -->
<el-dialog v-model="deriveDialog" title="编辑" width="28%" center>
<!-- 榜单数据 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>榜单数据</span
>
<el-select filterable v-model="deriveObj.value" placeholder="请选择">
<el-option
v-for="item in deriveObj.options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<!-- 选择时间 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>选择时间</span
>
<div class="inquire">
<el-date-picker
v-model="deriveObj.time"
type="datetimerange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 60%"
>
</el-date-picker>
</div>
</div>
<!-- 弹窗按钮 -->
<template #footer>
<span class="dialog-footer">
<el-button @click="deriveDialog = false">取消</el-button>
<el-button type="primary" @click="deriveOut()"> 确认导出 </el-button>
</span>
</template>
</el-dialog>
<!-- 详情导出弹窗 -->
<el-dialog v-model="detialDialog" title="榜单详情">
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: -20px"
class="col-sm-2 control-label"
>榜单数据</span
>
<el-select
filterable
v-model="detialObj.value"
placeholder="请选择"
style="display: inline-block; margin-right: 10px"
>
<el-option
v-for="item in detialObj.options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option> </el-select
><el-button
@click="detialQuery()"
class="primary"
type="primary"
size="default"
>查询</el-button
>
</div>
<el-table border style="width: 100%" :data="detialObj.tableData">
<el-table-column property="seqNo" label="排名" />
<el-table-column property="erbanNo" label="用户ID" />
<el-table-column property="nick" label="用户昵称" />
<el-table-column property="total" label="值" />
</el-table>
<el-button
class="dialogTabl eVisibleBut"
type="primary"
@click="detialDialogClick()"
style="margin-top: 20px"
>
导出
</el-button>
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage2"
v-model:page-size="pageSize2"
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total2"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"
/>
</el-dialog>
</template>
<script>
import {
luckyBagWeekRankList,
listPartitionInfo,
exportList,
luckyBagWeekRankListRank,
exportRank,
} from "@/api/luckyTycoon/luckyTycoon";
// @ts-ignore
import { dateFormat } from "@/utils/system-helper";
// @ts-ignore
import { ElMessage } from "element-plus";
export default {
name: "luckyTycoonListStatistics",
data() {
return {
inquire: {
giftId: "",
userId: "",
time: "",
rankDateType: "",
options: [
{
value: "1",
label: "天",
},
{
value: "2",
label: "周",
},
],
partitionId: "",
options2: [],
},
loading: false,
// 表格数据
tableData: [],
// 分页
total: 10, //总页数
currentPage: 1, //页码
pageSize: 10, //条数
total2: 20, //总页数
currentPage2: 1, //页码
pageSize2: 20, //条数
//导出
deriveDialog: false,
deriveObj: {
value: "",
time: "",
options: [
{
value: "2",
label: "实力代言榜",
},
{
value: "1",
label: "人气代言榜",
},
],
},
//详情导出
detialDialog: false,
detialNewObj: {},
detialObj: {
tableData: [],
value: "",
options: [
{
value: "2",
label: "实力代言榜",
},
{
value: "1",
label: "人气代言榜",
},
],
},
};
},
created() {
listPartitionInfo().then((res) => {
if (res.code == 200) {
this.inquire.options2 = res.data;
}
});
},
methods: {
getData() {
this.loading = true;
let startTime = "";
let endTime = "";
if (this.inquire.time && this.inquire.time.length > 0) {
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
}
luckyBagWeekRankList({
startDate: startTime,
endDate: endTime,
rankDateType: this.inquire.rankDateType,
partitionId: this.inquire.partitionId,
}).then((res) => {
if (res.code == 200) {
this.tableData = res.data;
this.loading = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
this.loading = false;
});
},
deriveOut() {
let startTime = "";
let endTime = "";
if (this.inquire.time && this.inquire.time.length > 0) {
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
}
exportList({
startDate: startTime,
endDate: endTime,
rankDateType: this.deriveObj.rankDateType,
partitionId: this.inquire.partitionId,
}).then((res) => {
if (res.code == 200) {
this.deriveDialog = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
detialQuery() {
luckyBagWeekRankListRank({
date: this.detialNewObj.date,
rankType: this.detialObj.value,
rankDateType: this.inquire.rankDateType,
partitionId: this.inquire.partitionId,
pageSize: this.pageSize2,
page: this.currentPage2,
}).then((res) => {
if (res.code == 200) {
this.deriveDialog = false;
var arr = [];
arr = res.data.rows;
res.data.rows.forEach((res, i) => {
arr[i].seqNo = i + 1;
});
this.detialObj.tableData = arr;
this.total2 = res.data.total
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
detialDialogClick() {
var obj = {
date: this.detialNewObj.date,
rankType: this.detialObj.value,
rankDateType: this.inquire.rankDateType,
partitionId: this.inquire.partitionId,
};
exportRank(obj).then((res) => {
if (res.code == 200) {
this.detialDialog = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
// 分页导航
handleSizeChange() {
this.getData();
},
handleCurrentChange() {
this.getData();
},
handleSizeChange2() {
this.getData();
},
handleCurrentChange2() {
this.getData();
},
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.inquire {
display: inline-block;
margin-right: 20px;
.block {
display: inline-block;
margin-right: 20px;
margin-bottom: 20px;
}
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
.dialogTableVisibleBut {
display: block;
margin: 30px 0 0 830px;
}
.paginationClass {
margin: 15px 0 5px 0px;
}
}
</style>

View File

@@ -0,0 +1,766 @@
<template>
<div class="box">
<!-- 查询按钮 -->
<el-button class="primary" type="primary" @click="add()">新增</el-button>
</div>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="partitionDesc" align="center" label="地区" />
<el-table-column prop="destGiftId" align="center" label="礼物id" />
<el-table-column prop="luckyBagName" align="center" label="福袋名称" />
<el-table-column
align="center"
prop="giftInfo"
label="福袋图片"
width="120"
>
<template v-slot="scope">
<el-image
style="width: 100px; height: 100px"
:src="scope.row.luckyBagPic"
:zoom-rate="1.1"
:preview-src-list="[scope.row.luckyBagPic]"
fit="cover"
preview-teleported="true"
hide-on-click-modal="true"
/>
</template>
</el-table-column>
<el-table-column prop="createTime" align="center" label="添加时间" />
<el-table-column prop="destGiftName" align="center" label="礼物名称" />
<el-table-column
align="center"
prop="giftInfo"
label="礼物图片"
width="120"
>
<template v-slot="scope">
<el-image
style="width: 100px; height: 100px"
:src="scope.row.destGiftPic"
:zoom-rate="1.1"
:preview-src-list="[scope.row.destGiftPic]"
fit="cover"
preview-teleported="true"
hide-on-click-modal="true"
/>
</template>
</el-table-column>
<el-table-column prop="destGiftPrice" align="center" label="礼物价值" />
<el-table-column
prop="rewardGiftName"
align="center"
label="奖励礼物昵称"
/>
<el-table-column
align="center"
prop="giftInfo"
label="奖励礼物图片"
width="120"
>
<template v-slot="scope">
<el-image
style="width: 100px; height: 100px"
:src="scope.row.rewardGiftPic"
:zoom-rate="1.1"
:preview-src-list="[scope.row.rewardGiftPic]"
fit="cover"
preview-teleported="true"
hide-on-click-modal="true"
/>
</template>
</el-table-column>
<el-table-column
prop="rewardGiftPrice"
align="center"
label="奖励礼物价值"
/>
<el-table-column prop="dayLimit" align="center" label="每日库存" />
<el-table-column prop="totalLimit" align="center" label="总库存" />
<el-table-column
prop="todayResideStock"
align="center"
label="今日剩余库存"
/>
<el-table-column prop="grantStock" align="center" label="已发放库存数量" />
<el-table-column prop="seqNo" align="center" label="排序" />
<el-table-column align="center" label="操作" width="240px">
<template v-slot="scope">
<el-button
@click="eid(scope)"
class="primary"
type="primary"
size="default"
>编辑</el-button
>
<el-button
@click="
delDialog = true;
delDialogObj = scope.row;
"
:class="scope.row.isEnabled == 1 ? 'danger' : 'primary'"
:type="scope.row.isEnabled == 1 ? 'danger' : 'primary'"
size="default"
>{{ scope.row.isEnabled == 1 ? "下线" : "上线" }}
</el-button>
<el-button
@click="
deriveDialog = true;
deriveObjNew = scope.row;
"
class="primary"
type="primary"
size="default"
>导出</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
<!-- 导出弹窗 -->
<el-dialog v-model="deriveDialog" title="导出" width="28%" center>
<!-- 榜单数据 -->
<!-- <div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>地区选择</span
>
<el-select v-model="deriveObj.value" placeholder="请选择">
<el-option
v-for="item in deriveObj.options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div> -->
<!-- 选择时间 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>选择时间</span
>
<div class="inquire">
<el-date-picker
v-model="deriveObj.time"
type="datetimerange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 60%"
>
</el-date-picker>
</div>
</div>
<!-- 弹窗按钮 -->
<template #footer>
<span class="dialog-footer">
<el-button @click="deriveDialog = false">取消</el-button>
<el-button type="primary" @click="deriveOut()"> 确认导出 </el-button>
</span>
</template>
</el-dialog>
<!-- 新增&编辑弹窗 -->
<el-dialog
class="pub"
v-model="controlsDialog"
:title="controlsTitle"
width="28%"
center
>
<!-- 地区选择 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>地区选择</span
>
<el-select filterable v-model="controlsObj.value" placeholder="请选择">
<el-option
v-for="item in controlsObj.options"
:key="item.id"
:label="item.desc"
:value="item.id"
>
</el-option>
</el-select>
</div>
<!-- 福袋礼物选择 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>福袋礼物选择</span
>
<el-select filterable v-model="controlsObj.value2" placeholder="请选择">
<el-option
v-for="item in controlsObj.options2"
:key="item.giftId"
:label="JsonFunc(item.giftName)"
:value="item.giftId"
>
</el-option>
</el-select>
</div>
<!-- 福袋价值 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>福袋价值</span
>
<el-input
v-model="controlsObj.cost"
placeholder=""
class="input"
disabled
></el-input>
</div>
<!-- 礼物昵称 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>礼物昵称</span
>
<el-select filterable v-model="controlsObj.value3" placeholder="请选择">
<el-option
v-for="item in controlsObj.options3"
:key="item.giftId"
:label="item.giftName"
:value="item.giftId"
>
</el-option>
</el-select>
</div>
<!-- 礼物价值 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>礼物价值</span
>
<el-input
v-model="controlsObj.cost2"
placeholder=""
class="input"
disabled
></el-input>
</div>
<!-- 奖励礼物昵称 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>奖励礼物昵称</span
>
<el-select filterable v-model="controlsObj.value4" placeholder="请选择">
<el-option
v-for="item in controlsObj.options4"
:key="item.giftId"
:label="JsonFunc(item.giftName)"
:value="item.giftId"
>
</el-option>
</el-select>
</div>
<!-- 奖励礼物价值 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>奖励礼物价值</span
>
<el-input
v-model="controlsObj.cost3"
placeholder=""
class="input"
disabled
></el-input>
</div>
<!-- 每日库存 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>每日库存</span
>
<el-input
v-model="controlsObj.inventory"
placeholder=""
class="input"
></el-input>
</div>
<!-- 总库存 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>总库存</span
>
<el-input
v-model="controlsObj.inventoryAll"
placeholder=""
class="input"
></el-input>
</div>
<!-- 排序 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>排序</span
>
<el-input
v-model="controlsObj.sort"
placeholder=""
class="input"
></el-input>
</div>
<!-- 是否可见 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>是否可见</span
>
<el-select filterable v-model="controlsObj.value5" placeholder="请选择">
<el-option
v-for="item in controlsObj.options5"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<!-- 选择时间 -->
<div style="margin-bottom: 25px; margin-top: 10px">
<span
style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label"
>选择时间</span
>
<div class="inquire">
<el-date-picker
v-model="controlsObj.time"
type="datetimerange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
style="width: 66%"
>
</el-date-picker>
</div>
</div>
<!-- 弹窗按钮 -->
<template #footer>
<span class="dialog-footer">
<el-button @click="controlsDialog = false">取消</el-button>
<el-button type="primary" @click="controlsDialogOut()">
确认
</el-button>
</span>
</template>
</el-dialog>
<!-- 二次确认弹窗 -->
<el-dialog v-model="delDialog" title="提示" width="30%" center>
<span> 确定要进行该操作吗?</span>
<template #footer>
<span class="dialog-footer">
<el-button @click="delDialog = false">取消</el-button>
<el-button type="primary" @click="delClick()"> 确认 </el-button>
</span>
</template>
</el-dialog>
</template>
<script>
import {
listPartitionInfo,
listLuckyBagLinearGift,
luckyBagFortunatePage,
getPrizeGroupsInfo,
getAll,
luckyBagFortunateExport,
luckyBagFortunateSave,
luckyBagFortunateUpdateEnabled,
} from "@/api/luckyTycoon/luckyTycoon";
// @ts-ignore
import { dateFormat } from "@/utils/system-helper";
// @ts-ignore
import { ElMessage } from "element-plus";
export default {
name: "luckyTycoonOnePlusOne",
created() {
listPartitionInfo().then((res) => {
this.controlsObj.options = res.data;
});
listLuckyBagLinearGift().then((res) => {
this.controlsObj.options2 = res.data;
});
this.getData();
},
data() {
return {
delDialog: false,
delDialogObj: {},
foundIndexFunVal: "",
loading: false,
// 表格数据
tableData: [],
// 分页
total: 10, //总页数
currentPage: 1, //页码
pageSize: 10, //条数//导出
deriveDialog: false,
deriveObjNew: {},
deriveObj: {
value: "",
time: "",
options: [
{
value: "1",
label: "英语区",
},
{
value: "2",
label: "阿拉伯区",
},
{
value: "4",
label: "华语区",
},
],
},
controlsDialog: false,
controlsDialogType: 1, //1新增 2编辑
controlsTitle: "编辑&新增",
controlsObj: {
// 地区选择
value: "",
options: [],
// 福袋礼物选择
value2: "",
options2: [],
cost: "",
value3: "",
options3: [],
cost2: "",
value4: "",
options4: [],
cost3: "",
inventory: "",
inventoryAll: "",
sort: "",
value5: 1,
options5: [
{
value: 1,
label: "是",
},
{
value: 0,
label: "否",
},
],
time: [],
},
};
},
watch: {
"controlsObj.value2": function (newValue, oldValue) {
this.controlsObj.cost = this.foundIndexFun(
newValue,
this.controlsObj.options2,
1
);
getPrizeGroupsInfo({ luckyBagGiftId: this.controlsObj.value2 }).then(
(res) => {
var newArr = [];
res.data.highPrizeGroup.forEach((val) => {
newArr.push(val);
});
res.data.normalPrizeGroup.forEach((val) => {
newArr.push(val);
});
this.controlsObj.options3 = newArr;
}
);
},
"controlsObj.value3": function (newValue, oldValue) {
if (this.watchType) {
return;
}
this.controlsObj.cost2 = this.foundIndexFun(
newValue,
this.controlsObj.options3,
2
);
},
"controlsObj.value4": function (newValue, oldValue) {
if (this.watchType) {
return;
}
this.controlsObj.cost3 = this.foundIndexFun(
newValue,
this.controlsObj.options4,
1
);
},
},
methods: {
getData() {
this.loading = true;
luckyBagFortunatePage({
page: this.currentPage,
pageSize: this.pageSize,
}).then((res) => {
if (res.code == 200) {
this.tableData = res.data.records;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
getAll().then((res) => {
this.controlsObj.options4 = res.data;
this.loading = false;
});
},
add() {
this.controlsDialog = true;
this.controlsTitle = "新增";
this.controlsDialogType = 1;
// this.controlsObj = {
// // 地区选择
// value: "",
// options: [],
// // 福袋礼物选择
// value2: "",
// options2: [],
// cost: "",
// value3: "",
// options3: [],
// cost2: "",
// value4: "",
// options4: [],
// cost3: "",
// inventory: "",
// inventoryAll: "",
// sort: "",
// value5: 1,
// options5: [
// {
// value: 1,
// label: "是",
// },
// {
// value: 2,
// label: "否",
// },
// ],
// time: "",
// };
},
eid(scope) {
var res = scope.row;
this.deriveObjNew = scope.row;
this.controlsTitle = "编辑";
this.controlsDialogType = 2;
this.foundIndexFunVal = res.rewardGiftId;
this.controlsObj.value = res.partitionId;
this.controlsObj.value2 = res.luckyBagId;
getPrizeGroupsInfo({ luckyBagGiftId: this.controlsObj.value2 }).then(
(resArr) => {
var newArr = [];
resArr.data.highPrizeGroup.forEach((val) => {
newArr.push(val);
});
resArr.data.normalPrizeGroup.forEach((val) => {
newArr.push(val);
});
this.controlsObj.options3 = newArr;
this.controlsObj.value3 = res.destGiftId;
// this.controlsObj.cost = res.luckyBagPrice;
// this.controlsObj.cost2 = res.destGiftId;
this.controlsObj.value4 = res.rewardGiftId;
// this.controlsObj.cost3 = res.rewardGiftPrice;
this.controlsObj.inventory = res.dayLimit;
this.controlsObj.inventoryAll = res.totalLimit;
this.controlsObj.sort = res.seqNo;
this.controlsObj.value5 = res.isEnabled;
this.controlsObj.time[0] = res.startTime;
this.controlsObj.time[1] = res.endTime;
this.controlsDialog = true;
}
);
},
// 保存
controlsDialogOut() {
let startTime = "";
let endTime = "";
if (this.controlsObj.time && this.controlsObj.time.length > 0) {
startTime = dateFormat(this.controlsObj.time[0], "yyyy-MM-dd hh:mm:ss");
endTime = dateFormat(this.controlsObj.time[1], "yyyy-MM-dd hh:mm:ss");
}
if (this.controlsDialogType == 1) {
luckyBagFortunateSave({
partitionId: this.controlsObj.value,
luckyBagId: this.controlsObj.value2,
destGiftId: this.controlsObj.value3,
rewardGiftId: this.controlsObj.value4,
dayLimit: this.controlsObj.inventory,
totalLimit: this.controlsObj.inventoryAll,
seqNo: this.controlsObj.sort,
isEnabled: this.controlsObj.value5,
startTime,
endTime,
}).then((res) => {
if (res.code == 200) {
this.controlsDialog = false;
this.getData();
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
} else {
luckyBagFortunateSave({
partitionId: this.controlsObj.value,
luckyBagId: this.controlsObj.value2,
destGiftId: this.controlsObj.value3,
rewardGiftId: this.controlsObj.value4,
dayLimit: this.controlsObj.inventory,
totalLimit: this.controlsObj.inventoryAll,
seqNo: this.controlsObj.sort,
isEnabled: this.controlsObj.value5,
id: this.deriveObjNew.id,
startTime,
endTime,
}).then((res) => {
if (res.code == 200) {
this.controlsDialog = false;
this.getData();
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
}
},
// 导出
deriveOut() {
let startTime = "";
let endTime = "";
if (this.deriveObj.time && this.deriveObj.time.length > 0) {
startTime = dateFormat(this.deriveObj.time[0], "yyyy-MM-dd hh:mm:ss");
endTime = dateFormat(this.deriveObj.time[1], "yyyy-MM-dd hh:mm:ss");
}
luckyBagFortunateExport({
fortunateId: this.deriveObjNew.id,
partitionId: this.deriveObjNew.partitionId,
startTime,
endTime,
}).then((res) => {});
},
// 上下线
delClick() {
luckyBagFortunateUpdateEnabled({
fortunateId: this.delDialogObj.id,
isEnabled: this.delDialogObj.isEnabled == 1 ? 0 : 1,
}).then((res) => {
if (res.code == 200) {
this.delDialog = false;
this.getData();
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
// 分页导航
handleSizeChange() {
this.getData();
},
handleCurrentChange() {
this.getData();
},
foundIndexFun(val, arr, type) {
var i;
i = arr.findIndex((item) => item.giftId === val);
return type == 1 ? arr[i].goldPrice : arr[i].platformValue;
},
JsonFunc(val) {
var res = JSON.parse(val);
return res.zh;
},
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.inquire {
display: inline-block;
margin-right: 20px;
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
.dialogTableVisibleBut {
display: block;
margin: 30px 0 0 830px;
}
.paginationClass {
margin: 15px 0 5px 0px;
}
}
.pub {
.input {
width: 55%;
display: inline-block;
}
}
</style>

View File

@@ -0,0 +1,193 @@
<template>
<div class="box">
<!-- 查询 -->
<div class="inquire">
<span>奖励礼物id</span>
<el-input
v-model="inquire.giftId"
placeholder=""
class="input"
></el-input>
</div>
<div class="inquire">
<span>用户id</span>
<el-input
v-model="inquire.userId"
placeholder=""
class="input"
></el-input>
</div>
<!-- 时间选择器 -->
<div class="inquire">
<div class="block">
<span class="demonstration">日期</span>
<el-date-picker
v-model="inquire.time"
type="datetimerange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</div>
</div>
<!-- 查询按钮 -->
<el-button class="primary" type="primary" @click="getData()"
>查询</el-button
>
<!-- 导出按钮 -->
<el-button class="primary" type="primary" @click="derive()">导出</el-button>
</div>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="createTimeStr" align="center" label="时间" />
<el-table-column prop="sendErBanNo" align="center" label="送礼人id" />
<el-table-column prop="sendNick" align="center" label="送礼人昵称" />
<el-table-column prop="receiveErBanNo" align="center" label="收礼人id" />
<el-table-column prop="receiveNick" align="center" label="收礼人昵称" />
<el-table-column prop="luckyBagId" align="center" label="福袋id" />
<el-table-column prop="luckyBagName" align="center" label="福袋昵称" />
<el-table-column prop="destGiftName" align="center" label="礼物名称" />
<el-table-column prop="luckyBagPrice" align="center" label="福袋流水" />
<!-- <el-table-column prop="x" align="center" label="该用户是否中奖">
<template v-slot="scope">{{ scope.row.x ? "是" : "否" }}</template>
</el-table-column> -->
<el-table-column prop="rewardGiftName" align="center" label="奖励名称">
<template v-slot="scope">{{
scope.row.rewardGiftName ? scope.row.rewardGiftName : "/"
}}</template>
</el-table-column>
<el-table-column prop="rewardGiftPrice" align="center" label="奖励价值">
<template v-slot="scope">{{
scope.row.rewardGiftPrice ? scope.row.rewardGiftPrice : "/"
}}</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
style="margin-top: 10px"
class="paginationClass"
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
layout="sizes, prev, pager, next"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</template>
<script>
import { getRecordPage, exportForReward } from "@/api/luckyTycoon/luckyTycoon";
// @ts-ignore
import { dateFormat } from "@/utils/system-helper";
// @ts-ignore
import { ElMessage } from "element-plus";
export default {
name: "luckyTycoonUserWinningRecord",
data() {
return {
inquire: {
giftId: "",
userId: "",
time: "",
},
loading: false,
// 表格数据
tableData: [],
// 分页
total: 10, //总页数
currentPage: 1, //页码
pageSize: 10, //条数
};
},
created() {
this.getData();
},
methods: {
getData() {
this.loading = true;
let startTime = "";
let endTime = "";
if (this.inquire.time && this.inquire.time.length > 0) {
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
}
this.loading = true;
getRecordPage({
page: this.currentPage,
pageSize: this.pageSize,
rewardGiftId: this.inquire.giftId,
erBanNo: this.inquire.userId,
startTime,
endTime,
}).then((res) => {
if (res.code == 200) {
this.tableData = res.data.records;
this.total = res.data.total;
this.loading = false;
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
this.loading = false;
});
},
derive() {
let startTime = "";
let endTime = "";
if (this.inquire.time && this.inquire.time.length > 0) {
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
}
exportForReward({
rewardGiftId: this.inquire.giftId,
erBanNo: this.inquire.userId,
startTime,
endTime,
}).then((res) => {});
},
// 分页导航
handleSizeChange() {
this.getData();
},
handleCurrentChange() {
this.getData();
},
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.inquire {
display: inline-block;
margin-right: 20px;
span {
margin-right: 10px;
}
.input {
width: 180px;
margin-right: 10px;
}
}
.dialogTableVisibleBut {
display: block;
margin: 30px 0 0 830px;
}
.paginationClass {
margin: 15px 0 5px 0px;
}
}
</style>