|
|
@ -1,17 +1,21 @@ |
|
|
|
<script setup> |
|
|
|
// 这是退款明细页面 |
|
|
|
import {computed, onMounted, ref} from 'vue' |
|
|
|
import {ElMessage} from 'element-plus' |
|
|
|
import { computed, onMounted, ref } from 'vue' |
|
|
|
import { ElMessage } from 'element-plus' |
|
|
|
import moment from 'moment' |
|
|
|
import API from '@/util/http.js' |
|
|
|
import request from '@/util/http.js' |
|
|
|
import {reverseMarketMapping} from "@/utils/marketMap.js"; |
|
|
|
import { reverseMarketMapping } from "@/utils/marketMap.js"; |
|
|
|
import dayjs from "dayjs"; |
|
|
|
|
|
|
|
const defaultTime = [ |
|
|
|
new Date(2000, 1, 1, 0, 0, 0), |
|
|
|
new Date(2000, 2, 1,23 , 59, 59), |
|
|
|
new Date(2000, 2, 1, 23, 59, 59), |
|
|
|
] |
|
|
|
const format3 = (num) => { |
|
|
|
// 每三位添加逗号 |
|
|
|
return num.toLocaleString('en-US') |
|
|
|
} |
|
|
|
// 精网号去空格 |
|
|
|
const trimJwCode = () => { |
|
|
|
if (refundUser.value.jwcode) { |
|
|
@ -39,7 +43,7 @@ const handleDatePickerChange = () => { |
|
|
|
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 |
|
|
|
console.log('请求成功', result) |
|
|
@ -53,7 +57,7 @@ const tableData = ref([]) |
|
|
|
// 搜索====================================== |
|
|
|
// 搜索detail |
|
|
|
const refundUser = ref({ |
|
|
|
market:"" |
|
|
|
market: "" |
|
|
|
}) |
|
|
|
// 搜索对象 |
|
|
|
const getObj = ref({ |
|
|
@ -94,7 +98,7 @@ const getRefundTypes = async function () { |
|
|
|
// 检查返回的数据是否为数组 |
|
|
|
if (Array.isArray(result.data)) { |
|
|
|
// 将字符串数组转换为 { value, label } 格式 |
|
|
|
refundType.value = result.data.map(item => ({value: item, label: item})); |
|
|
|
refundType.value = result.data.map(item => ({ value: item, label: item })); |
|
|
|
} else { |
|
|
|
console.error('退款类型数据格式错误', result) |
|
|
|
ElMessage.error('退款类型数据格式错误,请联系管理员') |
|
|
@ -148,11 +152,11 @@ const getSelectBy = async function (val) { |
|
|
|
url: '/refund/selectBy', |
|
|
|
data: { |
|
|
|
...getObj.value, |
|
|
|
refundUser: {...refundUser.value} |
|
|
|
refundUser: { ...refundUser.value } |
|
|
|
} |
|
|
|
}) |
|
|
|
// 复制一份 refundUser.value 并移除排序字段和排序方式 |
|
|
|
const detailWithoutSort = {...refundUser.value} |
|
|
|
const detailWithoutSort = { ...refundUser.value } |
|
|
|
delete detailWithoutSort.sortField |
|
|
|
delete detailWithoutSort.sortOrder |
|
|
|
|
|
|
@ -203,7 +207,7 @@ const search = function () { |
|
|
|
} |
|
|
|
// 重置 |
|
|
|
const reset = function () { |
|
|
|
refundUser.value = {market: ""} |
|
|
|
refundUser.value = { market: "" } |
|
|
|
sortField.value = '' |
|
|
|
sortOrder.value = '' |
|
|
|
getTime.value = {} |
|
|
@ -215,7 +219,7 @@ const reset = function () { |
|
|
|
const getToday = function () { |
|
|
|
const today = dayjs() |
|
|
|
const startTime = today.startOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
const endTime =today.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
const endTime = today.endOf('day').format('YYYY-MM-DD HH:mm:ss') |
|
|
|
getTime.value = [startTime, endTime] |
|
|
|
console.log('getTime', getTime.value) |
|
|
|
activeTimeRange.value = 'today' // 标记当前激活状态 |
|
|
@ -365,7 +369,7 @@ const exportExcel = async function () { |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
const res = await API({url: '/export/exportRefund', data: params}) |
|
|
|
const res = await API({ url: '/export/exportRefund', data: params }) |
|
|
|
if (res.code === 200) { |
|
|
|
ElMessage.success('导出成功') |
|
|
|
} else { |
|
|
@ -393,7 +397,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 === 3; //3表示金币退款列表 |
|
|
@ -480,8 +484,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, |
|
|
@ -507,63 +511,29 @@ const getMarket = async function () { |
|
|
|
<el-col :span="5"> |
|
|
|
<div class="head-card-element"> |
|
|
|
<el-text class="mx-1">精网号:</el-text> |
|
|
|
<el-input |
|
|
|
v-model="refundUser.jwcode" |
|
|
|
placeholder="请输入精网号" |
|
|
|
style="width: 150px" |
|
|
|
clearable |
|
|
|
/> |
|
|
|
<el-input v-model="refundUser.jwcode" placeholder="请输入精网号" style="width: 150px" clearable /> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="6"> |
|
|
|
<div class="head-card-element"> |
|
|
|
<el-text class="mx-1">商品名称:</el-text> |
|
|
|
<el-select |
|
|
|
v-model="refundUser.goodsName" |
|
|
|
placeholder="请选择商品名称" |
|
|
|
|
|
|
|
style="width: 180px" |
|
|
|
clearable |
|
|
|
|
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in goods" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
<el-select v-model="refundUser.goodsName" placeholder="请选择商品名称" style="width: 180px" clearable> |
|
|
|
<el-option v-for="item in goods" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-text class="mx-1" size="large">所属地区:</el-text> |
|
|
|
<el-cascader |
|
|
|
v-model="selectedMarketPath" |
|
|
|
:options="market" |
|
|
|
placeholder="请选择所属地区" |
|
|
|
clearable |
|
|
|
style="width:180px" |
|
|
|
@change="handleMarketChange" |
|
|
|
/> |
|
|
|
<el-cascader v-model="selectedMarketPath" :options="market" placeholder="请选择所属地区" clearable |
|
|
|
style="width:180px" @change="handleMarketChange" /> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<div class="head-card-element"> |
|
|
|
<el-text class="mx-1">退款类型:</el-text> |
|
|
|
<el-select |
|
|
|
v-model="refundUser.refundType" |
|
|
|
placeholder="请选择退款类型" |
|
|
|
|
|
|
|
style="width: 180px" |
|
|
|
clearable |
|
|
|
> |
|
|
|
<el-select v-model="refundUser.refundType" placeholder="请选择退款类型" style="width: 180px" clearable> |
|
|
|
<!-- todo 这需要改--> |
|
|
|
<el-option |
|
|
|
v-for="item in refundType" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
<el-option v-for="item in refundType" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</el-col> |
|
|
@ -573,15 +543,16 @@ const getMarket = async function () { |
|
|
|
<div class="head-card-element"> |
|
|
|
<el-text class="mx-1">退款时间:</el-text> |
|
|
|
<el-date-picker v-model="getTime" type="datetimerange" range-separator="至" start-placeholder="起始时间" |
|
|
|
end-placeholder="结束时间" style="width: 400px" @change="handleDatePickerChange" :default-time="defaultTime"/> |
|
|
|
end-placeholder="结束时间" style="width: 400px" @change="handleDatePickerChange" |
|
|
|
:default-time="defaultTime" /> |
|
|
|
<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> |
|
|
@ -598,48 +569,27 @@ const getMarket = async function () { |
|
|
|
<el-col> |
|
|
|
<el-card> |
|
|
|
<div> |
|
|
|
退款金币总数:{{ Math.abs(sumGolds) / 100 }},永久金币:{{ |
|
|
|
Math.abs(permanentGolds) / 100 |
|
|
|
}},免费金币:{{ Math.abs(freeGolds) / 100 }},任务金币:{{ |
|
|
|
Math.abs(taskGolds) / 100 |
|
|
|
}} |
|
|
|
退款金币总数:{{ format3(Math.abs(sumGolds) / 100) }} |
|
|
|
永久金币:{{ format3(Math.abs(permanentGolds) / 100) }} |
|
|
|
免费金币:{{ format3(Math.abs(freeGolds) / 100) }} |
|
|
|
任务金币:{{ format3(Math.abs(taskGolds) / 100) }} |
|
|
|
</div> |
|
|
|
<!-- 设置表格容器的高度和滚动样式 --> |
|
|
|
<div style="height: 520px; overflow-y: auto;margin-top:10px"> |
|
|
|
<el-table |
|
|
|
:data="tableData" |
|
|
|
style="width: 100%" |
|
|
|
@sort-change="handleSortChange" |
|
|
|
height="520px" |
|
|
|
> |
|
|
|
<el-table-column |
|
|
|
type="index" |
|
|
|
label="序号" |
|
|
|
width="80px" |
|
|
|
fixed="left" |
|
|
|
> |
|
|
|
<el-table :data="tableData" style="width: 100%" @sort-change="handleSortChange" height="520px"> |
|
|
|
<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="姓名" |
|
|
|
fixed="left" |
|
|
|
width="130px" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
prop="jwcode" |
|
|
|
label="精网号" |
|
|
|
fixed="left" |
|
|
|
width="110px" |
|
|
|
/> |
|
|
|
<el-table-column prop="market" label="所属地区" width="110px"/> |
|
|
|
<el-table-column prop="goodsName" label="商品名称" width="110px" show-overflow-tooltip/> |
|
|
|
<el-table-column prop="refundType" label="退款类型" width="100px"/> |
|
|
|
<el-table-column prop="name" label="姓名" fixed="left" width="130px" /> |
|
|
|
<el-table-column prop="jwcode" label="精网号" fixed="left" width="110px" /> |
|
|
|
<el-table-column prop="market" label="所属地区" width="110px" /> |
|
|
|
<el-table-column prop="goodsName" label="商品名称" width="110px" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="refundType" label="退款类型" width="100px" /> |
|
|
|
|
|
|
|
<!-- <el-table-column label="金额总数" width="110px"> |
|
|
|
<template #default="scope"> |
|
|
@ -649,51 +599,21 @@ const getMarket = async function () { |
|
|
|
</template> |
|
|
|
</el-table-column> --> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="sumGold" |
|
|
|
label="金额总数" |
|
|
|
width="110px" |
|
|
|
sortable="custom" |
|
|
|
/> |
|
|
|
<el-table-column prop="sumGold" label="金额总数" width="110px" sortable="custom" /> |
|
|
|
|
|
|
|
<el-table-column prop="refundModel" label="退款方式" width="110px"> |
|
|
|
<template #default="scope"> |
|
|
|
{{ scope.row.refundModel === 0 ? '全部退款' : scope.row.refundModel === 1 ? '部分退款' : '' }} |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="permanentGold" |
|
|
|
label="永久金币" |
|
|
|
width="110px" |
|
|
|
sortable="custom" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
prop="freeGold" |
|
|
|
sortable="custom" |
|
|
|
label="免费金币" |
|
|
|
width="110px" |
|
|
|
/> |
|
|
|
<el-table-column |
|
|
|
prop="taskGold" |
|
|
|
sortable="custom" |
|
|
|
label="任务金币" |
|
|
|
width="110px" |
|
|
|
/> |
|
|
|
<el-table-column prop="permanentGold" label="永久金币" width="110px" sortable="custom" /> |
|
|
|
<el-table-column prop="freeGold" sortable="custom" label="免费金币" width="110px" /> |
|
|
|
<el-table-column prop="taskGold" sortable="custom" label="任务金币" width="110px" /> |
|
|
|
<!-- 修改prop为taskGold --> |
|
|
|
<el-table-column |
|
|
|
prop="remark" |
|
|
|
label="退款原因" |
|
|
|
width="160px" |
|
|
|
show-overflow-tooltip |
|
|
|
/> |
|
|
|
<el-table-column prop="adminName" label="提交人" width="100px"/> |
|
|
|
|
|
|
|
<el-table-column |
|
|
|
prop="createTime" |
|
|
|
sortable="custom" |
|
|
|
label="提交时间" |
|
|
|
width="180px" |
|
|
|
> |
|
|
|
<el-table-column prop="remark" label="退款原因" width="160px" show-overflow-tooltip /> |
|
|
|
<el-table-column prop="adminName" label="提交人" width="100px" /> |
|
|
|
|
|
|
|
<el-table-column prop="createTime" sortable="custom" label="提交时间" width="180px"> |
|
|
|
<template #default="scope"> |
|
|
|
{{ moment(scope.row.createTime).format('YYYY-MM-DD HH:mm:ss') }} |
|
|
|
</template> |
|
|
@ -703,16 +623,9 @@ const getMarket = 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" |
|
|
|
@jump="checkPageNumber" |
|
|
|
></el-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" @jump="checkPageNumber"></el-pagination> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-col> |
|
|
@ -720,12 +633,11 @@ const getMarket = async function () { |
|
|
|
|
|
|
|
<!-- 导出弹窗 --> |
|
|
|
<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 :data="exportList" style="width: 100% ;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'"> |
|
|
|
<el-tag :type="getTagType(scope.row.state)" :effect="scope.row.state === 3 ? 'light' : 'plain'"> |
|
|
|
{{ getTagText(scope.row.state) }} |
|
|
|
</el-tag> |
|
|
|
</template> |
|
|
@ -738,7 +650,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> |
|
|
|