识别代办
This commit is contained in:
parent
ee94473c76
commit
97c1eb6f81
@ -25,16 +25,26 @@
|
|||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="角色" prop="roleCode">
|
|
||||||
<el-select v-model="queryParams.roleCode" placeholder="请选择角色">
|
<!-- <el-form-item label="角色" prop="roleCode">-->
|
||||||
<el-option
|
<!-- <el-select v-model="queryParams.roleCode" placeholder="请选择角色">-->
|
||||||
v-for="dict in dict.type.jcz_role"
|
<!-- <el-option-->
|
||||||
:key="dict.value"
|
<!-- v-for="dict in dict.type.jcz_role"-->
|
||||||
:label="dict.label"
|
<!-- :key="dict.value"-->
|
||||||
:value="dict.value"
|
<!-- :label="dict.label"-->
|
||||||
></el-option>
|
<!-- :value="dict.value"-->
|
||||||
</el-select>
|
<!-- ></el-option>-->
|
||||||
</el-form-item>
|
<!-- </el-select>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
|
||||||
|
<!--简单比较,不做角色绑定-->
|
||||||
|
<el-table-column label="角色" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ getOrderCount(scope.row.userId) > 1 ? '疑似代办' : '普通用户' }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
@ -58,7 +68,13 @@
|
|||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="客户名称" align="center" prop="customerName" />
|
<el-table-column label="客户名称" align="center" prop="customerName" />
|
||||||
<el-table-column label="客户手机号" align="center" prop="customerPhone" />
|
<el-table-column label="客户手机号" align="center" prop="customerPhone" />
|
||||||
<el-table-column label="角色" align="center" prop="roleName" />
|
<el-table-column label="标签" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.orderCount > 3" type="danger">疑似代办</el-tag>
|
||||||
|
<el-tag v-else type="success">正常</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="本年度订单数量" align="center" prop="orderCount"/>
|
||||||
<el-table-column label="性别" align="center" prop="sex">
|
<el-table-column label="性别" align="center" prop="sex">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
|
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
|
||||||
@ -67,11 +83,11 @@
|
|||||||
<el-table-column label="年龄" align="center" prop="userAge" />
|
<el-table-column label="年龄" align="center" prop="userAge" />
|
||||||
<el-table-column label="车辆号码----------保险到期时间-------年检到期时间 " width="355" align="center" prop="userCarList" >
|
<el-table-column label="车辆号码----------保险到期时间-------年检到期时间 " width="355" align="center" prop="userCarList" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- <div style="display: flex">-->
|
<!-- <div style="display: flex">-->
|
||||||
<!-- <div>{{scope.row.userCarList.carNo}}</div>-->
|
<!-- <div>{{scope.row.userCarList.carNo}}</div>-->
|
||||||
<!-- <div>{{scope.row.userCarList.insuranceExpiryDate}}</div>-->
|
<!-- <div>{{scope.row.userCarList.insuranceExpiryDate}}</div>-->
|
||||||
<!-- <div>{{scope.row.userCarList.nextInspectionDate}}</div>-->
|
<!-- <div>{{scope.row.userCarList.nextInspectionDate}}</div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
|
|
||||||
<el-table v-loading="loading" :show-header="tou" :data="scope.row.userCarList" >
|
<el-table v-loading="loading" :show-header="tou" :data="scope.row.userCarList" >
|
||||||
|
|
||||||
@ -162,7 +178,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 新增上传车辆信息-->
|
<!-- 新增上传车辆信息-->
|
||||||
<div v-for="(item,index) in form.userCarList" :key="index" style="width: 100%; ">
|
<div v-for="(item,index) in form.userCarList" :key="index" style="width: 100%; ">
|
||||||
<el-collapse v-model="activeName" accordion>
|
<el-collapse v-model="activeName" accordion>
|
||||||
<el-collapse-item title="车辆信息" accordion>
|
<el-collapse-item title="车辆信息" accordion>
|
||||||
@ -299,11 +315,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listCustomerInfo, getCustomerInfo, delCustomerInfo, addCustomerInfo, updateCustomerInfo } from "./api/customer";
|
import {
|
||||||
import request from "@/utils/request";
|
listCustomerInfo,
|
||||||
import DictTag from '@/components/DictTagOld/index.vue'
|
getCustomerInfo,
|
||||||
|
delCustomerInfo,
|
||||||
|
addCustomerInfo,
|
||||||
|
updateCustomerInfo,
|
||||||
|
getUserOrderCounts
|
||||||
|
} from './api/customer';
|
||||||
|
import request from "@/utils/request";
|
||||||
|
import DictTag from '@/components/DictTagOld/index.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "CustomerInfo",
|
name: "CustomerInfo",
|
||||||
components:{DictTag},
|
components:{DictTag},
|
||||||
dicts: ['sys_user_sex','jcz_role'],
|
dicts: ['sys_user_sex','jcz_role'],
|
||||||
@ -324,6 +347,8 @@
|
|||||||
total: 0,
|
total: 0,
|
||||||
// 客户信息表格数据
|
// 客户信息表格数据
|
||||||
customerInfoList: [],
|
customerInfoList: [],
|
||||||
|
//每个用户的订单数量
|
||||||
|
userOrderCounts: [],
|
||||||
// userCarList:[],
|
// userCarList:[],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
title: "",
|
title: "",
|
||||||
@ -378,6 +403,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.getList();
|
this.getList();
|
||||||
|
// this.queryUserOrderCounts();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addCommodity(){
|
addCommodity(){
|
||||||
@ -401,13 +427,45 @@
|
|||||||
/** 查询客户信息列表 */
|
/** 查询客户信息列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
|
// 查询客户信息
|
||||||
listCustomerInfo(this.queryParams).then(response => {
|
listCustomerInfo(this.queryParams).then(response => {
|
||||||
this.customerInfoList = response.data.records;
|
this.customerInfoList = response.data.records;
|
||||||
// this.userCarList = response.rows.userCarList
|
|
||||||
this.total = response.data.total;
|
this.total = response.data.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
||||||
|
// 获取用户的订单数量
|
||||||
|
// return getUserOrderCounts().then(userOrderCounts => {
|
||||||
|
// console.log("成功获取用户订单数量:", userOrderCounts.data);
|
||||||
|
// this.userOrderCounts = userOrderCounts.data;
|
||||||
|
// }).catch(error => {
|
||||||
|
// console.error("获取用户订单数量失败:", error);
|
||||||
|
// });
|
||||||
|
// }).then(userOrderCounts => {
|
||||||
|
// this.userOrderCounts = userOrderCounts.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// getRoleLabel(userId) {
|
||||||
|
// const orderCount = this.getOrderCount(userId);
|
||||||
|
// return orderCount > 1 ? '疑似代办' : '普通用户';
|
||||||
|
// },
|
||||||
|
queryUserOrderCounts() {
|
||||||
|
getUserOrderCounts().then(userOrderCounts => {
|
||||||
|
console.log("成功获取用户订单数量:", userOrderCounts);
|
||||||
|
// 存储订单数量
|
||||||
|
this.userOrderCounts = userOrderCounts.data;
|
||||||
|
this.getList();
|
||||||
|
}).catch(error => {
|
||||||
|
console.error("获取用户订单数量失败:", error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getOrderCount(userId) {
|
||||||
|
const userOrder = this.userOrderCounts.find(order => order.userId === userId);
|
||||||
|
console.log("用户订单数量:", this.userOrderCounts,userOrder);
|
||||||
|
// 如果找不到对应的订单数量,返回0
|
||||||
|
return userOrder ? userOrder.orderCount : 0;
|
||||||
|
},
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@ -512,5 +570,5 @@
|
|||||||
}, `customerInfo_${new Date().getTime()}.xlsx`)
|
}, `customerInfo_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -9,6 +9,14 @@ export function listCustomerInfo(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询客户订单数量列表
|
||||||
|
export function getUserOrderCounts() {
|
||||||
|
return request({
|
||||||
|
url: '/customerInfo/customerInfo/userOrderCounts',
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 查询客户信息详细
|
// 查询客户信息详细
|
||||||
export function getCustomerInfo(id) {
|
export function getCustomerInfo(id) {
|
||||||
return request({
|
return request({
|
||||||
@ -52,3 +60,5 @@ export function partnerGetWtList(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user