|
|
@@ -5,7 +5,7 @@
|
|
|
<view class="search-input ddflex fflex">
|
|
|
<image src="/static/images/ssico.png"></image>
|
|
|
<input @confirm="searchFn" confirm-type="search" @input="searchFn" v-model="searchVal" class="fflex"
|
|
|
- placeholder="请输入关键词" />
|
|
|
+ placeholder="请输入客户昵称" />
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="filter ddflex">
|
|
|
@@ -13,14 +13,6 @@
|
|
|
<text style="max-width: 150rpx;" class="tover">{{stateIndex!=-1?stateList[stateIndex].label:'智能筛选'}}</text>
|
|
|
<image class="filter-item-icon" :style="filterType==2&&isShowPop?'transform: rotate(180deg);':''" src="../static/images/down.png"></image>
|
|
|
</view>
|
|
|
- <view class="fflex">
|
|
|
- <picker mode="region" v-model="regionIndex" @change="regionChange">
|
|
|
- <view :class="'filter-item fflex ddflex '+(areaIndex!=-1?'f-active':'')" @click="changeFilterType(3)">
|
|
|
- <text style="max-width: 150rpx;" class="tover">{{regionText?regionText:'地区'}}</text>
|
|
|
- <image class="filter-item-icon" :style="filterType==1&&isShowPop?'transform: rotate(180deg);':''" src="../static/images/down.png"></image>
|
|
|
- </view>
|
|
|
- </picker>
|
|
|
- </view>
|
|
|
<view :class="'filter-item fflex ddflex '+(filterType==1&&isShowPop?'f-active':'')" @click="changeFilterType(1)">
|
|
|
筛选
|
|
|
<image class="filter-item-icon" :style="filterType==1&&isShowPop?'transform: rotate(180deg);':''" src="../static/images/down.png"></image>
|
|
|
@@ -66,10 +58,17 @@
|
|
|
<view class="flex" style="min-width: 0;">
|
|
|
<view class="ddflex">
|
|
|
<view class="card-name fflex tover">{{item.nickName?item.nickName:''}}</view>
|
|
|
+ <view v-if="item.mobile">
|
|
|
+ <image style="width: 140rpx;height: 64rpx;margin-left: 20rpx;" src="/mine/static/images/lx.png" @click.stop="goPhone(item.mobile)"></image>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="ddflex" style="margin-top: 4rpx;">
|
|
|
- <view class="card-tag">客户</view>
|
|
|
- <view class="card-tag">高价值</view>
|
|
|
+ <block v-if="item.customTypeName&&item.customTypeName.length>0">
|
|
|
+ <view class="card-tag" v-for="it,idx in item.customTypeName" :key="idx+'s'">{{it}}</view>
|
|
|
+ </block>
|
|
|
+ <block v-if="item.labelName&&item.labelName.length>0">
|
|
|
+ <view class="card-tag card-tag-t" v-for="it,idx in item.labelName" :key="idx+'l'">{{it}}</view>
|
|
|
+ </block>
|
|
|
</view>
|
|
|
<view class="ddflex" style="font-size: 24rpx;color: #999;font-weight: 400;margin: 20rpx 0;">
|
|
|
<text>保单</text><text style="color: #000000;">{{item.warrantyCount?item.warrantyCount:0}}</text>
|
|
|
@@ -78,7 +77,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="ddflex" style="margin-top: 41rpx;font-size: 24rpx;padding: 0 30rpx;">
|
|
|
+ <!-- <view class="ddflex" style="margin-top: 41rpx;font-size: 24rpx;padding: 0 30rpx;">
|
|
|
<view class="ddflex fflex">
|
|
|
<view style="color: #999;margin-right: 16rpx;">服务策略</view>
|
|
|
<view style="color: #333333;">刺激消费频率</view>
|
|
|
@@ -86,7 +85,7 @@
|
|
|
<view v-if="item.mobile">
|
|
|
<image style="width: 140rpx;height: 64rpx;margin-left: 20rpx;" src="/mine/static/images/lx.png" @click.stop="goPhone(item.mobile)"></image>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-else class="nodata">
|
|
|
@@ -100,14 +99,12 @@
|
|
|
const app = getApp();
|
|
|
const req = require("../../utils/request.js");
|
|
|
const util = require('../../utils/util.js');
|
|
|
- const QQMapWX = require("../../utils/qqmap.js");
|
|
|
|
|
|
export default {
|
|
|
components: {},
|
|
|
props: {},
|
|
|
data() {
|
|
|
return {
|
|
|
- statusBarHeight:0,
|
|
|
|
|
|
filterType:null,
|
|
|
|
|
|
@@ -130,26 +127,12 @@
|
|
|
},
|
|
|
]
|
|
|
},{
|
|
|
- title:'入司时间',
|
|
|
- key:'inDate',
|
|
|
- option:[
|
|
|
- {
|
|
|
- label: '1~2年',
|
|
|
- value: 1
|
|
|
- },{
|
|
|
- label: '2~3年',
|
|
|
- value: 2
|
|
|
- },{
|
|
|
- label: '3~4年',
|
|
|
- value: 3
|
|
|
- },{
|
|
|
- label: '4年以上',
|
|
|
- value: 4
|
|
|
- }
|
|
|
- ]
|
|
|
+ title:'客户类型',
|
|
|
+ key:'custom_type',
|
|
|
+ option:[]
|
|
|
},{
|
|
|
- title:'职务',
|
|
|
- key:'job',
|
|
|
+ title:'客户标签',
|
|
|
+ key:'custom_label',
|
|
|
option:[
|
|
|
{
|
|
|
label: '经理',
|
|
|
@@ -165,30 +148,29 @@
|
|
|
}
|
|
|
|
|
|
],
|
|
|
- startTime: '',
|
|
|
- endTime: '',
|
|
|
-
|
|
|
- regionText:'',
|
|
|
- regionCode:[],
|
|
|
- areaIndex:-1,
|
|
|
|
|
|
stateIndex: 0,
|
|
|
stateList:[{
|
|
|
label: '智能推荐',
|
|
|
value: null
|
|
|
},{
|
|
|
- label: '评价分从高到低',
|
|
|
- value: 'avage'
|
|
|
+ label: '保费从高到低',
|
|
|
+ value: 'warranty_money',
|
|
|
+ behavior:'desc'
|
|
|
},
|
|
|
{
|
|
|
- label: '浏览量从高到低',
|
|
|
- value: 'bCount',
|
|
|
- behavior:4
|
|
|
+ label: '保费从低到高',
|
|
|
+ value: 'warranty_money',
|
|
|
+ behavior:'asc'
|
|
|
},
|
|
|
{
|
|
|
- label: '点赞量从高到低',
|
|
|
- value: 'bCount',
|
|
|
- behavior:3
|
|
|
+ label: '保单从高到低',
|
|
|
+ value: 'warranty_count',
|
|
|
+ behavior:'desc'
|
|
|
+ },{
|
|
|
+ label: '保单从低到高',
|
|
|
+ value: 'warranty_count',
|
|
|
+ behavior:'asc'
|
|
|
}],
|
|
|
page: 1,
|
|
|
limit: 10,
|
|
|
@@ -196,22 +178,12 @@
|
|
|
searchVal: '',
|
|
|
dataList: [],
|
|
|
isReference:false,
|
|
|
- latitude: '23.027923',
|
|
|
- longitude: '113.753815',
|
|
|
}
|
|
|
},
|
|
|
- onLoad(options) {
|
|
|
- QQMapWX.initMap();
|
|
|
- req.getLocation(async res => {
|
|
|
- const to = {
|
|
|
- latitude: res.latitude,
|
|
|
- longitude: res.longitude
|
|
|
- };
|
|
|
- this.latitude = res.latitude;
|
|
|
- this.longitude = res.longitude;
|
|
|
- await this.getDict()
|
|
|
- this.getDataList()
|
|
|
- });
|
|
|
+ async onLoad(options) {
|
|
|
+ await this.getDict()
|
|
|
+ await this.getDictCustomType()
|
|
|
+ this.getDataList()
|
|
|
},
|
|
|
onShow() {
|
|
|
if(this.isReference){
|
|
|
@@ -231,11 +203,31 @@
|
|
|
url: url
|
|
|
})
|
|
|
},
|
|
|
+ // 客户标签字典
|
|
|
getDict(){
|
|
|
return new Promise((r,j)=>{
|
|
|
- req.getRequest('/api/other/dict/info',{dictType:'job'},res=>{
|
|
|
+ req.getRequest('/api/other/dict/info',{dictType:'custom_label'},res=>{
|
|
|
this.dateList.map(item=>{
|
|
|
- if(item.key=='job'){
|
|
|
+ if(item.key=='custom_label'){
|
|
|
+ item.option = []
|
|
|
+ res.map(it=>{
|
|
|
+ item.option.push({
|
|
|
+ label:it.dictName,
|
|
|
+ value:it.dictValue
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ r(res)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 客户类型字典
|
|
|
+ getDictCustomType(){
|
|
|
+ return new Promise((r,j)=>{
|
|
|
+ req.getRequest('/api/other/dict/info',{dictType:'custom_type'},res=>{
|
|
|
+ this.dateList.map(item=>{
|
|
|
+ if(item.key=='custom_type'){
|
|
|
item.option = []
|
|
|
res.map(it=>{
|
|
|
item.option.push({
|
|
|
@@ -277,24 +269,30 @@
|
|
|
this.confirm()
|
|
|
},
|
|
|
switchFilterType(index,idx) {
|
|
|
- if(!this.dateList[index].option[idx].isActive){
|
|
|
- this.dateList[index].option.map(item=>{
|
|
|
- item.isActive = false
|
|
|
- })
|
|
|
- this.dateList[index].option[idx].isActive = true
|
|
|
+ // 可多选
|
|
|
+ if(this.dateList[index].key=='custom_label' || this.dateList[index].key=='custom_type'){
|
|
|
+ if(!this.dateList[index].option[idx].isActive){
|
|
|
+ this.dateList[index].option[idx].isActive = true
|
|
|
+ }else{
|
|
|
+ this.dateList[index].option[idx].isActive = false
|
|
|
+ }
|
|
|
}else{
|
|
|
- this.dateList[index].option[idx].isActive = false
|
|
|
+ if(!this.dateList[index].option[idx].isActive){
|
|
|
+ this.dateList[index].option.map(item=>{
|
|
|
+ item.isActive = false
|
|
|
+ })
|
|
|
+ this.dateList[index].option[idx].isActive = true
|
|
|
+ }else{
|
|
|
+ this.dateList[index].option[idx].isActive = false
|
|
|
+ }
|
|
|
}
|
|
|
this.dateList = JSON.parse(JSON.stringify(this.dateList))
|
|
|
},
|
|
|
- regionChange(e){
|
|
|
- this.regionText = e.detail.value.join('')
|
|
|
- this.regionCode = e.detail.code
|
|
|
- this.confirm()
|
|
|
- },
|
|
|
confirm() {
|
|
|
this.hidePop();
|
|
|
this.isLoad = true;
|
|
|
+ this.page=1;
|
|
|
+ this.isLoad = true
|
|
|
this.getDataList();
|
|
|
},
|
|
|
reset() {
|
|
|
@@ -306,8 +304,6 @@
|
|
|
})
|
|
|
})
|
|
|
this.dateList = JSON.parse(JSON.stringify(this.dateList))
|
|
|
- this.regionText=''
|
|
|
- this.regionCode=[]
|
|
|
},
|
|
|
// 分页查询
|
|
|
getDataList() {
|
|
|
@@ -320,28 +316,16 @@
|
|
|
longitude: this.longitude,
|
|
|
}
|
|
|
if (this.searchVal) {
|
|
|
- queryParams.realName = this.searchVal
|
|
|
- }
|
|
|
- // 时间筛选
|
|
|
- if (this.dateIndex != -1) {
|
|
|
- queryParams.dateType = this.dateList[this.dateIndex].value;
|
|
|
- }else if (this.dateIndex == -1) {
|
|
|
- } else {
|
|
|
- queryParams.dateType = 8
|
|
|
- queryParams.end = this.endTime?this.endTime:null;
|
|
|
- queryParams.start = this.startTime?this.startTime:null;
|
|
|
+ queryParams.nickName = this.searchVal
|
|
|
}
|
|
|
|
|
|
// 状态筛选
|
|
|
if (this.stateIndex != -1) {
|
|
|
- queryParams.orderFiled = this.stateList[this.stateIndex].value;
|
|
|
+ queryParams.orderField = this.stateList[this.stateIndex].value;
|
|
|
if(this.stateList[this.stateIndex].behavior){
|
|
|
- queryParams.behavior = this.stateList[this.stateIndex].behavior;
|
|
|
+ queryParams.order = this.stateList[this.stateIndex].behavior;
|
|
|
}
|
|
|
}
|
|
|
- if(this.regionCode.length>0){
|
|
|
- queryParams.areaCode = this.regionCode[2]
|
|
|
- }
|
|
|
this.dateList.map(item=>{
|
|
|
if(item.key=="sex"){
|
|
|
let sl = item.option.filter(it=>{return it.isActive})
|
|
|
@@ -349,29 +333,19 @@
|
|
|
queryParams.gender = sl[0].value
|
|
|
}
|
|
|
}
|
|
|
- if(item.key=="job"){
|
|
|
+ if(item.key=="custom_label"){
|
|
|
let jl = item.option.filter(it=>{return it.isActive})
|
|
|
if(jl.length>0){
|
|
|
- queryParams.job = jl[0].value
|
|
|
+ // queryParams.label = jl[0].value
|
|
|
+ queryParams.label = jl.map(item => {return item.value}).join(',')
|
|
|
}
|
|
|
}
|
|
|
- if(item.key=="inDate"){
|
|
|
- console.log('indate')
|
|
|
- let il = item.option.filter(it=>{return it.isActive})
|
|
|
- console.log(il)
|
|
|
- if(il.length>0){
|
|
|
- let d = il[0].value
|
|
|
- if(d==4){
|
|
|
- queryParams.endTime = this.getYear(d+1)
|
|
|
- }else{
|
|
|
- queryParams.startTime = this.getYear(d)
|
|
|
- queryParams.endTime = this.getYear(d+1)
|
|
|
- }
|
|
|
+ if(item.key=="custom_type"){
|
|
|
+ let tl = item.option.filter(it=>{return it.isActive})
|
|
|
+ if(tl.length>0){
|
|
|
+ queryParams.type = tl.map(item => {return item.value}).join(',')
|
|
|
}
|
|
|
}
|
|
|
- if(item.key=="job"){
|
|
|
- // queryParams.gender = item.option.filter(it=>{return it.isActive})[0].value
|
|
|
- }
|
|
|
})
|
|
|
req.getRequest('/api/user/getUserBySaleNo', queryParams, data => {
|
|
|
data = data.list
|
|
|
@@ -388,31 +362,13 @@
|
|
|
console.log('列表数据>>>', this.dataList);
|
|
|
})
|
|
|
},
|
|
|
- getYear(index){
|
|
|
- let dateTime = new Date().getFullYear(); /* 获取现在的年份 */
|
|
|
- dateTime = new Date(new Date().setFullYear(dateTime-index))
|
|
|
- let y = dateTime.getFullYear()
|
|
|
- let m = dateTime.getMonth()+1<10?('0'+(dateTime.getMonth()+1)):dateTime.getMonth()+1
|
|
|
- let d = dateTime.getDate()<10?('0'+(dateTime.getDate())):dateTime.getDate()
|
|
|
- return y+'-'+m+'-'+d
|
|
|
- },
|
|
|
// 搜索
|
|
|
searchFn() {
|
|
|
this.page = 1;
|
|
|
this.isLoad = true;
|
|
|
+ this.page=1;
|
|
|
this.getDataList();
|
|
|
},
|
|
|
- formatTimeFn(data) {
|
|
|
- if (data) {
|
|
|
- return utils.formatTimeCommStr(data, 'Y-M-D')
|
|
|
- } else {
|
|
|
- return '';
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
- monthDayDiff(date) {
|
|
|
- return util.monthDayDiff(date)
|
|
|
- },
|
|
|
// 拨打电话
|
|
|
goPhone(phone) {
|
|
|
if(!phone) return false
|
|
|
@@ -424,10 +380,6 @@
|
|
|
},
|
|
|
},
|
|
|
mounted() {
|
|
|
- const systemInfo = uni.getSystemInfoSync();
|
|
|
- // px转换到rpx的比例
|
|
|
- let pxToRpxScale = 750 / systemInfo.windowWidth;
|
|
|
- this.statusBarHeight = uni.getSystemInfoSync().windowTop*pxToRpxScale
|
|
|
}
|
|
|
}
|
|
|
</script>
|