From b15fdc7f831964729db0aac893a517d49f3bffd4 Mon Sep 17 00:00:00 2001 From: corala <18339694416@163.com> Date: Fri, 30 Dec 2022 18:40:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=96=E6=8E=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.js | 2 + pages/center/records/index.vue | 2 +- pages/index/consumer/index.vue | 879 +++++++++++++++++++++------------ 3 files changed, 578 insertions(+), 305 deletions(-) diff --git a/config.js b/config.js index c6d5858..6f6b84b 100644 --- a/config.js +++ b/config.js @@ -42,6 +42,8 @@ var config = { cmmentList:`${host}/comment/list`, // 新增评论 saveCmment:`${host}/comment/saveCmment`, + // 获取客户来源列表 + sourceList: `${host}/customer/sourceList`, // 新增文件评论 saveCmmentUpload:`${host}/comment/upload`, // 点赞 diff --git a/pages/center/records/index.vue b/pages/center/records/index.vue index 0e4411a..9360010 100644 --- a/pages/center/records/index.vue +++ b/pages/center/records/index.vue @@ -711,7 +711,7 @@ }) }) }, - + //select接待顾问 actionSelectCallback(e) { if(e[0].label=='全部'){ this.counselorName = '接待顾问' diff --git a/pages/index/consumer/index.vue b/pages/index/consumer/index.vue index ed0e032..0a09fd7 100644 --- a/pages/index/consumer/index.vue +++ b/pages/index/consumer/index.vue @@ -14,20 +14,20 @@ - + {{ sortFilter }} - + {{ arriveFilter }} - - {{ receptionDuration }} + + {{ agentIdtext }} - - 更多筛选 + + 画像标签 @@ -113,90 +113,177 @@ - + + - - - - 所属顾问 - - - - - - - - - 客户标签 - - - - + + + + + 销讲业务 + + + + + + + {{item.templateName}} + + + - - - - 客户等级 + + + + 接待时长 + + + + + + + {{ item.label }} + + + - - - - {{item.label}} - - + + + + 意向等级 + + + + + + + {{ item.label }} + + + - - - - - - 到访次数 + + + + 客户阶段 + + + + + + + {{ item.label }} + + + - - - - {{item.label}} - - + + + + 需求挖掘率 + + + + + + + {{ item.label }} + + + - - - - 重置 + + + + 销讲执行率 + + + + + + + {{ item.label }} + + + - - 确定 + + + + 到访次数 + + + + + + + {{ item.label }} + + + + + + 重置 + 确定 - - - + - + + @click="tabtimetap(5, '接待时间')"> 全部 @@ -213,27 +300,7 @@ 自定义 - - 全部 - - - 0~15min - - 15~30min - - 30~60min - - 60~90min - - 90min以上 - - + @@ -244,8 +311,36 @@ - - + + + + + + + {{item.name}} + + + + + + + {{ subitem.name }} + + + + + + + 重置 + 确定 + + + @@ -258,9 +353,23 @@ export default { data() { return { - // tabbar配置项 - current: 1, - //--- end --- tabbar配置项 + keywordsIds: [], // 画像标签 + sourceList: [],//客户来源 + templateList: [], // 销讲业务 + showTemplate: true, // 展示销讲业务 + agentIdtext: '接待顾问', + phaseList: [],// 客户阶段 + huaxiangShow: false, + wajueArrow: true, + jieduanArrow: true, + sourceArrow: true, + levelArrow: true, + zixunArrow: true, + jiedaiArrow: true, + luyinArrow: true, + visitArrow: true, + xiaojiangArrow: true, + huaxiangList: [], orderBylist: [{ label: '创建时间倒序', value: '1' @@ -294,18 +403,92 @@ value: '8' }, ], + jiedaiList: [{ + label: "0~15min", + value: 1, + isShow: false, + }, + { + label: "16~30min", + value: 2, + isShow: false, + }, + { + label: "31~60min", + value: 3, + isShow: false, + }, + { + label: "61~90min", + value: 4, + isShow: false, + }, + { + label: "91min及以上", + value: 5, + isShow: false, + }, + ], + wajueList: [{ + label: "31%及以下", + value: 1, + isShow: false, + }, + { + label: "31%~50%", + value: 2, + isShow: false, + }, + { + label: "51%~70%", + value: 3, + isShow: false, + }, + { + label: "71%及以上", + value: 4, + isShow: false, + }, + ], + xiaojiangList: [{ + label: "30%及以下", + value: 1, + isShow: false, + }, + { + label: "31%~50%", + value: 2, + isShow: false, + }, + { + label: "51%~70%", + value: 3, + isShow: false, + }, + { + label: "71%及以上", + value: 4, + isShow: false, + }, + ], value: '', screenShow: false, selectshow: false, selectTipshow: false, buildingID: '', screen: { - agentId: '', - agentIdtext: '', - visitRecord: [], - record: [], - cunsumerTips: '', - cunsumerTipsid: '', + staTime: "", + endTime: "", + orderBy: "", // 排序 + agentId: "", //顾问 + sourceIds: [], // 客户来源 + level: [], // 客户等级 + visitRecord: [], // 到访次数 + wajueVal: [], // 需求挖掘 + xiaojiangVal: [], //销讲执行率 + jiedaiVal: [], // 接待时长 + validInvalid: null, // 录音标识 + clientStage: [], // 客户阶段 clientStage }, stageList: ['未知', '到访', '意向', '定金', '成交'], recordList: [], @@ -320,11 +503,7 @@ activeTotal2: 0, totalTimeShow: false, timeshow: false, - timetushow: false, soltishow: false, - staTime: '', - endtime: '', - orderBy: '', // 排序的id permissions: { commonly1: false, commonly2: false @@ -332,17 +511,13 @@ list: [], // 客户来源列表 sourceId: '', // 选中的客户来源id sourceIndex: -1, // 选中项的下标 - // 不同等级之间的颜色 colorName: [ '', "A", "B", "C", "D" ], - - // 筛选文字展示 sortFilter: '排序', - arriveFilter: '到访时间', - receptionDuration: '接待时长', + arriveFilter: '接待时间', visitList: [{ label: '首次到访', value: 1, @@ -401,7 +576,7 @@ this.getFreeList() this.getfindKeywordsList() this.getFromSource(); - // this.getMyCustom(); + this.getMyCustom(); setTimeout(() => { uni.stopPullDownRefresh() @@ -417,7 +592,9 @@ this.getMyCustom() this.getFreeList() this.getfindKeywordsList() + this.getCustomPhase(); this.getFromSource(); + this.getMarketingBusiness(); this.isRefresh = false; this.isnorefresh = 'refresh'; uni.setStorageSync('updatebuildingID', ''); @@ -439,7 +616,59 @@ } }, methods: { - + // 获取客户阶段数据 + getCustomPhase() { + this.phaseList = []; + this.$u + .post("/customer/lifeTrackDefineList", { + houseId: this.buildingID, + }) + .then((res) => { + if (res.length) { + this.phaseList = res.map(item => { + return { + label: item.stageName, + value: item.id, + isShow: false + } + }) + } else { + this.phaseList = [] + } + }); + }, + // 获取客户来源 + getFromSource() { + this.$u.get(config.service.sourceList, { + houseId: this.buildingID + }) + .then((res) => { + if (res.length) { + this.sourceList = res.map((item) => { + return { + label: item.sourceName, + value: item.id, + isShow: false + } + }) + } else { + this.sourceList = [] + } + }) + }, + // 获取销讲业务 + getMarketingBusiness() { + this.$u.get('/customer/marketingBusiness', { + houseId: this.buildingID, + }).then(res => { + this.templateList = res.map(item => { + return { + ...item, + isShow: false, + } + }) + }) + }, updateInit() { this.$u.get(config.service.notReadNum, { id: uni.getStorageSync('weapp_session_userInfo_data').accountId, @@ -469,55 +698,23 @@ // 过滤 resetFilter() { this.sortFilter = '排序'; - this.orderBy = null; - this.arriveFilter = '到访时间'; - this.staTime = ''; - this.endtime = ''; + this.agentIdtext = '接待顾问'; + this.screen.orderBy = null; + this.arriveFilter = '接待时间'; + this.screen.staTime = ''; + this.screen.endTime = ''; this.nextPage = 1; this.activeTotal = 5; this.recordList = []; - this.receptionDuration = '接待时长'; this.activeTotal2 = 0; }, - - - // 获取客户来源 - getFromSource() { - this.$u.get('customer/findCustomerSourceList', { - houseId: this.buildingID - }).then(res => { - console.log('我进来了') - this.list = res - }) - }, - - - tapsoltishow() { - this.soltishow = true; - }, - taptimetuisshow() { - this.timetushow = true; - }, - taptimeisshow() { - this.timeshow = true; - }, - //选择标签 + //选择排序 selectCallback2(e) { this.sortFilter = e.label; - this.orderBy = e.value; - this.nextPage = 1; - this.recordList = []; - this.soltishow = false - this.isRefresh = false; - this.getMyCustom(); - }, - //选择录音时长 - timetap(index, text) { - if (text) this.receptionDuration = text - this.timetushow = false; - this.activeTotal2 = index; + this.screen.orderBy = e.value; this.nextPage = 1; this.recordList = []; + this.soltishow = false; this.isRefresh = false; this.getMyCustom(); }, @@ -529,8 +726,8 @@ this.totalTimeShow = true; } else { this.activeTotal = index; - this.staTime = ''; - this.endtime = ''; + this.screen.staTime = ''; + this.screen.endTime = ''; this.nextPage = 1; this.isRefresh = false; this.recordList = []; @@ -539,55 +736,18 @@ }, //自定义时间 totalTimeChange(e) { - this.staTime = e.startDate; - this.endtime = e.endDate; + this.screen.staTime = e.startDate; + this.screen.endTime = e.endDate; this.activeTotal = 4; this.nextPage = 1; this.recordList = []; this.isRefresh = false; - this.arriveFilter = this.staTime + '-' + this.endtime + this.arriveFilter = this.screen.staTime + '-' + this.screen.endTime this.getMyCustom(); }, - recordclick(i) { - if (this.screen.record == i) { - this.screen.record = null - } else { - this.screen.record = i - } - }, - choice(index, e) { - if (this.visitList[index].isShow == true) { - this.visitList[index].isShow = false; - for (var i = 0; i < this.screen.visitRecord.length; i++) { - if (this.screen.visitRecord[i] === e) { - this.screen.visitRecord.splice(i, 1); - } - } - } else { - this.visitList[index].isShow = true; - console.log(this.screen) - this.screen.visitRecord.push(e) - } - }, - choiceLevel(index, e) { - if (this.levelList[index].isShow == true) { - this.levelList[index].isShow = false; - for (var i = 0; i < this.screen.record.length; i++) { - if (this.screen.record[i] === e) { - this.screen.record.splice(i, 1); - } - } - } else { - this.levelList[index].isShow = true; - this.screen.record.push(e) - } - }, - screenvisitRecord(i) { - if (this.screen.visitRecord == i) { - this.screen.visitRecord = '' - } else { - this.screen.visitRecord = i - } + + choice(item) { + item.isShow = !item.isShow; }, // 客户详情 gotoDetail(id) { @@ -598,6 +758,111 @@ } }, getMyCustom() { + this.screen.visitRecord = [] + this.screen.jiedaiVal = [] + this.screen.wajueVal = [] + this.screen.xiaojiangVal = [] + this.screen.level = [] + this.screen.clientStage = [] + this.screen.sourceIds = [] + let dateType = 0; + if (this.activeTotal == 5 || this.activeTotal == 4) { + dateType = null; + } else { + dateType = this.activeTotal; + } + // 到访次数 + this.visitList.forEach(i => { + if (i.isShow) this.screen.visitRecord.push(i.value) + }) + // 接待时长 + this.jiedaiList.forEach(i => { + if (i.isShow) this.screen.jiedaiVal.push(i.value) + }) + // 需求挖掘 + this.wajueList.forEach(i => { + if (i.isShow) this.screen.wajueVal.push(i.value) + }) + // 销讲执行率 + this.xiaojiangList.forEach(i => { + if (i.isShow) this.screen.xiaojiangVal.push(i.value) + }) + // 客户等级 + this.levelList.forEach(i => { + if (i.isShow) this.screen.level.push(i.value) + }) + //客户阶段 + this.phaseList.forEach(i => { + if (i.isShow) this.screen.clientStage.push(i.value) + }) + // 客户来源 + this.sourceList.forEach(i => { + if (i.isShow) this.screen.sourceIds.push(i.value) + }) + var parames = { + pageNum: this.nextPage, + pageSize: 10, + query: { + projectId: this.buildingID, + fractions: this.screen.xiaojiangVal.length ? this.screen.xiaojiangVal.join(',') : '', // 销讲执行率 + wordFractions: this.screen.wajueVal.length ? this.screen.wajueVal.join(',') : '', //需求挖掘 + visitRecordNum: this.screen.visitRecord.length ? this.screen.visitRecord.join(',') : '', //到访次数 + clientStages: this.screen.clientStage.length ? this.screen.clientStage.join(',') : '', // 客户阶段 + sourceIds: this.screen.sourceIds.length ? this.screen.sourceIds.join(',') : '', // 客户来源 + level: this.screen.level.length ? this.screen.level.join(',') : '', // 客户等级 + duractionNums: this.screen.jiedaiVal.length ? this.screen.jiedaiVal.join(',') : '', // 接待时长 + keywordsIds: this.keywordsIds.length ? this.keywordsIds.join(',') : '', // 画像标签 + dateType: dateType, // 接待时间 + staTime: this.screen.staTime, + endTime: this.screen.endTime, + agentId: this.screen.agentId, // 顾问 + orderBy: this.screen.orderBy == '' ? '' : this.screen.orderBy, // 排序 + }, + }; + let ars = [] + this.templateList.forEach(item => { + if (item.isShow) { + ars.push(item.id) + } + }) + parames.query.marketingBusiness = ars.join(',') + + this.$u.post("/customer/customerManagement", parames) + .then((data) => { + this.LOADING = false; + var list = data.results || []; + list.forEach((item) => { + if (this.userInfo.dataCode == 6) { + item.isshow = true; + } else { + item.isshow = false; + } + }); + + list.forEach((item) => { + if (item.demand.cusSemanticWordsList != null) { + item.demand.cusSemanticWordsList.forEach((che) => { + if (che.isInterval == 0) { + che.name = che.name + che.unit + "-" + che.endName + che.unit; + } + }); + } else { + item.demand.cusSemanticWordsList = [] + } + }); + if (this.isRefresh) { + this.recordList = list; + } else { + this.recordList = [...this.recordList, ...list]; + } + this.totalRecord = data.totalPage; + this.totalRecords = data.totalRecord; + }) + .catch((e) => { + this.LOADING = false; + }); + }, + getMyCustom1() { let dateType = 0; let recDurationInterval = 0; let orderBy = 0; @@ -629,14 +894,13 @@ keywordsId: this.screen.cunsumerTipsid, agentId: this.screen.agentId, dateType: dateType, - staDate: this.staTime, - endDate: this.endtime, + staDate: this.screen.staTime, + endDate: this.screen.endTime, recDurationInterval: recDurationInterval, orderBy: orderBy, sourceId: this.sourceId } }; - console.log(this.screen.visitRecord) if (this.screen.visitRecord.length > 0) { parames.query.visitRecords = this.screen.visitRecord.join(','); } @@ -645,11 +909,7 @@ } this.$u.post("/customer/customerManagement", parames).then(data => { this.LOADING = false - // if (this.staTime && this.endtime) { - // this.receptionDuration = `${this.staTime}-${this.endtime}` - // } var list = data.results || []; - console.log(list) list.forEach(item => { if (item.demand.cusSemanticWordsList != null) { item.demand.cusSemanticWordsList.forEach(che => { @@ -673,15 +933,19 @@ }, //获取顾问列表 getFreeList() { - this.freeList = [] this.$u.post("/cusLvStatistics/selectAllAccountIdByHouseId", { houseId: this.buildingID }).then(res => { - this.freeList = res; - this.freeList.forEach(item => { + res.forEach(item => { item.label = item.name; item.value = item.accountId }) + res.unshift({ + label: '全部', + value: '' + }) + this.freeList = res + console.log(this.freeList) }) }, //获取客户标签 @@ -701,50 +965,82 @@ this.findKeywordsList = res; }) }, - // 筛选 - screenshow() { - this.screenShow = true - }, //选择顾问 actionSelectCallback(e) { - this.screen.agentId = e[0].value; - this.screen.agentIdtext = e[0].label; - }, - //选择标签 - selectCallback(e) { - this.screen.cunsumerTips = e[0].label; - this.screen.cunsumerTipsid = e[0].value; + console.log(e) + if(e[0].label=='全部'){ + this.agentIdtext = '接待顾问' + this.screen.agentId= '' + }else{ + this.screen.agentId = e[0].value; + this.agentIdtext = e[0].label; + } }, - //重置 + + //重置 reset() { this.screen = { - agentId: '', - agentIdtext: '', + agentId: "", visitRecord: [], record: [], - cunsumerTips: '', - cunsumerTipsid: '', - level: '' - } - this.visitList.map(i => { - i.isShow = false - }) - this.levelList.map(i => { - i.isShow = false - }) + clientStage: "", + clientStageName: "", + }; + this.sourceList.map((i) => { + i.isShow = false; + }); + this.wajueList.map((i) => { + i.isShow = false; + }); + this.phaseList.map((i) => { + i.isShow = false; + }); + this.jiedaiList.map((i) => { + i.isShow = false; + }); + this.xiaojiangList.map((i) => { + i.isShow = false; + }); + this.visitList.map((i) => { + i.isShow = false; + }); + this.levelList.map((i) => { + i.isShow = false; + }); this.nextPage = 1; this.recordList = []; - this.sourceId = ''; - this.sourceIndex = -1; this.isRefresh = false; this.getMyCustom(); }, + //重置画像标签选择 + resetHuaXiang() { + if (this.huaxiangList.length) { + this.huaxiangList.forEach(item => { + item.isShow = true; + if (item.children.length) { + item.children.forEach(subitem => { + subitem.isShow = false; + }) + } + }) + } + }, //筛选确认 screensure() { this.nextPage = 1; this.recordList = []; + this.keywordsIds = [] this.screenShow = false; + this.huaxiangShow = false; this.isRefresh = false; + // 画像标签 + this.huaxiangList.forEach(item => { + if (item.children.length) { + item.children.forEach(im => { + if (im.isShow) this.keywordsIds.push(im.id) + }) + } + }) this.getMyCustom(); }, goSearch() { @@ -1125,118 +1421,93 @@ // 这是弹出层 .screen { - - // box-sizing: border-box; - // padding: 0 30rpx; - .screen-counselor { - display: flex; - height: 106rpx; - // padding: 40rpx 30rpx 36rpx 30rpx; + .screen-record { + overflow: hidden; padding: 0 30rpx; box-sizing: border-box; - border-bottom: 1px solid #E0E0E0; + border-bottom: 1px solid #e0e0e0; - .screen-text { - flex-shrink: 0; - margin: 40rpx 0 36rpx 0; + .screen-record-text { + font-weight: 600; + padding: 30rpx 0; font-size: 30rpx; - font-weight: 400; color: #333333; line-height: 30rpx; - } - - .screen-sel { - flex-grow: 1; display: flex; - justify-content: flex-end; align-items: center; - margin-left: 60rpx; - - .screen-sel-img { - flex-shrink: 0; - margin: 40rpx 0 36rpx 0; - width: 14rpx; - height: 30rpx; - } + justify-content: space-between; - .screen-inp { - padding: 0 20rpx; - text-align: right; + .arrow { + width: 30rpx; + height: 14rpx; } } - } - - .screen-record { - height: 192rpx; - // width: 100%; - overflow: hidden; - padding: 0 30rpx; - box-sizing: border-box; - border-bottom: 1px solid #E0E0E0; - - .screen-record-text { - margin-top: 36rpx; - font-size: 30rpx; - font-weight: 400; - color: #333333; - line-height: 30rpx; - } .screen-record-tab { margin-top: 30rpx; + padding-bottom: 10rpx; display: flex; + flex-wrap: wrap; - // justify-content: space-around; - .screen-record-chose { - width: 156rpx; + .screen-record-item { + min-width: 150rpx; + padding: 0 14rpx; height: 60rpx; - background: #2671E2; - border-radius: 4rpx; - border: 1px solid #2671E2; + border-radius: 8rpx; text-align: center; line-height: 60rpx; - margin-right: 22rpx; - color: #FFFFFF; + margin: 0 22rpx 22rpx 0; + + &:nth-child(4n) { + margin-right: 0; + } } - .screen-record-nochose { - width: 156rpx; - height: 60rpx; - background: #FFFFFF; - border-radius: 4rpx; - border: 1px solid #C9C9C9; - text-align: center; - line-height: 60rpx; - margin-right: 22rpx; + .screen-record-chose { + background: #f1f6fd; + color: #2671e2; } + .screen-record-nochose { + background: #f7f8fa; + color: #333; + } } } .screen-foot { width: 100%; - height: 88rpx; + height: 78rpx; display: flex; + margin: 30rpx 30rpx 0; .screen-foot-reset { - width: 50%; - text-align: center; - height: 88rpx; - line-height: 88rpx; + width: 176rpx; + height: 78rpx; + line-height: 78rpx; + background: #FFFFFF; + border-radius: 8rpx; + border: 1px solid #2671E2; + margin-right: 30rpx; font-size: 30rpx; + font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; - color: #666666; + color: #2671E2; + text-align: center; } .screen-foot-sure { - width: 50%; - text-align: center; - line-height: 88rpx; - height: 88rpx; + width: 484rpx; + height: 78rpx; + line-height: 78rpx; + background: #2671E2; + border: 1px solid #2671E2; + border-radius: 8rpx; font-size: 30rpx; + font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; color: #FFFFFF; - background: #2671E2; + text-align: center; } } }