Browse Source

样式合并10.13

zhangyong/milestone-20250913-现金管理
zhangrenyuan 2 months ago
parent
commit
f4b792912d
  1. 4
      .env.development
  2. 108
      src/assets/SvgIcons/背景.svg
  3. BIN
      src/assets/收款明细撤回背景.png
  4. 33
      src/components/workspace/GoldGraph.vue
  5. 8
      src/components/workspace/GoldManagement.vue
  6. 73
      src/css/btn.css
  7. 8
      src/main.ts
  8. 86
      src/views/audit/bean/beanAudit.vue
  9. 44
      src/views/audit/gold/audit.vue
  10. 44
      src/views/audit/gold/rechargeAudit.vue
  11. 102
      src/views/audit/gold/refundAudit.vue
  12. 167
      src/views/consume/bean/articleVideo.vue
  13. 14
      src/views/consume/bean/beanConsume.vue
  14. 208
      src/views/consume/bean/dieHardFan.vue
  15. 184
      src/views/consume/bean/liveStream.vue
  16. 22
      src/views/consume/gold/coinConsume.vue
  17. 184
      src/views/consume/gold/coinConsumeDetail.vue
  18. 32
      src/views/managerecharge/rate.vue
  19. 581
      src/views/moneyManage/receiveDetail/receiveDetail.vue
  20. 228
      src/views/permissions/userPermission.vue
  21. 197
      src/views/recharge/bean/beanOnlineRecharge.vue
  22. 42
      src/views/recharge/bean/beanRecharge.vue
  23. 667
      src/views/recharge/bean/beanSystemRecharge.vue
  24. 31
      src/views/recharge/gold/coinRecharge.vue
  25. 184
      src/views/recharge/gold/coinRechargeDetail.vue
  26. 18
      src/views/refund/gold/coinRefund.vue
  27. 40
      src/views/usergold/gold/clientCount.vue
  28. 24
      src/views/workspace/index.vue

4
.env.development

@ -1,4 +1,4 @@
VITE_API_BASE='https://hwjb.homilychart.com/dev/admin'
VITE_API_BASE='https://hwjb.homilychart.com/dev/admin'
# 测试环境
# VITE_API_BASE='http://54.255.212.181:10704/'
# 正式环境
@ -13,4 +13,4 @@ VITE_UPLOAD_URL=http://39.101.133.168:8828/hljw/api/aws/upload
# 本地
#VITE_API_BASE='http://localhost:8081/'
# sunjiabei
# VITE_API_BASE='http://192.168.1.70:8081/'
#VITE_API_BASE='http://192.168.1.50:8081/'

108
src/assets/SvgIcons/背景.svg
File diff suppressed because it is too large
View File

BIN
src/assets/收款明细撤回背景.png

After

Width: 700  |  Height: 392  |  Size: 116 KiB

33
src/components/workspace/GoldGraph.vue

@ -51,7 +51,7 @@
<div class="right">
<el-card class="graph-card-list">
<div class="card-large">金币{{ activeTab === 'recharge' ? '充值' : '消费' }}排名</div>
<el-select class="card-select" v-model="selectedType" style="width: 100%; margin-bottom: 15px">
<el-select popper-class="mySelectStyle" class="card-select" v-model="selectedType" style="width: 100%; margin-bottom: 15px">
<el-option label="全部类型" value="all"></el-option>
<el-option label="永久金币" value="permanent"></el-option>
<el-option label="免费金币" value="free"></el-option>
@ -770,16 +770,14 @@ onUnmounted(() => {
.card-select {
:deep(.el-select__wrapper) {
background-color: #E7F4FD !important;
// :hover {
// background-color: red !important;
// }
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.25) !important;
border: none !important;
}
:deep(.el-select-dropdown__item.selected) {
// :hover { background-color: red !important; }
background: red !important;
:deep(.el-select-dropdown) {
background-color: #E7F4FD !important;
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.25) !important;
border: none !important;
}
}
@ -806,13 +804,32 @@ onUnmounted(() => {
:deep(.el-table__body .el-table__cell) {
border-bottom: 1px solid #BBC0C9 !important;
}
}
/* select 列表项 初始颜色 */
.el-select-dropdown__item {
background: #ffffff;
}
/* select hover状态*/
.el-select-dropdown__item:hover {
border-radius: 8px;
margin-left: 2px;
margin-right: 2px;
background: #E5EBFE;
height: 32px;
}
/* 选中状态(针对 is-selected 类) */
.el-select-dropdown__item.is-selected {
color: #2549E0;
border-radius: 8px;
}
/* tabs的样式 */
/* 选中 tab 的文字颜色 */
:deep(.el-tabs__item.is-active) {
color: #2741DE !important;
font-size: 18px;
font-size: 18px;
font-weight: bold;
}
</style>

8
src/components/workspace/GoldManagement.vue

@ -63,7 +63,7 @@
<el-col :span="12">
<!-- 第二个卡片 -->
<div class="card-item-row1">
<div class="card-title">全年累计充值金币数{{ yearlyRecharge / 100 }}</div>
<div class="card-title">全年累计充值金币数{{ yearlyRecharge / 100 }}</div>
<el-row>
<el-col :span="12">
<div class="center-card">折合新币累计金额</div>
@ -85,7 +85,7 @@
<el-col :span="12">
<!-- 第三个卡片 -->
<div class="card-item">
<div class="card-title">全年累计消费金币数{{ yearlyReduce / 100 }}</div>
<div class="card-title">全年累计消费金币数{{ yearlyReduce / 100 }}</div>
<el-row style="height: 200px;">
<el-col :span="12">
<div ref="consumeChart" style="width:100%; height: 68%;"></div>
@ -98,8 +98,8 @@
</el-col>
<el-col :span="12">
<!-- 第四个卡片 -->
<div class="card-item">
<div class="card-title">全年累计充值人头数{{ yearlyRechargeNum }}</div>
<div class="card-item" >
<div class="card-title">全年累计充值人头数{{ yearlyRechargeNum }}</div>
<el-row style="height: 200px;">
<el-col :span="12" style="border-right: 2px solid #CFE6FE; height: 150px">
<div class="chart5">

73
src/css/btn.css

@ -0,0 +1,73 @@
/*各个页面的按钮激活*/
/*使用示例
import '@/css/btn.css';
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'rechargeAudit' }"
@click="navigateTo('rechargeAudit')"
v-if="hasRecharge"
>
充值审核
</el-button>
*/
/* 默认按钮样式 */
.no-active-btn {
background-color: #E5EBFE; /* 未激活背景色 */
color: #666; /* 未激活文字色 */
/* 确保激活状态下 hover 也不变化 */
&:hover {
background-color: #E5EBFE !important; /* 保持默认背景色 */
color: #666 !important; /* 保持默认文字色 */
border-color: transparent; /* 若有边框,保持默认 */
}
}
/* 激活状态样式 */
.active-btn {
background-color: #2741DE; /* 激活背景色 */
color: white; /* 激活文字色 */
/* 确保激活状态下 hover 也不变化 */
&:hover {
background-color: #2741DE !important;
color: white !important;
border-color: transparent;
}
}
/** ----------------------------------**/
/** 通过驳回按钮 使用的是el-link **/
.pass-btn {
color: #2741DE;
margin-right: 5px;
}
.reject-btn {
color: #2741DE;
margin-left: 5px;
}
/* 清除hover状态的样式变化 */
.pass-btn:hover,
.reject-btn:hover {
color: #2741DE; /* 保持与默认状态相同的颜色 */
}
/** ----------------------------------**/
/** ----------------------------------**/
/** 编辑 按钮 使用的是el-link **/
.edit-btn {
color: #2741DE;
}
.edit-btn:hover{
color: #2741DE; /* 保持与默认状态相同的颜色 */
}
/** ----------------------------------**/
/** ----------------------------------**/
.el-pagination .el-pager li.is-active {
background-color: #2741DE !important;
color: #FFFFFF !important;
}

8
src/main.ts

@ -1,4 +1,4 @@
import { createApp } from 'vue'
import {createApp} from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
@ -7,15 +7,17 @@ import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './assets/css/common.css' // 引入公共CSS文件
import JsonExcel from 'vue-json-excel'
import { createPinia } from 'pinia'
import {createPinia} from 'pinia'
import VxeUI from 'vxe-pc-ui'
import 'vxe-pc-ui/lib/style.css'
import VxeUITable from 'vxe-table'
import 'vxe-table/lib/style.css'
// 修正导入路径
import { useAdminStore } from './store'
import {useAdminStore} from './store'
import request from "@/util/request";
import "./global.css";
import '@/css/btn.css';
const app = createApp(App)
const pinia = createPinia()

86
src/views/audit/bean/beanAudit.vue

@ -4,27 +4,28 @@
<div class="select">
<div class="selectRow">
<el-text class="text" size="large">精网号</el-text>
<el-input v-model="searchForm.jwcode" placeholder="请输入精网号" style="width: 12vw;margin-right:1vw" clearable />
<el-input class="selectContent" v-model="searchForm.jwcode" placeholder="请输入精网号"
style="width: 12vw;margin-right:1vw" clearable/>
</div>
<div class="selectRow">
<el-text class="text" size="large">所属地区</el-text>
<el-cascader v-model="selectedMarkets" :options="marketOptions" placeholder="请选择所属地区" clearable
style="width: 12vw" @change="handleMarketChange" />
style="width: 12vw" @change="handleMarketChange"/>
</div>
</div>
</el-col>
<el-col>
<div class="select">
<div class="selectRow" style="width: 36vw;">
<el-text class="text" size="large" v-show="checkTab === 'pending'">提交时间</el-text>
<el-text size="large" style="width: 25vw;margin-right:1vw"
v-show="checkTab === 'reject' || checkTab === 'pass'">审核时间</el-text>
<el-text class="text" size="large" v-show="checkTab === 'pending'">提交时间</el-text>
<el-text class="text" size="large" v-show="checkTab === 'reject' || checkTab === 'pass'">审核时间</el-text>
<el-date-picker v-model="dateRange" type="datetimerange" range-separator="" start-placeholder="开始时间"
end-placeholder="结束时间" style="width: 25vw;margin-right:1vw" @change="handleDatePickerChange"
:default-time="defaultTime" />
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"></el-button>
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"></el-button>
<el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''">近7天</el-button>
end-placeholder="结束时间" class="selectContent" style="width: 25vw;margin-right:1vw"
@change="handleDatePickerChange"
:default-time="defaultTime"/>
<!-- <el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"></el-button>-->
<!-- <el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"></el-button>-->
<!-- <el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''">近7天</el-button>-->
</div>
<div class="selectRow" style="justify-content: flex-start;">
<el-button type="success" @click="resetSearch">重置</el-button>
@ -76,15 +77,15 @@
{{ scope.$index + 1 + (pagination.pageNum - 1) * pagination.pageSize }}
</template>
</el-table-column>
<el-table-column prop="name" label="姓名" width="120" show-overflow-tooltip />
<el-table-column prop="jwcode" label="精网号" width="120" />
<el-table-column prop="market" label="所属地区" width="120" />
<el-table-column prop="permanentBean" label="付费金豆" width="120" sortable="custom" />
<el-table-column prop="freeBean" label="免费金豆" width="120" sortable="custom" />
<el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip />
<el-table-column prop="submitName" label="提交人" width="120" />
<el-table-column v-if="checkTab === 'reject'" prop="reason" label="驳回理由" width="120" show-overflow-tooltip />
<el-table-column v-if="checkTab !== 'pending'" prop="auditName" label="审核人" width="120" />
<el-table-column prop="name" label="姓名" width="120" show-overflow-tooltip/>
<el-table-column prop="jwcode" label="精网号" width="120"/>
<el-table-column prop="market" label="所属地区" width="120"/>
<el-table-column prop="permanentBean" label="付费金豆" width="120" sortable="custom"/>
<el-table-column prop="freeBean" label="免费金豆" width="120" sortable="custom"/>
<el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip/>
<el-table-column prop="submitName" label="提交人" width="120"/>
<el-table-column v-if="checkTab === 'reject'" prop="reason" label="驳回理由" width="120" show-overflow-tooltip/>
<el-table-column v-if="checkTab !== 'pending'" prop="auditName" label="审核人" width="120"/>
<el-table-column prop="createTime" label="提交时间" width="180" sortable="custom">
<template #default="{ row }">
{{ moment(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
@ -96,14 +97,15 @@
</template>
</el-table-column>
<el-table-column v-if="checkTab === 'pending' && (hasbeanWaitThough || hasbeanWaitReject)" fixed="right"
prop="operation" label="操作" width="400px">
prop="operation" label="操作" width="400px">
<template #default="scope">
<div class="operation">
<el-popconfirm title="确定要通过此条记录吗?" @confirm="handleApprove(scope.row)">
<template #reference>
<el-button v-if="hasbeanWaitThough" :disabled="clicked || cancelClicked" type="primary" text>
<el-link :underline="false" class="pass-btn" v-if="hasbeanWaitThough"
:disabled="clicked || cancelClicked" type="primary">
通过
</el-button>
</el-link>
</template>
<template #actions="{ confirm }">
<el-button size="small">取消</el-button>
@ -112,23 +114,26 @@
</el-button>
</template>
</el-popconfirm>
<el-button v-if="hasbeanWaitReject" :disabled="clicked || cancelClicked" type="primary" text
@click="showRejectDialog(scope.row)">
<el-link :underline="false" class="reject-btn" v-if="hasbeanWaitReject" :disabled="clicked || cancelClicked"
type="primary"
@click="showRejectDialog(scope.row)">
驳回
</el-button>
</el-link>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination style="margin-top:20px" v-model:current-page="pagination.pageNum"
v-model:page-size="pagination.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="stats.num"
@size-change="handlePageSizeChange" @current-change="handleCurrentChange"></el-pagination>
v-model:page-size="pagination.pageSize" layout="total, sizes, prev, pager, next, jumper"
:total="stats.num"
@size-change="handlePageSizeChange" @current-change="handleCurrentChange"></el-pagination>
</el-card>
<el-dialog v-model="rejectVisible" title="驳回理由" width="500px">
<el-form>
<el-form-item label="驳回理由" required>
<el-input v-model="reason" type="textarea" :rows="4" placeholder="请输入驳回理由" maxlength="200" show-word-limit />
<el-input v-model="reason" type="textarea" :rows="4" placeholder="请输入驳回理由" maxlength="200"
show-word-limit/>
</el-form-item>
</el-form>
<template #footer>
@ -140,20 +145,21 @@
</el-dialog>
</template>
<script setup>
import { onMounted, ref } from 'vue'
import { ElMessage } from 'element-plus'
import {onMounted, ref} from 'vue'
import {ElMessage} from 'element-plus'
import API from '@/util/http.js'
import moment from 'moment'
import { useAdminStore } from "@/store/index.js";
import { storeToRefs } from "pinia";
import {useAdminStore} from "@/store/index.js";
import {storeToRefs} from "pinia";
import _ from 'lodash'
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js"
import {permissionMapping, hasMenuPermission} from "@/utils/menuTreePermission.js"
const defaultTime = [
new Date(2000, 1, 1, 0, 0, 0),
new Date(2000, 2, 1, 23, 59, 59),
]
const adminStore = useAdminStore();
const { adminData, menuTree } = storeToRefs(adminStore);
const {adminData, menuTree} = storeToRefs(adminStore);
import dayjs from "dayjs";
const tableData = ref([])
@ -287,7 +293,7 @@ const get = async function () {
}
}
console.log('看看传给后端的参数:', params)
const res = await API({ url: '/beanAudit/selectBy', data: params })
const res = await API({url: '/beanAudit/selectBy', data: params})
tableData.value = res.data.list || []
} catch (error) {
console.error('获取数据失败', error)
@ -334,7 +340,7 @@ const handleApprove = async (row) => {
id: row.id,
auditName: adminData.value.adminName
}
await API({ url: '/beanAudit/status1', data: params })
await API({url: '/beanAudit/status1', data: params})
ElMessage.success('审核通过成功')
await get()
clicked.value = false
@ -361,7 +367,7 @@ const handleReject = async () => {
auditName: adminData.value.adminName,
reason: reason.value
}
await API({ url: '/beanAudit/status2', data: params })
await API({url: '/beanAudit/status2', data: params})
ElMessage.success('驳回成功')
rejectVisible.value = false
await get()
@ -515,8 +521,8 @@ const getmarkets = async function () {
const allChildren = nodes.flatMap(node => node.children || []);
return allChildren.map(child => {
const grandchildren = child.children && child.children.length
? transformTree([child]) //
: null;
? transformTree([child]) //
: null;
return {
value: child.name,
label: child.name,
@ -604,7 +610,7 @@ onMounted(async () => {
:deep(.el-table__body-wrapper),
:deep(.el-table__cell),
/* 表格 */
/* 表格 */
:deep(.el-table__body td) {
background-color: #F3FAFE !important;
}

44
src/views/audit/gold/audit.vue

@ -1,13 +1,21 @@
<template>
<div>
<div style="height:4vh;width:82vw;">
<el-button-group class="custom-button-group">
<el-button :type="activeTab === 'rechargeAudit' ? 'primary' : 'default'" @click="navigateTo('rechargeAudit')" class="custom-tab-button"
v-if="hasRecharge">
<el-button-group>
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'rechargeAudit' }"
@click="navigateTo('rechargeAudit')"
v-if="hasRecharge"
>
充值审核
</el-button>
<el-button :type="activeTab === 'refundAudit' ? 'primary' : 'default'" @click="navigateTo('refundAudit')" class="custom-tab-button"
v-if="hasRefund">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'refundAudit' }"
@click="navigateTo('refundAudit')"
v-if="hasRefund"
>
退款审核
</el-button>
</el-button-group>
@ -43,7 +51,7 @@ const navigateTo = (name) => {
if(!hasRefund){
ElMessage.error('您暂无退款审核操作权限')
return;
}
}
}
activeTab.value = name;
router.push({ name });
@ -92,27 +100,3 @@ onMounted(() => {
}
});
</script>
<style scoped lang="scss">
/* 自定义按钮组布局 */
.custom-button-group {
display: flex;
margin-bottom: 16px;
gap: 8px;
}
:deep(.el-button.custom-tab-button) {
border-radius: 4px;
transition: all 0.3s ease;
}
// tab
:deep(.el-button.custom-tab-button.el-button--primary) {
background-color: #2741DE !important;
border-color: #2741DE !important;
color: #F3FAFE !important;
}
/* 鼠标悬停效果 */
:deep(.el-button.custom-tab-button:hover:not(.is-disabled)) {
opacity: 0.8;
}
</style>

44
src/views/audit/gold/rechargeAudit.vue

@ -48,32 +48,10 @@
</el-col>
</el-card>
<el-card class="card2">
<div class="custom-button-group">
<el-button
v-if="hasrechargeWait&&hasrechargeWaitShow"
:type="activeName === 'wait' ? 'primary' : 'default'"
@click="handleButtonClick('wait')"
class="custom-tab-button"
>
待审核
</el-button>
<el-button
v-if="hasrechargeThrough"
:type="activeName === 'pass' ? 'primary' : 'default'"
@click="handleButtonClick('pass')"
class="custom-tab-button"
>
已通过
</el-button>
<el-button
v-if="hasrechargeReject"
:type="activeName === 'reject' ? 'primary' : 'default'"
@click="handleButtonClick('reject')"
class="custom-tab-button"
>
已驳回
</el-button>
</div>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="待审核" name="wait" v-if="hasrechargeWait&&hasrechargeWaitShow"></el-tab-pane>
<el-tab-pane label="已通过" name="pass" v-if="hasrechargeThrough"></el-tab-pane>
<el-tab-pane label="已驳回" name="reject" v-if="hasrechargeReject"></el-tab-pane>
<div class="goldStatistics">
<!-- 总条数{{ format3(stats.totalNum) }}&nbsp;&nbsp;&nbsp;&nbsp;-->
@ -83,6 +61,7 @@
永久金币{{ format3(stats.permanentGolds.toFixed(2)) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
免费金币{{ format3(stats.freeGolds.toFixed(2)) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
</div>
</el-tabs>
<el-table :data="tableData" style="width: 82vw;height:54vh" @sort-change="handleSortChange"
:row-style="{ height: '50px' }">
@ -146,9 +125,10 @@
<div class="operation">
<el-popconfirm title="确定要通过此条记录吗?" @confirm="handleApprove(scope.row)">
<template #reference>
<el-button v-if="hasrechargeWaitThough" :disabled="clicked || cancelClicked" type="primary" text>
<el-link :underline="false" class="pass-btn" v-if="hasrechargeWaitThough"
:disabled="clicked || cancelClicked">
通过
</el-button>
</el-link>
</template>
<template #actions="{ confirm, cancel }">
<el-button size="small" @click="cancel">取消</el-button>
@ -157,9 +137,11 @@
</el-button>
</template>
</el-popconfirm>
<el-button v-if="hasrechargeWaitReject" :disabled="clicked || cancelClicked" type="primary" text @click="showRejectDialog(scope.row)">
<el-link :underline="false" class="reject-btn" v-if="hasrechargeWaitReject"
:disabled="clicked || cancelClicked" type="primary"
@click="showRejectDialog(scope.row)">
驳回
</el-button>
</el-link>
</div>
</template>
</el-table-column>
@ -594,7 +576,7 @@ const handleApprove = async (row) => {
console.error('审核通过失败', error)
ElMessage.error('操作失败')
}
}
const showRejectDialog = (row) => {

102
src/views/audit/gold/refundAudit.vue

@ -4,7 +4,7 @@
<div class="select">
<div class="selectRow">
<el-text class="text" size="large">精网号</el-text>
<el-input class="selectContent" v-model="searchForm.jwcode" placeholder="请输入精网号" clearable />
<el-input class="selectContent" v-model="searchForm.jwcode" placeholder="请输入精网号" clearable/>
</div>
<div class="selectRow">
<el-text class="text" size="large">商品名称</el-text>
@ -15,14 +15,14 @@
<div class="selectRow">
<el-text class="text" size="large">退款类型</el-text>
<el-select class="selectContent" v-model="searchForm.refundType" placeholder="请选择退款类型" clearable>
<el-option label="商品退款" value="商品退款" />
<el-option label="金币退款" value="金币退款" />
<el-option label="商品退款" value="商品退款"/>
<el-option label="金币退款" value="金币退款"/>
</el-select>
</div>
<div class="selectRow">
<el-text class="text" size="large">所属地区</el-text>
<el-cascader class="selectContent" style="width: 12vw;" v-model="selectedMarketPath" :options="market"
placeholder="请选择所属地区" clearable @change="handleMarketChange" />
placeholder="请选择所属地区" clearable @change="handleMarketChange"/>
</div>
</div>
</el-col>
@ -33,8 +33,8 @@
{{ activeName === 'wait' ? '提交时间:' : '审核时间:' }}
</el-text>
<el-date-picker class="selectContent" v-model="dateRange" type="datetimerange" range-separator=""
start-placeholder="起始时间" end-placeholder="结束时间" style="margin-right:1vw;width:25vw"
@change="handleDatePickerChange" :default-time="defaultTime" :disabled-date="disabledDate" />
start-placeholder="起始时间" end-placeholder="结束时间" style="margin-right:1vw;width:25vw"
@change="handleDatePickerChange" :default-time="defaultTime" :disabled-date="disabledDate"/>
<div v-if="false">
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"></el-button>
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"></el-button>
@ -78,7 +78,8 @@
</div>
<div class="goldStatistics">
退款总金币数{{ format3((stats.permanentGolds + stats.freeGolds + stats.taskGolds).toFixed(2))
退款总金币数{{
format3((stats.permanentGolds + stats.freeGolds + stats.taskGolds).toFixed(2))
}}金币&nbsp;&nbsp;&nbsp;&nbsp;
永久金币{{ format3(stats.permanentGolds.toFixed(2)) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
免费金币{{ format3(stats.freeGolds.toFixed(2)) }}金币&nbsp;&nbsp;&nbsp;&nbsp;
@ -86,19 +87,19 @@
</div>
<el-table :data="tableData" style="height:54vh;width:82vw" @sort-change="handleSortChange">
<el-table-column type="index" label="序号" width="60" />
<el-table-column prop="name" label="姓名" width="120" show-overflow-tooltip />
<el-table-column prop="jwcode" label="精网号" width="120" />
<el-table-column prop="market" label="所属地区" width="120" />
<el-table-column prop="orderCode" label="订单号" width="260px" show-overflow-tooltip />
<el-table-column type="index" label="序号" width="60"/>
<el-table-column prop="name" label="姓名" width="120" show-overflow-tooltip/>
<el-table-column prop="jwcode" label="精网号" width="120"/>
<el-table-column prop="market" label="所属地区" width="120"/>
<el-table-column prop="orderCode" label="订单号" width="260px" show-overflow-tooltip/>
<el-table-column prop="refundType" label="退款类型" width="120" />
<el-table-column prop="refundType" label="退款类型" width="120"/>
<el-table-column prop="refundModel" label="退款方式" width="120">
<template #default="{ row }">
{{ row.refundModel === 0 ? '全部退款' : '部分退款' }}
</template>
</el-table-column>
<el-table-column prop="goodsName" label="退款商品" width="120" show-overflow-tooltip />
<el-table-column prop="goodsName" label="退款商品" width="120" show-overflow-tooltip/>
<el-table-column prop="sumGold" label="退款金币总数" width="160" sortable="custom">
<template #default="{ row }">
{{ row.sumGold / 100 }}
@ -119,17 +120,17 @@
{{ row.taskGold / 100 }}
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip />
<el-table-column prop="adminName" label="提交人" width="120" />
<el-table-column prop="remark" label="备注" width="150" show-overflow-tooltip/>
<el-table-column prop="adminName" label="提交人" width="120"/>
<el-table-column v-if="checkTab === 'reject'" prop="rejectReason" label="驳回理由" width="150"
show-overflow-tooltip />
<el-table-column v-if="checkTab !== 'pending'" prop="auditName" label="审核人" width="120" />
show-overflow-tooltip/>
<el-table-column v-if="checkTab !== 'pending'" prop="auditName" label="审核人" width="120"/>
<el-table-column prop="createTime" label="提交时间" width="180" sortable="custom">
<template #default="{ row }">
{{
checkTab === 'pending'
? moment(row.auditTime).format('YYYY-MM-DD HH:mm:ss')
: moment(row.createTime).format('YYYY-MM-DD HH:mm:ss')
? moment(row.auditTime).format('YYYY-MM-DD HH:mm:ss')
: moment(row.createTime).format('YYYY-MM-DD HH:mm:ss')
}}
</template>
@ -139,15 +140,17 @@
{{ row.auditTime ? moment(row.auditTime).format('YYYY-MM-DD HH:mm:ss') : '--' }}
</template>
</el-table-column>
<el-table-column v-if="checkTab === 'pending' && (hasrefundWaitThough || hasrefundWaitReject)&&hasrefundWaitShow" fixed="right"
prop="operation" label="操作" width="150px">
<el-table-column v-if="checkTab === 'pending' && (hasrefundWaitThough || hasrefundWaitReject)&&hasrefundWaitShow"
fixed="right"
prop="operation" label="操作" width="150px">
<template #default="scope">
<div class="operation">
<el-popconfirm title="确定要通过此条记录吗?" @confirm="handleApprove(scope.row)">
<template #reference>
<el-button v-if="hasrefundWaitThough" :disabled="clicked || cancelClicked" type="primary" text>
<el-link :underline="false" class="pass-btn" v-if="hasrefundWaitThough"
:disabled="clicked || cancelClicked" type="primary">
通过
</el-button>
</el-link>
</template>
<template #actions="{ confirm, cancel }">
<el-button size="small" @click="cancel">取消</el-button>
@ -156,24 +159,26 @@
</el-button>
</template>
</el-popconfirm>
<el-button v-if="hasrefundWaitReject" :disabled="clicked || cancelClicked" type="primary" text
@click="showRejectDialog(scope.row)">
<el-link :underline="false" class="reject-btn" v-if="hasrefundWaitReject"
:disabled="clicked || cancelClicked" type="primary"
@click="showRejectDialog(scope.row)">
驳回
</el-button>
</el-link>
</div>
</template>
</el-table-column>
</el-table>
<el-pagination class="pagination" v-model:current-page="pagination.pageNum" v-model:page-size="pagination.pageSize"
layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
layout="total, sizes, prev, pager, next, jumper" :total="pagination.total"
@size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
</el-card>
<el-dialog v-model="rejectDialogVisible" title="驳回理由" width="500px">
<el-form>
<el-form-item label="驳回理由" required>
<el-input v-model="rejectReason" type="textarea" :rows="4" placeholder="请输入驳回理由" maxlength="200"
show-word-limit />
show-word-limit/>
</el-form-item>
</el-form>
<template #footer>
@ -186,16 +191,17 @@
</template>
<script setup>
import { onMounted, reactive, ref } from 'vue'
import { ElMessage } from 'element-plus'
import {onMounted, reactive, ref} from 'vue'
import {ElMessage} from 'element-plus'
import API from '@/util/http.js'
import moment from 'moment'
import { useAdminStore } from "@/store/index.js";
import { storeToRefs } from "pinia";
import {useAdminStore} from "@/store/index.js";
import {storeToRefs} from "pinia";
import dayjs from "dayjs";
import { permissionMapping, hasMenuPermission } from "@/utils/menuTreePermission.js"
import {permissionMapping, hasMenuPermission} from "@/utils/menuTreePermission.js"
const adminStore = useAdminStore();
const { adminData, menuTree } = storeToRefs(adminStore);
const {adminData, menuTree} = storeToRefs(adminStore);
const defaultTime = [
new Date(2000, 1, 1, 0, 0, 0),
new Date(2000, 2, 1, 23, 59, 59),
@ -264,7 +270,7 @@ const hasrefundWaitThough = ref(false) // 退款审核通过
const hasrefundWaitReject = ref(false) // 退
//
const initPermissions = async() => {
const initPermissions = async () => {
if (!menuTree.value || !menuTree.value.length) return;
// 退
hasrefundThrough.value = hasMenuPermission(menuTree.value, permissionMapping.refundThrough);
@ -311,7 +317,7 @@ const showRejectDialog = (row) => {
//
const getRefundGoods = async () => {
try {
const res = await API({ url: '/general/goods' })
const res = await API({url: '/general/goods'})
refundGoodsOptions.value = res.data || []
} catch (error) {
console.error('获取商品列表失败', error)
@ -360,7 +366,7 @@ const get = async function (val) {
return
}
}
const res = await API({ url: '/audit/selectRefund', data: params })
const res = await API({url: '/audit/selectRefund', data: params})
tableData.value = res.list || []
pagination.value.total = res.total || 0
console.log('查全部的total', pagination.value.total, res.total)
@ -383,7 +389,7 @@ const handleApprove = async (row) => {
action: 1,// action1,2
rejectReason: ''
}
await API({ url: '/audit/audit', data: params })
await API({url: '/audit/audit', data: params})
ElMessage.success('审核通过成功')
await get()
clicked.value = false
@ -415,7 +421,7 @@ const handleReject = async () => {
action: 2,
rejectReason: rejectReason.value
}
await API({ url: '/audit/audit', data: params })
await API({url: '/audit/audit', data: params})
ElMessage.success('驳回成功')
rejectDialogVisible.value = false
await get()
@ -618,8 +624,8 @@ const getMarket = async function () {
return allChildren.map(child => {
const grandchildren = child.children && child.children.length
? transformTree([child]) //
: null;
? transformTree([child]) //
: null;
return {
value: child.name,
@ -649,7 +655,7 @@ const format3 = (num) => {
}
//
const rules = reactive({
reason: [{ required: true, message: '请输入驳回理由', trigger: 'blur' }]
reason: [{required: true, message: '请输入驳回理由', trigger: 'blur'}]
})
const handlePageSizeChange = function (val) {
pagination.value.pageSize = val
@ -661,11 +667,11 @@ const handleCurrentChange = function (val) {
}
onMounted(async () => {
await initPermissions()
if(hasrefundWaitShow.value){
if (hasrefundWaitShow.value) {
searchForm.value.auditStatus = '0'
}else if(hasrefundThrough.value){
} else if (hasrefundThrough.value) {
searchForm.value.auditStatus = '1'
}else if(hasrefundReject){
} else if (hasrefundReject) {
searchForm.value.auditStatus = '2'
}
getRefundGoods()
@ -711,7 +717,7 @@ onMounted(async () => {
:deep(.el-table__header-wrapper),
:deep(.el-table__body-wrapper),
:deep(.el-table__cell),
/* 表格 */
/* 表格 */
:deep(.el-table__body td) {
background-color: #F3FAFE !important;
}

167
src/views/consume/bean/articleVideo.vue

@ -1,10 +1,10 @@
<script setup>
import { computed, onMounted, ref } from 'vue'
import { dayjs, ElMessage } from 'element-plus'
import {computed, onMounted, ref} from 'vue'
import {dayjs, ElMessage} from 'element-plus'
import request from '@/util/http.js'
import API from '@/util/http.js'
import moment from 'moment'
import { ar } from 'element-plus/es/locales.mjs'
import {ar} from 'element-plus/es/locales.mjs'
//
const defaultTime = [
new Date(2000, 1, 1, 0, 0, 0),
@ -43,9 +43,9 @@ const channels = ref([])
//
const consumeTypes = ref([
{ label: '打赏', value: 9 },
{ label: '打赏', value: 10 },
{ label: '付费购买', value: 11 },
{label: '打赏', value: 9},
{label: '打赏', value: 10},
{label: '付费购买', value: 11},
])
// payMode
@ -88,7 +88,7 @@ const getDept = async function () {
// url: '/general/dept',
url: '/beanConsume/getDept', // todo
data: { account: adminData.value.account }
data: {account: adminData.value.account}
})
console.log('请求地区列表成功', result)
//
@ -271,7 +271,6 @@ const reset = function () {
beanConsumeArticle.value.endTime = ''
sortField.value = ''
sortOrder.value = ''
getTime.value = {}
@ -317,8 +316,6 @@ const get7Days = function () {
}
//
const handleSortChange = (column) => {
console.log('排序字段:', column.prop)
@ -382,7 +379,7 @@ const exportExcel = async function () {
sortOrder: sortOrder.value,
},
}
const res = await API({ url: '/export/exportArticle', data: params })
const res = await API({url: '/export/exportArticle', data: params})
if (res.code === 200) {
ElMessage.success('导出成功')
}
@ -403,7 +400,7 @@ const exportListLoading = ref(false)
const getExportList = async () => {
exportListLoading.value = true
try {
const result = await API({ url: '/export/export' })
const result = await API({url: '/export/export'})
if (result.code === 200) {
const filteredData = result.data.filter(item => {
return item.type === 8; //4 // todo type 8/
@ -463,52 +460,70 @@ const getTagText = (state) => {
</script>
<template>
<el-card class="card1" style="margin-bottom: 1vh">
<el-card class="card1" style="margin-bottom: 0.5vh">
<el-col style="margin-bottom: 1vh; ">
<div style="display:flex">
<div style="width: 13vw; display:flex; align-items:center; justify-content: center;">
<el-text>精网号</el-text>
<el-input v-model="beanConsumeArticle.jwcode" style="width:8vw;margin-left: 0.5vw;" placeholder="请输入精网号" clearable />
<div class="select">
<div class="selectRow">
<el-text class="text" size="large">精网号</el-text>
<el-input class="selectContent" v-model="beanConsumeArticle.jwcode" placeholder="请输入精网号"
clearable/>
</div>
<div style="width: 13vw; display:flex; align-items:center; justify-content: center;">
<el-text>地区</el-text>
<el-select v-model="beanConsumeArticle.dept" style="width:8vw; margin-left: 0.5vw;" placeholder="请选择地区" clearable>
<el-option v-for="(item, index) in dept" :key="index" :label="item" :value="item" />
<div class="selectRow">
<el-text class="text" size="large">地区</el-text>
<el-select class="selectContent" v-model="beanConsumeArticle.dept"
placeholder="请选择地区"
clearable>
<el-option v-for="(item, index) in dept" :key="index" :label="item" :value="item"/>
</el-select>
</div>
<div style="width: 13vw; display:flex;align-items:center; justify-content: center;">
<el-text>类型</el-text>
<el-select v-model="beanConsumeArticle.payMode" style="width:8vw; margin-left: 0.5vw;" placeholder="请选择类型" clearable @change="handlePayModeChange">
<el-option label="打赏" value="0" />
<el-option label="付费购买" value="1" />
<el-option label="其他" value="2" />
<div class="selectRow">
<el-text class="text" size="large">类型</el-text>
<el-select class="selectContent"
style="width: 20px"
v-model="beanConsumeArticle.payMode"
placeholder="请选择类型" clearable
@change="handlePayModeChange"
>
<el-option label="打赏" value="0"/>
<el-option label="付费购买" value="1"/>
<el-option label="其他" value="2"/>
</el-select>
</div>
<div style="width: 15vw; display:flex; align-items:center; justify-content: center;">
<el-text>文章/视频ID:</el-text>
<el-input v-model="beanConsumeArticle.articleId" style="width:8vw; margin-left: 0.5vw;" placeholder="请输入文章/视频ID" clearable />
<div class="selectRow">
<el-text class="text" size="large">文章/视频ID:</el-text>
<el-input class="selectContent" v-model="beanConsumeArticle.articleId"
placeholder="请输入文章/视频ID" clearable/>
</div>
<div style="width: 16vw; display:flex; align-items:center; justify-content: center;">
<el-text>文章/视频标题</el-text>
<el-input v-model="beanConsumeArticle.articleName" style="width:9vw; margin-left: 0.5vw;" placeholder="请输入文章/视频标题" clearable />
</div>
<div style="width: 12vw; display:flex; align-items:center; justify-content: center;">
<el-text>作者</el-text>
<el-input v-model="beanConsumeArticle.author" style="width:8vw; margin-left: 0.5vw;" placeholder="请输入作者" clearable />
<div class="selectRow">
<el-text class="text" size="large">文章/视频标题</el-text>
<el-input class="selectContent" v-model="beanConsumeArticle.articleName"
placeholder="请输入文章/视频标题" clearable/>
</div>
</div>
</el-col>
<el-col>
<div>
<el-text>付费时间</el-text>
<el-date-picker v-model="getTime" type="datetimerange" range-separator="" start-placeholder="起始时间"
end-placeholder="结束时间" style="width: 20vw;margin-right: 10px" @change="handleDatePickerChange"
value-format="YYYY-MM-DD HH:mm:ss" :default-time="defaultTime" />
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"></el-button>
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"></el-button>
<el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''">近7天</el-button>
<div class="select">
<div class="selectRow" style="width: 30.5vw;">
<el-text class="text" size="large">付费时间</el-text>
<el-date-picker class="selectContent" v-model="getTime" type="datetimerange" range-separator=""
start-placeholder="起始时间"
end-placeholder="结束时间" style="width:25vw"
@change="handleDatePickerChange"
value-format="YYYY-MM-DD HH:mm:ss" :default-time="defaultTime"/>
<div v-if="false">
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"></el-button>
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"></el-button>
<el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''">近7天</el-button>
</div>
</div>
<div class="selectRow">
<el-text class="text" size="large">作者</el-text>
<el-input class="selectContent" v-model="beanConsumeArticle.author" placeholder="请输入作者"
clearable/>
</div>
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" @click="exportExcel()">导出Excel</el-button>
@ -527,30 +542,30 @@ const getTagText = (state) => {
<el-table-column type="index" label="序号" width="80px" fixed="left">
<template #default="scope">
<span>{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
</template>
</el-table-column>
<!-- 固定姓名列 -->
<el-table-column prop="name" label="姓名" width="150px" fixed="left" show-overflow-tooltip />
<el-table-column prop="name" label="姓名" width="150px" fixed="left" show-overflow-tooltip/>
<!-- 固定精网号列 -->
<el-table-column prop="jwcode" label="精网号" width="110px" fixed="left" />
<el-table-column prop="dept" label="地区" width="110px" />
<el-table-column prop="jwcode" label="精网号" width="110px" fixed="left"/>
<el-table-column prop="dept" label="地区" width="110px"/>
<el-table-column prop="type" label="类型" width="120px">
<template #default="scope">
{{
Array.isArray(consumeTypes)
? consumeTypes.find(item => item.value === Number(scope.row.type))?.label || '未知类型'
: '未知类型'
? consumeTypes.find(item => item.value === Number(scope.row.type))?.label || '未知类型'
: '未知类型'
}}
</template>
</el-table-column>
<el-table-column prop="beanNum" label="金豆总数" sortable="custom" width="120px" />
<el-table-column prop="buyBean" label="付费金豆数" sortable="custom" width="120px" />
<el-table-column prop="freeBean" label="免费金豆数" sortable="custom" width="120px" />
<el-table-column prop="articleId" label="文章/视频ID" width="150px" />
<el-table-column prop="articleName" label="文章/视频标题" width="150px" show-overflow-tooltip />
<el-table-column prop="author" label="作者" width="120px" show-overflow-tooltip />
<el-table-column prop="beanNum" label="金豆总数" sortable="custom" width="120px"/>
<el-table-column prop="buyBean" label="付费金豆数" sortable="custom" width="120px"/>
<el-table-column prop="freeBean" label="免费金豆数" sortable="custom" width="120px"/>
<el-table-column prop="articleId" label="文章/视频ID" width="150px"/>
<el-table-column prop="articleName" label="文章/视频标题" width="150px" show-overflow-tooltip/>
<el-table-column prop="author" label="作者" width="120px" show-overflow-tooltip/>
<el-table-column prop="consumeTime" label="付费时间" sortable="custom" width="180px">
<template #default="scope">
{{ formatTime(scope.row.consumeTime) }}
@ -562,15 +577,15 @@ const getTagText = (state) => {
<!-- 分页 -->
<div class="pagination">
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
</div>
</el-card>
<!-- 导出弹窗 -->
<el-dialog v-model="exportListVisible" title="导出列表" width="80%">
<el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading">
<el-table-column prop="fileName" label="文件名" />
<el-table-column prop="fileName" label="文件名"/>
<el-table-column prop="state" label="状态">
<template #default="scope">
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
@ -586,7 +601,7 @@ const getTagText = (state) => {
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
:disabled="scope.row.state !== 2">
:disabled="scope.row.state !== 2">
下载
</el-button>
</template>
@ -629,7 +644,7 @@ const getTagText = (state) => {
:deep(.el-table__header-wrapper),
:deep(.el-table__body-wrapper),
:deep(.el-table__cell),
/* 表格 */
/* 表格 */
:deep(.el-table__body td) {
background-color: #F3FAFE !important;
}
@ -648,4 +663,26 @@ const getTagText = (state) => {
display: flex;
margin-top: 20px;
}
/** 搜索的样式 */
.select {
display: flex;
.selectRow {
width: 17vw;
display: flex;
align-items: center;
justify-content: center;
padding: 0 0.5vw;
.text {
width: 5vw;
font-size: 15px;
}
.selectContent {
flex: 1;
}
}
}
</style>

14
src/views/consume/bean/beanConsume.vue

@ -2,7 +2,8 @@
<div style="height: 4vh;">
<el-button-group class="custom-button-group">
<el-button
:type="activeTab === 'addBeanConsume' ? 'primary' : 'default'" class="custom-tab-button"
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'addBeanConsume' }"
@click="navigateTo('addBeanConsume')"
v-if="hasAdd"
style="width: 6.5vw;"
@ -10,7 +11,8 @@
新增消耗
</el-button>
<el-button
:type="activeTab === 'liveStream' ? 'primary' : 'default'" class="custom-tab-button"
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'liveStream' }"
@click="navigateTo('liveStream')"
v-if="hasLive"
style="width: 6.5vw;"
@ -18,7 +20,8 @@
直播
</el-button>
<el-button
:type="activeTab === 'dieHardFan' ? 'primary' : 'default'" class="custom-tab-button"
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'dieHardFan' }"
@click="navigateTo('dieHardFan')"
v-if="hasFan"
style="width: 6.5vw;"
@ -26,7 +29,8 @@
铁粉
</el-button>
<el-button
:type="activeTab === 'articleVideo' ? 'primary' : 'default'" class="custom-tab-button"
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'articleVideo' }"
@click="navigateTo('articleVideo')"
v-if="hasArticleVideo"
style="width: 6.5vw;"
@ -116,7 +120,7 @@ onMounted(() => {
.custom-button-group {
display: flex;
margin-bottom: 16px;
gap: 8px;
// gap: 8px;
}
:deep(.el-button.custom-tab-button) {
border-radius: 4px;

208
src/views/consume/bean/dieHardFan.vue

@ -1,6 +1,6 @@
<script setup>
import { computed, onMounted, ref } from 'vue'
import { dayjs, ElMessage } from 'element-plus'
import {computed, onMounted, ref} from 'vue'
import {dayjs, ElMessage} from 'element-plus'
import request from '@/util/http.js'
import API from '@/util/http.js'
import moment from 'moment'
@ -46,7 +46,7 @@ const getChannel = async function () {
try {
const result = await request({
url: '/beanConsume/getLiveChannel', // todo
data: { account: adminData.value.account }
data: {account: adminData.value.account}
})
console.log('请求频道列表成功', result)
//
@ -70,14 +70,14 @@ const getChannel = async function () {
//
const consumeTypes = ref([
{ label: '发礼物', value: 1 },
{ label: '发红包', value: 2 },
{ label: '发福袋', value: 3 },
{ label: '付费直播', value: 4 },
{ label: '加入粉丝团', value: 5 },
{ label: '发弹幕', value: 6 },
{ label: '单次付费', value: 7 },
{ label: '连续包月', value: 8 }
{label: '发礼物', value: 1},
{label: '发红包', value: 2},
{label: '发福袋', value: 3},
{label: '付费直播', value: 4},
{label: '加入粉丝团', value: 5},
{label: '发弹幕', value: 6},
{label: '单次付费', value: 7},
{label: '连续包月', value: 8}
])
// //
@ -116,7 +116,6 @@ const getTime = ref({
const dept = ref([])
//
const sortField = ref('')
const sortOrder = ref('')
@ -258,7 +257,6 @@ const reset = function () {
beanConsumeFan.value.endTime = ''
sortField.value = ''
sortOrder.value = ''
getTime.value = {}
@ -312,7 +310,7 @@ const getDept = async function () {
// url: '/general/dept',
url: '/beanConsume/getDept', // todo
data: { account: adminData.value.account }
data: {account: adminData.value.account}
})
console.log('请求地区列表成功', result)
//
@ -387,7 +385,7 @@ const exportExcel = async function () {
sortOrder: sortOrder.value,
},
}
const res = await API({ url: '/export/exportFan', data: params })
const res = await API({url: '/export/exportFan', data: params})
if (res.code === 200) {
ElMessage.success('导出成功')
}
@ -408,7 +406,7 @@ const exportListLoading = ref(false)
const getExportList = async () => {
exportListLoading.value = true
try {
const result = await API({ url: '/export/export' })
const result = await API({url: '/export/export'})
if (result.code === 200) {
const filteredData = result.data.filter(item => {
return item.type === 7; //4 // todo type 7
@ -468,82 +466,99 @@ const getTagText = (state) => {
</script>
<template>
<el-card class="card1" style="margin-bottom: 1vh;">
<el-col style="margin-bottom: 10px">
<el-text>精网号</el-text>
<el-input v-model="beanConsumeFan.jwcode" placeholder="请输入精网号" style="width: 200px;margin-right: 20px"
clearable />
<el-text>地区</el-text>
<el-select v-model="beanConsumeFan.dept" placeholder="请选择地区" style="width: 200px;margin-right: 20px" clearable>
<el-option v-for="(item, index) in dept" :key="index" :label="item" :value="item" />
</el-select>
<el-text>频道</el-text>
<el-select v-model="beanConsumeFan.channel" placeholder="请选择频道" style="width: 200px" clearable filterable >
<el-option v-for="(item, index) in channels" :key="index" :label="item" :value="item" />
</el-select>
<el-card class="card1" style="margin-bottom: 0.5vh;">
<el-col style="margin-bottom: 1vh">
<div class="select">
<div class="selectRow">
<el-text class="text">精网号</el-text>
<el-input class="selectContent" v-model="beanConsumeFan.jwcode" placeholder="请输入精网号"
clearable/>
</div>
<div class="selectRow">
<el-text class="text">地区</el-text>
<el-select class="selectContent" v-model="beanConsumeFan.dept" placeholder="请选择地区"
clearable>
<el-option v-for="(item, index) in dept" :key="index" :label="item" :value="item"/>
</el-select>
</div>
<div class="selectRow">
<el-text class="text">频道</el-text>
<el-select class="selectContent" v-model="beanConsumeFan.channel" placeholder="请选择频道"
clearable filterable>
<el-option v-for="(item, index) in channels" :key="index" :label="item" :value="item"/>
</el-select>
</div>
</div>
</el-col>
<el-col>
<el-text>消费时间</el-text>
<el-date-picker v-model="getTime" type="datetimerange" range-separator="" start-placeholder="起始时间"
end-placeholder="结束时间" style="width: 400px;margin-right:20px" @change="handleDatePickerChange"
value-format="YYYY-MM-DD HH:mm:ss" :default-time="defaultTime" />
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"></el-button>
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"></el-button>
<el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''">近7天</el-button>
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" @click="exportExcel()">导出Excel</el-button>
<el-button type="primary" @click="openExportList">查看导出列表</el-button>
<div class="select">
<div class="selectRow" style="width: 36vw;">
<el-text class="text" size="large">消费时间</el-text>
<el-date-picker class="selectContent" v-model="getTime" type="datetimerange" range-separator=""
start-placeholder="起始时间"
end-placeholder="结束时间" style="margin-right:1vw;width:25vw"
@change="handleDatePickerChange"
value-format="YYYY-MM-DD HH:mm:ss" :default-time="defaultTime"/>
<div v-if="false">
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"></el-button>
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"></el-button>
<el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''">近7天</el-button>
</div>
</div>
<div class="selectRow" style="justify-content: flex-start;">
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" @click="exportExcel()">导出Excel</el-button>
<el-button type="primary" @click="openExportList">查看导出列表</el-button>
</div>
</div>
</el-col>
</el-card>
<el-card class="card2">
<div class="goldStatistics">
金豆总数{{ format3(Math.abs(permanentBean + freeBean)) }}&nbsp;&nbsp;&nbsp;&nbsp;
付费金豆数{{ format3(Math.abs(permanentBean)) }}&nbsp;&nbsp;&nbsp;&nbsp;
免费金豆数{{ format3(Math.abs(freeBean)) }}
</div>
<div style="overflow-y: auto">
<el-table :data="tableData" style="width: 82vw" height="57vh" @sort-change="handleSortChange">
<el-table-column type="index" label="序号" width="80px" fixed="left">
<template #default="scope">
<el-card class="card2">
<div class="goldStatistics">
金豆总数{{ format3(Math.abs(permanentBean + freeBean)) }}&nbsp;&nbsp;&nbsp;&nbsp;
付费金豆数{{ format3(Math.abs(permanentBean)) }}&nbsp;&nbsp;&nbsp;&nbsp;
免费金豆数{{ format3(Math.abs(freeBean)) }}
</div>
<div style="overflow-y: auto">
<el-table :data="tableData" style="width: 82vw" height="57vh" @sort-change="handleSortChange">
<el-table-column type="index" label="序号" width="80px" fixed="left">
<template #default="scope">
<span>{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
</template>
</el-table-column>
<!-- 固定姓名列 -->
<el-table-column prop="name" label="姓名" width="150px" fixed="left" show-overflow-tooltip />
<!-- 固定精网号列 -->
<el-table-column prop="jwcode" label="精网号" width="110px" fixed="left" />
<el-table-column prop="dept" label="地区" width="110px" />
<el-table-column prop="beanNum" label="金豆数量" sortable="custom" width="120px" />
<el-table-column prop="buyBean" label="付费金豆数" sortable="custom" width="120px" />
<el-table-column prop="freeBean" label="免费金豆数" sortable="custom" width="120px" />
<el-table-column prop="channel" label="频道" width="190px" show-overflow-tooltip />
<el-table-column prop="type" label="会员类型" width="120px">
<template #default="scope">
{{consumeTypes.find(item => item.value === Number(scope.row.type))?.label || '未知类型'}}
</template>
</el-table-column>
<el-table-column prop="consumeTime" label="加入时间" sortable="custom" width="180px" />
</el-table>
</div>
<!-- 分页 -->
<div class="pagination">
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
</div>
</el-card>
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
</template>
</el-table-column>
<!-- 固定姓名列 -->
<el-table-column prop="name" label="姓名" width="150px" fixed="left" show-overflow-tooltip/>
<!-- 固定精网号列 -->
<el-table-column prop="jwcode" label="精网号" width="110px" fixed="left"/>
<el-table-column prop="dept" label="地区" width="110px"/>
<el-table-column prop="beanNum" label="金豆数量" sortable="custom" width="120px"/>
<el-table-column prop="buyBean" label="付费金豆数" sortable="custom" width="120px"/>
<el-table-column prop="freeBean" label="免费金豆数" sortable="custom" width="120px"/>
<el-table-column prop="channel" label="频道" width="190px" show-overflow-tooltip/>
<el-table-column prop="type" label="会员类型" width="120px">
<template #default="scope">
{{ consumeTypes.find(item => item.value === Number(scope.row.type))?.label || '未知类型' }}
</template>
</el-table-column>
<el-table-column prop="consumeTime" label="加入时间" sortable="custom" width="180px"/>
</el-table>
</div>
<!-- 分页 -->
<div class="pagination">
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
</div>
</el-card>
<!-- 导出弹窗 -->
<el-dialog v-model="exportListVisible" title="导出列表" width="80%">
<el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading">
<el-table-column prop="fileName" label="文件名" />
<el-table-column prop="fileName" label="文件名"/>
<el-table-column prop="state" label="状态">
<template #default="scope">
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
@ -559,7 +574,7 @@ const getTagText = (state) => {
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
:disabled="scope.row.state !== 2">
:disabled="scope.row.state !== 2">
下载
</el-button>
</template>
@ -602,7 +617,7 @@ const getTagText = (state) => {
:deep(.el-table__header-wrapper),
:deep(.el-table__body-wrapper),
:deep(.el-table__cell),
/* 表格 */
/* 表格 */
:deep(.el-table__body td) {
background-color: #F3FAFE !important;
}
@ -621,4 +636,27 @@ const getTagText = (state) => {
display: flex;
margin-top: 20px;
}
/** 搜索的样式 */
.select {
display: flex;
.selectRow {
width: 17vw;
display: flex;
align-items: center;
justify-content: center;
padding: 0 0.5vw;
.text {
width: 5vw;
font-size: 15px;
}
.selectContent {
flex: 1;
}
}
}
</style>

184
src/views/consume/bean/liveStream.vue

@ -1,6 +1,6 @@
<script setup>
import { computed, onMounted, ref } from 'vue'
import { dayjs, ElMessage } from 'element-plus'
import {computed, onMounted, ref} from 'vue'
import {dayjs, ElMessage} from 'element-plus'
import request from '@/util/http.js'
import API from '@/util/http.js'
import moment from 'moment'
@ -49,7 +49,7 @@ const getGift = async function () {
try {
const result = await request({
url: '/beanConsume/getLiveGift', // todo
data: { account: adminData.value.account }
data: {account: adminData.value.account}
})
console.log('请求礼物列表成功', result)
//
@ -71,7 +71,7 @@ const getChannel = async function () {
try {
const result = await request({
url: '/beanConsume/getLiveChannel', // todo
data: { account: adminData.value.account }
data: {account: adminData.value.account}
})
console.log('请求频道列表成功', result)
//
@ -88,12 +88,12 @@ const getChannel = async function () {
//
const consumeTypes = ref([
{ label: '发礼物', value: 1 },
{ label: '发红包', value: 2 },
{ label: '发福袋', value: 3 },
{ label: '付费直播', value: 4 },
{ label: '加入粉丝团', value: 5 },
{ label: '发弹幕', value: 6 }
{label: '发礼物', value: 1},
{label: '发红包', value: 2},
{label: '发福袋', value: 3},
{label: '付费直播', value: 4},
{label: '加入粉丝团', value: 5},
{label: '发弹幕', value: 6}
])
//
const handleTypeChange = (value) => {
@ -136,7 +136,7 @@ const getDept = async function () {
// url: '/general/dept',
url: '/beanConsume/getDept', // todo
data: { account: adminData.value.account }
data: {account: adminData.value.account}
})
console.log('请求地区列表成功', result)
//
@ -260,7 +260,6 @@ const selectLiveBy = async function (val) {
totalNum.value = Number(data.totalNum) || 0;
//
total.value = result.data.total
console.log('total', total.value)
@ -337,8 +336,6 @@ const get7Days = function () {
}
//
const handleSortChange = (column) => {
console.log('排序字段:', column.prop)
@ -413,7 +410,7 @@ const exportExcel = async function () {
try {
console.log('2')
const res = await API({ url: '/export/exportLive', data: params });
const res = await API({url: '/export/exportLive', data: params});
console.log('导出请求响应:', res);
if (res.code === 200) {
ElMessage.success('导出成功');
@ -442,7 +439,7 @@ const exportListLoading = ref(false)
const getExportList = async () => {
exportListLoading.value = true
try {
const result = await API({ url: '/export/export' })
const result = await API({url: '/export/export'})
if (result.code === 200) {
const filteredData = result.data.filter(item => {
return item.type === 6; //4 // todo type 6
@ -502,53 +499,64 @@ const getTagText = (state) => {
</script>
<template>
<el-card class="card1" style="margin-bottom: 1vh;">
<div style="margin-bottom: 1vh;display: flex;">
<div style="width: 18vw;margin-right: 1vw;display: flex;align-items: center;">
<el-text>精网号</el-text>
<el-input v-model="beanConsumeLive.jwcode" style="width:10vw;" placeholder="请输入精网号" clearable />
</div>
<div style="margin-bottom: 1vh;width:18vw;display: flex;align-items: center;">
<el-text>地区</el-text>
<el-select v-model="beanConsumeLive.dept" placeholder="请选择地区" style="width:10vw" clearable>
<el-option v-for="(item, index) in dept" :key="index" :label="item" :value="item" />
</el-select>
</div>
<div style="margin-bottom: 1vh;width:18vw;display: flex;align-items: center;">
<el-text>礼物名称</el-text>
<el-select v-model="beanConsumeLive.gift" placeholder="请选择礼物名称" style="width:10vw"
clearable filterable allow-create default-first-option>
<el-option v-for="(item, index) in gifts" :key="index" :label="item" :value="item" />
</el-select>
<el-card class="card1" style="margin-bottom: 0.5vh;">
<el-col style="margin-bottom: 1vh">
<div class="select">
<div class="selectRow">
<el-text class="text">精网号</el-text>
<el-input class="selectContent" v-model="beanConsumeLive.jwcode" placeholder="请输入精网号" clearable/>
</div>
<div class="selectRow">
<el-text class="text">地区</el-text>
<el-select class="selectContent" v-model="beanConsumeLive.dept" placeholder="请选择地区" clearable>
<el-option v-for="(item, index) in dept" :key="index" :label="item" :value="item"/>
</el-select>
</div>
<div class="selectRow">
<el-text class="text">礼物名称</el-text>
<el-select class="selectContent" v-model="beanConsumeLive.gift" placeholder="请选择礼物名称"
clearable filterable allow-create default-first-option>
<el-option v-for="(item, index) in gifts" :key="index" :label="item" :value="item"/>
</el-select>
</div>
<div class="selectRow">
<el-text class="text">频道</el-text>
<el-select class="selectContent" v-model="beanConsumeLive.liveChannel" placeholder="请选择频道"
clearable filterable allow-create default-first-option>
<el-option v-for="(item, index) in channels" :key="index" :label="item" :value="item"/>
</el-select>
</div>
<div class="selectRow">
<el-text class="text">直播间</el-text>
<el-input class="selectContent" v-model="beanConsumeLive.liveName" placeholder="请输入直播间"
clearable/>
</div>
</div>
<div style="margin-bottom: 1vh;width:18vw;display: flex;align-items: center;">
<el-text>频道</el-text>
<el-select v-model="beanConsumeLive.liveChannel" placeholder="请选择频道" style="width:10vw"
clearable filterable allow-create default-first-option>
<el-option v-for="(item, index) in channels" :key="index" :label="item" :value="item" />
</el-select>
</el-col>
<el-col>
<div class="select">
<div class="selectRow" style="width: 31.5vw;">
<el-text class="text">消费时间</el-text>
<el-date-picker class="selectContent" v-model="getTime" type="datetimerange" range-separator=""
start-placeholder="起始时间"
end-placeholder="结束时间" style="margin-right:1vw;width:480px"
@change="handleDatePickerChange"
:default-time="defaultTime"/>
<div v-if="false">
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"> </el-button>
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"> </el-button>
<el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''"> 近7天</el-button>
</div>
</div>
<div class="selectRow" style="justify-content: flex-start;">
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" @click="exportExcel()">导出excel</el-button>
<el-button type="primary" @click="openExportList">查看导出列表</el-button>
</div>
</div>
<div style="margin-bottom: 1vh;width:18vw;display: flex;align-items: center;">
<el-text>直播间</el-text>
<el-input v-model="beanConsumeLive.liveName" placeholder="请输入直播间" style="width:10vw"
clearable />
</div>
</div>
<div>
<el-text>消费时间</el-text>
<el-date-picker v-model="getTime" type="datetimerange" range-separator="" start-placeholder="起始时间"
end-placeholder="结束时间" style="width: 20vw;margin-right: 1vw;" @change="handleDatePickerChange"
:default-time="defaultTime" />
<el-button @click="getToday()" :type="activeTimeRange === 'today' ? 'primary' : ''"> </el-button>
<el-button @click="getYesterday()" :type="activeTimeRange === 'yesterday' ? 'primary' : ''"> </el-button>
<el-button @click="get7Days()" :type="activeTimeRange === '7days' ? 'primary' : ''"> 近7天</el-button>
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" @click="exportExcel()">导出excel</el-button>
<el-button type="primary" @click="openExportList">查看导出列表</el-button>
</div>
</el-col>
</el-card>
<el-card class="card2">
<div class="goldStatistics">
@ -561,39 +569,39 @@ const getTagText = (state) => {
<el-table-column type="index" label="序号" width="80px" fixed="left">
<template #default="scope">
<span>{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
</template>
</el-table-column>
<!-- 固定姓名列 -->
<el-table-column prop="name" label="姓名" width="150px" fixed="left" show-overflow-tooltip />
<el-table-column prop="name" label="姓名" width="150px" fixed="left" show-overflow-tooltip/>
<!-- 固定精网号列 -->
<el-table-column prop="jwcode" label="精网号" width="110px" fixed="left" />
<el-table-column prop="dept" label="地区" width="110px" />
<el-table-column prop="jwcode" label="精网号" width="110px" fixed="left"/>
<el-table-column prop="dept" label="地区" width="110px"/>
<el-table-column prop="gift" label="礼物" width="140px">
</el-table-column>
<el-table-column prop="beanNum" label="金豆数量" sortable="custom" width="120px" />
<el-table-column prop="beanNum" label="金豆数量" sortable="custom" width="120px"/>
<el-table-column prop="isBackpack" label="背包礼物" width="120px">
<template #default="scope">
{{ scope.row.isBackpack == 1 ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column prop="buyBean" label="付费金豆数" sortable="custom" width="120px" />
<el-table-column prop="freeBean" label="免费金豆数" sortable="custom" width="120px" />
<el-table-column prop="liveChannel" label="频道" width="120px" show-overflow-tooltip />
<el-table-column prop="liveName" label="直播间名称" width="160px" show-overflow-tooltip />
<el-table-column prop="consumeTime" label="消费时间" sortable="custom" width="180px" />
<el-table-column prop="buyBean" label="付费金豆数" sortable="custom" width="120px"/>
<el-table-column prop="freeBean" label="免费金豆数" sortable="custom" width="120px"/>
<el-table-column prop="liveChannel" label="频道" width="120px" show-overflow-tooltip/>
<el-table-column prop="liveName" label="直播间名称" width="160px" show-overflow-tooltip/>
<el-table-column prop="consumeTime" label="消费时间" sortable="custom" width="180px"/>
</el-table>
</div>
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]" style="margin-top: 20px;"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
</el-card>
<!-- 导出弹窗 -->
<el-dialog v-model="exportListVisible" title="导出列表" width="80%">
<el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading">
<el-table-column prop="fileName" label="文件名" />
<el-table-column prop="fileName" label="文件名"/>
<el-table-column prop="state" label="状态">
<template #default="scope">
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
@ -609,7 +617,7 @@ const getTagText = (state) => {
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
:disabled="scope.row.state !== 2">
:disabled="scope.row.state !== 2">
下载
</el-button>
</template>
@ -652,7 +660,7 @@ const getTagText = (state) => {
:deep(.el-table__header-wrapper),
:deep(.el-table__body-wrapper),
:deep(.el-table__cell),
/* 表格 */
/* 表格 */
:deep(.el-table__body td) {
background-color: #F3FAFE !important;
}
@ -671,4 +679,26 @@ const getTagText = (state) => {
display: flex;
margin-top: 20px;
}
/** 搜索的样式 */
.select {
display: flex;
.selectRow {
width: 17vw;
display: flex;
align-items: center;
justify-content: center;
padding: 0 0.5vw;
.text {
width: 5vw;
font-size: 15px;
}
.selectContent {
flex: 1;
}
}
}
</style>

22
src/views/consume/gold/coinConsume.vue

@ -1,13 +1,23 @@
<template>
<div style="height:4vh;width:82vw;">
<el-button-group class="custom-button-group">
<el-button :type="activeTab === 'coinConsumeDetail' ? 'primary' : 'default'" class="custom-tab-button"
@click="navigateTo('coinConsumeDetail')" v-if="hasDetail">
<div class="fatherTop">
<el-button-group>
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'coinConsumeDetail' }"
@click="navigateTo('coinConsumeDetail')"
v-if="hasDetail"
>
金币消耗明细
</el-button>
<el-button :type="activeTab === 'addCoinConsume' ? 'primary' : 'default'" class="custom-tab-button"
@click="navigateTo('addCoinConsume')" v-if="hasAdd">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'addCoinConsume' }"
@click="navigateTo('addCoinConsume')"
v-if="hasAdd"
>
新增消耗
</el-button>
</el-button-group>

184
src/views/consume/gold/coinConsumeDetail.vue

@ -1,10 +1,10 @@
<script setup>
import { computed, onMounted, ref } from 'vue'
import { dayjs, ElMessage } from 'element-plus'
import {computed, onMounted, ref} from 'vue'
import {dayjs, ElMessage} from 'element-plus'
import request from '@/util/http.js'
import API from '@/util/http.js'
import moment from 'moment'
import { reverseMarketMapping } from "@/utils/marketMap.js";
import {reverseMarketMapping} from "@/utils/marketMap.js";
//
/*
@ -219,7 +219,7 @@ const ConsumeSelectBy = async function (val) {
//
// detail.value
const detailWithoutSort = { ...consumeUser.value, flag: showEmployeeData.value ? 0 : 1 }
const detailWithoutSort = {...consumeUser.value, flag: showEmployeeData.value ? 0 : 1}
delete detailWithoutSort.sortField
delete detailWithoutSort.sortOrder
@ -434,7 +434,7 @@ const exportExcel = async function () {
}
}
const res = await API({ url: '/export/exportConsume', data: params })
const res = await API({url: '/export/exportConsume', data: params})
if (res.code === 200) {
ElMessage.success('导出成功')
}
@ -455,7 +455,7 @@ const exportListLoading = ref(false)
const getExportList = async () => {
exportListLoading.value = true
try {
const result = await API({ url: '/export/export' })
const result = await API({url: '/export/export'})
if (result.code === 200) {
const filteredData = result.data.filter(item => {
return item.type === 4; //4
@ -541,8 +541,8 @@ const getMarket = async function () {
return allChildren.map(child => {
const grandchildren = child.children && child.children.length
? transformTree([child]) //
: null;
? transformTree([child]) //
: null;
return {
value: child.name,
@ -563,47 +563,77 @@ const getMarket = async function () {
<template>
<el-card class="card1" style="margin-bottom: 0.5vh;">
<div style="width:82vw;margin-bottom: 1vh;">
<el-text>精网号</el-text>
<el-input v-model="consumeUser.jwcode" placeholder="请输入精网号" style="width: 10vw;margin-right: 1vw;" clearable />
<el-text size="large">商品名称</el-text>
<el-select v-model="consumeUser.goodsName" placeholder="请选择商品名称" style="width: 10vw;margin-right: 1vw;" clearable
filterable>
<el-option v-for="(item, index) in goods" :key="index" :label="item.label" :value="item" />
</el-select>
<el-text size="large">所属地区</el-text>
<el-cascader v-model="selectedMarketPath" :options="market" placeholder="请选择所属地区" clearable
style="width: 10vw;margin-right: 1vw;" @change="handleMarketChange" />
<el-text size="large">消耗平台</el-text>
<el-select v-model="consumeUser.payPlatform" placeholder="请选择消耗平台" style="width: 10vw;margin-right: 1vw;"
clearable>
<el-option v-for="item in consumePlatform" :key="item.id" :label="item.label" :value="item.value" />
</el-select>
<el-checkbox v-model="showEmployeeData" @change="search()">员工数据</el-checkbox>
</div>
<div>
<el-text size="large">消耗时间</el-text>
<el-date-picker v-model="getTime" type="datetimerange" range-separator="" start-placeholder="起始时间"
end-placeholder="结束时间" style="width: 20vw" @change="handleDatePickerChange" :default-time="defaultTime"
:disabled-date="disabledDate" />
<el-button @click="getToday()" style="margin-left: 1vw" :type="activeTimeRange === 'today' ? 'primary' : ''">
</el-button>
<el-button @click="getYesterday()" style="margin-left: 1vw"
:type="activeTimeRange === 'yesterday' ? 'primary' : ''">
</el-button>
<el-button @click="get7Days()" style="margin-left: 1vw" :type="activeTimeRange === '7days' ? 'primary' : ''">
近7天
</el-button>
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" @click="exportExcel()">导出excel</el-button>
<el-button type="primary" @click="openExportList">查看导出列表</el-button>
</div>
<el-col style="margin-bottom: 1vh">
<div class="select">
<div class="selectRow">
<el-text class="text">精网号</el-text>
<el-input class="selectContent" v-model="consumeUser.jwcode" placeholder="请输入精网号"
clearable/>
</div>
<div class="selectRow">
<el-text class="text" size="large">商品名称</el-text>
<el-select class="selectContent" v-model="consumeUser.goodsName" placeholder="请选择商品名称"
clearable
filterable>
<el-option v-for="(item, index) in goods" :key="index" :label="item.label" :value="item"/>
</el-select>
</div>
<div class="selectRow">
<el-text class="text" size="large">所属地区</el-text>
<el-cascader class="selectContent" v-model="selectedMarketPath" :options="market" placeholder="请选择所属地区"
clearable
@change="handleMarketChange"/>
</div>
<div class="selectRow">
<el-text size="large">消耗平台</el-text>
<el-select class="selectContent" v-model="consumeUser.payPlatform" placeholder="请选择消耗平台"
clearable>
<el-option v-for="item in consumePlatform" :key="item.id" :label="item.label" :value="item.value"/>
</el-select>
</div>
<el-checkbox v-model="showEmployeeData" @change="search()">员工数据</el-checkbox>
</div>
</el-col>
<el-col>
<div class="select">
<div class="selectRow" style="width: 36vw;">
<el-text class="text" size="large">消耗时间</el-text>
<el-date-picker class="selectContent" v-model="getTime" type="datetimerange" range-separator=""
start-placeholder="起始时间"
end-placeholder="结束时间"
style="margin-right:1vw;width:25vw"
@change="handleDatePickerChange"
:default-time="defaultTime"
:disabled-date="disabledDate"/>
<div v-if="false">
<el-button @click="getToday()" style="margin-left: 1vw"
:type="activeTimeRange === 'today' ? 'primary' : ''">
</el-button>
<el-button @click="getYesterday()" style="margin-left: 1vw"
:type="activeTimeRange === 'yesterday' ? 'primary' : ''">
</el-button>
<el-button @click="get7Days()" style="margin-left: 1vw"
:type="activeTimeRange === '7days' ? 'primary' : ''">
近7天
</el-button>
</div>
</div>
<div class="selectRow" style="justify-content: flex-start;">
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" @click="exportExcel()">导出excel</el-button>
<el-button type="primary" @click="openExportList">查看导出列表</el-button>
</div>
</div>
</el-col>
</el-card>
<el-card class="card2">
<div class="goldStatistics">
@ -618,16 +648,16 @@ const getMarket = async function () {
<el-table-column type="index" label="序号" width="80px" fixed="left">
<template #default="scope">
<span>{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
</template>
</el-table-column>
<el-table-column prop="name" label="姓名" width="150px" fixed="left" show-overflow-tooltip />
<el-table-column prop="jwcode" label="精网号" width="110px" fixed="left" />
<el-table-column prop="market" label="所属地区" width="110px" />
<el-table-column prop="orderCode" label="订单号" width="260px" show-overflow-tooltip />
<el-table-column prop="name" label="姓名" width="150px" fixed="left" show-overflow-tooltip/>
<el-table-column prop="jwcode" label="精网号" width="110px" fixed="left"/>
<el-table-column prop="market" label="所属地区" width="110px"/>
<el-table-column prop="orderCode" label="订单号" width="260px" show-overflow-tooltip/>
<el-table-column prop="goodsName" label="商品名称" width="160px" show-overflow-tooltip />
<el-table-column prop="goodsName" label="商品名称" width="160px" show-overflow-tooltip/>
<el-table-column prop="payPlatform" label="消耗平台" width="120px">
<template #default="scope">
{{ scope.row.payPlatform }}
@ -637,8 +667,8 @@ const getMarket = async function () {
<template #default="scope">
{{
(scope.row.taskGold +
scope.row.freeGold +
scope.row.permanentGold)
scope.row.freeGold +
scope.row.permanentGold)
}}
</template>
</el-table-column>
@ -659,7 +689,7 @@ const getMarket = async function () {
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" width="200px" show-overflow-tooltip />
<el-table-column prop="remark" label="备注" width="200px" show-overflow-tooltip/>
<el-table-column prop="isRefund" label="订单状态" width="200px" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.isRefund == 0">正常</span>
@ -667,23 +697,23 @@ const getMarket = async function () {
<span v-else>未知状态</span>
</template>
</el-table-column>
<el-table-column prop="adminName" label="提交人" width="110px" />
<el-table-column prop="createTime" label="消耗时间" sortable="custom" width="180px" />
<el-table-column prop="adminName" label="提交人" width="110px"/>
<el-table-column prop="createTime" label="消耗时间" sortable="custom" width="180px"/>
</el-table>
</div>
<!-- 分页 -->
<div class="pagination">
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
</div>
</el-card>
<!-- 导出弹窗 -->
<el-dialog v-model="exportListVisible" title="导出列表" width="80%">
<el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading">
<el-table-column prop="fileName" label="文件名" />
<el-table-column prop="fileName" label="文件名"/>
<el-table-column prop="state" label="状态">
<template #default="scope">
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
@ -699,7 +729,7 @@ const getMarket = async function () {
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
:disabled="scope.row.state !== 2">
:disabled="scope.row.state !== 2">
下载
</el-button>
</template>
@ -736,7 +766,6 @@ const getMarket = async function () {
}
//
.card1 {
background: #F3FAFE;
@ -763,7 +792,7 @@ const getMarket = async function () {
:deep(.el-table__header-wrapper),
:deep(.el-table__body-wrapper),
:deep(.el-table__cell),
/* 表格 */
/* 表格 */
:deep(.el-table__body td) {
background-color: #F3FAFE !important;
}
@ -778,4 +807,25 @@ const getMarket = async function () {
background-color: #E5EBFE !important;
}
/** 搜索的样式 */
.select {
display: flex;
.selectRow {
width: 17vw;
display: flex;
align-items: center;
justify-content: center;
padding: 0 0.5vw;
.text {
width: 5vw;
font-size: 15px;
}
.selectContent {
flex: 1;
}
}
}
</style>

32
src/views/managerecharge/rate.vue

@ -252,7 +252,7 @@ onMounted(async function () {
</script>
<template>
<el-card class="card1" style="width:82vw;height:85vh" v-if="hasrateShow">
<el-card class="card2" style="width:82vw;height:85vh" v-if="hasrateShow">
<el-table :data="tableData" v-if="(tableData.flag = 1)">
<el-table-column type="index" label="序号" width="100px" fixed="left">
<template #default="scope">
@ -277,11 +277,11 @@ onMounted(async function () {
</el-table-column>
<el-table-column v-if="hasrateEdit" label="操作" :span="3">
<template #default="scope">
<el-button type="text" @click="() => {
<el-link :underline="false" class="edit-btn" @click="() => {
regeEdit = true
getEditData(scope.row)
}">编辑
</el-button>
</el-link>
</template>
</el-table-column>
</el-table>
@ -367,4 +367,30 @@ onMounted(async function () {
.rate-tip {
hyphens: auto;
}
/**表单的卡片样式**/
.card2 {
background: #E7F4FD;
}
/**表头背景等**/
:deep(.el-table__header-wrapper),
:deep(.el-table__body-wrapper),
:deep(.el-table__cell),
/* 表格 */
:deep(.el-table__body td) {
background-color: #F3FAFE !important;
}
/* 表头 */
:deep(.el-table__header th) {
background-color: #F3FAFE !important;
}
/* 鼠标悬停 */
:deep(.el-table__row:hover > .el-table__cell) {
background-color: #E5EBFE !important;
}
</style>

581
src/views/moneyManage/receiveDetail/receiveDetail.vue

@ -96,19 +96,21 @@
<el-table-column prop="market" label="所属地区" width="80px" />
<el-table-column prop="activity" label="活动名称" width="120px" />
<el-table-column prop="rateName" label="产品名称" width="120px" />
<el-table-column prop="money" label="付款币种" width="100px">
<el-table-column prop="rateNum" label="产品数量" width="120px" />
<el-table-column prop="moneyType" label="付款币种" width="100px">
</el-table-column>
<el-table-column prop="permanentGold" label="付款金额" width="120px">
</el-table-column>
<el-table-column prop="moneyType" label="到账币种" v-if="caiwu && activeTab == 'pass'" width="150px" ></el-table-column>
<el-table-column prop="getMoney" label="到账金额" v-if="caiwu && activeTab == 'pass'" width="150px" >
<el-table-column prop="getMoneyType" label="到账币种" v-if="caiwu && activeTab == 'pass'"
width="150px"></el-table-column>
<el-table-column prop="getMoney" label="到账金额" v-if="caiwu && activeTab == 'pass'" width="150px">
<template #default="scope">
<div v-if="!scope.row.getMoney">
<text style="color: #FA5A1E;">待补充</text>
</div>
</template>
</el-table-column>
<el-table-column prop="shouxufei" label="手续费" v-if="caiwu && activeTab == 'pass'" width="150px" >
<el-table-column prop="shouxufei" label="手续费" v-if="caiwu && activeTab == 'pass'" width="150px">
<template #default="scope">
<div v-if="!scope.row.shouxufei">
<text style="color: #FA5A1E;">待补充</text>
@ -127,24 +129,51 @@
</div>
<div v-else
style="display: flex; justify-content: center; align-items: center; height: 40px;">
--
</div>
</template>
</el-table-column>
<el-table-column prop="bankOrder" label="银行流水订单号" v-if="caiwu && activeTab == 'pass'" width="150px" show-overflow-tooltip></el-table-column>
<el-table-column prop="submiter" label="提交人" width="150px" show-overflow-tooltip></el-table-column>
<el-table-column prop="auditor" label="审核人" v-if="caiwu && activeTab == 'pass'" width="150px" show-overflow-tooltip></el-table-column>
<el-table-column prop="mask" label="备注" width="150px" show-overflow-tooltip></el-table-column>
<el-table-column prop="getMoneyTime" label="到账时间" v-if="caiwu && activeTab == 'pass'" width="150px" show-overflow-tooltip>
<el-table-column prop="bankOrder" label="银行流水订单号" v-if="caiwu && activeTab == 'pass'"
width="150px" show-overflow-tooltip></el-table-column>
<el-table-column prop="submiter" label="提交人" width="150px"
show-overflow-tooltip></el-table-column>
<el-table-column prop="auditor" label="审核人" v-if="caiwu && activeTab == 'pass' || 'reject'"
width="150px" show-overflow-tooltip></el-table-column>
<el-table-column prop="mask" label="备注" v-if="activeTab != 'reject'" width="150px"
show-overflow-tooltip></el-table-column>
<el-table-column prop="rejectTime" label="驳回时间" v-if="activeTab == 'reject' && !kefu"
width="150px" show-overflow-tooltip></el-table-column>
<el-table-column prop="rejectReason" label="驳回理由" v-if="activeTab == 'reject' && !kefu"
width="150px">
<template #default="scope">
<div class="ellipsis-container"
@mouseenter="handleMouseEnter($event, scope.row.rejectReason)"
@mouseleave="handleMouseLeave" @mousemove="handleMouseMove($event)">
<span class="ellipsis-text">
{{ scope.row.rejectReason || '—' }}
</span>
<!-- 自定义提示框 -->
<div v-if="showTooltip && tooltipContent" class="custom-tooltip" :style="{
left: `${tooltipLeft}px`,
top: `${tooltipTop}px`
}">
{{ tooltipContent }}
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="getMoneyTime" label="到账时间" v-if="caiwu && activeTab == 'pass'"
width="150px">
</el-table-column>
<el-table-column v-if="kefu" fixed="right" prop="orderStatus" label="订单状态" width="100px" />
<el-table-column fixed="right" label="操作" width="100px" v-if="activeTab != 'reject'">
<template #default=scope>
<span v-if="kefu && scope.row.orderStatus == '已通过'" style="color: #FA5A1E;">退款</span>
<span v-else-if="kefu && scope.row.orderStatus == '已撤回'"
style="color: #2741DE;">编辑</span>
<span v-else-if="kefu && scope.row.orderStatus == '待审核'"
style="color: #FA5A1E;">撤回</span>
<span v-if="kefu && scope.row.orderStatus == '已通过'" style="color: #FA5A1E;" @click="openRecall('refund')">退款</span>
<span v-else-if="kefu && scope.row.orderStatus == '已撤回'" style="color: #2741DE;"
@click="openAddForm(scope.row)">编辑</span>
<span v-else-if="kefu && scope.row.orderStatus == '待审核'" style="color: #FA5A1E;"
@click="openRecall('recall')">撤回</span>
<span v-else-if="activeTab == 'wait' && !kefu" style="color: #2741DE;"
@click="openAuditForm">审核</span>
<span v-else-if="activeTab == 'pass' && !kefu" style="color: #2741DE;"
@ -161,10 +190,24 @@
</div>
</el-card>
</div>
<div class="recallDialog" v-show="recallDialog">
<div class="close">
<button @click="closeRecall" class="Btn">关闭</button>
</div>
<div class="text">
<text class="txt">{{ textContent }}</text>
</div>
<div class="cancle">
<button @click="closeRecall" class="Btn">取消</button>
</div>
<div class="confirm">
<button class="Btn">确定</button>
</div>
</div>
<el-dialog class="adddialog" v-model="addFormisible" width="20vw" :before-close="closeAddForm">
<el-form class="addForm" label-width="4vw" label-position="left">
<el-form-item label="精网号" required>
<el-input v-model="addFormData.jwcode" placeholder="请输入驳回理由" />
<el-input v-model="addFormData.jwcode" placeholder="请输入精网号" />
</el-form-item>
<el-form-item label="客户姓名" required>
<el-input v-model="addFormData.userName" placeholder="请输入客户姓名" />
@ -176,10 +219,19 @@
<el-input v-model="addFormData.jwcode" placeholder="请输入活动名称" />
</el-form-item>
<el-form-item label="产品名称" required>
<el-select placeholder="请选择产品名称" clearable></el-select>
<el-select placeholder="请选择产品名称" v-model="addFormData.rateName" clearable>
</el-select>
</el-form-item>
<el-form-item label="产品数量" required>
<div style="padding-right: 50px; display: flex;">
<el-input style="padding-right: 10px;" v-model="addFormData.rateNum" placeholder="请输入产品数量" />
<span style="color: #999999;"></span>
</div>
</el-form-item>
<el-form-item label="付款币种" required>
<el-select placeholder="请选择付款币种" clearable></el-select>
<el-select placeholder="请选择付款币种" v-model="addFormData.moneyType" clearable>
<el-option v-for="item in payModel" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="付款金额" required>
<el-input v-model="addFormData.jwcode" placeholder="请输入付款金额" />
@ -188,18 +240,21 @@
<el-select placeholder="请选择支付方式" clearable></el-select>
</el-form-item>
<el-form-item label="付款时间" required>
<el-time-picker v-model="addFormData.time" placeholder="请选择付款时间" />
<el-date-picker type="datetime" placement="right" v-model="addFormData.time"
placeholder="请选择付款时间" />
</el-form-item>
<el-form-item label="转账凭证" required>
<el-upload ref="uploadRef" class="uploader" :show-file-list="false" list-type="picture-card"
:auto-upload="false" :before-upload="beforeUpload" :on-error="handelImgErr"
:on-change="handleImageChange" :http-request="customUpload">
<img v-if="addFormData.imageUrl" :src="addFormData.imageUrl" class="avatar"
style="height: 100%; width: 100%; object-fit: cover;" />
<el-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
</el-upload>
<div class="pic">
<el-upload ref="uploadRef" class="uploader" :show-file-list="false" list-type="picture-card"
:auto-upload="false" :before-upload="beforeUpload" :on-error="handelImgErr"
:on-change="handleImageChange" :http-request="customUpload">
<img v-if="addFormData.imageUrl" :src="addFormData.imageUrl" class="avatar"
style="height: 100%; width: 100%; object-fit: cover;" />
<el-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
</el-upload>
</div>
</el-form-item>
<el-form-item label="备注" required>
<el-input v-model="addFormData.mask" type="textarea" :rows="4" placeholder="请输入备注" maxlength="100"
@ -233,7 +288,9 @@
<el-select placeholder="请选择产品名称" clearable></el-select>
</el-form-item>
<el-form-item label="付款币种">
<el-select placeholder="请选择付款币种" clearable></el-select>
<el-select placeholder="请选择付款币种" v-model="auditFormData.moneyType" clearable>
<el-option v-for="item in payModel" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="付款金额">
<el-input v-model="auditFormData.jwcode" placeholder="请输入付款金额" />
@ -242,7 +299,7 @@
<el-select placeholder="请选择支付方式" clearable></el-select>
</el-form-item>
<el-form-item label="付款时间">
<el-time-picker v-model="auditFormData.time" placeholder="请选择付款时间" />
<el-date-picker type="datetime" v-model="auditFormData.time" placeholder="请选择付款时间" />
</el-form-item>
<el-form-item label="转账凭证">
<div class="pic">
@ -306,7 +363,10 @@
<el-select placeholder="请选择产品名称" clearable></el-select>
</el-form-item>
<el-form-item label="付款币种">
<el-select placeholder="请选择付款币种" clearable></el-select>
<el-select placeholder="请选择付款币种" clearable>
<el-option v-for="item in payModel" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="付款金额">
<el-input v-model="editFormData.jwcode" placeholder="请输入付款金额" />
@ -315,7 +375,7 @@
<el-select placeholder="请选择支付方式" clearable></el-select>
</el-form-item>
<el-form-item label="付款时间">
<el-time-picker v-model="editFormData.time" placeholder="请选择付款时间" />
<el-date-picker type="datetime" v-model="editFormData.time" placeholder="请选择付款时间" />
</el-form-item>
<el-form-item label="转账凭证">
<div class="pic">
@ -359,12 +419,12 @@
</el-form-item>
</el-form>
<span class="editBtns">
<button class="editBtn1">
<button class="editBtn1" @click="closeEditForm">
<text class="txt">
取消
</text>
</button>
<button class="editBtn2">
<button class="editBtn2" @click="submitEditForm">
<text class="txt">
提交
</text>
@ -414,14 +474,35 @@ const addFormisible = ref(false)
const uploadRef = ref()
const openAddForm = () => {
const openAddForm = (row) => {
if (row) {
addFormData.value = row
}
addFormisible.value = true
}
const closeAddForm = () => {
addFormisible.value = false
addFormData.value = {}
}
//
const textContent = ref('')
const recallDialog = ref(false)
const openRecall = (val) => {
console.log('打开弹窗',val);
if(val == 'refund'){
textContent.value = '将要对该订单退款!'
}
if(val == 'recall'){
textContent.value = '将要撤回该信息!'
}
recallDialog.value = true
}
const closeRecall = () => {
recallDialog.value = false
textContent.value = ''
}
//
const handleImgSuccess = (response, uploadFile) => {
try {
console.log('11', response)
@ -484,7 +565,7 @@ const editFormData = ref({
})
const editFormisible = ref(false)
const openEditForm = (row) => {
console.log('编辑时该行数据:',row);
console.log('编辑时该行数据:', row);
editFormData.value = row
editFormisible.value = true
}
@ -492,6 +573,10 @@ const closeEditForm = () => {
editFormisible.value = false
editFormData.value = {}
}
//
const submitEditForm = () => {
}
//================== =========================
const auditFormData = ref({
@ -536,130 +621,192 @@ const pageInfo = ref({
pageSize: 10,
pageNum: 1
})
const total = ref(0)
// ============ ===========================
//
const showTooltip = ref(false);
const tooltipContent = ref('');
const tooltipLeft = ref(0);
const tooltipTop = ref(0);
const tooltipWidth = 200;
//
const handleMouseEnter = (e, content) => {
if (content) {
showTooltip.value = true;
tooltipContent.value = content;
handleMouseMove(e);
}
};
//
const handleMouseLeave = () => {
showTooltip.value = false;
tooltipContent.value = '';
};
//
const handleMouseMove = (e) => {
// X - -
tooltipLeft.value = e.clientX - tooltipWidth - 10;
// Y
tooltipTop.value = e.clientY - 10;
};
const tableData = [
{
"jwcode": "HM2024001",
"name": "张三",
"market": "华东区",
"activity": "2024春季促销活动",
"rateName": "年度会员套餐A",
"money": "人民币",
"permanentGold": 2980.00,
"moneyType": "人民币",
"getMoney": 2980.00,
"shouxufei": 59.60,
"pastType": "支付宝转账",
"remark": "2024-05-10 09:23",
"voucher": "https://example.com/voucher/1.jpg",
"payModel": "https://example.com/icon/alipay.png",
"bankOrder": "ALIPAY2024051000001",
"submiter": "李四(运营部)",
"auditor": "王五(财务部)",
"mask": "客户主动购买,无特殊备注",
"getMoneyTime": "2024-05-10 10:05",
"orderStatus": "已通过"
},
{
"jwcode": "HM2024002",
"name": "李四",
"market": "华北区",
"activity": "新客首单优惠",
"rateName": "季度体验套餐B",
"money": "美元",
"permanentGold": 99.00,
"moneyType": "人民币",
"getMoney": 712.00,
"shouxufei": 14.24,
"pastType": "PayPal",
"remark": "2024-05-11 14:56",
"voucher": "https://example.com/voucher/2.jpg",
"payModel": "https://example.com/icon/paypal.png",
"bankOrder": "PAYPAL2024051100002",
"submiter": "赵六(国际部)",
"auditor": "孙七(财务部)",
"mask": "跨境支付,汇率按当日中间价计算",
"getMoneyTime": "2024-05-12 08:30",
"orderStatus": "待审核"
},
{
"jwcode": "HM2024003",
"name": "王五",
"market": "华南区",
"activity": "老客召回活动",
"rateName": "月度续费套餐C",
"money": "人民币",
"permanentGold": 399.00,
"moneyType": "人民币",
"getMoney": null,
"shouxufei": null,
"pastType": "微信支付",
"remark": "2024-05-12 11:18",
"voucher": "https://example.com/voucher/3.jpg",
"payModel": "https://example.com/icon/wechat.png",
"bankOrder": "WECHAT2024051200003",
"submiter": "钱八(客服部)",
"auditor": null,
"mask": "到账信息待财务补充",
"getMoneyTime": null,
"orderStatus": "已撤回"
},
{
"jwcode": "HM2024004",
"name": "赵六",
"market": "西区",
"activity": "企业团购活动",
"rateName": "企业定制套餐D",
"money": "人民币",
"permanentGold": 15800.00,
"moneyType": "人民币",
"getMoney": 15800.00,
"shouxufei": 316.00,
"pastType": "银行对公转账",
"remark": "2024-05-13 09:45",
"voucher": "https://example.com/voucher/4.jpg",
"payModel": "https://example.com/icon/bank.png",
"bankOrder": "BANK2024051300004",
"submiter": "周九(销售部)",
"auditor": "吴十(财务部)",
"mask": "10人企业团单,享受95折优惠",
"getMoneyTime": "2024-05-13 11:20",
"orderStatus": "已通过"
},
{
"jwcode": "HM2024005",
"name": "孙七",
"market": "东北区",
"activity": "节日特惠活动",
"rateName": "年度会员套餐A",
"money": "人民币",
"permanentGold": 2780.00,
"moneyType": "人民币",
"getMoney": 2780.00,
"shouxufei": 55.60,
"pastType": "银联支付",
"remark": "2024-05-14 15:30",
"voucher": null,
"payModel": null,
"bankOrder": "UNIONPAY2024051400005",
"submiter": "郑一(市场部)",
"auditor": "王二(财务部)",
"mask": "凭证暂未上传,已提醒客户补充",
"getMoneyTime": "2024-05-14 16:45",
"orderStatus": "待审核"
}
{
"jwcode": "HM20240601",
"name": "张三",
"market": "华东区",
"activity": "2024年中促销",
"rateName": "年度会员套餐A",
"moneyType": "人民币",
"permanentGold": 2980.00,
"getMoneyType": "人民币",
"getMoney": 2980.00,
"shouxufei": 59.60,
"pastType": "支付宝转账",
"remark": "2024-06-01 09:30",
"voucher": "https://mock-img.com/voucher/2024060101.jpg",
"payModel": "https://mock-img.com/icon/alipay.png",
"bankOrder": "ALIPAY202406010001",
"submiter": "李四(运营部)",
"auditor": "王五(财务部)",
"mask": "客户主动购买,无特殊需求",
"rejectTime": null,
"rejectReason": null,
"getMoneyTime": "2024-06-01 10:15",
"orderStatus": "已撤回"
},
{
"jwcode": "HM20240602",
"name": "李四",
"market": "华北区",
"activity": "新客首单优惠",
"rateName": "季度体验套餐B",
"moneyType": "美元",
"permanentGold": 99.00,
"getMoneyType": "人民币",
"getMoney": 712.50,
"shouxufei": 14.25,
"pastType": "PayPal",
"remark": "2024-06-02 14:15",
"voucher": "https://mock-img.com/voucher/2024060201.jpg",
"payModel": "https://mock-img.com/icon/paypal.png",
"bankOrder": "PAYPAL202406020001",
"submiter": "赵六(国际部)",
"auditor": "孙七(财务部)",
"mask": "跨境支付,汇率按当日中间价计算",
"rejectTime": null,
"rejectReason": null,
"getMoneyTime": "2024-06-02 16:40",
"orderStatus": "已通过"
},
{
"jwcode": "HM20240603",
"name": "王五",
"market": "华南区",
"activity": "老客召回活动",
"rateName": "月度续费套餐C",
"moneyType": "人民币",
"permanentGold": 399.00,
"getMoneyType": null,
"getMoney": null,
"shouxufei": null,
"pastType": "微信支付",
"remark": "2024-06-03 11:20",
"voucher": "https://mock-img.com/voucher/2024060301.jpg",
"payModel": "https://mock-img.com/icon/wechat.png",
"bankOrder": null,
"submiter": "钱八(客服部)",
"auditor": null,
"mask": "待财务补充到账信息",
"rejectTime": null,
"rejectReason": null,
"getMoneyTime": null,
"orderStatus": "待审核"
},
{
"jwcode": "HM20240604",
"name": "赵六",
"market": "西区",
"activity": "企业团购活动",
"rateName": "企业定制套餐D",
"moneyType": "人民币",
"permanentGold": 15800.00,
"getMoneyType": null,
"getMoney": null,
"shouxufei": null,
"pastType": "银行对公转账",
"remark": "2024-06-04 09:05",
"voucher": null,
"payModel": null,
"bankOrder": null,
"submiter": "周九(销售部)",
"auditor": "吴十(财务部)",
"mask": null,
"rejectTime": "2024-06-04 10:30",
"rejectReason": "未上传转账凭证,需补充后重新提交",
"getMoneyTime": null,
"orderStatus": "已驳回"
},
{
"jwcode": "HM20240605",
"name": "孙七",
"market": "东北区",
"activity": "节日特惠活动",
"rateName": "年度会员套餐A",
"moneyType": "人民币",
"permanentGold": 2780.00,
"getMoneyType": "人民币",
"getMoney": 2780.00,
"shouxufei": 55.60,
"pastType": "银联支付",
"remark": "2024-06-05 15:40",
"voucher": "https://mock-img.com/voucher/2024060501.jpg",
"payModel": "https://mock-img.com/icon/unionpay.png",
"bankOrder": "UNION202406050001",
"submiter": "郑一(市场部)",
"auditor": "王二(财务部)",
"mask": "客户使用节日优惠券,已核减200元",
"rejectTime": null,
"rejectReason": null,
"getMoneyTime": "2024-06-05 16:25",
"orderStatus": "已通过"
},
{
"jwcode": "HM20240606",
"name": "周八",
"market": "华北区",
"activity": "新客首单优惠",
"rateName": "季度体验套餐B",
"moneyType": "人民币",
"permanentGold": 359.00,
"getMoneyType": null,
"getMoney": null,
"shouxufei": null,
"pastType": "微信支付",
"remark": "2024-06-06 13:10",
"voucher": "https://mock-img.com/voucher/2024060601.jpg",
"payModel": "https://mock-img.com/icon/wechat.png",
"bankOrder": null,
"submiter": "吴九(客服部)",
"auditor": "郑十(财务部)",
"mask": null,
"rejectTime": "2024-06-06 14:00",
"rejectReason": "付款金额与订单金额不符(订单359元,实付349元)",
"getMoneyTime": null,
"orderStatus": "已驳回"
}
]
</script>
<style scoped lang="scss">
.content { //
.content {
//
height: 100%;
width: 83vw;
.div-card1 { //
.card1 {
//
width: 100%;
.row {
@ -691,7 +838,8 @@ const tableData = [
margin-top: 2vh;
.btns { //
.btns {
//
display: flex;
align-items: center;
justify-content: space-between;
@ -708,7 +856,7 @@ const tableData = [
.btnAdd {
margin-right: 5vw;
padding-left: 10px;
padding-left: 50px;
}
}
@ -717,6 +865,41 @@ const tableData = [
.table {
margin: 10px 3vw;
border-radius: 20px;
.ellipsis-container {
//
position: relative;
width: 100%;
.ellipsis-text {
display: inline-block;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
}
.custom-tooltip {
position: fixed;
z-index: 9999;
padding: 8px 12px;
width: 200px;
/* 固定宽度 */
background-color: #E4F0FC;
color: #333333;
border: 1px solid #e5e7eb;
border-radius: 4px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
/* 高度随内容自动适应 */
min-height: 30px;
max-height: 300px;
/* 限制最大高度,超出滚动 */
overflow-y: auto;
font-size: 14px;
line-height: 1.5;
}
}
}
.pagination {
@ -725,7 +908,84 @@ const tableData = [
}
}
:deep(.adddialog) { //
.recallDialog {
//
height: 392px;
width: 700px;
background-image: url('/src/assets/收款明细撤回背景.png');
position: fixed; //
top: 50%; // 50%
left: 50%; // 50%
transform: translate(-50%, -50%); // 50%
z-index: 1000; //
.close {
position: absolute;
left: 625px;
top: 20px;
height: 38px;
width: 38px;
opacity: 0;
.Btn {
height: 100%;
width: 100%;
border-radius: 10px;
}
}
.text {
position: absolute;
left: 185px;
top: 190px;
height: 67px;
width: 500px;
.txt {
height: 100%;
width: 100%;
color: #001a42;
font-family: "PingFang SC";
font-size: 48px;
font-style: normal;
font-weight: 900;
line-height: normal;
}
}
.cancle {
position: absolute;
left: 185px;
top: 304px;
height: 55px;
width: 150px;
opacity: 0;
.Btn {
height: 100%;
width: 100%;
border-radius: 20px;
}
}
.confirm {
position: absolute;
left: 375px;
top: 304px;
height: 55px;
width: 150px;
opacity: 0;
.Btn {
height: 100%;
width: 100%;
border-radius: 20px;
}
}
}
:deep(.adddialog) {
//
min-width: 500px;
background-color: #F3FAFE !important;
margin-top: 8vh;
@ -775,7 +1035,8 @@ const tableData = [
}
}
:deep(.editdialog) { //
:deep(.editdialog) {
//
min-width: 990px;
background-color: #F3FAFE !important;
margin-top: 8vh;
@ -817,7 +1078,8 @@ const tableData = [
}
.content { //
.content {
//
display: flex;
height: 100%;
width: 100%;
@ -912,7 +1174,8 @@ const tableData = [
}
:deep(.adddialog .el-form-item__label) { //
:deep(.adddialog .el-form-item__label) {
//
min-width: 80px;
width: auto;
font-weight: 800;

228
src/views/permissions/userPermission.vue

@ -1,15 +1,16 @@
<script setup>
import { computed, onMounted, ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import { InfoFilled } from '@element-plus/icons-vue'
import {computed, onMounted, ref} from 'vue'
import {ElMessage, ElMessageBox} from 'element-plus'
import {InfoFilled} from '@element-plus/icons-vue'
import _ from 'lodash'
import request from '@/util/http'
import API from '@/util/http'
import { useAdminStore } from "@/store/index.js"
import { storeToRefs } from "pinia"
import { findMenuById, permissionMapping } from "@/utils/menuTreePermission.js"
import {useAdminStore} from "@/store/index.js"
import {storeToRefs} from "pinia"
import {findMenuById, permissionMapping} from "@/utils/menuTreePermission.js"
const adminStore = useAdminStore()
const { adminData, menuTree } = storeToRefs(adminStore)
const {adminData, menuTree} = storeToRefs(adminStore)
//
const tableData = ref([])
@ -46,23 +47,23 @@ const showStatusConfirm = (row, targetStatus) => {
//
const addUserRules = {
account: [
{ required: true, message: '请输入OA号', trigger: 'blur' },
{ pattern: /^\d+$/, message: 'OA号必须为数字', trigger: 'blur' },
{ max: 20, message: '长度不能超过20位', trigger: 'blur' }
{required: true, message: '请输入OA号', trigger: 'blur'},
{pattern: /^\d+$/, message: 'OA号必须为数字', trigger: 'blur'},
{max: 20, message: '长度不能超过20位', trigger: 'blur'}
],
name: [
{ required: true, message: '请输入用户名', trigger: 'blur' },
{ max: 20, message: '长度不能超过20位', trigger: 'blur' }
{required: true, message: '请输入用户名', trigger: 'blur'},
{max: 20, message: '长度不能超过20位', trigger: 'blur'}
],
market: [
{ required: true, message: '请选择所属地区', trigger: 'change' }
{required: true, message: '请选择所属地区', trigger: 'change'}
],
permission: [
{ required: true, message: '请选择角色名称', trigger: 'change' }
{required: true, message: '请选择角色名称', trigger: 'change'}
],
postiton: [
{ required: true, message: '请输入职位', trigger: 'blur' },
{ max: 20, message: '长度不能超过20位', trigger: 'blur' }
{required: true, message: '请输入职位', trigger: 'blur'},
{max: 20, message: '长度不能超过20位', trigger: 'blur'}
],
machineIds: [
{
@ -215,8 +216,8 @@ const getArea = async function () {
return allChildren.map(child => {
const grandchildren = child.children && child.children.length
? transformTree([child]) //
: null;
? transformTree([child]) //
: null;
return {
value: child.name,
@ -324,7 +325,7 @@ const Ref = ref(null)
const permissionList = ref([])
const getRoles = async function () {
try {
const res = await API({ url: '/role/selectAll' })
const res = await API({url: '/role/selectAll'})
permissionList.value = res.data.map(item => ({
label: item.roleName,
value: item.id
@ -438,7 +439,7 @@ const getUserLists = async function (selectedRoleId) {
parentRoleTip.value = '';
const parentRes = await request({
url: '/role/selectFather',
data: { id: selectedRoleId } // ID
data: {id: selectedRoleId} // ID
});
const parentId = parentRes.data.fatherId;
const parentName = parentRes.data.parentName;
@ -456,7 +457,7 @@ const getUserLists = async function (selectedRoleId) {
// }
const res = await API({
url: '/menu/tree',
data: { id: roleId }
data: {id: roleId}
})
data.value = processTreeData(res.data)
permissionEditObj.value.checkedKeys = collectIds(res.data) || [];
@ -471,11 +472,11 @@ const getUserLists = async function (selectedRoleId) {
//
const editAdminRules = {
market: [
{ required: true, message: '请选择所属地区', trigger: 'change' }
{required: true, message: '请选择所属地区', trigger: 'change'}
],
postiton: [
{ required: true, message: '请输入职位', trigger: ['blur', 'change'] },
{ max: 20, message: '长度不能超过20位', trigger: ['blur', 'change'] }
{required: true, message: '请输入职位', trigger: ['blur', 'change']},
{max: 20, message: '长度不能超过20位', trigger: ['blur', 'change']}
],
machineIds: [
{
@ -500,7 +501,7 @@ const permissionEdit = async function () {
ElMessage.error('无此权限')
return
}
let { adminName: userName, roleName: oldRole, roleId: newRoleId } = permissionEditObj.value;
let {adminName: userName, roleName: oldRole, roleId: newRoleId} = permissionEditObj.value;
if (oldRole == null) {
oldRole = '暂未分配角色'
}
@ -516,15 +517,15 @@ const permissionEdit = async function () {
});
});
await ElMessageBox.confirm(
`确认修改权限角色?<br>您正在将【${userName}】的权限角色从【${oldRole}】修改为【${newRole}】<br>变更后,该用户的可操作权限将同步更新为新角色配置,涉及数据访问、功能操作等权限变化,请谨慎确认。`,
'警告',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: "warning",
lockScroll: false,
dangerouslyUseHTMLString: true // HTML
}
`确认修改权限角色?<br>您正在将【${userName}】的权限角色从【${oldRole}】修改为【${newRole}】<br>变更后,该用户的可操作权限将同步更新为新角色配置,涉及数据访问、功能操作等权限变化,请谨慎确认。`,
'警告',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: "warning",
lockScroll: false,
dangerouslyUseHTMLString: true // HTML
}
)
const result = await request({
url: '/permission/updateAdmin',
@ -543,12 +544,12 @@ const permissionEdit = async function () {
console.log('编辑最后提交数据', permissionEditObj.value);
if (result.code === 200) {
await ElMessageBox.alert(
`用户${userName}的权限角色已更改为【${newRole}`,
'成功',
{
confirmButtonText: '确定',
type: 'success' // success
}
`用户${userName}的权限角色已更改为【${newRole}`,
'成功',
{
confirmButtonText: '确定',
type: 'success' // success
}
);
getPermission();
closeUserEditVisible();
@ -598,7 +599,7 @@ const editStatus = async function (row) {
ElMessage.error('无此权限')
return
}
const { id, account, targetStatus, ...restRow } = currentStatusRow.value
const {id, account, targetStatus, ...restRow} = currentStatusRow.value
try {
statusLoading.value[id] = true
@ -617,7 +618,7 @@ const editStatus = async function (row) {
console.log('请求成功2', result)
if (result.code === 200) {
ElMessage.success(
permissionEditObj.value.adminStatus === 1 ? '启用成功' : '禁用成功'
permissionEditObj.value.adminStatus === 1 ? '启用成功' : '禁用成功'
)
statusLoading.value[id] = false
}
@ -672,8 +673,8 @@ const handleMarketChangeAddUser = (value) => {
if (Array.isArray(value) && value.length > 0) {
//
const selectedMarkets = value
.map(path => Array.isArray(path) && path.length > 0 ? path[path.length - 1] : null)
.filter(Boolean);
.map(path => Array.isArray(path) && path.length > 0 ? path[path.length - 1] : null)
.filter(Boolean);
//
const hasHeadquarters = selectedMarkets.includes('总部');
@ -696,8 +697,8 @@ const handleMarketChangeEditUser = (value) => {
if (Array.isArray(value) && value.length > 0) {
//
const selectedMarkets = value
.map(path => Array.isArray(path) && path.length > 0 ? path[path.length - 1] : null)
.filter(Boolean);
.map(path => Array.isArray(path) && path.length > 0 ? path[path.length - 1] : null)
.filter(Boolean);
//
const hasHeadquarters = selectedMarkets.includes('总部');
@ -905,7 +906,7 @@ onMounted(async function () {
await getRoles()
await getRoleArea()
console.log('看看权限', canAdd, canEdit, canReset, canDel, change)
})
})
</script>
<template>
@ -914,18 +915,19 @@ onMounted(async function () {
<div class="head-card">
<div class="head-card-element">
<el-text class="mx-1" size="large">OA号</el-text>
<el-input v-model="admin.account" style="width: 240px" placeholder="请输入OA号" clearable />
<el-input v-model="admin.account" style="width: 240px" placeholder="请输入OA号" clearable/>
</div>
<div class="head-card-element" style="margin-left: 50px">
<el-text class="mx-1" size="large">所属地区</el-text>
<el-cascader v-model="admin.market" :options="marketsTree" placeholder="请选择所属地区" clearable style="width:180px"
@change="handleMarketChange" />
<el-cascader v-model="admin.market" :options="marketsTree" placeholder="请选择所属地区" clearable
style="width:180px"
@change="handleMarketChange"/>
</div>
<div class="head-card-element" style="margin-left: 50px">
<el-text class="mx-1" size="large">职位名称</el-text>
<el-select v-model="admin.postiton" placeholder="请选择职位名称" style="width: 240px" clearable>
<el-option v-for="item in postiton" :key="item" :label="item" :value="item" />
<el-option v-for="item in postiton" :key="item" :label="item" :value="item"/>
</el-select>
</div>
@ -938,7 +940,9 @@ onMounted(async function () {
<el-card class="card2">
<!-- 展示表单 -->
<div class="add-item">
<el-button style="color: #048efb; border: 1px solid #048efb" :disabled="!canAdd" v-if="canAdd" @click="userAddInit()">新增用户</el-button>
<el-button style="color: #048efb; border: 1px solid #048efb" :disabled="!canAdd" v-if="canAdd"
@click="userAddInit()">新增用户
</el-button>
</div>
<div>
@ -946,31 +950,31 @@ onMounted(async function () {
<el-table-column type="index" label="序号" width="100px" fixed="left">
<template #default="scope">
<span>{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
</template>
</el-table-column>
<el-table-column prop="account" label="OA号" />
<el-table-column prop="name" label="姓名" />
<el-table-column prop="market" label="所属地区" />
<el-table-column prop="postiton" label="职位" />
<el-table-column prop="account" label="OA号"/>
<el-table-column prop="name" label="姓名"/>
<el-table-column prop="market" label="所属地区"/>
<el-table-column prop="postiton" label="职位"/>
<el-table-column prop="roleName" label="部门权限">
</el-table-column>
<el-table-column prop="remark" label="备注" />
<el-table-column prop="remark" label="备注"/>
<el-table-column prop="operation" label="操作" width="280px">
<template #default="scope">
<el-button type="warning" text :disabled="!canReset" @click="resetPassword(scope.row)" v-if="canReset">
重置密码
</el-button>
<el-button type="primary" text @click="permissionEditInit(scope.row)" v-if="canEdit"
:disabled="!canEdit || scope.row.adminStatus === 0 || scope.row.account === adminData.account">
:disabled="!canEdit || scope.row.adminStatus === 0 || scope.row.account === adminData.account">
修改权限
</el-button>
<el-popconfirm title="确定将此用户删除吗?" @confirm="delConfirm">
<template #reference>
<el-button type="danger" text @click="del(scope.row)" v-if="canDel"
:disabled="!canDel ||scope.row.adminStatus === 0 || scope.row.account === adminData.account">
:disabled="!canDel ||scope.row.adminStatus === 0 || scope.row.account === adminData.account">
删除
</el-button>
</template>
@ -985,19 +989,21 @@ onMounted(async function () {
</el-table-column>
<el-table-column prop="adminStatus" label="状态">
<template #default="scope">
<el-switch :model-value="scope.row.adminStatus" :active-value="1" :inactive-value="0" size="large" v-if="change"
:disabled="!change || scope.row.account === adminData.account || statusLoading[scope.row.id]"
@change="(targetStatus) => showStatusConfirm(scope.row, targetStatus)" style="
<el-switch :model-value="scope.row.adminStatus" :active-value="1" :inactive-value="0" size="large"
v-if="change"
:disabled="!change || scope.row.account === adminData.account || statusLoading[scope.row.id]"
@change="(targetStatus) => showStatusConfirm(scope.row, targetStatus)" style="
--el-switch-on-color: #13ce66;
--el-switch-off-color: #ff4949;
" active-text="启用" inactive-text="禁用" inline-prompt />
" active-text="启用" inactive-text="禁用" inline-prompt/>
</template>
</el-table-column>
</el-table>
<div class="pagination" style="margin-top: 1vh;">
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
layout="total, sizes, prev, pager, next, jumper" :total="total"
@size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
</div>
</div>
</el-card>
@ -1005,45 +1011,47 @@ onMounted(async function () {
<!-- 新增用户权限 -->
<el-dialog v-model="userAddVisible" title="新增用户权限" width="800px" :close-on-click-modal="false"
@close="handleDialogClose">
@close="handleDialogClose">
<template #footer>
<el-form ref="Ref" :rules="addUserRules" :model="addAdmin" label-width="auto"
style="max-width: 600px; align-items: center">
style="max-width: 600px; align-items: center">
<el-form-item prop="account" label="OA号:" required clearable>
<el-input v-model="addAdmin.account" placeholder="请输入OA号" style="width: 220px" />
<el-input v-model="addAdmin.account" placeholder="请输入OA号" style="width: 220px"/>
</el-form-item>
<el-form-item prop="name" label="用户名:" required clearable>
<el-input v-model="addAdmin.name" placeholder="请输入用户名" style="width: 220px" />
<el-input v-model="addAdmin.name" placeholder="请输入用户名" style="width: 220px"/>
</el-form-item>
<el-form-item prop="market" label="所属地区:" required clearable>
<el-cascader v-model="addAdmin.market" :options="marketsTree" placeholder="请选择所属地区" clearable collapse-tags
collapse-tags-tooltip style="width:220px" @change="handleMarketChangeAddUser" :max-collapse-tags="2"
:props="addUserProps" />
<el-cascader v-model="addAdmin.market" :options="marketsTree" placeholder="请选择所属地区" clearable
collapse-tags
collapse-tags-tooltip style="width:220px" @change="handleMarketChangeAddUser"
:max-collapse-tags="2"
:props="addUserProps"/>
</el-form-item>
<el-form-item prop="permission" label="角色名称:" required>
<el-select v-model="addAdmin.permission" placeholder="请选择角色名称" style="width: 220px" clearable>
<el-option v-for="item in permissionList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="postiton" label="职位:" required>
<el-input v-model="addAdmin.postiton" placeholder="请输入职位" style="width: 220px" clearable />
<el-input v-model="addAdmin.postiton" placeholder="请输入职位" style="width: 220px" clearable/>
</el-form-item>
<el-form-item prop="machineIds" label="机器码:" required>
<div style="display: flex; align-items: center; flex-wrap: wrap; gap: 10px;">
<!-- 动态添加的机器码输入框 -->
<div v-for="(item, index) in addAdmin.machineIds" :key="index">
<el-input v-model="addAdmin.machineIds[index]" placeholder="请输入机器码"
style="width: 220px; margin-right: 10px;" />
style="width: 220px; margin-right: 10px;"/>
</div>
<el-button type="primary" @click="addMachineIdInput">添加</el-button>
</div>
</el-form-item>
<el-form-item prop="remark" label="备注">
<el-input v-model="addAdmin.remark" style="width: 300px" :rows="2" maxlength="100" show-word-limit
type="textarea" />
type="textarea"/>
</el-form-item>
</el-form>
@ -1059,38 +1067,40 @@ onMounted(async function () {
<!-- 这是编辑用户权限弹窗 -->
<el-dialog v-model="userEditVisible" title="编辑用户权限" width="800px" :close-on-click-modal="false">
<el-form ref="Ref" :rules="editAdminRules" :model="permissionEditObj" label-width="auto"
style="max-width: 600px; align-items: center">
style="max-width: 600px; align-items: center">
<el-form-item prop="account" label="用户账号:" clearable>
<el-input v-model="permissionEditObj.account" placeholder="请输入OA号" style="width: 220px" disabled />
<el-input v-model="permissionEditObj.account" placeholder="请输入OA号" style="width: 220px" disabled/>
</el-form-item>
<el-form-item prop="name" label="用户名称:">
<el-input v-model="permissionEditObj.adminName" placeholder="请输入用户名" style="width: 220px" disabled />
<el-input v-model="permissionEditObj.adminName" placeholder="请输入用户名" style="width: 220px" disabled/>
</el-form-item>
<el-form-item prop="market" label="所属地区:" clearable>
<el-cascader v-model="permissionEditObj.market" :options="marketsTree" placeholder="请选择所属地区" clearable
collapse-tags collapse-tags-tooltip style="width:220px" @change="handleMarketChangeEditUser"
:max-collapse-tags="2" :props="editUserProps" />
collapse-tags collapse-tags-tooltip style="width:220px" @change="handleMarketChangeEditUser"
:max-collapse-tags="2" :props="editUserProps"/>
</el-form-item>
<el-form-item prop="postiton" label="职位:">
<el-input v-model="permissionEditObj.postiton" placeholder="请输入职位" style="width: 220px" clearable />
<el-input v-model="permissionEditObj.postiton" placeholder="请输入职位" style="width: 220px" clearable/>
</el-form-item>
<el-form-item prop="roleName" label="角色名称:">
<el-select v-model="permissionEditObj.roleId" placeholder="请选择角色" style="width: 220px" @change="getUserLists">
<el-select v-model="permissionEditObj.roleId" placeholder="请选择角色" style="width: 220px"
@change="getUserLists">
<el-option v-for="item in permissionList" :key="item.value" :label="item.label"
:value="item.value"></el-option>
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="parentName" label="上级角色:">
<el-select v-model="permissionEditObj.parentId" placeholder="无上级角色" :disabled="!!parentRoleTip"
style="width: 220px">
<el-option v-if="parentRoleTip" :key="0" :label="parentRoleTip" :value="null" disabled />
style="width: 220px">
<el-option v-if="parentRoleTip" :key="0" :label="parentRoleTip" :value="null" disabled/>
<el-option v-else v-for="item in permissionList" :key="item.value" :label="item.label" disabled
:value="item.value"></el-option>
:value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="permissionSelect" label="权限列表:">
<el-tree v-if="data.length > 0" :data="data" :disabled="true" show-checkbox node-key="id"
:props="{ label: 'menuName', children: 'children' }" :default-checked-keys="permissionEditObj.checkedKeys">
:props="{ label: 'menuName', children: 'children' }"
:default-checked-keys="permissionEditObj.checkedKeys">
</el-tree>
<div v-else style="display: flex; align-items: center; gap: 8px;">
<span style="color: #999;">暂无数据</span>
@ -1101,7 +1111,7 @@ onMounted(async function () {
<!-- 动态添加的机器码输入框 -->
<div v-for="(item, index) in permissionEditObj.machineIds" :key="index">
<el-input v-model="permissionEditObj.machineIds[index]" placeholder=""
style="width: 220px; margin-right: 10px;" />
style="width: 220px; margin-right: 10px;"/>
</div>
<el-button type="primary" @click="UseraddMachineIdInput">添加</el-button>
</div>
@ -1121,11 +1131,11 @@ onMounted(async function () {
<!-- 重置密码确认弹窗 -->
<el-dialog v-model="resetConfirmVisible" width="500px" :close-on-click-modal="false"
:before-close="cancelResetPassword">
:before-close="cancelResetPassword">
<el-row>
<el-col :span="4" style="margin-top: 20px">
<el-icon class="dialog-icon" color="#10AEFF" size="50">
<InfoFilled />
<InfoFilled/>
</el-icon>
</el-col>
<el-col :span="20">
@ -1142,22 +1152,29 @@ onMounted(async function () {
</template>
</el-dialog>
<el-dialog v-model="ackVisible" :title="currentStatusRow?.adminStatus === 1 ? '确认禁用' : '确认启用'" width="300px"
:close-on-click-modal="false"
@close="() => { if (currentStatusRow) currentStatusRow.adminStatus = currentStatusRow.adminStatus === 1 ? 0 : 1 }">
<div class="status-confirm-content">
确定要{{ currentStatusRow?.adminStatus === 1 ? '禁用' : '启用' }}该用户吗
<el-dialog v-model="ackVisible" width="700px"
:close-on-click-modal="false"
:style="{
backgroundImage: 'url(/src/assets/SvgIcons/背景.svg',
backgroundSize: 'cover',
backgroundPosition: 'center',
height:'400px'
}"
@close="() => { if (currentStatusRow) currentStatusRow.adminStatus = currentStatusRow.adminStatus === 1 ? 0 : 1 }">
<div class="status-confirm-content"
>
将要{{ currentStatusRow?.adminStatus === 1 ? '禁用' : '启用' }}该用户
<br>
</div>
<template #footer>
<div style="display: flex;">
<el-button @click="() => {
<div style="display: flex; justify-content: center; gap: 10px;">
<el-button round size="large" @click="() => {
currentStatusRow.adminStatus = currentStatusRow.adminStatus === 1 ? 0 : 1
ackVisible = false
}">
取消
</el-button>
<el-button type="primary" @click="() => {
<el-button round size="large" type="primary" @click="() => {
editStatus(currentStatusRow)
ackVisible = false
}">
@ -1185,7 +1202,7 @@ onMounted(async function () {
:deep(.el-table__header-wrapper),
:deep(.el-table__body-wrapper),
:deep(.el-table__cell),
/* 表格 */
/* 表格 */
:deep(.el-table__body td) {
background-color: #F3FAFE !important;
}
@ -1216,4 +1233,11 @@ onMounted(async function () {
.head-card-btn {
margin-left: auto;
}
.status-confirm-content {
text-align: center;
margin-top: 160px;
margin-bottom: 30px;
font-size: 48px;
}
</style>

197
src/views/recharge/bean/beanOnlineRecharge.vue

@ -1,8 +1,8 @@
<script setup>
import { ref, onMounted, reactive, computed } from 'vue'
import {ref, onMounted, reactive, computed} from 'vue'
import ElementPlus from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import { AiFillRead } from 'vue-icons-plus/ai'
import {ElMessage, ElMessageBox} from 'element-plus'
import {AiFillRead} from 'vue-icons-plus/ai'
import axios from 'axios'
import moment from 'moment'
import API from '@/util/http.js'
@ -33,13 +33,13 @@ const getTotalBeans = async () => {
}
})
if (result.code == 200) {
if(result.data){
if (result.data) {
permanentBeans.value = result.data.permanentBean
num.value = result.data.num
money.value = result.data.money
}else{
permanentBeans.value = 0
} else {
permanentBeans.value = 0
num.value = 0
money.value = 0
}
@ -80,15 +80,15 @@ const getArea = async () => {
const getToday = () => {
const today = new Date()
const startTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
today.getFullYear(),
today.getMonth(),
today.getDate(),
)
const endTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
23, 59, 59
today.getFullYear(),
today.getMonth(),
today.getDate(),
23, 59, 59
)
getTime.value = [startTime, endTime]
activeTimeRange.value = 'today'
@ -99,15 +99,15 @@ const getYesterday = () => {
const yesterday = new Date()
yesterday.setDate(yesterday.getDate() - 1)
const startTime = new Date(
yesterday.getFullYear(),
yesterday.getMonth(),
yesterday.getDate()
yesterday.getFullYear(),
yesterday.getMonth(),
yesterday.getDate()
)
const endTime = new Date(
yesterday.getFullYear(),
yesterday.getMonth(),
yesterday.getDate(),
23, 59, 59
yesterday.getFullYear(),
yesterday.getMonth(),
yesterday.getDate(),
23, 59, 59
)
getTime.value = [startTime, endTime]
activeTimeRange.value = 'yesterday'
@ -118,15 +118,15 @@ const getYesterday = () => {
const get7Days = function () {
const today = new Date()
const startTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate() - 6
today.getFullYear(),
today.getMonth(),
today.getDate() - 6
)
const endTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
23, 59, 59
today.getFullYear(),
today.getMonth(),
today.getDate(),
23, 59, 59
)
getTime.value = [startTime, endTime]
activeTimeRange.value = '7days'
@ -254,7 +254,7 @@ const exportExcel = async () => {
},
}
try {
const res = await API({ url: '/export/exportol', data: params })
const res = await API({url: '/export/exportol', data: params})
if (res.code === 200) {
ElMessage.success('导出成功')
} else {
@ -281,7 +281,7 @@ const exportListLoading = ref(false)
const getExportList = async () => {
exportListLoading.value = true
try {
const result = await API({ url: '/export/export' })
const result = await API({url: '/export/export'})
if (result.code === 200) {
const filteredData = result.data.filter(item => {
return item.type === 10;
@ -350,40 +350,64 @@ onMounted(async function () {
</script>
<template>
<el-card class="card1" style="margin-bottom: 0.5vh;">
<div>
<el-text size="large">精网号</el-text>
<el-input v-model="selectData.jwcode" placeholder="请输入精网号" style="width: 10vw;margin-right: 1vw;" clearable />
<el-text size="large">所属地区</el-text>
<el-select v-model="selectData.market" placeholder="请选择所属地区" clearable style="width: 10vw;margin-right: 1vw;">
<el-option v-for="item in market" :key="item" :label="item" :value="item" />
</el-select>
<el-text size="large">订单号</el-text>
<el-input v-model="selectData.orderNo" placeholder="请输入订单号" style="width: 10vw;margin-right: 1vw;" clearable />
<el-text size="large">充值平台</el-text>
<el-select v-model="selectData.platform" placeholder="请选择充值平台" clearable style="width: 10vw;margin-right: 1vw;">
<el-option v-for="item in platform" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
<div style="margin-top: 0.5vh;">
<el-text size="large">充值时间</el-text>
<el-date-picker v-model="getTime" type="datetimerange" range-separator="" start-placeholder="起始时间"
end-placeholder="结束时间" style="width: 20vw" @change="handleDatePickerChange" :default-time="defaultTime" />
<el-button @click="getToday()" style="margin-left: 10px" :type="activeTimeRange === 'today' ? 'primary' : ''">
</el-button>
<el-button @click="getYesterday()" style="margin-left: 10px"
:type="activeTimeRange === 'yesterday' ? 'primary' : ''">
</el-button>
<el-button @click="get7Days()" style="margin-left: 10px" :type="activeTimeRange === '7days' ? 'primary' : ''"> 近7天
</el-button>
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" @click="exportExcel()">导出Excel</el-button>
<el-button type="primary" @click="openExportList">查看导出列表</el-button>
</div>
<el-col style="margin-bottom: 1vh">
<div class="select">
<div class="selectRow">
<el-text class="text" size="large">精网号</el-text>
<el-input class="selectContent" v-model="selectData.jwcode" placeholder="请输入精网号"
clearable/>
</div>
<div class="selectRow">
<el-text class="text" size="large">所属地区</el-text>
<el-select class="selectContent" v-model="selectData.market" placeholder="请选择所属地区" clearable
>
<el-option v-for="item in market" :key="item" :label="item" :value="item"/>
</el-select>
</div>
<div class="selectRow">
<el-text class="text" size="large">订单号</el-text>
<el-input class="selectContent" v-model="selectData.orderNo" placeholder="请输入订单"
clearable/>
</div>
<div class="selectRow">
<el-text class="text" size="large">充值平台</el-text>
<el-select class="selectContent" v-model="selectData.platform" placeholder="请选择充值平台" clearable
>
<el-option v-for="item in platform" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</div>
</div>
</el-col>
<el-col>
<div class="select">
<div class="selectRow" style="width: 36vw;">
<el-text class="text" size="large">充值时间</el-text>
<el-date-picker class="selectContent" v-model="getTime" type="datetimerange" range-separator=""
start-placeholder="起始时间"
end-placeholder="结束时间" style="margin-right:1vw;width:25vw"
@change="handleDatePickerChange"
:default-time="defaultTime"/>
<div v-if="false">
<el-button @click="getToday()" style="margin-left: 10px"
:type="activeTimeRange === 'today' ? 'primary' : ''">
</el-button>
<el-button @click="getYesterday()" style="margin-left: 10px"
:type="activeTimeRange === 'yesterday' ? 'primary' : ''">
</el-button>
<el-button @click="get7Days()" style="margin-left: 10px"
:type="activeTimeRange === '7days' ? 'primary' : ''">
近7天
</el-button>
</div>
</div>
<div class="selectRow" style="justify-content: flex-start;">
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" @click="exportExcel()">导出Excel</el-button>
<el-button type="primary" @click="openExportList">查看导出列表</el-button>
</div>
</div>
</el-col>
</el-card>
<el-card class="card2">
<div class="goldStatistics">
@ -395,16 +419,16 @@ onMounted(async function () {
<el-table-column type="index" label="序号" width="80px" fixed="left">
<template #default="scope">
<span>{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
</template>
</el-table-column>
<el-table-column fixed="left" prop="name" label="姓名" min-width="120" show-overflow-tooltip />
<el-table-column fixed="left" prop="jwcode" label="精网号" min-width="110px" />
<el-table-column prop="market" label="所属地区" min-width="100px" />
<el-table-column prop="orderNo" header-align="center" align="center" label="订单号" min-width="210px" />
<el-table-column prop="num" label="数量" sortable="custom" min-width="110px" />
<el-table-column prop="money" label="金额" sortable="custom" min-width="150px" />
<el-table-column fixed="left" prop="name" label="姓名" min-width="120" show-overflow-tooltip/>
<el-table-column fixed="left" prop="jwcode" label="精网号" min-width="110px"/>
<el-table-column prop="market" label="所属地区" min-width="100px"/>
<el-table-column prop="orderNo" header-align="center" align="center" label="订单号" min-width="210px"/>
<el-table-column prop="num" label="数量" sortable="custom" min-width="110px"/>
<el-table-column prop="money" label="金额" sortable="custom" min-width="150px"/>
<el-table-column prop="platform" label="充值平台" min-width="150px" show-overflow-tooltip>
<template #default=scope>
<span v-if="scope.row.platform == 1">PC</span>
@ -423,14 +447,14 @@ onMounted(async function () {
<!-- 分页 -->
<div class="pagination" style="margin-top: 20px">
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
</div>
</el-card>
<!-- 导出弹窗 -->
<el-dialog v-model="exportListVisible" title="导出列表" width="80vw" class="custom-height-dialog">
<el-table :data="exportList" style="width:80vw;height: 60vh;" :loading="exportListLoading">
<el-table-column prop="fileName" label="文件名" />
<el-table-column prop="fileName" label="文件名"/>
<el-table-column prop="state" label="状态">
<template #default="scope">
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
@ -446,7 +470,7 @@ onMounted(async function () {
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
:disabled="scope.row.state !== 2">
:disabled="scope.row.state !== 2">
下载
</el-button>
</template>
@ -488,7 +512,7 @@ onMounted(async function () {
:deep(.el-table__header-wrapper),
:deep(.el-table__body-wrapper),
:deep(.el-table__cell),
/* 表格 */
/* 表格 */
:deep(.el-table__body td) {
background-color: #F3FAFE !important;
}
@ -503,4 +527,25 @@ onMounted(async function () {
background-color: #E5EBFE !important;
}
/** 搜索的样式 */
.select {
display: flex;
.selectRow {
width: 17vw;
display: flex;
align-items: center;
justify-content: center;
padding: 0 0.5vw;
.text {
width: 5vw;
font-size: 15px;
}
.selectContent {
flex: 1;
}
}
}
</style>

42
src/views/recharge/bean/beanRecharge.vue

@ -1,16 +1,28 @@
<template>
<div style="height: 4vh;">
<el-button-group class="custom-button-group">
<el-button :type="activeTab === 'addBeanRecharge' ? 'primary' : 'default'" class="custom-tab-button"
@click="navigateTo('addBeanRecharge')" v-if="hasAdd" style="width: 6.5vw">
<div class="father">
<el-button-group>
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'addBeanRecharge' }"
@click="navigateTo('addBeanRecharge')"
v-if="hasAdd"
style="width: 6.5vw">
新增充值
</el-button>
<el-button :type="activeTab === 'beanSystemRecharge' ? 'primary' : 'default'" class="custom-tab-button"
@click="navigateTo('beanSystemRecharge')" v-if="hasSystem" style="width: 6.5vw;">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'beanSystemRecharge' }"
@click="navigateTo('beanSystemRecharge')"
v-if="hasSystem"
style="width: 6.5vw;">
系统充值
</el-button>
<el-button :type="activeTab === 'beanOnlineRecharge' ? 'primary' : 'default'" class="custom-tab-button"
@click="navigateTo('beanOnlineRecharge')" v-if="hasOnline" style="width: 6.5vw;">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'beanOnlineRecharge' }"
@click="navigateTo('beanOnlineRecharge')"
v-if="hasOnline"
style="width: 6.5vw;">
线上充值
</el-button>
</el-button-group>
@ -20,16 +32,16 @@
</template>
<script setup>
import { ref, watch, onMounted } from 'vue';
import { useRouter, useRoute } from 'vue-router';
import { storeToRefs } from 'pinia';
import { useAdminStore } from '@/store/index.js';
import { hasMenuPermission, permissionMapping } from "@/utils/menuTreePermission.js";
import {ref, watch, onMounted} from 'vue';
import {useRouter, useRoute} from 'vue-router';
import {storeToRefs} from 'pinia';
import {useAdminStore} from '@/store/index.js';
import {hasMenuPermission, permissionMapping} from "@/utils/menuTreePermission.js";
const router = useRouter();
const route = useRoute();
const adminStore = useAdminStore();
const { menuTree } = storeToRefs(adminStore);
const {menuTree} = storeToRefs(adminStore);
const activeTab = ref('');
const hasAdd = ref(false);
@ -38,7 +50,7 @@ const hasOnline = ref(false);
//
const navigateTo = (name) => {
activeTab.value = name;
router.push({ name });
router.push({name});
};

667
src/views/recharge/bean/beanSystemRecharge.vue

@ -1,24 +1,25 @@
<script setup>
import { ref, onMounted, reactive, computed } from 'vue'
import {ref, onMounted, reactive, computed} from 'vue'
import ElementPlus from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import { AiFillRead } from 'vue-icons-plus/ai'
import {ElMessage, ElMessageBox} from 'element-plus'
import {AiFillRead} from 'vue-icons-plus/ai'
import axios from 'axios'
import moment from 'moment'
import API from '@/util/http.js'
const selectData = ref({
jwcode: '',
market: '',
startTime: '',
endTime: '',
jwcode: '',
market: '',
startTime: '',
endTime: '',
})
const permanentBeans = ref(0)
const freeBean = ref(0)
const beanNum = ref(0)
const money = ref(0)
const defaultTime = [
new Date(2000, 1, 1, 0, 0, 0),
new Date(2000, 2, 1, 23, 59, 59),
new Date(2000, 1, 1, 0, 0, 0),
new Date(2000, 2, 1, 23, 59, 59),
]
//
const formatTime = (val) => val ? moment(val).format('YYYY-MM-DD HH:mm:ss') : ''
@ -29,234 +30,234 @@ const getTime = ref([])
//
const activeTimeRange = ref('')
const handleDatePickerChange = () => {
activeTimeRange.value = ''
activeTimeRange.value = ''
}
//
const getTotalBeans = async () => {
try {
const result = await API({
url: '/beanRecharge/statsSystemBean',
data: {
...selectData.value,
}
})
if (result.code == 200) {
if (result.data) {
permanentBeans.value = result.data.permanentBean
freeBean.value = result.data.freeBean
beanNum.value = result.data.beanNum
money.value = result.data.money
}else{
permanentBeans.value = 0
freeBean.value = 0
beanNum.value = 0
money.value = 0
}
try {
const result = await API({
url: '/beanRecharge/statsSystemBean',
data: {
...selectData.value,
}
})
if (result.code == 200) {
if (result.data) {
permanentBeans.value = result.data.permanentBean
freeBean.value = result.data.freeBean
beanNum.value = result.data.beanNum
money.value = result.data.money
} else {
permanentBeans.value = 0
freeBean.value = 0
beanNum.value = 0
money.value = 0
}
console.log('金豆总数获取成功');
}
console.log('获取金豆总数失败:', result.msg);
} catch (error) {
console.log('获取金豆总数出错');
console.log('金豆总数获取成功');
}
console.log('获取金豆总数失败:', result.msg);
} catch (error) {
console.log('获取金豆总数出错');
}
}
//
const getArea = async () => {
const result = await API({
url: '/beanRecharge/systemMarket',
data: {}
})
if (result.code == 200) {
market.value = result.data
console.log('系统充值地区获取成功', market.value)
} else {
ElMessage.error('系统充值地区获取失败')
}
const result = await API({
url: '/beanRecharge/systemMarket',
data: {}
})
if (result.code == 200) {
market.value = result.data
console.log('系统充值地区获取成功', market.value)
} else {
ElMessage.error('系统充值地区获取失败')
}
}
//
const getToday = () => {
const today = new Date()
const startTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
)
const endTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
23, 59, 59
)
getTime.value = [startTime, endTime]
activeTimeRange.value = 'today'
search()
const today = new Date()
const startTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
)
const endTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
23, 59, 59
)
getTime.value = [startTime, endTime]
activeTimeRange.value = 'today'
search()
}
const getYesterday = () => {
const yesterday = new Date()
yesterday.setDate(yesterday.getDate() - 1)
const startTime = new Date(
yesterday.getFullYear(),
yesterday.getMonth(),
yesterday.getDate()
)
const endTime = new Date(
yesterday.getFullYear(),
yesterday.getMonth(),
yesterday.getDate(),
23, 59, 59
)
getTime.value = [startTime, endTime]
activeTimeRange.value = 'yesterday'
search()
const yesterday = new Date()
yesterday.setDate(yesterday.getDate() - 1)
const startTime = new Date(
yesterday.getFullYear(),
yesterday.getMonth(),
yesterday.getDate()
)
const endTime = new Date(
yesterday.getFullYear(),
yesterday.getMonth(),
yesterday.getDate(),
23, 59, 59
)
getTime.value = [startTime, endTime]
activeTimeRange.value = 'yesterday'
search()
}
const get7Days = function () {
const today = new Date()
const startTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate() - 6
)
const endTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
23, 59, 59
)
getTime.value = [startTime, endTime]
activeTimeRange.value = '7days'
search()
const today = new Date()
const startTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate() - 6
)
const endTime = new Date(
today.getFullYear(),
today.getMonth(),
today.getDate(),
23, 59, 59
)
getTime.value = [startTime, endTime]
activeTimeRange.value = '7days'
search()
}
const reset = () => {
selectData.value = {
jwcode: '',
market: '',
startTime: '',
endTime: '',
}
getTime.value = []
activeTimeRange.value = ''
search()
selectData.value = {
jwcode: '',
market: '',
startTime: '',
endTime: '',
}
getTime.value = []
activeTimeRange.value = ''
search()
}
//
const search = () => {
//
getObj.value.pageNum = 1
if (selectData.value.jwcode) {
const numRef = /^\d{1,9}$/;
if (!numRef.test(selectData.value.jwcode)) {
ElMessage.error('请检查精网号格式')
return
}
//
getObj.value.pageNum = 1
if (selectData.value.jwcode) {
const numRef = /^\d{1,9}$/;
if (!numRef.test(selectData.value.jwcode)) {
ElMessage.error('请检查精网号格式')
return
}
get()
getTotalBeans()
}
get()
getTotalBeans()
}
//
const get = async () => {
try {
if (getTime.value != null) {
selectData.value.startTime = formatTime(getTime.value[0])
selectData.value.endTime = formatTime(getTime.value[1])
} else {
selectData.value.startTime = ''
selectData.value.endTime = ''
}
const data = {
...getObj.value,
"beanSystemRechargeInfo": {
...selectData.value,
sortField: sortField.value,
sortOrder: sortOrder.value,
},
}
console.log('请求参数:', data);
const result = await API({
url: '/beanRecharge/selectBySystem',
data: data
})
if (result.code == 200) {
tableData.value = result.data.list
total.value = result.data.total
} else {
ElMessage.error(result.message)
}
} catch (error) {
console.log('搜索失败', error);
try {
if (getTime.value != null) {
selectData.value.startTime = formatTime(getTime.value[0])
selectData.value.endTime = formatTime(getTime.value[1])
} else {
selectData.value.startTime = ''
selectData.value.endTime = ''
}
const data = {
...getObj.value,
"beanSystemRechargeInfo": {
...selectData.value,
sortField: sortField.value,
sortOrder: sortOrder.value,
},
}
console.log('请求参数:', data);
const result = await API({
url: '/beanRecharge/selectBySystem',
data: data
})
if (result.code == 200) {
tableData.value = result.data.list
total.value = result.data.total
} else {
ElMessage.error(result.message)
}
} catch (error) {
console.log('搜索失败', error);
}
}
//
//
const sortField = ref('')
const sortOrder = ref('')
const handleSortChange = (column) => {
console.log('排序字段:', column.prop)
console.log('排序方式:', column.order)
console.log('排序字段:', column.prop)
console.log('排序方式:', column.order)
// 使
const allowedFields = ['money', 'freeBean', 'rechargeTime', 'createTime', 'permanentBean'];
if (allowedFields.includes(column.prop)) {
sortField.value = column.prop;
}
// 使
const allowedFields = ['money', 'freeBean', 'rechargeTime', 'createTime', 'permanentBean'];
if (allowedFields.includes(column.prop)) {
sortField.value = column.prop;
}
sortOrder.value = column.order === 'ascending' ? 'ASC' : 'DESC';
sortOrder.value = column.order === 'ascending' ? 'ASC' : 'DESC';
console.log('传递给后端的排序字段:', sortField.value)
console.log('传递给后端的排序方式:', sortOrder.value)
console.log('传递给后端的排序字段:', sortField.value)
console.log('传递给后端的排序方式:', sortOrder.value)
get();
get();
}
//===================================================
//
const total = ref(0)
const getObj = ref({
pageNum: 1,
pageSize: 50
pageNum: 1,
pageSize: 50
})
const handlePageSizeChange = (value) => {
getObj.value.pageSize = value
get()
getObj.value.pageSize = value
get()
}
const handleCurrentChange = (value) => {
getObj.value.pageNum = value
get()
getObj.value.pageNum = value
get()
}
//=================================================
const exportExcel = async () => {
const params = {
...getObj.value,
"beanSystemRechargeInfo": {
...selectData.value,
sortField: sortField.value,
sortOrder: sortOrder.value,
},
}
try {
const res = await API({ url: '/export/exportBean', data: params })
console.log('系统充值导出的参数为:', params);
const params = {
...getObj.value,
"beanSystemRechargeInfo": {
...selectData.value,
sortField: sortField.value,
sortOrder: sortOrder.value,
},
}
try {
const res = await API({url: '/export/exportBean', data: params})
console.log('系统充值导出的参数为:', params);
if (res.code === 200) {
ElMessage.success('导出成功')
} else {
ElMessage.error(res.message || '导出失败,请稍后重试')
}
} catch (error) {
console.log('请求失败', error)
ElMessage.error('导出失败,请稍后重试')
if (res.code === 200) {
ElMessage.success('导出成功')
} else {
ElMessage.error(res.message || '导出失败,请稍后重试')
}
} catch (error) {
console.log('请求失败', error)
ElMessage.error('导出失败,请稍后重试')
}
}
const exportListVisible = ref(false)
//
const openExportList = () => {
getExportList()
exportListVisible.value = true
getExportList()
exportListVisible.value = true
}
//
@ -265,174 +266,187 @@ const exportList = ref([])
const exportListLoading = ref(false)
//
const getExportList = async () => {
exportListLoading.value = true
try {
const result = await API({ url: '/export/export' })
if (result.code === 200) {
const filteredData = result.data.filter(item => {
return item.type === 9;
});
exportList.value = filteredData
} else {
ElMessage.error(result.msg || '获取导出列表失败')
}
} catch (error) {
console.error('获取导出列表出错:', error)
ElMessage.error('获取导出列表失败,请稍后重试')
} finally {
exportListLoading.value = false
exportListLoading.value = true
try {
const result = await API({url: '/export/export'})
if (result.code === 200) {
const filteredData = result.data.filter(item => {
return item.type === 9;
});
exportList.value = filteredData
} else {
ElMessage.error(result.msg || '获取导出列表失败')
}
} catch (error) {
console.error('获取导出列表出错:', error)
ElMessage.error('获取导出列表失败,请稍后重试')
} finally {
exportListLoading.value = false
}
}
//
const downloadExportFile = (item) => {
if (item.state === 2) {
const link = document.createElement('a')
link.href = item.url
link.download = item.fileName
link.click()
} else {
ElMessage.warning('文件还在导出中,请稍后再试')
}
if (item.state === 2) {
const link = document.createElement('a')
link.href = item.url
link.download = item.fileName
link.click()
} else {
ElMessage.warning('文件还在导出中,请稍后再试')
}
}
//
const getTagType = (state) => {
switch (state) {
case 0:
return 'info';
case 1:
return 'primary';
case 2:
return 'success';
case 3:
return 'danger';
default:
return 'info';
}
switch (state) {
case 0:
return 'info';
case 1:
return 'primary';
case 2:
return 'success';
case 3:
return 'danger';
default:
return 'info';
}
}
//
const getTagText = (state) => {
switch (state) {
case 0:
return '待执行';
case 1:
return '执行中';
case 2:
return '执行完成';
case 3:
return '执行出错';
default:
return '未知状态';
}
switch (state) {
case 0:
return '待执行';
case 1:
return '执行中';
case 2:
return '执行完成';
case 3:
return '执行出错';
default:
return '未知状态';
}
}
const format3 = (num) => {
//
return num.toLocaleString('en-US')
//
return num.toLocaleString('en-US')
}
onMounted(async function () {
await get()
await getArea()
await getTotalBeans()
await get()
await getArea()
await getTotalBeans()
})
</script>
<template>
<el-card class="card1" style="margin-bottom: 0.5vh">
<div>
<el-text size="large">精网号</el-text>
<el-input v-model="selectData.jwcode" placeholder="请输入精网号" style="width: 9vw;margin-right:1vw" clearable />
<el-text size="large">所属地区</el-text>
<el-select v-model="selectData.market" placeholder="请选择所属地区" clearable style="width: 9vw;margin-right:1vw">
<el-option v-for="item in market" :key="item" :label="item" :value="item" />
</el-select>
<el-card class="card1" style="margin-bottom: 0.5vh">
<el-col style="margin-bottom: 1vh">
<div class="select">
<div class="selectRow">
<el-text class="text" size="large">精网号</el-text>
<el-input class="selectContent" v-model="selectData.jwcode" placeholder="请输入精网号"
clearable/>
</div>
<div class="selectRow">
<el-text class="text" size="large">所属地区</el-text>
<el-select class="selectContent" v-model="selectData.market" placeholder="请选择所属地区" clearable>
<el-option v-for="item in market" :key="item" :label="item" :value="item"/>
</el-select>
</div>
<div style="margin-top: 1vh;">
<el-text size="large">充值时间</el-text>
<el-date-picker v-model="getTime" type="datetimerange" range-separator="" start-placeholder="起始时间"
end-placeholder="结束时间" style="width: 20vw" @change="handleDatePickerChange"
:default-time="defaultTime" />
</div>
</el-col>
<el-col>
<div class="select">
<div class="selectRow" style="width: 36vw;">
<el-text class="text" size="large">充值时间</el-text>
<el-date-picker class="selectContent" v-model="getTime" type="datetimerange" range-separator=""
start-placeholder="起始时间"
end-placeholder="结束时间" style="margin-right:1vw;width:25vw" @change="handleDatePickerChange"
:default-time="defaultTime"/>
<div v-if="false">
<el-button @click="getToday()" style="margin-left: 10px"
:type="activeTimeRange === 'today' ? 'primary' : ''">
:type="activeTimeRange === 'today' ? 'primary' : ''">
</el-button>
<el-button @click="getYesterday()" style="margin-left: 10px"
:type="activeTimeRange === 'yesterday' ? 'primary' : ''">
:type="activeTimeRange === 'yesterday' ? 'primary' : ''">
</el-button>
<el-button @click="get7Days()" style="margin-left: 10px"
:type="activeTimeRange === '7days' ? 'primary' : ''">
近7天
:type="activeTimeRange === '7days' ? 'primary' : ''">
近7天
</el-button>
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" style="width: 80px;" @click="exportExcel()">导出Excel</el-button>
<el-button type="primary" style="width: 95px;" @click="openExportList">查看导出列表</el-button>
</div>
</el-card>
<el-card class="card2">
<div class="goldStatistics">
金豆总数{{ format3(beanNum) }}&nbsp;&nbsp;&nbsp;&nbsp;
付费金豆数{{ format3(permanentBeans) }}&nbsp;&nbsp;&nbsp;&nbsp;
免费金豆数{{ format3(freeBean) }}
</div>
</div>
<div>
<el-table :data="tableData" style="width: 82vw;height:60vh;" @sort-change="handleSortChange">
<el-table-column type="index" label="序号" width="80px" fixed="left">
<template #default="scope">
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" style="width: 80px;" @click="exportExcel()">导出Excel</el-button>
<el-button type="primary" style="width: 95px;" @click="openExportList">查看导出列表</el-button>
</div>
</el-col>
</el-card>
<el-card class="card2">
<div class="goldStatistics">
金豆总数{{ format3(beanNum) }}&nbsp;&nbsp;&nbsp;&nbsp;
付费金豆数{{ format3(permanentBeans) }}&nbsp;&nbsp;&nbsp;&nbsp;
免费金豆数{{ format3(freeBean) }}
</div>
<div>
<el-table :data="tableData" style="width: 82vw;height:60vh;" @sort-change="handleSortChange">
<el-table-column type="index" label="序号" width="80px" fixed="left">
<template #default="scope">
<span>{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
</template>
</el-table-column>
<el-table-column fixed="left" prop="name" label="姓名" min-width="100" show-overflow-tooltip />
<el-table-column fixed="left" prop="jwcode" label="精网号" min-width="110px" />
<el-table-column prop="market" label="所属地区" min-width="100px" />
<el-table-column prop="permanentBean" label="付费金豆" sortable="custom" min-width="110px" />
<el-table-column prop="freeBean" label="免费金豆" sortable="custom" min-width="110px" />
<el-table-column prop="remark" label="备注" min-width="150px" show-overflow-tooltip />
<el-table-column prop="rechargeTime" label="充值时间" min-width="200px">
<template #default="scope">
{{ moment(scope.row.rechargeTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
</el-table>
</div>
}}</span>
</template>
</el-table-column>
<el-table-column fixed="left" prop="name" label="姓名" min-width="100" show-overflow-tooltip/>
<el-table-column fixed="left" prop="jwcode" label="精网号" min-width="110px"/>
<el-table-column prop="market" label="所属地区" min-width="100px"/>
<el-table-column prop="permanentBean" label="付费金豆" sortable="custom" min-width="110px"/>
<el-table-column prop="freeBean" label="免费金豆" sortable="custom" min-width="110px"/>
<el-table-column prop="remark" label="备注" min-width="150px" show-overflow-tooltip/>
<el-table-column prop="rechargeTime" label="充值时间" min-width="200px">
<template #default="scope">
{{ moment(scope.row.rechargeTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
</el-table>
</div>
<!-- 分页 -->
<div class="pagination" style="margin-top: 1vw">
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
</div>
</el-card>
<!-- 导出弹窗 -->
<el-dialog v-model="exportListVisible" title="导出列表" width="80vw">
<el-table :data="exportList" style="width: 80vw;height: 60vh;" :loading="exportListLoading">
<el-table-column prop="fileName" label="文件名" />
<el-table-column prop="state" label="状态">
<template #default="scope">
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
{{ getTagText(scope.row.state) }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间">
<template #default="scope">
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
:disabled="scope.row.state !== 2">
下载
</el-button>
</template>
</el-table-column>
</el-table>
<template #footer>
<div class="dialog-footer">
<el-button text @click="exportListVisible = false">关闭</el-button>
</div>
<!-- 分页 -->
<div class="pagination" style="margin-top: 1vw">
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
</div>
</el-card>
<!-- 导出弹窗 -->
<el-dialog v-model="exportListVisible" title="导出列表" width="80vw">
<el-table :data="exportList" style="width: 80vw;height: 60vh;" :loading="exportListLoading">
<el-table-column prop="fileName" label="文件名"/>
<el-table-column prop="state" label="状态">
<template #default="scope">
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
{{ getTagText(scope.row.state) }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间">
<template #default="scope">
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-dialog>
</el-table-column>
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
:disabled="scope.row.state !== 2">
下载
</el-button>
</template>
</el-table-column>
</el-table>
<template #footer>
<div class="dialog-footer">
<el-button text @click="exportListVisible = false">关闭</el-button>
</div>
</template>
</el-dialog>
</template>
<style scoped lang="scss">
/* .condition {
@ -470,7 +484,7 @@ onMounted(async function () {
:deep(.el-table__header-wrapper),
:deep(.el-table__body-wrapper),
:deep(.el-table__cell),
/* 表格 */
/* 表格 */
:deep(.el-table__body td) {
background-color: #F3FAFE !important;
}
@ -485,5 +499,26 @@ onMounted(async function () {
background-color: #E5EBFE !important;
}
/** 搜索的样式 */
.select {
display: flex;
.selectRow {
width: 17vw;
display: flex;
align-items: center;
justify-content: center;
padding: 0 0.5vw;
.text {
width: 5vw;
font-size: 15px;
}
.selectContent {
flex: 1;
}
}
}
</style>

31
src/views/recharge/gold/coinRecharge.vue

@ -1,30 +1,35 @@
<template>
<div style="height:4vh;">
<el-button-group class="custom-button-group">
<el-button :type="activeTab === 'coinRechargeDetail' ? 'primary' : 'default'" class="custom-tab-button"
@click="navigateTo('coinRechargeDetail')" v-if="hasDetail">
<el-button-group>
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'coinRechargeDetail' }"
@click="navigateTo('coinRechargeDetail')"
v-if="hasDetail">
金币充值明细
</el-button>
<el-button :type="activeTab === 'addCoinRecharge' ? 'primary' : 'default'" class="custom-tab-button" @click="navigateTo('addCoinRecharge')"
v-if="hasAdd">
<el-button class="no-active-btn"
:class="{ 'active-btn': activeTab === 'addCoinRecharge' }"
@click="navigateTo('addCoinRecharge')"
v-if="hasAdd">
新增充值
</el-button>
</el-button-group>
</div>
<router-view></router-view>
<router-view></router-view>
</template>
<script setup>
import { onMounted, ref, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { storeToRefs } from "pinia";
import { useAdminStore } from "@/store/index.js";
import { hasMenuPermission, permissionMapping } from "@/utils/menuTreePermission.js";
import {onMounted, ref, watch} from 'vue';
import {useRoute, useRouter} from 'vue-router';
import {storeToRefs} from "pinia";
import {useAdminStore} from "@/store/index.js";
import {hasMenuPermission, permissionMapping} from "@/utils/menuTreePermission.js";
const router = useRouter();
const route = useRoute();
const adminStore = useAdminStore();
const { menuTree } = storeToRefs(adminStore);
const {menuTree} = storeToRefs(adminStore);
const activeTab = ref('');
const hasAdd = ref(false);
@ -32,7 +37,7 @@ const hasDetail = ref(false);
//
const navigateTo = (name) => {
activeTab.value = name;
router.push({ name });
router.push({name});
};

184
src/views/recharge/gold/coinRechargeDetail.vue

@ -1,9 +1,9 @@
<script setup>
import { onMounted, ref } from 'vue'
import { ElMessage } from 'element-plus'
import {onMounted, ref} from 'vue'
import {ElMessage} from 'element-plus'
import moment from 'moment'
import API from '@/util/http.js'
import { reverseMarketMapping } from '@/utils/marketMap.js';
import {reverseMarketMapping} from '@/utils/marketMap.js';
import dayjs from "dayjs";
//
@ -18,7 +18,7 @@ const trimJwCode = () => {
const adminData = ref({})
const getAdminData = async function () {
try {
const result = await API({ url: '/admin/userinfo', data: {} })
const result = await API({url: '/admin/userinfo', data: {}})
adminData.value = result
rechargeUser.value.adminId = adminData.value.id
console.log('请求成功', result)
@ -49,8 +49,6 @@ const rechargeUser = ref({
})
/*//处理地区选择变化
const handleMarketChange = (value) => {
if (Array.isArray(value) && value.length > 0) {
@ -209,7 +207,7 @@ const delObj = ref({})
const getActivity = async function () {
try {
// POST
const result = await API({ url: '/general/activity', data: {} })
const result = await API({url: '/general/activity', data: {}})
//
console.log('请求成功', result)
@ -217,7 +215,7 @@ const getActivity = async function () {
//
if (Array.isArray(result.data)) {
// { value, label }
activity.value = result.data.map(item => ({ value: item, label: item }));
activity.value = result.data.map(item => ({value: item, label: item}));
} else {
console.error('活动数据格式错误', result)
ElMessage.error('活动数据格式错误,请联系管理员')
@ -248,8 +246,8 @@ const getArea = async function () {
return allChildren.map(child => {
const grandchildren = child.children && child.children.length
? transformTree([child]) //
: null;
? transformTree([child]) //
: null;
return {
value: child.name,
@ -281,7 +279,7 @@ const getPlatform = async () => {
})
// { value, label }
if (Array.isArray(result.data)) {
platform.value = result.data.map(item => ({ value: item, label: item }));
platform.value = result.data.map(item => ({value: item, label: item}));
} else {
console.error('充值方式格式错误', result)
ElMessage.error('充值方式格式错误,请联系管理员')
@ -336,7 +334,7 @@ const get = async function (val) {
url: '/recharge/selectBy',
data: {
...getObj.value,
rechargeUser: { ...rechargeUser.value, flag: showEmployeeData.value ? 0 : 1 }//flag
rechargeUser: {...rechargeUser.value, flag: showEmployeeData.value ? 0 : 1}//flag
}
})
// rechargeUser.value
@ -496,7 +494,7 @@ const exportExcel = async function () {
size: total.value
}
try {
const res = await API({ url: '/export/exportRecharge', data: params })
const res = await API({url: '/export/exportRecharge', data: params})
if (res.code === 200) {
ElMessage.success('导出成功')
} else {
@ -524,7 +522,7 @@ const exportListLoading = ref(false)
const getExportList = async () => {
exportListLoading.value = true
try {
const result = await API({ url: '/export/export' })
const result = await API({url: '/export/export'})
if (result.code === 200) {
const filteredData = result.data.filter(item => {
return item.type === 2; //2
@ -587,45 +585,68 @@ const getTagText = (state) => {
<template>
<el-card class="card1" style="margin-bottom: 0.5vh">
<div style="margin-bottom: 0.5vh;">
<el-text size="large">精网号</el-text>
<el-input v-model="rechargeUser.jwcode" placeholder="请输入精网号" style="width: 10vw;margin-right: 1vw;" clearable />
<el-text size="large">活动名称</el-text>
<el-select v-model="rechargeUser.activity" placeholder="请选择活动名称" style="width: 10vw;margin-right: 1vw;" clearable>
<el-option v-for="item in activity" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-text size="large">所属地区</el-text>
<el-cascader v-model="selectedMarketPath" :options="market" placeholder="请选择所属地区" clearable style="width: 10vw;margin-right: 1vw;"
@change="handleMarketChange" />
<el-text size="large">充值平台</el-text>
<el-select v-model="rechargeUser.payPlatform" placeholder="请选择充值平台" style="width: 10vw;margin-right: 1vw;" clearable>
<el-option v-for="item in platform" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-col style="margin-bottom: 1vh">
<div class="select">
<div class="selectRow">
<el-text class="text" size="large">精网号</el-text>
<el-input class="selectContent" v-model="rechargeUser.jwcode" placeholder="请输入精网号"
clearable/>
</div>
<div class="selectRow">
<el-text class="text" size="large">活动名称</el-text>
<el-select class="selectContent" v-model="rechargeUser.activity" placeholder="请选择活动名称"
clearable>
<el-option v-for="item in activity" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</div>
<div class="selectRow">
<el-text class="text" size="large">所属地区</el-text>
<el-cascader class="selectContent" v-model="selectedMarketPath" :options="market" placeholder="请选择所属地区"
clearable
@change="handleMarketChange"/>
</div>
<div class="selectRow">
<el-text class="text" size="large">充值平台</el-text>
<el-select class="selectContent" v-model="rechargeUser.payPlatform" placeholder="请选择充值平台" clearable>
<el-option v-for="item in platform" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</div>
<el-checkbox v-model="showEmployeeData" @change="search()">员工数据</el-checkbox>
</div>
</el-col>
<el-col>
<div class="select">
<div class="selectRow" style="width: 36vw;">
<el-text class="text" size="large">充值时间</el-text>
<el-date-picker class="selectContent" v-model="getTime" type="datetimerange" range-separator=""
start-placeholder="起始时间"
end-placeholder="结束时间" style="margin-right:1vw;width:25vw"
@change="handleDatePickerChange"
:default-time="defaultTime"
:disabled-date="disabledDate"/>
<div v-if="false">
<el-button @click="getToday()" style="margin-left: 1vw"
:type="activeTimeRange === 'today' ? 'primary' : ''">
</el-button>
<el-button @click="getYesterday()" style="margin-left: 1vw"
:type="activeTimeRange === 'yesterday' ? 'primary' : ''">
</el-button>
<el-button @click="get7Days()" style="margin-left: 1vw"
:type="activeTimeRange === '7days' ? 'primary' : ''">
近7天
</el-button>
</div>
</div>
<div class="selectRow" style="justify-content: flex-start;">
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" @click="exportExcel()">导出Excel</el-button>
<el-button type="primary" @click="openExportList">查看导出列表</el-button>
</div>
</div>
<el-checkbox v-model="showEmployeeData" @change="search()">员工数据</el-checkbox>
</div>
<div>
<el-text size="large">充值时间</el-text>
<el-date-picker v-model="getTime" type="datetimerange" range-separator="" start-placeholder="起始时间"
end-placeholder="结束时间" style="width: 20vw" @change="handleDatePickerChange" :default-time="defaultTime"
:disabled-date="disabledDate" />
<el-button @click="getToday()" style="margin-left: 1vw" :type="activeTimeRange === 'today' ? 'primary' : ''">
</el-button>
<el-button @click="getYesterday()" style="margin-left: 1vw"
:type="activeTimeRange === 'yesterday' ? 'primary' : ''">
</el-button>
<el-button @click="get7Days()" style="margin-left: 1vw" :type="activeTimeRange === '7days' ? 'primary' : ''">
近7天
</el-button>
<el-button type="success" @click="reset()">重置</el-button>
<el-button type="primary" @click="search()">查询</el-button>
<el-button type="primary" @click="exportExcel()">导出Excel</el-button>
<el-button type="primary" @click="openExportList">查看导出列表</el-button>
</div>
</el-col>
</el-card>
<el-card class="card2">
@ -641,21 +662,21 @@ const getTagText = (state) => {
<el-table-column type="index" label="序号" width="80px" fixed="left">
<template #default="scope">
<span>{{
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
scope.$index + 1 + (getObj.pageNum - 1) * getObj.pageSize
}}</span>
</template>
</el-table-column>
<el-table-column fixed="left" prop="name" label="姓名" width="150px" />
<el-table-column fixed="left" prop="jwcode" label="精网号" width="110px" />
<el-table-column prop="market" label="所属地区" width="100px" />
<el-table-column prop="activity" label="活动名称" width="110px" show-overflow-tooltip />
<el-table-column prop="rateName" label="货币名称" width="110px" />
<el-table-column prop="money" sortable="custom" label="充值金额" width="110px" />
<el-table-column prop="permanentGold" label="永久金币" sortable="custom" width="110px" />
<el-table-column prop="freeGold" label="免费金币" sortable="custom" width="110px" />
<el-table-column prop="payPlatform" label="充值平台" width="110px" />
<el-table-column prop="payModel" label="支付方式" width="100px" />
<el-table-column prop="remark" label="备注" width="150px" show-overflow-tooltip />
<el-table-column fixed="left" prop="name" label="姓名" width="150px"/>
<el-table-column fixed="left" prop="jwcode" label="精网号" width="110px"/>
<el-table-column prop="market" label="所属地区" width="100px"/>
<el-table-column prop="activity" label="活动名称" width="110px" show-overflow-tooltip/>
<el-table-column prop="rateName" label="货币名称" width="110px"/>
<el-table-column prop="money" sortable="custom" label="充值金额" width="110px"/>
<el-table-column prop="permanentGold" label="永久金币" sortable="custom" width="110px"/>
<el-table-column prop="freeGold" label="免费金币" sortable="custom" width="110px"/>
<el-table-column prop="payPlatform" label="充值平台" width="110px"/>
<el-table-column prop="payModel" label="支付方式" width="100px"/>
<el-table-column prop="remark" label="备注" width="150px" show-overflow-tooltip/>
<el-table-column prop="isRefund" label="订单状态" width="200px" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.isRefund == 0">正常</span>
@ -663,7 +684,7 @@ const getTagText = (state) => {
<span v-else>未知状态</span>
</template>
</el-table-column>
<el-table-column prop="adminName" label="提交人" width="100px" />
<el-table-column prop="adminName" label="提交人" width="100px"/>
<el-table-column prop="auditTime" sortable label="充值时间" width="200px">
<template #default="scope">
{{ moment(scope.row.auditTime).format('YYYY-MM-DD HH:mm:ss') }}
@ -675,15 +696,15 @@ const getTagText = (state) => {
<!-- 分页 -->
<div style="margin-top: 1vh">
<el-pagination background :page-size="getObj.pageSize" :page-sizes="[5, 10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handlePageSizeChange"
@current-change="handleCurrentChange"></el-pagination>
</div>
</el-card>
<!-- 导出弹窗 -->
<el-dialog v-model="exportListVisible" title="导出列表" width="80%">
<el-table :data="exportList" style="width: 100% ;height: 60vh;" :loading="exportListLoading">
<el-table-column prop="fileName" label="文件名" />
<el-table-column prop="fileName" label="文件名"/>
<el-table-column prop="state" label="状态">
<template #default="scope">
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'">
@ -699,7 +720,7 @@ const getTagText = (state) => {
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" size="small" @click="downloadExportFile(scope.row)"
:disabled="scope.row.state !== 2">
:disabled="scope.row.state !== 2">
下载
</el-button>
</template>
@ -740,7 +761,7 @@ const getTagText = (state) => {
:deep(.el-table__header-wrapper),
:deep(.el-table__body-wrapper),
:deep(.el-table__cell),
/* 表格 */
/* 表格 */
:deep(.el-table__body td) {
background-color: #F3FAFE !important;
}
@ -755,4 +776,25 @@ const getTagText = (state) => {
background-color: #E5EBFE !important;
}
/** 上面搜索的布局 **/
.select {
display: flex;
.selectRow {
width: 17vw;
display: flex;
align-items: center;
justify-content: center;
padding: 0 0.5vw;
.text {
width: 5vw;
font-size: 15px;
}
.selectContent {
flex: 1;
}
}
}
</style>

18
src/views/refund/gold/coinRefund.vue

@ -1,14 +1,22 @@
<template>
<div style="height: 4vh;">
<!-- 这里放置标签切换的按钮 -->
<el-button-group class="custom-button-group">
<el-button :type="activeTab === 'coinRefundDetail' ? 'primary' : 'default'" class="custom-tab-button"
@click="navigateTo('coinRefundDetail')" :disabled="!hasDetail" v-if="hasDetail">
<el-button-group>
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'coinRefundDetail' }"
@click="navigateTo('coinRefundDetail')"
:disabled="!hasDetail"
v-if="hasDetail">
金币退款明细
</el-button>
<!-- 切换后状态显示 primary 样式否则是默认样式 -->
<el-button :type="activeTab === 'addCoinRefund' ? 'primary' : 'default'" class="custom-tab-button" @click="navigateTo('addCoinRefund')"
:disabled="!hasAdd" v-if="hasAdd">
<el-button
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'addCoinRefund' }"
@click="navigateTo('addCoinRefund')"
:disabled="!hasAdd"
v-if="hasAdd">
新增退款
</el-button>
</el-button-group>

40
src/views/usergold/gold/clientCount.vue

@ -4,16 +4,17 @@
<el-button-group class="custom-button-group">
<!-- 切换后状态显示 primary 样式否则是默认样式 -->
<el-button
:type="activeTab === 'clientCountDetail' ? 'primary' : 'default'"
class="custom-tab-button"
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'clientCountDetail' }"
@click="navigateTo('clientCountDetail')"
:disabled="!hasDetail" v-if="hasDetail"
:disabled="!hasDetail"
v-if="hasDetail"
>
金币明细
</el-button>
<el-button
:type="activeTab === 'clientCountBalance' ? 'primary' : 'default'"
class="custom-tab-button"
class="no-active-btn"
:class="{ 'active-btn': activeTab === 'clientCountBalance' }"
@click="navigateTo('clientCountBalance')"
:disabled="!hasBalance" v-if="hasBalance"
>
@ -21,8 +22,8 @@
</el-button>
</el-button-group>
<!-- 渲染子路由组件 -->
</div>
<div>
</div>
<div>
<router-view></router-view>
</div>
</template>
@ -91,27 +92,10 @@ onMounted(() => {
}
});
</script>
<style scoped lang="scss">
/* 自定义按钮组布局 */
.custom-button-group {
display: flex;
margin-bottom: 16px;
gap: 8px;
}
:deep(.el-button.custom-tab-button) {
border-radius: 4px;
transition: all 0.3s ease;
}
// tab
:deep(.el-button.custom-tab-button.el-button--primary) {
background-color: #2741DE !important;
border-color: #2741DE !important;
color: #F3FAFE !important;
}
/* 鼠标悬停效果 */
:deep(.el-button.custom-tab-button:hover:not(.is-disabled)) {
opacity: 0.8;
<style>
.father {
width: 82vw;
height: 4vh;
}

24
src/views/workspace/index.vue

@ -1,16 +1,16 @@
<template>
<!-- 头部 -->
<el-header class="header">
<div class="title">数据总览</div>
</el-header>
<el-header class="header">
<div class="title">数据总览</div>
</el-header>
<div style="height: 100vh;">
<el-row class="cards" >
<el-row class="cards">
<el-col :span="14">
<GoldManagement/>
</el-col>
<!-- 右上格子占12列 -->
<el-col :span="10">
<CashManagement />
<CashManagement/>
</el-col>
</el-row>
<el-row class="graphs">
@ -22,7 +22,7 @@
</template>
<script setup>
import { ref, onMounted } from 'vue'
import {ref, onMounted} from 'vue'
import API from '@/util/http'
import GoldManagement from "@/components/workspace/GoldManagement.vue"
@ -37,10 +37,10 @@ import GoldGraph from "@/components/workspace/GoldGraph.vue"
.header {
/* 将纯色背景替换为线性渐变 */
background: linear-gradient(
90deg,
rgba(228, 240, 252, 1) 20%,
rgba(190, 218, 247, 1) 50%,
rgba(228, 240, 252, 1) 100%
90deg,
rgba(228, 240, 252, 1) 20%,
rgba(190, 218, 247, 1) 50%,
rgba(228, 240, 252, 1) 100%
);
height: 6vh;
border-radius: 12px;
@ -64,5 +64,7 @@ import GoldGraph from "@/components/workspace/GoldGraph.vue"
text-align: center;
}
.graphs {
padding-bottom: 10px;
}
</style>
Loading…
Cancel
Save