|
@ -242,20 +242,146 @@ const json_meta = [ |
|
|
], |
|
|
], |
|
|
]; |
|
|
]; |
|
|
const exportExcel = () => { |
|
|
const exportExcel = () => { |
|
|
const ws = XLSX.utils.json_to_sheet(tableData.value, json_fields); |
|
|
|
|
|
|
|
|
const ws = XLSX.utils.json_to_sheet(excelInfo.value, json_fields); |
|
|
const wb = XLSX.utils.book_new(); |
|
|
const wb = XLSX.utils.book_new(); |
|
|
XLSX.utils.book_append_sheet(wb, ws, "Sheet1"); |
|
|
XLSX.utils.book_append_sheet(wb, ws, "Sheet1"); |
|
|
XLSX.writeFile(wb, "客户金币明细.xlsx"); |
|
|
XLSX.writeFile(wb, "客户金币明细.xlsx"); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const putExcel = ref({}); |
|
|
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的弹窗 --> |
|
|
<!-- 这是导出excel的弹窗 --> |
|
|
<el-dialog |
|
|
<el-dialog |
|
|
v-model="getPutEX" |
|
|
v-model="getPutEX" |
|
|
title="请选择要导出的内容" |
|
|
|
|
|
|
|
|
title="请选择导出条件" |
|
|
width="500" |
|
|
width="500" |
|
|
:close-on-click-modal="false" |
|
|
:close-on-click-modal="false" |
|
|
> |
|
|
> |
|
@ -285,51 +411,28 @@ const putExcel = ref({}); |
|
|
clearable |
|
|
clearable |
|
|
> |
|
|
> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="item in updateType" |
|
|
|
|
|
|
|
|
v-for="item in area" |
|
|
:key="item.value" |
|
|
:key="item.value" |
|
|
:label="item.label" |
|
|
:label="item.label" |
|
|
:value="item.value" |
|
|
:value="item.value" |
|
|
/> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="平台信息:" |
|
|
|
|
|
><el-select |
|
|
|
|
|
v-model="putExcel.consumePlatform" |
|
|
|
|
|
placeholder="请选择平台信息" |
|
|
|
|
|
style="width: 240px" |
|
|
|
|
|
clearable |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in updateType" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:value="item.value" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="更新类型:"> |
|
|
|
|
|
<el-radio-group v-model="putExcel.updateType"> |
|
|
|
|
|
<el-radio label="all">全部</el-radio> |
|
|
|
|
|
<el-radio label="page">充值</el-radio> |
|
|
|
|
|
<el-radio label="page">消费</el-radio> |
|
|
|
|
|
<el-radio label="page">退款</el-radio> |
|
|
|
|
|
</el-radio-group> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="更新时间:"> |
|
|
<el-form-item label="更新时间:"> |
|
|
<el-date-picker |
|
|
|
|
|
v-model="putExcel.createTime" |
|
|
|
|
|
type="datetimerange" |
|
|
|
|
|
range-separator="至" |
|
|
|
|
|
start-placeholder="起始时间" |
|
|
|
|
|
end-placeholder="结束时间" |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
<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-form-item> |
|
|
<el-button |
|
|
<el-button |
|
|
type="primary" |
|
|
type="primary" |
|
|
size="small" |
|
|
size="small" |
|
|
style="margin-left: 10px" |
|
|
style="margin-left: 10px" |
|
|
@click="exportExcel" |
|
|
|
|
|
>导出</el-button |
|
|
|
|
|
|
|
|
@click="areyour()" |
|
|
|
|
|
>确定</el-button |
|
|
> |
|
|
> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</template> |
|
|
</template> |
|
|