|
|
|
|
@ -17,15 +17,12 @@ |
|
|
|
|
<el-descriptions-item label="昵称">{{ recordRow.username }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="手机号">{{ recordRow.phone }}</el-descriptions-item> |
|
|
|
|
<template v-for="(item) in recordData"> |
|
|
|
|
<el-descriptions-item label="下单时间">{{item.createTime}}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="下单编号">{{item.orderNo}}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="下单时间">{{ item.createTime }}</el-descriptions-item> |
|
|
|
|
<el-descriptions-item label="下单编号">{{ item.orderNo }}</el-descriptions-item> |
|
|
|
|
</template> |
|
|
|
|
</el-descriptions> |
|
|
|
|
<div style="margin: 20px 0 0; text-align:center;"> |
|
|
|
|
<el-pagination |
|
|
|
|
background |
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
@current-change="currentRecordChange" |
|
|
|
|
<el-pagination background layout="total, prev, pager, next" @current-change="currentRecordChange" |
|
|
|
|
:total="recordPage.total"> |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
|
@ -35,6 +32,12 @@ |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { getWeChatUser, getWeChatUserBuy } from "@/api/customer/customer"; |
|
|
|
|
import { exportBlob } from "@/api/common"; |
|
|
|
|
import { downloadXls } from "@/util/util"; |
|
|
|
|
import { dateNow } from "@/util/date"; |
|
|
|
|
import { getToken } from "@/util/auth"; |
|
|
|
|
import NProgress from 'nprogress'; |
|
|
|
|
import 'nprogress/nprogress.css'; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
@ -123,7 +126,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
//购买记录列表分页查询 |
|
|
|
|
queryBuyRecord() { |
|
|
|
|
getWeChatUserBuy({buyerPhone: this.recordRow.phone, current: this.recordPage.currentPage, size: this.recordPage.size}).then(res => { |
|
|
|
|
getWeChatUserBuy({ buyerPhone: this.recordRow.phone, current: this.recordPage.currentPage, size: this.recordPage.size }).then(res => { |
|
|
|
|
this.recordData = res.data.data.records; |
|
|
|
|
this.recordPage.total = res.data.data.total; |
|
|
|
|
}) |
|
|
|
|
@ -221,98 +224,20 @@ export default { |
|
|
|
|
this.$router.push({ path: "/register/add", query: { type: "add" } }); |
|
|
|
|
}, |
|
|
|
|
exportData() { |
|
|
|
|
let params = {}; |
|
|
|
|
if (!this.form.timeArr) { |
|
|
|
|
params = { |
|
|
|
|
username: this.form.name ? this.form.name : "", |
|
|
|
|
phone: this.form.phonenumber ? this.form.phonenumber : "", |
|
|
|
|
pillowHardness: this.form.hardness ? this.form.hardness : "", |
|
|
|
|
pillowMaterial: this.form.material ? this.form.material : "", |
|
|
|
|
ageRange: this.form.age ? this.form.age : "", |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
params = { |
|
|
|
|
username: this.form.name ? this.form.name : "", |
|
|
|
|
phone: this.form.phonenumber ? this.form.phonenumber : "", |
|
|
|
|
pillowHardness: this.form.hardness ? this.form.hardness : "", |
|
|
|
|
pillowMaterial: this.form.material ? this.form.material : "", |
|
|
|
|
ageRange: this.form.age ? this.form.age : "", |
|
|
|
|
startTime: this.form.timeArr[0], |
|
|
|
|
endTime: this.form.timeArr[1], |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
exportList(params).then((res) => { |
|
|
|
|
console.log(res); |
|
|
|
|
if (!res || !res.data) { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "error", |
|
|
|
|
message: "导出失败!", |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
let blob = new Blob([res.data]); //response.data为后端传的流文件 |
|
|
|
|
let downloadFilename = "统计" + ".xlsx"; //设置导出的文件名 |
|
|
|
|
if (window.navigator && window.navigator.msSaveOrOpenBlob) { |
|
|
|
|
//兼容ie浏览器 |
|
|
|
|
window.navigator.msSaveOrOpenBlob(blob, downloadFilename); |
|
|
|
|
} else { |
|
|
|
|
//谷歌,火狐等浏览器 |
|
|
|
|
let url = window.URL.createObjectURL(blob); |
|
|
|
|
let downloadElement = document.createElement("a"); |
|
|
|
|
downloadElement.style.display = "none"; |
|
|
|
|
downloadElement.href = url; |
|
|
|
|
downloadElement.download = downloadFilename; |
|
|
|
|
document.body.appendChild(downloadElement); |
|
|
|
|
downloadElement.click(); |
|
|
|
|
document.body.removeChild(downloadElement); |
|
|
|
|
window.URL.revokeObjectURL(url); |
|
|
|
|
} |
|
|
|
|
this.$message({ type: "success", message: "导出成功!" }); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
deleteItem() { |
|
|
|
|
if (this.selectionList.length == 0) { |
|
|
|
|
this.$message.warning("请至少选择一条数据"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.$confirm(`确认删除当前数据吗?`, { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
}).then(() => { |
|
|
|
|
deleteList(this.ids).then((res) => { |
|
|
|
|
console.log(res); |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success("删除成功"); |
|
|
|
|
this.page.pageSize = 1; |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
importRegister() { }, |
|
|
|
|
handleEdit() { |
|
|
|
|
this.$router.push({ path: "/request/add" }); |
|
|
|
|
}, |
|
|
|
|
handleDelete(row) { |
|
|
|
|
this.$confirm(`确认删除当前数据吗?`, { |
|
|
|
|
this.$confirm("是否导出用户数据?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
deleteList(row.id).then((res) => { |
|
|
|
|
console.log(res); |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success("删除成功"); |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
NProgress.start(); |
|
|
|
|
exportBlob(`/api/weChatUser/export?${this.website.tokenHeader}=${getToken()}${this.query.phone ? '&phone=' + this.query.phone : ''}${this.query.username ? '&username=' + this.query.username : ''}`).then(res => { |
|
|
|
|
downloadXls(res.data, `用户数据${dateNow()}.xlsx`); |
|
|
|
|
NProgress.done(); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
|
</style> |
|
|
|
|
<style lang="scss"></style> |
|
|
|
|
|