Files
peko-admin-web/src/views/nobleman/WagesCount.vue

332 lines
10 KiB
Vue
Raw Normal View History

2024-07-25 17:50:35 +08:00
<template>
<div class="box">
<!-- 时间选择器 -->
2025-09-24 15:25:13 +08:00
<div class="inquire">
<span>周期</span>
2025-09-24 15:25:13 +08:00
<el-select v-model="inquire.cycleDate"
placeholder="请选择">
<el-option v-for="(item,index) in dateCycleArr"
:key="index"
:label="item.startDateStr + '~' + item.endDateStr"
:value="item.dateCycle">
</el-option>
</el-select>
</div>
<!-- <div class="inquire">
2024-07-25 17:50:35 +08:00
<div class="block">
<span class="demonstration">日期</span>
<el-config-provider :locale="zhCn">
2024-08-06 16:39:48 +08:00
<el-date-picker v-model="inquire.time"
type="month"
placeholder="选择月">
</el-date-picker></el-config-provider>
2024-07-25 17:50:35 +08:00
</div>
</div> -->
2024-08-01 17:42:58 +08:00
<div class="inquire">
<div class="block">
<span class="demonstration">会长分区</span>
2024-08-06 16:39:48 +08:00
<el-select v-model="inquire.partitionId"
style="width: 75%"
placeholder="请选择">
<el-option v-for="item in inquire.inquireonInfos"
:key="item.id"
:label="item.desc"
:value="item.id"></el-option>
2024-08-01 17:42:58 +08:00
</el-select>
</div>
</div>
2024-07-25 17:50:35 +08:00
<!-- 公会 -->
<div class="inquire">
2024-08-01 17:42:58 +08:00
<span>会长ID</span>
2024-08-06 16:39:48 +08:00
<el-input v-model="inquire.nick"
placeholder=""
class="input"></el-input>
2024-07-25 17:50:35 +08:00
</div>
<!-- 查询按钮 -->
2024-08-06 16:39:48 +08:00
<el-button class="primary"
type="primary"
@click="getData()">查询</el-button>
2024-08-01 17:42:58 +08:00
<!-- 导出 -->
2024-08-06 16:39:48 +08:00
<el-button class="primary"
type="primary"
@click="deriveFun()">导出</el-button>
2024-07-25 17:50:35 +08:00
<!-- 表格 -->
2024-08-06 16:39:48 +08:00
<el-table v-loading="loading"
:data="tableData"
border
style="width: 100%; margin-top: 25px">
<el-table-column prop="ownerErbanNo"
align="center"
label="会长ID" />
<el-table-column prop="name"
align="center"
label="公会名称" />
<el-table-column prop="ownerPartitionName"
align="center"
label="会长分区" />
<el-table-column prop="enable"
align="center"
label="是否有效状态">
<template v-slot="scope">{{ scope.row.enable? '': '' }}</template>
</el-table-column>
<el-table-column prop="memberNum"
align="center"
label="成员数" />
<el-table-column prop="goldIncome"
align="center"
label="月金币收入(流水)" />
<el-table-column prop="goldWage"
align="center"
label="金币工资" />
<el-table-column prop="agentWage"
align="center"
label="代理工资" />
2025-09-24 15:25:13 +08:00
<el-table-column prop="diamondWage"
align="center"
label="钻石工资" />
2024-08-06 16:39:48 +08:00
<el-table-column prop="diamondRemain"
align="center"
2025-09-24 15:25:13 +08:00
label="当前钻石余额" />
2024-08-06 16:39:48 +08:00
<el-table-column align="center"
label="操作"
width="260">
2024-07-25 17:50:35 +08:00
<template v-slot="scope">
2024-08-06 16:39:48 +08:00
<el-button @click="ediClick(scope.row)"
class="primary"
type="primary"
size="default">查看详情</el-button>
<el-button @click="deriveFun2(scope.row)"
class="primary"
type="primary"
size="default">导出</el-button>
2024-07-25 17:50:35 +08:00
</template>
</el-table-column>
</el-table>
<!-- 内嵌单个工会详情 -->
2024-08-06 16:39:48 +08:00
<el-dialog :title="detailsTitle"
v-model="detailsDialog">
<el-table v-loading="loading"
:data="tableDataDetails"
border
style="width: 100%; margin-top: 25px">
<el-table-column prop="erbanNo"
align="center"
label="用户平台ID">
2024-07-25 17:50:35 +08:00
<template v-slot="scope">
{{
scope.row.erbanNo == scope.row.familyOwnerErbanNo
? scope.row.erbanNo + "(会长)"
2024-07-31 10:22:26 +08:00
: scope.row.enable
? scope.row.erbanNo
: scope.row.erbanNo + "离开"
2024-07-25 17:50:35 +08:00
}}
</template>
</el-table-column>
2024-08-06 16:39:48 +08:00
<el-table-column prop="nick"
align="center"
label="用户昵称" />
<el-table-column prop="micRemainTime"
align="center"
label="本月直播时长" />
<el-table-column prop="micVaildDays"
align="center"
label="本月有效天数" />
<el-table-column prop="goldIncome"
align="center"
label="月金币收入(流水)" />
<el-table-column prop="goldWage"
align="center"
label="金币工资" />
<el-table-column prop="agentWage"
align="center"
label="代理工资" />
2025-09-24 15:25:13 +08:00
<el-table-column prop="diamondWage"
align="center"
label="钻石工资" />
2024-08-06 16:39:48 +08:00
<el-table-column prop="diamondRemain"
align="center"
label="当前钻石余额" />
2024-07-25 17:50:35 +08:00
</el-table>
<template #footer>
<div class="dialog-footer">
<el-button @click="detailsDialog = false">关闭</el-button>
2024-08-06 16:39:48 +08:00
<el-button type="primary"
@click="detailsClickOut()">导出</el-button>
</div>
</template>
2024-07-25 17:50:35 +08:00
</el-dialog>
<!-- 分页 -->
2024-08-06 16:39:48 +08:00
<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" />
2024-07-25 17:50:35 +08:00
</div>
</template>
<script>
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import {
statPageFamily,
listFamilyMember,
statExportFamilyMember,
2024-08-01 17:42:58 +08:00
statExportFamily,
2024-07-25 17:50:35 +08:00
} from "@/api/nobleman/nobleman";
2025-09-24 15:25:13 +08:00
import { getWageStatListDateCycle } from "@/api/relAgency/relAgency.js";
2024-07-25 17:50:35 +08:00
// @ts-ignore
import { ElMessage } from "element-plus";
export default {
name: "WagesCount",
2024-08-06 16:39:48 +08:00
data () {
2024-07-25 17:50:35 +08:00
return {
zhCn,
loading: false,
//查询所需条件对象
inquire: {
nick: "",
2025-09-24 15:25:13 +08:00
partitionId: 1,
2024-08-01 17:42:58 +08:00
inquireonInfos: [
{ desc: "英语区", id: 1 },
{ desc: "阿拉伯区", id: 2 },
{ desc: "土耳其区", id: 8 },
2024-08-01 17:42:58 +08:00
],
2025-09-24 15:25:13 +08:00
cycleDate: '',
2024-07-25 17:50:35 +08:00
},
// 表格
tableData: [],
// 分页
total: 10, //总页数
currentPage: 1, //页码
pageSize: 10, //条数
// 内嵌单个公会详情
detailsDialog: false,
detailsTitle: "工会昵称 时间段 结算明细",
tableDataDetails: [],
detailsClickOutObj: {},
// 内嵌单个公会详情2
detailsDialog2: false,
detailsTitle2: "工会昵称 用户昵称ID0 时间段 结算明细",
tableDataDetails2: [],
detailsClickOutObj2: {},
2025-09-24 15:25:13 +08:00
dateCycleArr: [],
2024-07-25 17:50:35 +08:00
};
},
2024-08-06 16:39:48 +08:00
created () {
getWageStatListDateCycle({ month: 4 }).then((res) => {
2025-09-24 15:25:13 +08:00
if (res.code == 200) {
this.dateCycleArr = res.data || [];
this.inquire.cycleDate = this.dateCycleArr[0].dateCycle;
this.getData();
2025-09-24 15:25:13 +08:00
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
2024-07-25 17:50:35 +08:00
},
methods: {
// 查询接口
2024-08-06 16:39:48 +08:00
getData () {
2024-07-25 17:50:35 +08:00
// this.loading = true;
// let time = this.inquire.time;
// if (time) {
// time = dateFormat(this.inquire.time, "yyyy-MM");
// }
2025-09-24 15:25:13 +08:00
if (this.inquire.cycleDate == "") {
ElMessage.error("请选择周期");
return;
2024-07-25 17:50:35 +08:00
}
statPageFamily({
erbanNo: this.inquire.nick,
2024-08-01 17:42:58 +08:00
partitionId: this.inquire.partitionId,
cycleDate: this.inquire.cycleDate,
2024-07-25 17:50:35 +08:00
pageNum: this.currentPage,
pageSize: this.pageSize,
}).then((res) => {
this.total = res.data.total;
this.tableData = res.data.rows;
this.loading = false;
});
},
2024-08-01 17:42:58 +08:00
// 导出总外列表
2024-08-06 16:39:48 +08:00
deriveFun (val) {
2024-08-01 17:42:58 +08:00
statExportFamily({
erbanNo: this.inquire.nick,
2025-09-24 15:25:13 +08:00
cycleDate: this.inquire.cycleDate,
2024-08-01 17:42:58 +08:00
partitionId: this.inquire.partitionId,
2024-08-06 16:39:48 +08:00
}).then((res) => { });
2024-08-01 17:42:58 +08:00
},
// 导出列表最外层
2024-08-06 16:39:48 +08:00
deriveFun2 (val) {
2024-08-01 17:42:58 +08:00
statExportFamilyMember({
familyId: val.id,
2025-09-24 15:25:13 +08:00
cycleDate: this.inquire.cycleDate,
2024-08-01 17:42:58 +08:00
});
this.detailsDialog = false;
},
// 1层查看详情按钮
2024-08-06 16:39:48 +08:00
ediClick (val) {
2024-07-25 17:50:35 +08:00
console.log(val);
var than = this;
this.detailsClickOutObj = val;
2025-09-24 15:25:13 +08:00
than.detailsTitle = `[${val.name}] [${this.inquire.cycleDate}]结算明细`;
2024-07-25 17:50:35 +08:00
listFamilyMember({
familyId: val.id,
2025-09-24 15:25:13 +08:00
cycleDate: this.inquire.cycleDate,
2024-07-25 17:50:35 +08:00
}).then((res) => {
this.tableDataDetails = res.data;
this.detailsDialog = true;
});
},
// 导出最外层数据按钮
2024-08-06 16:39:48 +08:00
detailsClickOut () {
2024-07-25 17:50:35 +08:00
statExportFamilyMember({
familyId: this.detailsClickOutObj.id,
2025-09-24 15:25:13 +08:00
cycleDate: this.inquire.cycleDate,
2024-07-25 17:50:35 +08:00
});
this.detailsDialog = false;
},
// 分页导航
2024-08-06 16:39:48 +08:00
handleSizeChange () {
2024-07-25 17:50:35 +08:00
this.getData();
},
2024-08-06 16:39:48 +08:00
handleCurrentChange () {
2024-07-25 17:50:35 +08:00
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>