客户列表

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">
<template slot-scope="{ row }" slot="menu">
<el-button type="text" icon="el-icon-shopping-cart-1" size="small" @click="handleDetail(row)"
:disabled="row.neckLength < 1">购买记录</el-button>
<el-button type="text" icon="el-icon-delete" size="small" @click="handleDelete(row)">删除</el-button>
:disabled="row.count < 1">购买记录</el-button>
</template>
<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>
</template>
</avue-crud>
<el-dialog :visible.sync="dialogVisible" width="60%" title="购买记录" :append-to-body="true" center>
<el-descriptions :column="2" border>
<el-descriptions-item label="昵称">kooriookami</el-descriptions-item>
<el-descriptions-item label="手机号">18100000000</el-descriptions-item>
<template v-for="(item, index) in recordData">
<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>
</template>
@ -36,13 +34,7 @@
</template>
<script>
// import {getBaseList,getTypeList} from "@/api/base"
import {
getList,
exportList,
deleteList,
detailList,
} from "@/api/statistics/statistics";
import { getWeChatUser, getWeChatUserBuy } from "@/api/customer/customer";
export default {
data() {
return {
@ -57,7 +49,7 @@ export default {
},
selectionList: [],
option: {
selection: true,
selection: false,
searchShowBtn: false,
refreshBtn: false,
columnBtn: false,
@ -75,20 +67,20 @@ export default {
column: [
{
label: "微信昵称",
prop: "nickname",
prop: "username",
search: true,
},
{
label: "手机号",
prop: "phonenumber",
prop: "phone",
search: true,
},
{
label: "购买次数",
prop: "neckLength",
prop: "count",
html: true,
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) {
this.recordRow = row;
this.recordData = [
{ createTime: '2023-07-21 21:12:53', orderNo: '14426859489451654' }
];
this.recordPage.total = 20;
this.recordPage.currentPage = 1;
this.queryBuyRecord();
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) {
console.log(currentPage)
this.recordPage.currentPage = currentPage;
// this.recordData = [
// { 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();
this.queryBuyRecord();
},
selectionChange(data) {
this.selectionList = data;
@ -213,39 +205,11 @@ export default {
this.date = year + "-" + (month + 1) + "-" + data;
},
onLoad() {
let params = {};
// 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 : ''
// }
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({
this.loading = true;
getWeChatUser({
current: this.page.currentPage,
size: this.page.pageSize,
...params,
...this.query,
}).then((res) => {
console.log("res==>", res);
this.loading = false;

Loading…
Cancel
Save