客户列表

main
xuechunyuan 2 years ago
parent fd540fee0a
commit 057ec713d7
  1. 17
      src/api/customer/customer.js
  2. 82
      src/views/customer/index.vue

@ -0,0 +1,17 @@
import request from "@/router/axios";
//查询用户列表
export const getWeChatUser = (params) => {
return request({
url: "/api/weChatUser/buyCount",
method: "get",
params: params
});
};
//查询用户购买记录列表
export const getWeChatUserBuy = (params) => {
return request({
url: "/api/blade-desk/order/page",
method: "get",
params: params
});
};

@ -6,19 +6,17 @@
@refresh-change="refreshChange"> @refresh-change="refreshChange">
<template slot-scope="{ row }" slot="menu"> <template slot-scope="{ row }" slot="menu">
<el-button type="text" icon="el-icon-shopping-cart-1" size="small" @click="handleDetail(row)" <el-button type="text" icon="el-icon-shopping-cart-1" size="small" @click="handleDetail(row)"
:disabled="row.neckLength < 1">购买记录</el-button> :disabled="row.count < 1">购买记录</el-button>
<el-button type="text" icon="el-icon-delete" size="small" @click="handleDelete(row)">删除</el-button>
</template> </template>
<template slot-scope="scope" slot="menuLeft"> <template slot-scope="scope" slot="menuLeft">
<el-button icon="el-icon-delete" type="danger" size="small" @click="deleteItem" plain>删除</el-button>
<el-button icon="el-icon-download" type="warning" size="small" @click="exportData" plain>导出</el-button> <el-button icon="el-icon-download" type="warning" size="small" @click="exportData" plain>导出</el-button>
</template> </template>
</avue-crud> </avue-crud>
<el-dialog :visible.sync="dialogVisible" width="60%" title="购买记录" :append-to-body="true" center> <el-dialog :visible.sync="dialogVisible" width="60%" title="购买记录" :append-to-body="true" center>
<el-descriptions :column="2" border> <el-descriptions :column="2" border>
<el-descriptions-item label="昵称">kooriookami</el-descriptions-item> <el-descriptions-item label="昵称">{{ recordRow.username }}</el-descriptions-item>
<el-descriptions-item label="手机号">18100000000</el-descriptions-item> <el-descriptions-item label="手机号">{{ recordRow.phone }}</el-descriptions-item>
<template v-for="(item, index) in recordData"> <template v-for="(item) in recordData">
<el-descriptions-item label="下单时间">{{item.createTime}}</el-descriptions-item> <el-descriptions-item label="下单时间">{{item.createTime}}</el-descriptions-item>
<el-descriptions-item label="下单编号">{{item.orderNo}}</el-descriptions-item> <el-descriptions-item label="下单编号">{{item.orderNo}}</el-descriptions-item>
</template> </template>
@ -36,13 +34,7 @@
</template> </template>
<script> <script>
// import {getBaseList,getTypeList} from "@/api/base" import { getWeChatUser, getWeChatUserBuy } from "@/api/customer/customer";
import {
getList,
exportList,
deleteList,
detailList,
} from "@/api/statistics/statistics";
export default { export default {
data() { data() {
return { return {
@ -57,7 +49,7 @@ export default {
}, },
selectionList: [], selectionList: [],
option: { option: {
selection: true, selection: false,
searchShowBtn: false, searchShowBtn: false,
refreshBtn: false, refreshBtn: false,
columnBtn: false, columnBtn: false,
@ -75,20 +67,20 @@ export default {
column: [ column: [
{ {
label: "微信昵称", label: "微信昵称",
prop: "nickname", prop: "username",
search: true, search: true,
}, },
{ {
label: "手机号", label: "手机号",
prop: "phonenumber", prop: "phone",
search: true, search: true,
}, },
{ {
label: "购买次数", label: "购买次数",
prop: "neckLength", prop: "count",
html: true, html: true,
formatter: (data) => { formatter: (data) => {
return '<span style="' + (data.neckLength > 0 ? '' : 'color:red;') + '">' + data.neckLength + '</span>' return '<span style="' + (data.count > 0 ? '' : 'color:red;') + '">' + data.count + '</span>'
} }
}, },
], ],
@ -125,22 +117,22 @@ export default {
// //
handleDetail(row) { handleDetail(row) {
this.recordRow = row; this.recordRow = row;
this.recordData = [ this.recordPage.currentPage = 1;
{ createTime: '2023-07-21 21:12:53', orderNo: '14426859489451654' } this.queryBuyRecord();
];
this.recordPage.total = 20;
this.dialogVisible = true; this.dialogVisible = true;
}, },
//
queryBuyRecord() {
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;
})
},
// //
currentRecordChange(currentPage) { currentRecordChange(currentPage) {
console.log(currentPage) console.log(currentPage)
this.recordPage.currentPage = currentPage; this.recordPage.currentPage = currentPage;
// this.recordData = [ this.queryBuyRecord();
// { createTime: '2023-07-21 21:12:53', orderNo: '14426859489451654' },
// { createTime: '2023-07-21 21:12:53', orderNo: '14426859489451654' },
// { createTime: '2023-07-21 21:12:53', orderNo: '14426859489451654' }
// ];
this.handleDetail();
}, },
selectionChange(data) { selectionChange(data) {
this.selectionList = data; this.selectionList = data;
@ -213,39 +205,11 @@ export default {
this.date = year + "-" + (month + 1) + "-" + data; this.date = year + "-" + (month + 1) + "-" + data;
}, },
onLoad() { onLoad() {
let params = {}; this.loading = true;
// params = { getWeChatUser({
// 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 : ''
// }
if (!this.form.timeArr) {
params = {
username: this.form.username ? this.form.username : "",
phone: this.form.phonenumber ? this.form.phonenumber : "",
pillowHardness: this.form.hardness ? this.form.hardness : "",
pillowMaterial: this.form.material ? this.form.material : "",
ageRange: this.form.ageRange ? this.form.ageRange : "",
};
} else {
params = {
username: this.form.username ? this.form.username : "",
phone: this.form.phonenumber ? this.form.phonenumber : "",
pillowHardness: this.form.hardness ? this.form.hardness : "",
pillowMaterial: this.form.material ? this.form.material : "",
ageRange: this.form.ageRange ? this.form.ageRange : "",
startTime: this.form.timeArr[0],
endTime: this.form.timeArr[1],
};
}
console.log("par", params);
getList({
current: this.page.currentPage, current: this.page.currentPage,
size: this.page.pageSize, size: this.page.pageSize,
...params, ...this.query,
}).then((res) => { }).then((res) => {
console.log("res==>", res); console.log("res==>", res);
this.loading = false; this.loading = false;

Loading…
Cancel
Save