|
@ -6,6 +6,7 @@ import axios from "axios"; |
|
|
import moment from "moment"; |
|
|
import moment from "moment"; |
|
|
import { ta } from "element-plus/es/locales.mjs"; |
|
|
import { ta } from "element-plus/es/locales.mjs"; |
|
|
import API from "../../api/index.js"; |
|
|
import API from "../../api/index.js"; |
|
|
|
|
|
import * as XLSX from "xlsx"; |
|
|
|
|
|
|
|
|
// 充值明细表格 |
|
|
// 充值明细表格 |
|
|
const tableData = ref([]); |
|
|
const tableData = ref([]); |
|
@ -29,6 +30,8 @@ const getObj = ref({ |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
|
pageSize: 50, |
|
|
pageSize: 50, |
|
|
}); |
|
|
}); |
|
|
|
|
|
//开启条件筛选导出excel |
|
|
|
|
|
const getPutEX = ref(false); |
|
|
|
|
|
|
|
|
// 支付方式选项 |
|
|
// 支付方式选项 |
|
|
const updateType = [ |
|
|
const updateType = [ |
|
@ -210,9 +213,231 @@ const checkNumber = function () { |
|
|
onMounted(async function () { |
|
|
onMounted(async function () { |
|
|
await get(); |
|
|
await get(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 这是导出excel表格的方法 |
|
|
|
|
|
// 导出Excel的方法 |
|
|
|
|
|
// 定义字段映射 |
|
|
|
|
|
const json_fields = (row) => { |
|
|
|
|
|
return [ |
|
|
|
|
|
row.uname, // 姓名 |
|
|
|
|
|
row.jwcode, // 精网号 |
|
|
|
|
|
row.area, // 所属地区 |
|
|
|
|
|
row.consumePlatform, // 平台信息 |
|
|
|
|
|
row.firstexam_score, // 更新数量 |
|
|
|
|
|
row.freeCoin, // 免费金币 |
|
|
|
|
|
row.rechageCoin, // 充值金币 |
|
|
|
|
|
row.taskCoin, // 任务金币 |
|
|
|
|
|
row.name, // 提交人 |
|
|
|
|
|
moment(row.createTime).format("YYYY-MM-DD HH:mm:ss"), // 更新时间,假设你想要格式化时间 |
|
|
|
|
|
]; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 定义元数据 |
|
|
|
|
|
const json_meta = [ |
|
|
|
|
|
[ |
|
|
|
|
|
{ |
|
|
|
|
|
key: "charset", |
|
|
|
|
|
value: "utf-8", |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
]; |
|
|
|
|
|
const exportExcel = () => { |
|
|
|
|
|
const ws = XLSX.utils.json_to_sheet(excelInfo.value, json_fields); |
|
|
|
|
|
const wb = XLSX.utils.book_new(); |
|
|
|
|
|
XLSX.utils.book_append_sheet(wb, ws, "Sheet1"); |
|
|
|
|
|
XLSX.writeFile(wb, "客户金币明细.xlsx"); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const putExcel = ref({}); |
|
|
|
|
|
const excelInfo = ref({}); |
|
|
|
|
|
const areyour = async function (val) { |
|
|
|
|
|
try { |
|
|
|
|
|
const result = await API.post( |
|
|
|
|
|
"http://192.168.8.93:10010/detailY/searchAll", |
|
|
|
|
|
{ ...putExcel.value } |
|
|
|
|
|
); |
|
|
|
|
|
excelInfo.value = result.data; |
|
|
|
|
|
areyouright.value = true; |
|
|
|
|
|
ElMessage({ |
|
|
|
|
|
type: "success", |
|
|
|
|
|
message: "导出成功", |
|
|
|
|
|
}); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.log("请求失败", error); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const areyouright = ref(false); |
|
|
|
|
|
|
|
|
|
|
|
//选地区 |
|
|
|
|
|
const area = [ |
|
|
|
|
|
{ |
|
|
|
|
|
value: "马来西亚", |
|
|
|
|
|
label: "马来西亚", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: "新加坡", |
|
|
|
|
|
label: "新加坡", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: "香港", |
|
|
|
|
|
label: "香港", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: "泰国", |
|
|
|
|
|
label: "泰国", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: "加拿大", |
|
|
|
|
|
label: "加拿大", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
value: "越南HCM", |
|
|
|
|
|
label: "越南HCM", |
|
|
|
|
|
}, |
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
const TimeGet = ref("1"); |
|
|
|
|
|
|
|
|
|
|
|
// 今天 |
|
|
|
|
|
const getT = function () { |
|
|
|
|
|
const today = new Date(); |
|
|
|
|
|
const startDate = new Date( |
|
|
|
|
|
today.getFullYear(), |
|
|
|
|
|
today.getMonth(), |
|
|
|
|
|
today.getDate() |
|
|
|
|
|
); |
|
|
|
|
|
const endDate = new Date( |
|
|
|
|
|
today.getFullYear(), |
|
|
|
|
|
today.getMonth(), |
|
|
|
|
|
today.getDate() + 1 |
|
|
|
|
|
); |
|
|
|
|
|
putExcel.value.startDate = startDate; |
|
|
|
|
|
putExcel.value.endDate = endDate; |
|
|
|
|
|
console.log("putExcel", putExcel.value); |
|
|
|
|
|
}; |
|
|
|
|
|
//3天 |
|
|
|
|
|
const get3 = function () { |
|
|
|
|
|
const today = new Date(); |
|
|
|
|
|
const startDate = new Date( |
|
|
|
|
|
today.getFullYear(), |
|
|
|
|
|
today.getMonth(), |
|
|
|
|
|
today.getDate() - 2 |
|
|
|
|
|
); |
|
|
|
|
|
const endDate = new Date( |
|
|
|
|
|
today.getFullYear(), |
|
|
|
|
|
today.getMonth(), |
|
|
|
|
|
today.getDate() + 1 |
|
|
|
|
|
); |
|
|
|
|
|
putExcel.value.startDate = startDate; |
|
|
|
|
|
putExcel.value.endDate = endDate; |
|
|
|
|
|
console.log("putExcel", putExcel.value); |
|
|
|
|
|
}; |
|
|
|
|
|
// 7天 |
|
|
|
|
|
const get7 = function () { |
|
|
|
|
|
const today = new Date(); |
|
|
|
|
|
const startDate = new Date( |
|
|
|
|
|
today.getFullYear(), |
|
|
|
|
|
today.getMonth(), |
|
|
|
|
|
today.getDate() - 6 |
|
|
|
|
|
); |
|
|
|
|
|
const endDate = new Date( |
|
|
|
|
|
today.getFullYear(), |
|
|
|
|
|
today.getMonth(), |
|
|
|
|
|
today.getDate() + 1 |
|
|
|
|
|
); |
|
|
|
|
|
putExcel.value.startDate = startDate; |
|
|
|
|
|
putExcel.value.endDate = endDate; |
|
|
|
|
|
console.log("putExcel", putExcel.value); |
|
|
|
|
|
}; |
|
|
|
|
|
// 30天 |
|
|
|
|
|
const get30 = function () { |
|
|
|
|
|
const today = new Date(); |
|
|
|
|
|
const startDate = new Date( |
|
|
|
|
|
today.getFullYear(), |
|
|
|
|
|
today.getMonth() - 1, |
|
|
|
|
|
today.getDate() |
|
|
|
|
|
); |
|
|
|
|
|
const endDate = new Date( |
|
|
|
|
|
today.getFullYear(), |
|
|
|
|
|
today.getMonth(), |
|
|
|
|
|
today.getDate() + 1 |
|
|
|
|
|
); |
|
|
|
|
|
putExcel.value.startDate = startDate; |
|
|
|
|
|
putExcel.value.endDate = endDate; |
|
|
|
|
|
console.log("putExcel", putExcel.value); |
|
|
|
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<template> |
|
|
<template> |
|
|
|
|
|
<el-dialog |
|
|
|
|
|
v-model="areyouright" |
|
|
|
|
|
title="" |
|
|
|
|
|
width="500" |
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
> |
|
|
|
|
|
<el-button type="success" @click="exportExcel()">导出</el-button> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
<!-- 这是导出excel的弹窗 --> |
|
|
|
|
|
<el-dialog |
|
|
|
|
|
v-model="getPutEX" |
|
|
|
|
|
title="请选择导出条件" |
|
|
|
|
|
width="500" |
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
> |
|
|
|
|
|
<template #footer> |
|
|
|
|
|
<el-form |
|
|
|
|
|
ref="ruleFormRef" |
|
|
|
|
|
style="max-width: 600px" |
|
|
|
|
|
:model="putExcel" |
|
|
|
|
|
:rules="rules" |
|
|
|
|
|
label-width="auto" |
|
|
|
|
|
class="demo-ruleForm" |
|
|
|
|
|
:size="formSize" |
|
|
|
|
|
status-icon |
|
|
|
|
|
> |
|
|
|
|
|
<el-form-item prop="activityName" label="精网号:"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="putExcel.jwcode" |
|
|
|
|
|
placeholder="请输入精网号" |
|
|
|
|
|
style="width: 220px" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="所属地区:" |
|
|
|
|
|
><el-select |
|
|
|
|
|
v-model="putExcel.area" |
|
|
|
|
|
placeholder="请选择所属地区" |
|
|
|
|
|
style="width: 240px" |
|
|
|
|
|
clearable |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in area" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:value="item.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="更新时间:"> |
|
|
|
|
|
<el-radio-group v-model="TimeGet"> |
|
|
|
|
|
<el-radio value="1" @click="getT()">今天</el-radio> |
|
|
|
|
|
<el-radio value="3" @click="get3()">近三天</el-radio> |
|
|
|
|
|
<el-radio value="7" @click="get7()">近一周</el-radio> |
|
|
|
|
|
<el-radio value="30" @click="get30()">近一个月</el-radio> |
|
|
|
|
|
</el-radio-group> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="primary" |
|
|
|
|
|
size="small" |
|
|
|
|
|
style="margin-left: 10px" |
|
|
|
|
|
@click="areyour()" |
|
|
|
|
|
>确定</el-button |
|
|
|
|
|
> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col> |
|
|
<el-col> |
|
|
<el-card style="margin-bottom: 20px"> |
|
|
<el-card style="margin-bottom: 20px"> |
|
@ -254,6 +479,12 @@ onMounted(async function () { |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<div class="head-card-btn"> |
|
|
<div class="head-card-btn"> |
|
|
|
|
|
<el-button |
|
|
|
|
|
type="success" |
|
|
|
|
|
style="margin-right: 40px" |
|
|
|
|
|
@click="getPutEX = true" |
|
|
|
|
|
>导出Excel表格</el-button |
|
|
|
|
|
> |
|
|
<el-button @click="reset()">重置</el-button> |
|
|
<el-button @click="reset()">重置</el-button> |
|
|
<el-button type="primary" @click="search()">查询</el-button> |
|
|
<el-button type="primary" @click="search()">查询</el-button> |
|
|
</div> |
|
|
</div> |
|
@ -283,7 +514,7 @@ onMounted(async function () { |
|
|
}}</span> |
|
|
}}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="uname" label="姓名" width="130" /> |
|
|
|
|
|
|
|
|
<el-table-column prop="username" label="姓名" width="130" /> |
|
|
<el-table-column prop="jwcode" label="精网号" width="170" /> |
|
|
<el-table-column prop="jwcode" label="精网号" width="170" /> |
|
|
<el-table-column prop="area" label="所属地区" width="170" /> |
|
|
<el-table-column prop="area" label="所属地区" width="170" /> |
|
|
<el-table-column |
|
|
<el-table-column |
|
|