优化代码
This commit is contained in:
@@ -27,8 +27,7 @@
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -56,18 +55,20 @@
|
||||
<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>
|
||||
<template #default="{ row }">
|
||||
{{ 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>
|
||||
<template #default="{ row }">
|
||||
{{ row.rewardGiftPrice || "/" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="x" align="center" label="该用户是否中奖">
|
||||
<template #default="{ row }">
|
||||
{{ row.x ? "是" : "否" }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -84,12 +85,12 @@
|
||||
@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() {
|
||||
@@ -120,7 +121,6 @@ export default {
|
||||
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,
|
||||
@@ -128,20 +128,29 @@ export default {
|
||||
erBanNo: this.inquire.userId,
|
||||
startTime,
|
||||
endTime,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.tableData = res.data.records;
|
||||
this.total = res.data.total;
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.tableData = res.data.records;
|
||||
this.total = res.data.total;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "获取数据失败",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
this.loading = false;
|
||||
} else {
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("请求出错:", error);
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
message: "请求出错,请稍后重试",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
this.loading = false;
|
||||
});
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
derive() {
|
||||
let startTime = "";
|
||||
@@ -155,18 +164,40 @@ export default {
|
||||
erBanNo: this.inquire.userId,
|
||||
startTime,
|
||||
endTime,
|
||||
}).then((res) => {});
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
// 可以添加导出成功的提示信息
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "导出失败",
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("导出请求出错:", error);
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "导出请求出错,请稍后重试",
|
||||
type: "error",
|
||||
});
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange() {
|
||||
handleSizeChange(size) {
|
||||
this.pageSize = size;
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange() {
|
||||
handleCurrentChange(page) {
|
||||
this.currentPage = page;
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
@@ -182,12 +213,8 @@ export default {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.dialogTableVisibleBut {
|
||||
display: block;
|
||||
margin: 30px 0 0 830px;
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
Reference in New Issue
Block a user