|
|
|
@ -38,18 +38,19 @@ const scrollTableTop = () => { |
|
|
|
} |
|
|
|
|
|
|
|
// 新增金币总数变量 |
|
|
|
const goldtotal = ref(0) |
|
|
|
|
|
|
|
// 计算用户各金币总数的不分页对象 |
|
|
|
const tableAllData = ref([]) |
|
|
|
// 各金币字段 |
|
|
|
const permanentGold = ref(0) // 修改为 currentPermanentGold 对应字段 |
|
|
|
const freeJuneGold = ref(0) // 修改为 currentFreeJune 对应字段 |
|
|
|
const freeDecemberGold = ref(0) // 修改为 currentFreeDecember 对应字段 |
|
|
|
const taskGold = ref(0) // 修改为 currentTaskGold 对应字段 |
|
|
|
const freeGold = ref(0) // 计算免费金币总数 |
|
|
|
const statisticsData = ref({ |
|
|
|
hkGold: 0, |
|
|
|
sgHcGold: 0, |
|
|
|
myGold: 0, |
|
|
|
sgGold: 0, |
|
|
|
caGold: 0, |
|
|
|
thHsGold: 0, |
|
|
|
thHaGold: 0, |
|
|
|
vnGold: 0, |
|
|
|
bjGold: 0 |
|
|
|
}) |
|
|
|
|
|
|
|
//客户消费记录 |
|
|
|
const tableCountData = ref([]) |
|
|
|
const userInfo = ref({}) |
|
|
|
|
|
|
|
// 搜索=========================================== |
|
|
|
@ -76,10 +77,6 @@ const sortOrder = ref('') |
|
|
|
// 搜索=========================================================================== |
|
|
|
// 搜索方法 |
|
|
|
const get = async function (val) { |
|
|
|
if (!findMenuById(menuTree.value, permissionMapping.gold_coin_customer_balance)) { |
|
|
|
ElMessage.error(t('elmessage.noPermission')) |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
// 搜索参数页码赋值 |
|
|
|
if (typeof val === 'number') { |
|
|
|
@ -134,12 +131,17 @@ const get = async function (val) { |
|
|
|
// 将表格数据设置为空数组 |
|
|
|
tableData.value = [] |
|
|
|
// 将合计数设置为 0 |
|
|
|
permanentGold.value = 0 |
|
|
|
freeJuneGold.value = 0 |
|
|
|
freeDecemberGold.value = 0 |
|
|
|
taskGold.value = 0 |
|
|
|
goldtotal.value = 0 |
|
|
|
freeGold.value = 0 |
|
|
|
statisticsData.value = { |
|
|
|
hkGold: 0, |
|
|
|
sgHcGold: 0, |
|
|
|
myGold: 0, |
|
|
|
sgGold: 0, |
|
|
|
caGold: 0, |
|
|
|
thHsGold: 0, |
|
|
|
thHaGold: 0, |
|
|
|
vnGold: 0, |
|
|
|
bjGold: 0 |
|
|
|
} |
|
|
|
|
|
|
|
// // 新增金币总数变量 |
|
|
|
// const goldtotal = ref(0) |
|
|
|
@ -152,12 +154,17 @@ const get = async function (val) { |
|
|
|
// 将表格数据设置为空数组 |
|
|
|
tableData.value = [] |
|
|
|
// 将合计数设置为 0 |
|
|
|
permanentGold.value = 0 |
|
|
|
freeJuneGold.value = 0 |
|
|
|
freeDecemberGold.value = 0 |
|
|
|
taskGold.value = 0 |
|
|
|
goldtotal.value = 0 |
|
|
|
freeGold.value = 0 |
|
|
|
statisticsData.value = { |
|
|
|
hkGold: 0, |
|
|
|
sgHcGold: 0, |
|
|
|
myGold: 0, |
|
|
|
sgGold: 0, |
|
|
|
caGold: 0, |
|
|
|
thHsGold: 0, |
|
|
|
thHaGold: 0, |
|
|
|
vnGold: 0, |
|
|
|
bjGold: 0 |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
// 将响应结果存储到响应式数据中 |
|
|
|
@ -170,10 +177,7 @@ const get = async function (val) { |
|
|
|
|
|
|
|
// 从接口返回数据中获取各金币数值 |
|
|
|
if (resultGoldTotal.data) { |
|
|
|
permanentGold.value = parseFloat(resultGoldTotal.data.permanentGold.toFixed(2)) |
|
|
|
freeGold.value = parseFloat(resultGoldTotal.data.freeGold.toFixed(2)) |
|
|
|
taskGold.value = parseFloat(resultGoldTotal.data.taskGold.toFixed(2)) |
|
|
|
goldtotal.value = parseFloat(resultGoldTotal.data.goldtotal.toFixed(2)) |
|
|
|
statisticsData.value = { ...resultGoldTotal.data } |
|
|
|
} else { |
|
|
|
console.error('合计数数据格式错误', resultGoldTotal) |
|
|
|
ElMessage.error(t('elmessage.getTotalFailed')) |
|
|
|
@ -217,7 +221,6 @@ const cellClick = function (row, column) { |
|
|
|
console.log('cellClick', column.label) |
|
|
|
if (column.label === t('common.name')) { |
|
|
|
dialogVisible.value = true |
|
|
|
|
|
|
|
userInfo.value = row |
|
|
|
} |
|
|
|
} |
|
|
|
@ -225,14 +228,8 @@ const cellClick = function (row, column) { |
|
|
|
const handleSortChange = (column) => { |
|
|
|
console.log('排序字段:', column.prop) |
|
|
|
console.log('排序方式:', column.order) |
|
|
|
if (column.prop === 'currentPermanentGold') { |
|
|
|
sortField.value = 'current_permanent_gold' |
|
|
|
} else if (column.prop === 'currentTaskGold') { |
|
|
|
sortField.value = 'current_task_gold' |
|
|
|
} else if (column.prop === 'currentFreeJune') { |
|
|
|
sortField.value = 'current_free_june' |
|
|
|
} else if (column.prop === 'currentFreeDecember') { |
|
|
|
sortField.value = 'current_free_december' |
|
|
|
if (column.prop) { |
|
|
|
sortField.value = column.prop.replace(/([A-Z])/g, "_$1").toLowerCase(); |
|
|
|
} |
|
|
|
sortOrder.value = column.order === 'ascending' ? 'ASC' : 'DESC' |
|
|
|
get() |
|
|
|
@ -420,10 +417,15 @@ const format3 = (num) => { |
|
|
|
</el-card> |
|
|
|
<el-card class="card2"> |
|
|
|
<div class="goldStatistics"> |
|
|
|
{{ $t('common.totalGoldCoin') }}:{{ format3(goldtotal || 0) }} |
|
|
|
{{ $t('common.permanentGold') }}:{{ format3(permanentGold || 0) }} |
|
|
|
{{ $t('common.freeGold') }}:{{ format3(freeGold || 0) }} |
|
|
|
{{ $t('common.taskGold') }}:{{ format3(taskGold || 0) }} |
|
|
|
香港:{{ format3(statisticsData.hkGold || 0) }} |
|
|
|
新加坡HC:{{ format3(statisticsData.sgHcGold || 0) }} |
|
|
|
马来西亚:{{ format3(statisticsData.myGold || 0) }} |
|
|
|
新加坡:{{ format3(statisticsData.sgGold || 0) }} |
|
|
|
加拿大:{{ format3(statisticsData.caGold || 0) }} |
|
|
|
泰国HS:{{ format3(statisticsData.thHsGold || 0) }} |
|
|
|
泰国HA:{{ format3(statisticsData.thHaGold || 0) }} |
|
|
|
越南:{{ format3(statisticsData.vnGold || 0) }} |
|
|
|
北京:{{ format3(statisticsData.bjGold || 0) }} |
|
|
|
</div> |
|
|
|
<!-- 设置表格容器的高度和滚动样式 --> |
|
|
|
<div style="flex: 1; overflow-y: auto"> |
|
|
|
@ -439,34 +441,49 @@ const format3 = (num) => { |
|
|
|
<el-table-column prop="name" :label="$t('common_list.name')" width="140" /> |
|
|
|
<el-table-column prop="jwcode" :label="$t('common_list.jwcode')" width="160" /> |
|
|
|
<el-table-column prop="market" :label="$t('common_list.market')" width="140" /> |
|
|
|
<el-table-column prop="sumGold" :label="$t('common_list.sumGold')" width="180" aligh="center"> |
|
|
|
<!-- <template #default="scope"> |
|
|
|
<span>{{ |
|
|
|
((scope.row.currentPermanentGold || 0) + |
|
|
|
(scope.row.currentFreeJune || 0) + |
|
|
|
(scope.row.currentFreeDecember || 0) + |
|
|
|
(scope.row.currentTaskGold || 0)) |
|
|
|
}}</span> |
|
|
|
</template> --> |
|
|
|
<el-table-column prop="hkGold" label="香港" sortable="custom" min-width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ (scope.row.hkGold || 0) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="sgHcGold" label="新加坡HC" sortable="custom" min-width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ (scope.row.sgHcGold || 0) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="myGold" label="马来西亚" sortable="custom" min-width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ (scope.row.myGold || 0) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="sgGold" label="新加坡" sortable="custom" min-width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ (scope.row.sgGold || 0) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="caGold" label="加拿大" sortable="custom" min-width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ (scope.row.caGold || 0) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="currentPermanentGold" :label="$t('common_list.permanentGold')" sortable="custom" width="210"> |
|
|
|
<el-table-column prop="thHsGold" label="泰国HS" sortable="custom" min-width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ (scope.row.currentPermanentGold || 0) }}</span> |
|
|
|
<span>{{ (scope.row.thHsGold || 0) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="currentFreeJune" :label="$t('common_list.freeGold6Month')" sortable="custom" width="200"> |
|
|
|
<el-table-column prop="thHaGold" label="泰国HA" sortable="custom" min-width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ (scope.row.currentFreeJune || 0) }}</span> |
|
|
|
<span>{{ (scope.row.thHaGold || 0) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="currentFreeDecember" :label="$t('common_list.freeGold12Month')" sortable="custom" width="200"> |
|
|
|
<el-table-column prop="vnGold" label="越南" sortable="custom" min-width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ (scope.row.currentFreeDecember || 0) }}</span> |
|
|
|
<span>{{ (scope.row.vnGold || 0) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="currentTaskGold" :label="$t('common_list.taskGold')" sortable="custom" width="180"> |
|
|
|
<el-table-column prop="bjGold" label="北京" sortable="custom" min-width="120"> |
|
|
|
<template #default="scope"> |
|
|
|
<span>{{ (scope.row.currentTaskGold || 0) }}</span> |
|
|
|
<span>{{ (scope.row.bjGold || 0) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column prop="rcoin" label="历史金币总额" width="150"> |
|
|
|
@ -555,7 +572,6 @@ const format3 = (num) => { |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|