Commit ebb8c283 by 前端

Merge branch 'wangzh_dev_2.3.3' into 'master'

Wangzh dev 2.3.3

See merge request !43
2 parents 5113b2b5 7444d72d
Showing 60 changed files with 3765 additions and 324 deletions
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
"dev": "npm run serve" "dev": "npm run serve"
}, },
"dependencies": { "dependencies": {
"@antv/f2": "^3.8.10-beta.1",
"autoprefixer": "^8.0.0", "autoprefixer": "^8.0.0",
"core-js": "^3.6.4", "core-js": "^3.6.4",
"dayjs": "^1.10.5", "dayjs": "^1.10.5",
......
...@@ -14,13 +14,5 @@ import groupCustomer from './groupCustomer' ...@@ -14,13 +14,5 @@ import groupCustomer from './groupCustomer'
import groupTag from './groupTag' import groupTag from './groupTag'
import entmicroApi from './entmicroApi' import entmicroApi from './entmicroApi'
import detailApi from './detail' import detailApi from './detail'
export {
ssoApi,
groupChat,
wxConfig,
liveBroadcast,
groupCustomer,
groupTag,
entmicroApi,
detailApi
}
\ No newline at end of file \ No newline at end of file
import solicitApi from './solicit'
export { ssoApi, groupChat, wxConfig, liveBroadcast, groupCustomer, groupTag, entmicroApi, detailApi, solicitApi }
/*
* @Description:
* @Author: huyue
* @Date: 2022-06-06 14:26:32
* @LastEditors: huyue
* @LastEditTime: 2022-06-07 14:27:45
*/
const url = '/rop-scrm-marketing/router'
export default {
/**
* 获取跟进结果字典 */
followFindAllDictData(data) {
data.method = 'merchants.api.menu.findAllDictData'
return window.$HTTP({
url:window.$fetchConfig.dict,
data,
returnAll: true
})
},
// 员工id获取
getStaffid(data) {
data.method = 'marketing.api.solicit.staffid.obtain'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 根据任务id查询活动
findActivityIdByUUID(data) {
data.method = 'marketing.api.activity.findActivityIdByUUID'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 客户招揽-任务总览
taskOverviewData(data) {
data.method = 'marketing.api.solicit.taskOverview'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 客户招揽-招揽跟进
solicitationFollow(data) {
data.method = 'marketing.api.solicit.solicitationFollow'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 一键营销
createdOcmarketing(data) {
data.method = 'marketing.api.solicit.ocmarketing.send'
return window.$HTTP({
url,
data
})
},
// 一键营销内容回显
getocmarketingList(data) {
data.method = 'marketing.api.solicit.ocmarketing.echo'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 触达统计-客户送达分层
deliveredStatistics(data) {
data.method = 'marketing.api.solicit.customer.delivered.statistics'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 获取送达、未送达列表
getCustomerList(data) {
data.method = 'marketing.api.solicit.page.customer.condition'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 获取客户详情
getCustomerDetail(data) {
data.method = 'marketing.api.solicit.customer.detail'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 招揽跟进记录保存
sendSolicitRecord(data) {
data.method = 'marketing.api.solicit.record.save'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 跟进结果-成功到店与战败分析
getFollowResult(data) {
data.method = 'marketing.api.solicit.staffid.getFollowResult'
return window.$HTTP({
url,
data,
returnAll: true
})
},
// 跟进结果-成功到店与战败分析
getCustomerFollowTotal(data) {
data.method = 'marketing.api.solicit.staffid.getCustomerFollowTotal'
return window.$HTTP({
url,
data,
returnAll: true
})
}
}
@import './normalize.scss'; @import './normalize.scss';
@import './sprite.scss'; @import './sprite.scss';
*{ * {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
...@@ -25,6 +25,25 @@ img { ...@@ -25,6 +25,25 @@ img {
align-items: center; align-items: center;
} }
.flex-top {
display: flex;
align-items: flex-start;
}
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.flex-between {
display: flex;
justify-content: space-between;
align-items: center;
}
.flex-around {
display: flex;
justify-content: space-around;
align-items: center;
}
.text-hide { .text-hide {
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
...@@ -40,12 +59,6 @@ img { ...@@ -40,12 +59,6 @@ img {
word-break: break-all; word-break: break-all;
} }
.text-center {
display: flex;
align-items: center;
justify-content: center;
}
.x-center { .x-center {
position: absolute; position: absolute;
left: 50%; left: 50%;
...@@ -61,47 +74,162 @@ img { ...@@ -61,47 +74,162 @@ img {
.sticky { .sticky {
position: static; position: static;
} }
.text-12{ .text-12 {
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #FFFFFF; color: #ffffff;
} }
.text-20{ .text-20 {
font-size: 20px; font-size: 20px;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #ffffff;
}
.color-3 {
color: #333333;
}
.color-2f {
color: rgba(47, 64, 86, 0.7);
}
.color39 {
color: #3975c6;
}
.colord8 {
// color: #d8d8d8;
color:rgba(216, 216, 216, 0.3)
}
.color54 {
color: #545454;
}
.font-10{
font-size: 10px;
}
.font-12 {
font-size: 12px;
}
.font-20 {
font-size: 20px;
}
.font-24 {
font-size: 24px;
} }
.line-28{
.font-14 {
font-size: 14px;
}
.font-16 {
font-size: 16px;
}
.line-24 {
line-height: 24px;
}
.line-28 {
line-height: 28px; line-height: 28px;
} }
.line-17{ .line-18 {
line-height: 18px;
}
.line-36 {
line-height: 36px;
}
.line-17 {
line-height: 17px; line-height: 17px;
} }
.text-14{ .text-14 {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
} }
.hg{ .hg {
height: 28px; height: 28px;
} }
.button{ .m-b-12 {
margin-bottom: 12px;
}
.m-b-14 {
margin-bottom: 14px;
}
.m-b-16 {
margin-bottom: 16px;
}
.m-t-8 {
margin-top: 8px;
}
.m-t-16 {
margin-top: 16px;
}
.m-t-4 {
margin-top: 4px;
}
.m-t-6 {
margin-top: 6px;
}
.m-l-4 {
margin-left: 4px;
}
.m-l-8 {
margin-left: 8px;
}
.m-r-8 {
margin-right: 8px;
}
.m-l-16 {
margin-left: 16px;
}
.m-l-14{
margin-left: 14px;
}
.fw4 {
font-weight: 400;
}
.fw5 {
font-weight: 500;
}
.fw7 {
font-weight: 700;
}
.bold{
font-weight: bold;
}
.button {
width: 343px; width: 343px;
height: 42px; height: 42px;
background: #3975C6; background: #3975c6;
border-radius: 21px; border-radius: 21px;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #ffffff;
line-height: 42px; line-height: 42px;
text-align: center; text-align: center;
margin:0 auto; margin: 0 auto;
}
.bottom{
vertical-align:bottom;
} }
.bottom {
vertical-align: bottom;
}
.title-info {
font-size: 16px;
color: #333333;
line-height: 44px;
font-weight: 500;
height: 44px;
border-bottom: 1px solid rgba(216, 216, 216, 0.3);
box-sizing: border-box;
}
.title-info::before {
content: '';
width: 3px;
height: 14px;
background: #3975c6;
border-radius: 1.5px;
margin-right: 13px;
display: inline-block;
}
.emo_img {
width: 20px;
height: 20px;
}
\ No newline at end of file \ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 110px 74px;} .sprite-icon { background-image: url(../images/sprite.png);background-size: 158px 148px;}
.icon-active { width: 20px; height: 20px; background-position: 0px -54px;} .icon-active { width: 20px; height: 20px; background-position: -72px -96px;}
.icon-arrow { width: 7px; height: 11px; background-position: -92px -56px;} .icon-append { width: 32px; height: 32px; background-position: -54px 0px;}
.icon-appoint { width: 32px; height: 32px; background-position: 0px -54px;}
.icon-arrow { width: 7px; height: 11px; background-position: -140px -130px;}
.icon-avatar { width: 44px; height: 44px; background-position: 0px 0px;} .icon-avatar { width: 44px; height: 44px; background-position: 0px 0px;}
.icon-customer-active { width: 16px; height: 16px; background-position: -92px -30px;}
.icon-customer-add { width: 28px; height: 20px; background-position: -54px 0px;}
.icon-customer-copy { width: 18px; height: 20px; background-position: -92px 0px;}
.icon-customer-phone { width: 20px; height: 20px; background-position: -30px -54px;}
.icon-identifier { width: 20px; height: 20px; background-position: -60px -54px;}
.icon-open-arrow { width: 8px; height: 7px; background-position: -54px -30px;}
\ No newline at end of file \ No newline at end of file
.icon-customer-active { width: 16px; height: 16px; background-position: -114px -130px;}
.icon-customer-add { width: 28px; height: 20px; background-position: -34px -96px;}
.icon-customer-copy { width: 18px; height: 20px; background-position: -138px -90px;}
.icon-customer-phone { width: 20px; height: 20px; background-position: -102px -96px;}
.icon-factory { width: 32px; height: 32px; background-position: -42px -54px;}
.icon-fail { width: 24px; height: 24px; background-position: -96px -42px;}
.icon-fllow { width: 18px; height: 18px; background-position: -30px -130px;}
.icon-follow { width: 32px; height: 32px; background-position: -96px 0px;}
.icon-followRecord { width: 20px; height: 20px; background-position: -138px 0px;}
.icon-identifier { width: 20px; height: 20px; background-position: -138px -30px;}
.icon-maintant { width: 20px; height: 20px; background-position: -138px -60px;}
.icon-message { width: 18px; height: 18px; background-position: -58px -130px;}
.icon-open-arrow { width: 8px; height: 7px; background-position: -96px -76px;}
.icon-sendwechat { width: 20px; height: 18px; background-position: 0px -130px;}
.icon-succeed { width: 24px; height: 24px; background-position: 0px -96px;}
.icon-tel { width: 18px; height: 18px; background-position: -86px -130px;}
\ No newline at end of file \ No newline at end of file

7.63 KB | W: | H:

36.1 KB | W: | H:

src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
src/assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
<template>
<div>
<div class="customer-box" v-for="(item, index) in customerData" :key="index">
<div class="customer-title">
<div class="customer-name">{{ item.customerName }}</div>
<div class="customer-carnumber">{{ item.cars && item.cars.length > 0 && item.cars[0].carNumber }}</div>
</div>
<div class="customer-info">
<div class="customer-info-left">
<div class="customer-info-label">
<div class="customer-info-name">车系:</div>
<div class="customer-info-message customer-info-car text-hide">{{ item.cars && item.cars.length > 0 && item.cars[0].carSeries }}</div>
</div>
<div class="customer-info-label">
<div class="customer-info-name">招揽结果:</div>
<div class="customer-info-message">{{ item.followResultEcho }}</div>
</div>
<div class="customer-info-label">
<div class="customer-info-name">企微营销:</div>
<div class="customer-info-message">{{ item.checkStatus == 0 ? '未查看' : item.checkStatus == 1 ? '已查看' : '' }}</div>
</div>
</div>
<div class="customer-info-right">
<div class="customer-info-label">
<div class="customer-info-name">企微账号:</div>
<div v-if="item.nickName">
<span class="customer-info-message customer-info-wechatnick text-hide">{{ item.nickName }}</span>
<span class="customer-info-message" :class="[item.type == 1 ? 'customer-info-wechat' : 'customer-info-qiwechat']">{{ item.type == 1 ? '@微信' : item.type == 2 ? '@企微' : '' }}</span>
</div>
<div class="customer-info-message" v-else>未添加</div>
</div>
<div class="customer-info-label">
<div class="customer-info-name">招揽日期:</div>
<div class="customer-info-message">{{ item.solicitTime }}</div>
</div>
<div class="customer-info-label">
<div class="customer-info-name">更新日期:</div>
<div class="customer-info-message">{{ item.updatedTime }}</div>
</div>
</div>
</div>
<div class="customer-marketing">
<div class="sprite-icon icon-tel" @click="callCustomer(item)"></div>
<div class="sprite-icon icon-fllow" @click="followCustomer(item, index)"></div>
<div class="sprite-icon icon-message" @click="sendMessage(item)"></div>
<div class="sprite-icon icon-sendwechat" @click="sendWechat(item)"></div>
</div>
</div>
<!-- 电话营销弹窗 -->
<van-action-sheet v-model:show="show" :actions="actions" @select="onSelect" cancel-text="取消" close-on-click-action @cancel="onCancel" />
</div>
</template>
<script>
import { Toast } from 'vant'
import { wxConfig } from '@/api'
import CustomerInfoPopup from './CustomerInfoPopup.vue'
import CustomerFollowPopup from './CustomerFollowPopup.vue'
import { solicitApi } from '@/api'
export default {
components: { CustomerInfoPopup, CustomerFollowPopup },
name: 'CustomerCard',
props: {
customerInfo: {
type: Array,
default: () => {
return []
}
},
groupId: {
type: String,
default: () => {
return null
}
},
groupName: {
type: String,
default: () => {
return ''
}
}
},
watch: {
customerInfo(n) {
console.log(n, '监听数据')
this.customerData = n
}
},
data() {
return {
// 电话营销弹窗
show: false,
actions: [{ name: '呼叫' }, { name: '复制' }],
chatParams: {
externalUserIds: [],
groupName: '',
userIds: [],
chatId: ''
},
phoneNumber: null,
customerData: this.customerInfo,
customerIndex: 0
}
},
mounted() {
this.initWx()
},
methods: {
// 初始化微信接口
initWx() {
window.$wx = wxConfig
window.$wx.init(['setClipboardData', 'navigateToAddCustomer', 'makePhoneCall']).then(() => {})
},
changeTab(index) {
this.isShow = false
if (index === 0) {
this.isShow = true
}
},
// 电话招揽
callCustomer(val) {
// console.log(val)
if (!val.phoneNumber) {
Toast('系统尚未查询到该用户的电话号码')
return
}
this.phoneNumber = val.phoneNumber
// 打开电话营销弹窗
this.show = true
},
// 选择电话营销方式
onSelect(e) {
// 呼叫
if (e.name === '呼叫') {
// window.location.href = 'tel://' + this.telNumber
this.makePhoneCall(this.phoneNumber)
return
}
// 复制
this.setClipboardData(this.phoneNumber)
},
// 电话招揽弹窗关闭
onCancel() {
this.show = false
},
// 招揽跟进
followCustomer(val, index) {
this.$emit('showFollowPop', { customerIndex: index, followCustomerData: val })
},
// 客户详情
sendMessage(val) {
this.$emit('showInfoPop', { followCustomerData: val })
},
// 企微沟通
sendWechat(val) {
// 如果未添加企微客户
if (!val.userId) {
if (val.phoneNumber) {
this.setClipboardData(val.phoneNumber)
Toast('已复制手机号,请尝试通过用户手机号来添加好友')
} else {
Toast('尚未添加好友,请尝试添加客户为好友')
}
// 如果没有手机号,跳转到添加好友页面
setTimeout(() => {
window.$wx.navigateToAddCustomer().then(res => {
// console.log(res)
})
}, 1000)
return
}
let seach = {
userIds: [], // 参与会话的企业成员列表,格式为userid1;userid2;...,用分号隔开。
externalUserIds: [val.userId], // 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
groupName: '', // 会话名称。单聊时该参数传入空字符串""即可。
chatId: ''
}
console.log(seach, 'seach')
wxConfig.openEnterpriseChat(seach).then(res => {
// console.log(res)
})
}
}
}
</script>
<style lang="scss" scoped>
.customer-box {
// width: 100%;
background: #ffffff;
box-shadow: 0px 2px 10px 0px rgba(224, 224, 224, 0.8);
border-radius: 4px;
margin: 0 16px 12px 16px;
}
.customer-title {
display: flex;
justify-content: space-between;
padding: 10px 12px;
}
.customer-name {
font-size: 14px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #282829;
line-height: 20px;
}
.customer-carnumber {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 16px;
}
.customer-info {
display: flex;
padding: 12px;
border-top: 1px solid #c3c3c3;
border-bottom: 1px solid #c3c3c3;
&-left,
&-right {
width: 50%;
}
&-label {
display: flex;
}
&-name {
font-size: 12px;
width: 40%;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 18px;
}
&-message {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 18px;
}
&-wechatnick {
display: inline-block;
max-width: 58px;
}
&-car {
max-width: 80px;
}
&-wechat {
vertical-align: bottom;
color: #3975c6;
}
&-qiwechat {
vertical-align: bottom;
color: #2cca74;
}
}
.customer-marketing {
display: flex;
justify-content: space-around;
padding: 11px 0;
}
.customer-info-qiwechat {
vertical-align: bottom;
color: #2cca74;
}
</style>
<template>
<div>
<van-action-sheet v-model="showCustomerDetail" cancel-text="关闭详情" close-on-click-action @cancel="onCancel">
<div class="popup-card">
<div class="name-title">
<div class="name-title-text">{{ customerList.customerName }}</div>
</div>
<!-- 客户信息 -->
<div class="customer-message">
<div class="customer-info-title">客户信息</div>
<div class="customer-info-box">
<div class="customer-info-item">
<div class="customer-info-item-title">VIN码</div>
<div class="customer-info-item-content">{{ customerList.cars && customerList.cars.length > 0 && customerList.cars[0].carVin }}</div>
</div>
<div class="customer-info-item">
<div class="customer-info-item-title">车系</div>
<div class="customer-info-item-content">{{ customerList.cars && customerList.cars.length > 0 && customerList.cars[0].carSeries }}</div>
</div>
<div class="customer-info-item">
<div class="customer-info-item-title">车牌号码</div>
<div class="customer-info-item-content">{{ customerList.cars && customerList.cars.length > 0 && customerList.cars[0].carNumber }}</div>
</div>
<div class="customer-info-item">
<div class="customer-info-item-title">购车日期</div>
<div class="customer-info-item-content">{{ customerList.cars && customerList.cars.length > 0 && customerList.cars[0].carBuyDate }}</div>
</div>
<div class="customer-info-item">
<div class="customer-info-item-title">最近保养</div>
<div class="customer-info-item-content">{{ maintennceList.length > 0 ? maintennceList[0].maDate : '' }}</div>
</div>
<div class="customer-info-item">
<div class="customer-info-item-title">人群分组</div>
<div class="customer-info-item-content">{{ groupName }}</div>
</div>
<div class="customer-info-item">
<div class="customer-info-item-title">企微账号</div>
<div v-if="customerList.nickName">
<span class="customer-info-item-content">{{ customerList.nickName }}</span>
<span class="customer-info-item-wechat customer-info-item-message" v-if="customerList.type == 1">@微信</span>
<span class="customer-info-item-qiwei customer-info-item-message" v-else>@企微</span>
</div>
<div class="customer-info-message" v-else>未添加</div>
</div>
</div>
</div>
<!-- 维保记录 -->
<div class="customer-message">
<div class="customer-info-title">维保记录</div>
<template v-if="maintennceList.length">
<div class="stepItem" v-for="(item, index) in maintennceList" :key="index">
<div class="sprite-icon icon-maintant"></div>
<div class="stepBox">
<div class="stepBox-left">
<div class="stepBox-left-name">{{ item.repairItems }}</div>
<div class="stepBox-left-title">
费用:
<span class="stepBox-left-content">{{ item.price }}</span>
</div>
<div class="stepBox-left-title">
跟进人:
<span class="stepBox-left-content">{{ item.follower }}</span>
</div>
</div>
<div class="stepBox-right">{{ item.maDate }}</div>
</div>
</div>
</template>
<div v-else class="no-data">暂无数据</div>
</div>
<!-- 跟进记录 -->
<div class="record">
<div class="customer-info-title">跟进记录</div>
<template v-if="followRecordList.length">
<div class="stepItem" v-for="(item, index) in followRecordList" :key="index">
<div class="sprite-icon icon-followRecord"></div>
<div style="width: 90%">
<div class="stepBox-follow">
<div class="stepBox-left-name">{{ item.followResultEcho }}</div>
<div class="stepBox-right">{{ item.createdTime }}</div>
</div>
<div class="stepBox-left-title">
预约时间:
<span class="stepBox-left-content">{{ item.orderTime ? item.orderTime : '-' }}</span>
</div>
<div class="stepBox-left-title" style="display: flex">
<div class="stepBox-left-title-tip">备注:</div>
<div class="stepBox-left-content stepBox-left-content-overflow">{{ item.followMark ? item.followMark : '-' }}</div>
</div>
</div>
</div>
</template>
<div v-else class="no-data">暂无数据</div>
</div>
</div>
</van-action-sheet>
</div>
</template>
<script>
import { solicitApi } from '@/api'
export default {
name: 'CustomerInfoPopup',
data() {
return {
// 客户信息弹出层展示
showCustomerDetail: false,
// 客户信息表
customerList: {},
// 车辆信息列表
carInfoList: [],
// 维保记录表
maintennceList: [],
// 跟进记录列表
followRecordList: []
}
},
created() {
this.groupName = this.getQuery().groupName ? this.getQuery().groupName : ''
},
methods: {
// 获取客户详情
getCustomerDetail(val) {
this.showCustomerDetail = true
var params = {
customerId: val.actCutId
}
solicitApi.getCustomerDetail(params).then(({ code, data, message }) => {
if (code == 0) {
this.customerList = data
if (data.cars && data.cars.length) {
this.carInfoList = data.cars
this.carInfoList.map(item => {
item.carBuyDate = this.timeTransfer(item.carBuyDate)
})
}
if (data.maList && data.maList.length) {
this.maintennceList = data.maList.slice(0, 2)
this.maintennceList.map(item => {
item.maDate = this.timeTransfer(item.maDate)
})
}
if (data.followRecordList && data.followRecordList.length) {
this.followRecordList = data.followRecordList
this.followRecordList.map(item => {
item.orderTime = item.orderTime && this.timeTransfer(item.orderTime)
item.createdTime = this.timeTransfer(item.createdTime)
})
}
}
})
},
// 时间戳转换
timeTransfer(val) {
let time = new Date(val)
let year = time.getFullYear() + '-'
let month = time.getMonth() + 1
let date = time.getDate()
let hour = time.getHours()
let minute = time.getMinutes()
month = month < 10 ? '0' + month + '-' : month + '-'
date = date < 10 ? '0' + date : date
hour = hour < 10 ? '0' + hour + ':' : hour + ':'
minute = minute < 10 ? '0' + minute : minute
let result = String(year) + String(month) + String(date) + ' ' + String(hour) + String(minute)
return result
},
// 关闭弹窗
onCancel() {
this.showCustomerDetail = false
this.customerList = {}
this.carInfoList = []
this.maintennceList = []
this.followRecordList = []
}
}
}
</script>
<style lang="scss" scoped>
.popup-card {
padding: 0 16px 16px 16px;
}
.name-title {
width: 100%;
height: 48px;
background-color: #fff;
position: sticky;
top: 0;
z-index: 999;
&-text {
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #333333;
line-height: 48px;
}
}
.customer-message {
padding: 16px 0;
border-bottom: 1px solid #c3c3c3;
}
.customer-info-title {
font-size: 16px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
line-height: 22px;
margin-bottom: 12px;
}
.customer-info-item {
display: flex;
justify-content: space-between;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
line-height: 22px;
padding-top: 8px;
&-title {
color: #666666;
}
&-content {
color: #333333;
}
&-message {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
line-height: 18px;
}
&-wechat {
color: #3975c6;
}
&-qiwei {
color: #2cca74;
}
}
.record {
margin-top: 16px;
}
.stepItem {
display: flex;
justify-content: space-between;
position: relative;
padding-bottom: 5px;
margin-top: 17px;
}
.stepItem:not(:last-of-type):after {
content: '';
font-size: 0;
height: 100%;
width: 1px;
background: #e6e8eb;
position: absolute;
left: 10px;
top: 20px;
}
.stepBox {
width: 90%;
display: flex;
justify-content: space-between;
&-follow {
display: flex;
justify-content: space-between;
}
}
.stepBox-left {
&-name {
font-size: 14px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #333333;
line-height: 22px;
}
&-title {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 18px;
&-tip {
display: inline-block;
min-width: 36px;
}
}
&-content {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #330000;
line-height: 18px;
&-overflow {
display: inline-block;
padding-right: 16px;
}
}
}
.stepBox-right {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 18px;
}
.no-data {
height: 50px;
width: 100%;
text-align: center;
line-height: 50px;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
}
/deep/ .van-action-sheet {
max-height: 100%;
}
</style>
<template>
<van-dropdown-menu active-color="#3369B1" class="qw-drop-down">
<van-dropdown-item v-model="value1" :options="option1" @change="selectChange" />
<van-dropdown-item v-model="value2" :disabled="disabled" :options="option2" @change="selectSecondChange" />
</van-dropdown-menu>
</template>
<script>
export default {
name: 'DropDown',
data() {
return {
option1: this.selectOption1,
option2: this.selectOption2,
value1: this.currentValue1,
value2: this.currentValue2,
disabled: false
}
},
watch: {
currentValue1(n) {
this.value1 = n
},
currentValue2(n) {
this.value2 = n
},
selectOption2(n) {
this.option2 = n
}
},
props: {
selectOption1: {
type: Array,
default: () => {
return []
}
},
selectOption2: {
type: Array,
default: () => {
return []
}
},
currentValue1: {
type: Number,
default: 0
},
currentValue2: {
type: Number,
default: 0
}
},
methods: {
selectChange(value) {
this.disabled = false
if (value == 2) this.disabled = true
this.value1 = value
this.$emit('changeFirst', value)
},
selectSecondChange(value) {
this.value2 = value
this.$emit('changeSecond', value)
}
}
}
</script>
<style lang="scss" scoped>
.qw-drop-down /deep/ .van-ellipsis {
font-size: 14px;
font-weight: 400;
}
</style>
...@@ -18,9 +18,9 @@ export default { ...@@ -18,9 +18,9 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.custom-image { // .custom-image {
padding-top: 79px; // // padding-top: 79px;
} // }
.custom-image /deep/ .van-empty__image { .custom-image /deep/ .van-empty__image {
width: 88px; width: 88px;
......
<template>
<div class="select-tab flex" v-if="data.length > 0">
<template v-for="(i) in data">
<div @click="click(i)" :class="['item', tabIndex == i.value ? 'active' : '']" :key="i.value">{{ i.text }}</div>
</template>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'SelectBar',
props: {
list: {
type: Array,
default: () => {
return []
}
},
index: {
type: Number,
default: 0
},
updata: null
},
data () {
return {
tabIndex: this.index,
data: this.list
}
},
watch: {
'index' (n) {
this.tabIndex = n
},
'updata' (n) {
this.data = this.list
this.tabIndex = this.index
}
},
mounted () {
},
methods: {
click (data) {
this.tabIndex = data.value
this.$emit('change', this.tabIndex)
}
}
}
</script>
<style lang="scss" scoped>
.select-tab {
margin: 10px 16px;
height: 28px;
background: #ebeff5;
border-radius: 6px;
box-sizing: border-box;
.item {
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 28px;
flex: 1;
text-align: center;
}
.active {
height: 24px;
background: #ffffff;
box-shadow: 0px 1px 2px 0px rgba(94, 97, 102, 0.2);
border-radius: 4px;
border: 1px solid rgba(0, 0, 0, 0.04);
color: #3975c6;
line-height: 24px;
}
}
</style>
<template> <template>
<div :class="[{'sticky':sticky}]"> <div :class="[{ sticky: sticky }]">
<van-tabs <van-tabs v-model="tabIndex" color="#3975C6" title-inactive-color="#BBB" title-active-color="#2c2c2c" @click="click" :key="updata">
v-model="tabIndex" <template v-for="(i, index) in data">
color="#3975C6" <van-tab :title="i" :key="index"></van-tab>
title-inactive-color="#BBB"
title-active-color="#2c2c2c"
@click="click"
:key="updata"
>
<template v-for="(i,index) in data">
<van-tab
:title="i"
:key="index"
></van-tab>
</template> </template>
</van-tabs> </van-tabs>
</div> </div>
</template> </template>
<script type='text/ecmascript-6'> <script type="text/ecmascript-6">
export default { export default {
name: 'Tab', name: 'Tab',
props: { props: {
...@@ -48,6 +38,9 @@ export default { ...@@ -48,6 +38,9 @@ export default {
'updata' (n) { 'updata' (n) {
this.data = this.list this.data = this.list
this.tabIndex = this.index this.tabIndex = this.index
},
'list'(n){
this.data = n
} }
}, },
mounted () { mounted () {
...@@ -61,7 +54,7 @@ export default { ...@@ -61,7 +54,7 @@ export default {
} }
</script> </script>
<style lang='scss'> <style lang="scss">
.sticky { .sticky {
position: sticky; position: sticky;
top: 0; top: 0;
...@@ -76,4 +69,4 @@ export default { ...@@ -76,4 +69,4 @@ export default {
.van-tab--active { .van-tab--active {
font-size: 16px !important; font-size: 16px !important;
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
background-color: #dfe7f1; background-color: #dfe7f1;
.item { .item {
width: 50%; width: 50%;
transition: all 0.5s; // transition: all 0.5s;
font-size: 14px; font-size: 14px;
} }
.active-0 { .active-0 {
......
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
*/ */
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
envVersion: "develop", envVersion: 'develop',
title: '嘀加企微管家', title: '嘀加企微管家',
request: { request: {
baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址, baseURL: 'http://scrm.dev.glsx.com.cn', // 本地测试项目地址,
// 设置超时时间 // 设置超时时间
timeout: 180000, timeout: 180000,
// 携带凭证 // 携带凭证
...@@ -28,14 +28,14 @@ module.exports = { ...@@ -28,14 +28,14 @@ module.exports = {
logout_function: 'reLogin', logout_function: 'reLogin',
code_message_map: {} code_message_map: {}
}, },
secret: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b", secret: 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b',
shopmall_appid: "wxe10067a63c1856ac", shopmall_appid: 'wxe10067a63c1856ac',
sign: { sign: {
appKey: "48e5e13229b82c1b4e6e8c96151f0637", appKey: '48e5e13229b82c1b4e6e8c96151f0637',
format: "json", format: 'json',
locale: "zh_CN", locale: 'zh_CN',
source: "scrm-main", source: 'scrm-main',
v: "1.0.0", v: '1.0.0'
}, },
vconsole: true vconsole: true
}
\ No newline at end of file \ No newline at end of file
}
...@@ -17,11 +17,12 @@ import store from './store' ...@@ -17,11 +17,12 @@ import store from './store'
import api from './api' import api from './api'
import { fetchConfig, cfg } from '@/config' import { fetchConfig, cfg } from '@/config'
import '@/assets/css/index.scss' import '@/assets/css/index.scss'
import { bus, tools, store as local, util } from './utils' import { bus, tools, store as local, util,constants } from './utils'
import './utils/util' import './utils/util'
import 'components' import 'components'
import { components } from '@/plugins/vant' import { components } from '@/plugins/vant'
components.forEach(component => Vue.use(component)) components.forEach(component => Vue.use(component))
Vue.prototype.$constants = constants
Vue.prototype.api = api Vue.prototype.api = api
Vue.prototype.bus = bus Vue.prototype.bus = bus
Vue.prototype.tools = tools Vue.prototype.tools = tools
......
...@@ -48,7 +48,11 @@ import { ...@@ -48,7 +48,11 @@ import {
ShareSheet, ShareSheet,
Overlay, Overlay,
loading, loading,
DatetimePicker DatetimePicker,
Toast,
Switch,
Form,
Sticky
} from 'vant' } from 'vant'
export const components = [ export const components = [
Button, Button,
...@@ -91,5 +95,9 @@ export const components = [ ...@@ -91,5 +95,9 @@ export const components = [
ShareSheet, ShareSheet,
Overlay, Overlay,
loading, loading,
DatetimePicker
]
\ No newline at end of file \ No newline at end of file
DatetimePicker,
Toast,
Switch,
Form,
Sticky
]
const pages = { const pages = {
customerGroup: [{ customerGroup: [
name: 'index', {
meta: { name: 'index',
title: '一客一群', meta: {
backgroundColor: '#F7F7F7', title: '一客一群',
keepAlive: true, backgroundColor: '#F7F7F7',
} keepAlive: true
}, }
{ name: 'mass' } },
{ name: 'mass' }
], ],
attractCustomer: [{ attractCustomer: [
name: 'index', {
meta: { name: 'index',
title: '渠道活码', meta: {
backgroundColor: '#F7F7F7', title: '渠道活码',
keepAlive: true, backgroundColor: '#F7F7F7',
} keepAlive: true
}, { }
name: 'detail', },
meta: { {
title: '渠道活码', name: 'detail',
keepAlive: true, meta: {
} title: '渠道活码',
}], keepAlive: true
customer: [{ }
name: 'index',
meta: {
title: '查看客户详情',
backgroundColor: '#F7F7F7',
}
}, {
name: 'information',
meta: {
title: '完善信息',
backgroundColor: '#F7F7F7'
}
}, {
name: 'detail',
meta: {
title: '客户跟进',
backgroundColor: '#F7F7F7',
// keepAlive: true,
} }
}, { ],
name: 'groupDetail', customer: [
meta: { {
title: '客户跟进', name: 'index',
backgroundColor: '#F7F7F7', meta: {
keepAlive: true, title: '查看客户详情',
} backgroundColor: '#F7F7F7'
}, { }
name: 'editDetail', },
meta: { {
backgroundColor: '#F7F7F7', name: 'information',
keepAlive: true, meta: {
title: '完善信息',
backgroundColor: '#F7F7F7'
}
},
{
name: 'detail',
meta: {
title: '客户跟进',
backgroundColor: '#F7F7F7'
// keepAlive: true,
}
},
{
name: 'groupDetail',
meta: {
title: '客户跟进',
backgroundColor: '#F7F7F7',
keepAlive: true
}
},
{
name: 'editDetail',
meta: {
backgroundColor: '#F7F7F7',
keepAlive: true
}
} }
}], ],
tag: [{ tag: [
name: 'index', {
meta: { name: 'index',
title: '批量打标签', meta: {
backgroundColor: '#F7F7F7' title: '批量打标签',
backgroundColor: '#F7F7F7'
}
} }
}], ],
customerDetails: [{ customerDetails: [
name: 'index', {
meta: { name: 'index',
title: '查看客户详情', meta: {
backgroundColor: '#F7F7F7' title: '查看客户详情',
backgroundColor: '#F7F7F7'
}
},
{
name: 'detail',
meta: {
title: '查看客户详情',
backgroundColor: '#F7F7F7'
}
} }
}, { ],
name: 'detail', solicit: [
meta: { {
title: '查看客户详情', name: 'index',
backgroundColor: '#F7F7F7' meta: {
title: '查看客户详情',
backgroundColor: '#F7F7F7'
}
},
{
name: 'customer',
meta: {
title: '查看客户详情',
backgroundColor: '#F7F7F7'
}
},
{
name: 'marketing',
meta: {
title: '一键营销',
backgroundColor: '#F7F7F7'
}
},
{
name: 'succeed',
meta: {
title: '招揽跟进',
backgroundColor: '#F7F7F7'
}
},
{
name: 'statistic',
meta: {
title: '触达统计',
backgroundColor: '#F7F7F7'
}
},
{
name: 'lookCustomer',
meta: {
title: '查看客户',
backgroundColor: '#F7F7F7'
}
} }
}] ]
} }
const redirect = '' const redirect = ''
...@@ -87,9 +146,7 @@ Object.keys(pages).map(parent => { ...@@ -87,9 +146,7 @@ Object.keys(pages).map(parent => {
const isIndex = parent == redirect && val.name == 'index' const isIndex = parent == redirect && val.name == 'index'
let childrenPath = `${parent}/${val.name}` let childrenPath = `${parent}/${val.name}`
let { meta } = val let { meta } = val
const path = isIndex ? const path = isIndex ? '/' : `/${val.name == 'index' ? parent : childrenPath}`
'/' :
`/${val.name == 'index' ? parent : childrenPath}`
const name = val.name == 'index' ? parent : childrenPath.replace('/', '.') const name = val.name == 'index' ? parent : childrenPath.replace('/', '.')
if (meta && meta.keepAlive) keepAlives.push(name) if (meta && meta.keepAlive) keepAlives.push(name)
let route = { let route = {
...@@ -103,4 +160,4 @@ Object.keys(pages).map(parent => { ...@@ -103,4 +160,4 @@ Object.keys(pages).map(parent => {
}) })
export const keeps = keepAlives export const keeps = keepAlives
export default routes
\ No newline at end of file \ No newline at end of file
export default routes
...@@ -2,13 +2,15 @@ import Vue from 'vue' ...@@ -2,13 +2,15 @@ import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
import getters from './getters' import getters from './getters'
import app from './modules/app' import app from './modules/app'
import solicit from './modules/solicit'
// import createPersistedState from "vuex-persistedstate" // import createPersistedState from "vuex-persistedstate"
Vue.use(Vuex) Vue.use(Vuex)
const store = new Vuex.Store({ const store = new Vuex.Store({
modules: { modules: {
app app,
solicit
}, },
getters getters
// plugins: [createPersistedState({ // plugins: [createPersistedState({
......
...@@ -95,7 +95,6 @@ const actions = { ...@@ -95,7 +95,6 @@ const actions = {
util.setSessionId(userInfo.sessionId) util.setSessionId(userInfo.sessionId)
dispatch('registerHttp', userInfo.sessionId) dispatch('registerHttp', userInfo.sessionId)
// 只有一个账号 history.back() // 只有一个账号 history.back()
console.log(`${redirectUrl}${route}`)
state.showWindow = true state.showWindow = true
window.location.replace(`${redirectUrl}#/${route}`) window.location.replace(`${redirectUrl}#/${route}`)
} }
...@@ -128,7 +127,7 @@ const actions = { ...@@ -128,7 +127,7 @@ const actions = {
} }
}, },
navigation({ dispatch }) { navigation({ dispatch }) {
let { sessionId, corpId ,id} = getParams() let { sessionId, corpId, id, activityId } = getParams()
const storage_corpId = util.getLocalStorage('dj_scrm_corpId') const storage_corpId = util.getLocalStorage('dj_scrm_corpId')
if (!corpId) corpId = storage_corpId && storage_corpId.corpId if (!corpId) corpId = storage_corpId && storage_corpId.corpId
if (corpId && storage_corpId) { if (corpId && storage_corpId) {
...@@ -138,6 +137,7 @@ const actions = { ...@@ -138,6 +137,7 @@ const actions = {
} }
} }
util.setLocalStorage('dj_scrm_corpId', { corpId }) util.setLocalStorage('dj_scrm_corpId', { corpId })
if (activityId) util.setLocalStorage('dj_scrm_activityId', activityId)
if (id) util.setLocalStorage('dj_scrm_id', { id }) if (id) util.setLocalStorage('dj_scrm_id', { id })
const storage_sessionId = util.getSessionId() const storage_sessionId = util.getSessionId()
if (sessionId || storage_sessionId) { if (sessionId || storage_sessionId) {
...@@ -171,4 +171,4 @@ export default { ...@@ -171,4 +171,4 @@ export default {
state, state,
mutations, mutations,
actions actions
}
\ No newline at end of file \ No newline at end of file
}
import { solicitApi } from '@/api'
import { util } from 'utils'
import { Notify } from 'vant'
export default {
namespaced: true,
state: {
currentIndex: 0,
follewIndex: 0,
activityId: util.getLocalStorage('dj_scrm_activityId') ? util.getLocalStorage('dj_scrm_activityId') : '',
staffId: util.getLocalStorage('dj_scrm_staffId') ? util.getLocalStorage('dj_scrm_staffId') : '',
followResultList: util.getLocalStorage('followResultList') ? util.getLocalStorage('followResultList') : [],
customerInfoList: [],
overviewCountInfo: {
tabPageFollowUpCount: 0,
tabPageResultCount: 0
}
},
mutations: {
['SET_TAB_INDEX'](state, payload) {
state.currentIndex = payload.currentIndex
},
['SET_FOLLOW_INDEX'](state, payload) {
state.follewIndex = payload.follewIndex
},
['SET_STAFF_ID'](state, payload) {
state.staffId = payload.staffId
util.setLocalStorage('dj_scrm_staffId', payload.staffId)
},
['SET_COUSTOMER_LIST'](state, payload) {
state.customerInfoList = payload.customerInfoList
},
['SET_FOLLOE_RESULT_LIST'](state, payload) {
state.followResultList = payload.followResultList
util.setLocalStorage('followResultList', payload.followResultList)
},
['SET_ACTIVITY_ID'](state, payload) {
state.activityId = payload.activityId
util.setLocalStorage('dj_scrm_activityId', payload.activityId)
},
['SET_OVERVIEW_COUNT_INFO'](state, payload) {
state.overviewCountInfo = payload.overviewCountInfo
}
},
actions: {
//设置staffId
getStaffId(conText, payload) {
solicitApi.getStaffid(payload).then(res => {
if (res.code == 0) {
conText.commit('SET_STAFF_ID', { staffId: res.data })
if (payload.success) {
payload.success()
}
}
})
},
// 获取跟进结果字典数据
getFollowDataList(conText, payload) {
var params = {
dictType: 'follow_result'
}
solicitApi.followFindAllDictData(params).then(res => {
conText.commit('SET_FOLLOE_RESULT_LIST', { followResultList: res.data })
})
},
// 获取跟进总数和结果总数
getTaskOverviewData(conText, payload) {
console.log('------这里')
let params = {
activityId: conText.state.activityId,
staffId: conText.state.staffId
}
solicitApi.taskOverviewData(params).then(({ code, data, message }) => {
if (code == '0') {
conText.commit('SET_OVERVIEW_COUNT_INFO', {
overviewCountInfo: {
tabPageFollowUpCount: data.tabPageFollowUpCount,
tabPageResultCount: data.tabPageResultCount
}
})
} else {
Notify(message)
}
})
},
findActivityIdByUUID(conText, payload) {
solicitApi.findActivityIdByUUID(payload).then(res => {
if (res.code == 0) {
conText.commit('SET_ACTIVITY_ID', { activityId: res.data })
if (payload.success) {
payload.success(res.data)
}
} else {
Notify(res.message)
}
})
}
}
}
...@@ -7,3 +7,91 @@ ...@@ -7,3 +7,91 @@
* @LastEditTime: 2021-06-15 14:45:39 * @LastEditTime: 2021-06-15 14:45:39
*/ */
export const STORE_USER_KEY = 'STORE_USER_KEY' export const STORE_USER_KEY = 'STORE_USER_KEY'
export const BULLETINLIST = [
{
todayText: '今日跟进 (人)',
todayValue: obj => {
return obj.workBriefingFollowUpTodayCount
},
currentMonth: '本月跟进 ',
currentValue: obj => {
return obj.workBriefingFollowUpMonthCount
},
icon: 'icon-follow'
},
{
todayText: '今日添加 (人)',
todayValue: obj => {
return obj.workBriefingAddedTodayCount
},
currentMonth: '本月添加 ',
currentValue: obj => {
return obj.workBriefingAddedMonthCount
},
icon: 'icon-append'
},
{
todayText: '今日预约 (人)',
todayValue: obj => {
return obj.workBriefingAppointmentTodayCount
},
currentMonth: '本月预约 ',
currentValue: obj => {
return obj.workBriefingAppointmentMonthCount
},
icon: 'icon-appoint'
},
{
todayText: '今日到店 (人)',
todayValue: obj => {
return obj.workBriefingReturnFactoryTodayCount
},
currentMonth: '本月到店 ',
currentValue: obj => {
return obj.workBriefingReturnFactoryMonthCount
},
icon: 'icon-factory'
}
]
export const STATICLIST = [
{
text: '总招揽数',
value: obj => {
return obj.solicitationTotal
}
},
{
text: '企微客户',
value: obj => {
return obj.solicitationWeComCustomerCount
}
},
{
text: '未加企微',
value: obj => {
return obj.solicitationNotWeComCustomerCount
}
}
]
export const FOLLOWLIST = [
{
text: '平均跟进',
value: obj => {
return obj.addWayName+'次/人'
}
},
{
text: '最多跟进',
value: obj => {
return obj.addWayName+'次'
}
},
{
text: '最少跟进',
value: obj => {
return obj.addWayName+'次'
}
}
]
/*
* @Description:
* @Author: huyue
* @Date: 2022-06-07 15:05:02
* @LastEditors: huyue
* @LastEditTime: 2022-06-07 15:05:04
*/
const emoji = [
['微笑', '撇嘴', '色', '发呆', '得意', '流泪', '害羞', '闭嘴'],
['睡', '大哭', '尴尬', '发怒', '调皮', '呲牙', '惊讶', '难过'],
['酷', '囧', '抓狂', '吐', '微笑', '愉快', '白眼', '傲慢'],
['饥饿', '困', '惊恐', '流汗', '憨笑', '大兵', '奋斗', '咒骂'],
['疑问', '嘘', '晕', '折磨', '衰', '骷髅', '敲打', '再见'],
['擦汗', '抠鼻', '鼓掌', '糗大了', '坏笑', '左哼哼', '右哼哼', '哈欠'],
['鄙视', '委屈', '快哭了', '阴险', '亲亲', '吓', '可怜', '菜刀'],
['西瓜', '啤酒', '篮球', '乒乓', '咖啡', '饭', '猪头', '玫瑰'],
['凋谢', '示爱', '爱心', '心碎', '蛋糕', '闪电', '炸弹', '刀'],
['足球', '瓢虫', '便便', '月亮', '太阳', '礼物', '拥抱', '强'],
['弱', '握手', '胜利', '抱拳', '勾引', '拳头', '差劲', '爱你'],
['NO', 'OK', '爱情', '飞吻', '跳跳', '发抖', '怄火', '转圈'],
['磕头', '回头', '跳绳', '投降', '挥手', '激动', '街舞', '左太极'],
['右太极', '嘿哈', '捂脸', '奸笑', '机智', '皱眉', '耶', '社会社会'],
['让我看看', '666', '红包', '蜡烛', '烟花', '福', '庆祝', '爆竹']
]
export default emoji
\ No newline at end of file \ No newline at end of file
import Vue from 'vue' import Vue from 'vue'
import { import { Toast, Dialog } from 'vant'
Toast,
Dialog
} from 'vant'
/** /**
* 日期格式化 * 日期格式化
* let time = new Date().format('yyyy-MM-dd hh:mm:ss') * let time = new Date().format('yyyy-MM-dd hh:mm:ss')
*/ */
Date.prototype.format = function(fmt) { Date.prototype.format = function (fmt) {
let o = { let o = {
'M+': this.getMonth() + 1, //月份 'M+': this.getMonth() + 1, //月份
'd+': this.getDate(), //日 'd+': this.getDate(), //日
'h+': this.getHours(), //小时 'h+': this.getHours(), //小时
'm+': this.getMinutes(), //分 'm+': this.getMinutes(), //分
's+': this.getSeconds(), //秒 's+': this.getSeconds(), //秒
//季度 //季度
'q+': Math.floor((this.getMonth() + 3) / 3), 'q+': Math.floor((this.getMonth() + 3) / 3),
'S': this.getMilliseconds() //毫秒 S: this.getMilliseconds() //毫秒
}; }
if (/(y+)/.test(fmt)) { if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
} }
for (let k in o) { for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) { if (new RegExp(`(${k})`).test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length))) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length))
} }
} }
return fmt return fmt
} }
const throttle = (fn, gapTime) => { const throttle = (fn, gapTime) => {
if (gapTime == null || gapTime == undefined) { if (gapTime == null || gapTime == undefined) {
gapTime = 1500 gapTime = 1500
} }
let _lastTime = null let _lastTime = null
return function() { return function () {
let _nowTime = +new Date() let _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) { if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments) fn.apply(this, arguments)
_lastTime = _nowTime _lastTime = _nowTime
}
} }
} }
/**防止重复点击 */ }
/**防止重复点击 */
const showLoading = (title = '加载中...') => { const showLoading = (title = '加载中...') => {
Toast({ Toast({
type: 'loading', type: 'loading',
...@@ -52,27 +49,27 @@ const showLoading = (title = '加载中...') => { ...@@ -52,27 +49,27 @@ const showLoading = (title = '加载中...') => {
}) })
} }
const hideLoading = () => { const hideLoading = () => {
Toast.clear() Toast.clear()
} }
/**num:要转换的数值,fixed:精确几位小数 */ /**num:要转换的数值,fixed:精确几位小数 */
const decimal = (num, fixed) => { const decimal = (num, fixed) => {
let pow = Math.pow(10, fixed) let pow = Math.pow(10, fixed)
return Math.round(num * pow) / pow return Math.round(num * pow) / pow
} }
const showToast = (message = '', callBack) => { const showToast = (message = '', callBack) => {
let params = { let params = {
message, message,
forbidClick: true, forbidClick: true,
duration: 1500 duration: 1500
} }
Toast(params) Toast(params)
if (callBack && typeof callBack == 'function') { if (callBack && typeof callBack == 'function') {
setTimeout(() => { setTimeout(() => {
callBack() callBack()
}, 1500) }, 1500)
}
} }
/**触摸样式 */ }
/**触摸样式 */
const touchstart = e => { const touchstart = e => {
e.target.classList.add('btn-on-leave') e.target.classList.add('btn-on-leave')
} }
...@@ -98,28 +95,28 @@ const removeLocalStorage = key => { ...@@ -98,28 +95,28 @@ const removeLocalStorage = key => {
window.localStorage.removeItem(key) window.localStorage.removeItem(key)
} }
const dialog = (params = {}) => { const dialog = (params = {}) => {
if (!params.confirmButtonColor) params.confirmButtonColor = '#FF7336' if (!params.confirmButtonColor) params.confirmButtonColor = '#FF7336'
return Dialog.confirm(params) return Dialog.confirm(params)
} }
/**拨打电话 */ /**拨打电话 */
const makePhoneCall = phoneNumber => { const makePhoneCall = phoneNumber => {
window.location.href = `tel://${phoneNumber}` window.location.href = `tel://${phoneNumber}`
} }
/**是否全面屏 */ /**是否全面屏 */
const isFullSucreen = () => { const isFullSucreen = () => {
let result = false; let result = false
const rate = window.screen.height / window.screen.width const rate = window.screen.height / window.screen.width
let limit = window.screen.height == window.screen.availHeight ? 1.8 : 1.65 // 临界判断值 let limit = window.screen.height == window.screen.availHeight ? 1.8 : 1.65 // 临界判断值
result = rate > limit result = rate > limit
return result return result
} }
const jumpChildrenPage = (to, params) => { const jumpChildrenPage = (to, params) => {
let { name } = window.vm._route let { name } = window.vm._route
window.vm.$router.push({ name: `${name}.${to}`, params }) window.vm.$router.push({ name: `${name}.${to}`, params })
} }
/**拷贝 */ /**拷贝 */
const setClipboardData = data => { const setClipboardData = data => {
wx.setClipboardData({ wx.setClipboardData({
data, data,
...@@ -127,8 +124,7 @@ const setClipboardData = data => { ...@@ -127,8 +124,7 @@ const setClipboardData = data => {
console.log(res) console.log(res)
Toast('复制成功') Toast('复制成功')
}, },
fail(res){ fail(res) {}
}
}) })
} }
...@@ -165,7 +161,6 @@ const watchPageBack = () => { ...@@ -165,7 +161,6 @@ const watchPageBack = () => {
resolve() resolve()
} }
}) })
} }
const utils = { const utils = {
removeLocalStorage, removeLocalStorage,
...@@ -196,4 +191,4 @@ const utils = { ...@@ -196,4 +191,4 @@ const utils = {
Object.keys(utils).map(key => { Object.keys(utils).map(key => {
Vue.prototype[key] = utils[key] Vue.prototype[key] = utils[key]
}) })
export default utils
\ No newline at end of file \ No newline at end of file
export default utils
...@@ -3,30 +3,11 @@ ...@@ -3,30 +3,11 @@
<tip :title="title"></tip> <tip :title="title"></tip>
<template v-if="customerList.length > 0"> <template v-if="customerList.length > 0">
<div class="customerList-add"> <div class="customerList-add">
<scroll-view <scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
class="content" <div class="customer-add" v-for="(item, index) in customerList" :key="index">
@ReachBottom="onReachBottom" <div class="customer-add-portrait" v-if="tabIndex == 3">
ref="scrollView" <img :src="item.avatar" alt="" v-if="item.avatar" />
> <img src="../../assets/images/user.png" alt="" v-else />
<div
class="customer-add"
v-for="(item, index) in customerList"
:key="index"
>
<div
class="customer-add-portrait"
v-if="tabIndex == 3"
>
<img
:src="item.avatar"
alt=""
v-if="item.avatar"
/>
<img
src="../../assets/images/user.png"
alt=""
v-else
/>
</div> </div>
<div :class="{ 'customer-add-info': true, 'customer-add-all-info': tabIndex === 3 }"> <div :class="{ 'customer-add-info': true, 'customer-add-all-info': tabIndex === 3 }">
<div class="customer-add-info-number">{{ item.customerPhone }}</div> <div class="customer-add-info-number">{{ item.customerPhone }}</div>
...@@ -34,48 +15,30 @@ ...@@ -34,48 +15,30 @@
</div> </div>
<template v-if="item.status == 0"> <template v-if="item.status == 0">
<div class="customer-add-friend flex"> <div class="customer-add-friend flex">
<div <div class="sprite-icon icon-customer-add" @click="addFriend(item)"></div>
class="sprite-icon icon-customer-add"
@click="addFriend(item)"
></div>
<div class="customer-add-friend-text">加好友</div> <div class="customer-add-friend-text">加好友</div>
</div> </div>
<div class="line"></div> <div class="line"></div>
<div <div class="customer-add-friend flex" @click="callPhone(item.customerPhone)">
class="customer-add-friend flex"
@click="callPhone(item.customerPhone)"
>
<div class="sprite-icon icon-customer-phone"></div> <div class="sprite-icon icon-customer-phone"></div>
<div class="customer-add-friend-text">拨打电话</div> <div class="customer-add-friend-text">拨打电话</div>
</div> </div>
</template> </template>
<div <div class="customer-add-stay" v-else-if="item.status == 1">待通过</div>
class="customer-add-stay" <div class="customer-add-pass" v-else-if="item.status == 2">已通过</div>
v-else-if="item.status == 1"
>待通过</div>
<div
class="customer-add-pass"
v-else-if="item.status == 2"
>已通过</div>
<div class="buttomLine"></div> <div class="buttomLine"></div>
</div> </div>
</scroll-view> </scroll-view>
</div> </div>
<template v-if="tabIndex == 0 && copywriting != ''"> <template v-if="tabIndex == 0 && copywriting != ''">
<div class="copy-box"> <div class="copy-box">
<div <div class="sprite-icon icon-customer-copy" @click="copy"></div>
class="sprite-icon icon-customer-copy"
@click="copy"
></div>
<div class="title">客户好友申请文案</div> <div class="title">客户好友申请文案</div>
<div>{{ copywriting }}</div> <div>{{ copywriting }}</div>
</div> </div>
</template> </template>
</template> </template>
<empty <empty v-else description="暂无数据" />
v-else
description="暂无数据"
/>
</div> </div>
</template> </template>
<script> <script>
...@@ -266,7 +229,7 @@ export default { ...@@ -266,7 +229,7 @@ export default {
.customer-add-stay { .customer-add-stay {
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #3975C6; color: #3975c6;
line-height: 17px; line-height: 17px;
margin-left: 78px; margin-left: 78px;
white-space: nowrap; white-space: nowrap;
...@@ -327,4 +290,4 @@ export default { ...@@ -327,4 +290,4 @@ export default {
height: calc(100vh - 220px) !important; height: calc(100vh - 220px) !important;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
<template>
<div class="friend-wrap">
<img src="@/assets/images/friend.png"/>
</div>
</template>
<script>
export default {
}
</script>
<style lang="scss" scoped>
.friend-wrap{
width:375px;
height:1186px;
img{
width:100%;
height: 100%;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="bar-container">
<canvas class="canvas" :id="refId"></canvas>
</div>
</template>
<script>
import F2 from '@antv/f2/lib/index-all'
export default {
name: 'barChart',
data() {
return {
chart: null,
chartColor: this.color,
refId: this.id,
barList: this.list
}
},
props: {
color: {
type: String,
default: ''
},
list: {
type: Array,
default: () => []
},
id: {
type: String,
default: () => ''
},
tickCount: {
type: Number,
default: () => 5
}
},
mounted() {
this.initCanvas()
},
watch: {
list() {
this.initCanvas()
}
},
methods: {
initCanvas() {
let id = this.refId
let { barList, color } = this
let tickIntervalNum = 0
// 判断barList是否有值,根据barList中最大值计算tickInterval
if (barList.length) {
let s = barList[0].value
for (var i = 1; i < barList.length; i++) {
if (s < barList[i].value) {
s = barList[i].value
}
}
tickIntervalNum = s
}
let textLength = 2
this.list.forEach(item => {
textLength = item.text.length > textLength ? item.text.length : textLength
})
this.chart && this.chart.clear()
this.chart = null
this.chart = new F2.Chart({
id,
pixelRatio: window.devicePixelRatio,
padding: [16, 24, 24, textLength * 10 + 20],
height: barList.length < 2 ? 80 : barList.length * 45
})
this.chart.source(barList, {
value: {
tickCount: this.tickCount,
tickInterval: Math.ceil(tickIntervalNum / this.tickCount)
}
})
this.chart.coord({
transposed: true
})
this.chart.interval().position('text*value').color(color)
this.chart.render()
// 绘制柱状图文本
const offset = -6
const canvas = this.chart.get('canvas')
const group = canvas.addGroup()
const shapes = {}
barList.forEach(obj => {
const point = this.chart.getPosition(obj)
const text = group.addShape('text', {
attrs: {
x: textLength * 10 + 30,
y: point.y - offset,
text: obj.value,
fill: '#ffffff',
fontSize: 10
}
})
shapes[obj.text] = text // 缓存该 shape, 便于后续查找
})
}
}
}
</script>
<style lang="scss" scoped>
.canvas {
width: 100%;
// height: 160px;
}
</style>
<template>
<div class="line-container">
<canvas class="canvas" id="orderRef"></canvas>
<div class="line-tooltip flex" ref="lineTooltip"></div>
</div>
</template>
<script>
import F2 from '@antv/f2/lib/index-all'
export default {
name: 'lineChart',
data() {
return {
chart: null,
// tickInterval: 5,
chartColor: this.color,
refId: this.id
}
},
props: {
color: {
type: Array,
default: () => []
},
list: {
type: Array,
default: () => []
},
id: {
type: String,
default: () => ''
},
lineData: {
type: Array,
default: () => []
}
},
watch: {
lineData: {
handler() {
this.initCanvas()
},
deep: true
}
},
mounted() {
this.initCanvas()
},
methods: {
initCanvas(id = 'orderRef') {
// let offsetY
// offsetY = document.getElementById(id).height * 0.4
// await this.dynamicTick() //动态生成各个标度点的间距
const data = this.lineData
let tickIntervalNum = 0
// 判断lineData是否有值,根据barList中最大值计算tickInterval
if (data.length) {
let s = data[0].value
for (var i = 1; i < data.length; i++) {
if (s < data[i].value) {
s = data[i].value
}
}
tickIntervalNum = s
}
this.chart && this.chart.clear()
this.chart = null
this.chart = new F2.Chart({
id,
padding: [30, 40, 30, 40],
pixelRatio: window.devicePixelRatio
})
this.chart.source(data, {
date: {
type: 'timeCat',
mask: 'MM/DD',
range: [0, 1],
tickCount: 5
},
value: {
type: 'linear',
nice: true,
tickCount: 4,
tickInterval: Math.ceil(tickIntervalNum / 3)
}
})
this.chart.axis('date', {
label: function label(text, index, total) {
var textCfg = {}
if (index === 0) {
textCfg.textAlign = 'left'
} else if (index === total - 1) {
textCfg.textAlign = 'right'
}
return textCfg
}
})
const tooltipEl = this.$refs.lineTooltip
this.chart.tooltip({
custom: true,
showCrosshairs: false,
triggerOn: ['touchstart', 'touchmove'],
triggerOff: 'touchend',
onChange(ev) {
const currentData = ev.items[0]
// let reg = /(\d{4})-(\d{1,2})-(\d{1,2})/
// const time = currentData.origin.date.replace(reg, '$1年$2月$3日')
tooltipEl.innerHTML = `<div class="time">${currentData.origin.date}</div>
<div class="item flex"><span class="arc" style="color:#3975C6;">●</span>预约到店:${ev.items[0].value}</div>
<div class="item flex"><span class="arc" style="color:#FA7C0B;">●</span>实际到店:${ev.items[1].value}</div>`
tooltipEl.style.opacity = 1
tooltipEl.style.left = currentData.x - 140 / 2 + 'px'
tooltipEl.style.top = currentData.y - 45 - 15 + 'px'
},
onHide() {
tooltipEl.style.opacity = 0
}
})
this.chart.line().position('date*value').shape('smooth').color('type', ['#3975C6', '#FA7C0B'])
this.chart.legend(false)
this.chart.render()
},
dynamicTick() {
let entMicroCountData = [] //新增企微客户数
let newlyCustomerCountData = []
let entMicroCount
let newlyCustomerCount
let tickData = [...this.trendChartList]
tickData.forEach(i => {
entMicroCountData.push(i.entMicroCount)
newlyCustomerCountData.push(i.newlyCustomerCount)
})
entMicroCountData.sort((a, b) => {
return b - a
})
newlyCustomerCountData.sort((a, b) => {
return b - a
})
entMicroCount = entMicroCountData[0]
newlyCustomerCount = newlyCustomerCountData[0]
this.tickInterval = Math.ceil(entMicroCount > newlyCustomerCount ? entMicroCount / 5 : newlyCustomerCount / 5)
}
}
}
</script>
<style lang="scss" scoped>
.line-container {
position: relative;
.canvas {
width: 100%;
height: 180px;
}
.line-tooltip {
opacity: 0;
position: absolute;
width: 140px;
height: 70px;
border-radius: 6px;
box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
background: #ffffff;
z-index: 99;
flex-direction: column;
font-size: 12px;
box-sizing: border-box;
padding: 10px;
left: 0;
top: 0;
/deep/.time {
color: #a9a9a9;
}
/deep/.item,
/deep/.time {
width: 100%;
text-align: left;
font-size: 12px;
}
/deep/.arc {
border-radius: 100%;
font-size: 5px;
margin-right: 4px;
}
}
}
</style>
<template>
<div class="pie-container flex">
<canvas class="canvas" :id="refId"></canvas>
<div class="list-info">
<template v-for="(legend, index) in chartData">
<div class="list-info-item" :key="index">
<div class="font-12 color-2f line-18 flex">
<div class="circle" :style="{ background: color[index] }"></div>
{{ legend.text }}
</div>
<div class="font-16 color-3 line-24 bold m-l-14">{{ legend.value }}</div>
</div>
</template>
<!-- <div class="list-info-item">
<div class="font-12 color-2f line-18 flex">
<div class="circle"></div>
已跟进 (人)
</div>
<div class="font-16 color-3 line-24 bold m-l-14">396</div>
</div> -->
</div>
</div>
</template>
<script>
import F2 from '@antv/f2/lib/index-all'
export default {
name: 'pieChart',
data() {
return {
chart: null,
chartColor: this.color,
refId: this.id,
chartData: this.list
}
},
props: {
color: {
type: Array,
default: () => []
},
list: {
type: Array,
default: () => []
},
id: {
type: String,
default: ''
},
centerData: {
type: Object,
default: () => {}
}
},
watch: {
list() {
this.initCanvas()
}
},
mounted() {
console.log(this.list)
this.initCanvas()
},
methods: {
initCanvas() {
let id = this.refId
let { chartData, chartColor, centerData } = this
this.chart && this.chart.clear()
this.chart = null
this.chart = new F2.Chart({
id,
pixelRatio: window.devicePixelRatio,
padding: [20, 20, 20, 20]
})
this.chart.source(chartData)
this.chart.coord('polar', {
transposed: true,
radius: 0.9,
innerRadius: 0.6
})
this.chart.axis(false)
this.chart.legend(false)
this.chart.tooltip(false)
this.chart.guide().html({
position: ['50%', '53%'],
html: `<div style="width: 250px;height: 40px;text-align: center;">
<div style="font-size: 12px;color: rgba(47, 64, 86, 0.7);">${centerData.text}</div>
<div style="font-size: 18px;color: #343434;margin: 0;font-weight: bold;line-height: 24px;">${centerData.rate}</div>
</div>`
// html: '<div style="text-align: center;width:150px;height: 50px;">\n <p style="font-size: 10px;color: #999;margin: 0" id="title"></p>\n <p style="font-size: 18px;color: #343434;margin: 0;font-weight: bold;" id="value"></p>\n </div>'
})
this.chart.interval().position('const*value').adjust('stack').color('text', chartColor)
// this.chart.pieLabel({
// activeShape: false,
// lineStyle: {
// stroke: '#fff' // 线的颜色
// },
// anchorStyle: {
// fill: '#fff'
// },
// onClick(ev) {
// const data = ev.data
// if (data) {
// document.getElementById('title').innerText = data.text
// document.getElementById('value').innerText = data.value
// }
// }
// })
this.chart.render()
}
}
}
</script>
<style lang="scss" scoped>
.canvas {
width: calc(100% - 135px);
height: 160px;
}
.list-info-item {
margin-top: 16px;
.circle {
width: 8px;
height: 8px;
background: #3975c6;
border-radius: 2px;
margin-right: 6px;
}
}
.list-info-item:nth-child(1) {
margin-top: 0;
}
</style>
<template>
<div class="tagContainer">
<template v-if="customerInfoList && customerInfoList.length > 0">
<div class="customerList">
<scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
<div class="customer" v-for="(item) in customerInfoList" :key="item.id" @click="gotoInfo(item)">
<div class="customer-portrait">
<img :src="item.avatar" alt="" v-if="item.avatar" />
<img src="../../assets/images/user.png" alt="" v-else />
</div>
<div class="customer-info">
<div class="customer-info-name">
<label class="name text-hide">
{{ item.customerName }}
</label>
<label class="origin">{{ item.type == 1 ? '@微信' : item.type == 2 ? '@企微' : '' }}</label>
</div>
</div>
<div class="buttomLine"></div>
</div>
</scroll-view>
</div>
</template>
<empty v-else description="暂无数据" />
</div>
</template>
<script>
import { wxConfig } from '@/api'
import { mapState } from 'vuex'
export default {
data() {
return {
}
},
name: 'customer',
computed: {
...mapState({
customerInfoList: state => state.solicit.customerInfoList
})
},
mounted() {
// this.initWx()
},
methods: {
//初始化微信接口
initWx() {
wxConfig.init(['openEnterpriseChat']).then(() => { })
},
//打开会话
gotoInfo(item) {
let seach = {
userIds: [this.workUserId], //参与会话的企业成员列表,格式为userid1;userid2;...,用分号隔开。
externalUserIds: [item.userid], // 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
groupName: '', // 会话名称。单聊时该参数传入空字符串""即可。
chatId: ''
}
wxConfig.openEnterpriseChat(seach).then(res => {
// console.log(res)
})
},
onReachBottom() {
this.$refs.scrollView.loading = false
this.$refs.scrollView.finished = true
}
}
}
</script>
<style lang="scss" scoped>
.tagContainer {
.customerList {
// background: #fff;
.customer {
padding: 0 8px;
box-sizing: border-box;
display: flex;
align-items: center;
position: relative;
.customer-portrait {
width: 44px;
height: 44px;
padding: 12px 16px;
img {
width: 100%;
}
}
.customer-info {
padding: 16px 0;
width: calc(100% - 130px);
.customer-info-name {
font-size: 16px;
line-height: 22px;
color: #333333;
display: flex;
.name {
max-width: 70%;
}
.origin {
font-size: 14px;
color: #2cca74;
margin-left: 6px;
}
}
}
}
}
.buttomLine {
position: absolute;
left: 0;
bottom: 0;
width: 375px !important;
height: 1px;
opacity: 0.3;
background-color: #c3c3c3 !important;
}
}
.tagContainer /deep/ .van-checkbox__icon--checked .van-icon {
color: #fff;
background-color: #3975c6 !important;
border-color: #3975c6 !important;
}
.tagContainer /deep/.van-checkbox__icon .van-icon {
width: 16px;
height: 16px;
}
</style>
<template>
<div class="follow-container" v-if="flag">
<div class="follow-statistics flex m-b-16">
<template v-for="(s, i) in statisticList">
<div class="follow-statistics-single" :key="i">
<div class="font-24 color-3 fw7 line-36">{{ s.value(solicitationFollowData) }}</div>
<div class="font-12 color-2f m-t-4">{{ s.text }}</div>
</div>
</template>
</div>
<tab-customer :list="['企微营销', '电话招揽']" @change="changeFollow" :index="follewIndex">
<scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
<template
v-if="solicitationFollowData.weComMarketingList && solicitationFollowData.weComMarketingList.length > 0">
<div class="follow-content">
<div class="follow-content-item m-b-12" v-for="(item, index) in solicitationFollowData.weComMarketingList"
:key="index">
<div class="follow-content-item-top">
<div class="font-16 color-3 fw5 text-hide">{{ item.groupName }}</div>
<div class="m-t-8 flex-between fw7">
<div class="font-24 line-36 color-3">
{{ item.groupWeComCustomerCount }}
<span class="font-12 color-2f m-l-8">个企微客户</span>
</div>
<div class="font-12 color-2f">招揽月份:{{ item.solicitationMonth }}月</div>
</div>
</div>
<template v-if="follewIndex == 0">
<div class="flex-around follow-btn">
<div class="color39 font-14" @click="goTo('solicit.marketing', item)">一键营销</div>
<div class="colord8">|</div>
<div class="color39 font-14" @click="goTo('solicit.statistic', item)">触达统计</div>
</div>
</template>
<template v-else>
<div class="follow-btn">
<div class="color39 font-14" @click="goTo('solicit.lookCustomer', item)">查看客户</div>
</div>
</template>
</div>
</div>
</template>
<template v-else>
<empty description="暂无数据" />
</template>
</scroll-view>
</tab-customer>
</div>
</template>
<script>
import { mapState, mapMutations, mapActions } from 'vuex'
import { solicitApi } from '@/api'
import { Toast } from 'vant'
import { Notify } from 'vant'
export default {
data() {
return {
flag: false,
solicitationFollowData: {
solicitationTotal: 20,
solicitationWeComCustomerCount: 30,
solicitationNotWeComCustomerCount: 20,
weComMarketingList: []
},
statisticList: []
}
},
computed: {
...mapState({
follewIndex: state => state.solicit.follewIndex,
activityId: state => state.solicit.activityId,
staffId: state => state.solicit.staffId
})
},
created() {
this.statisticList = this.$constants.STATICLIST
this.getFollowDataList()
this.solicitationFollow()
},
methods: {
...mapMutations({
SET_FOLLOW_INDEX: 'solicit/SET_FOLLOW_INDEX'
}),
...mapActions({
getFollowDataList: 'solicit/getFollowDataList'
}),
solicitationFollow() {
let params = {
activityId: this.activityId,
staffId: this.staffId
}
this.showLoading()
solicitApi.solicitationFollow(params).then(({ code, data, message }) => {
this.hideLoading()
if (code == '0') {
this.solicitationFollowData = data
} else {
Notify(message)
}
this.flag = true
})
},
goTo(name, item) {
let { groupId, groupName } = item
let query = { groupId }
if (name !== 'solicit.marketing') {
query.groupName = groupName
}
this.$router.push({
name,
query
})
},
changeFollow(index) {
this.SET_FOLLOW_INDEX({ follewIndex: index })
},
onReachBottom() {
this.$refs.scrollView.loading = false
this.$refs.scrollView.finished = true
}
}
}
</script>
<style lang="scss" scoped>
.follow-container {
.follow-statistics {
background: #fff;
height: 82px;
&-single {
padding: 12px 0;
width: 33.3%;
div {
text-align: center;
}
}
}
.content {
height: calc(100vh - 232px);
.follow-content {
padding: 16px 12px;
box-sizing: border-box;
&-item {
background: #f7f7f7;
border-radius: 8px;
height: 140px;
&-top {
padding: 16px 16px 0 16px;
border-bottom: 1px solid rgba(216, 216, 216, 0.3);
height: 96px;
box-sizing: border-box;
}
.follow-btn {
padding: 10px 52px;
box-sizing: border-box;
text-align: center;
}
}
}
}
.custom-image {
background: #fff;
height: 100%;
}
}
</style>
<!--
* @Description:
* @Author: huyue
* @Date: 2022-05-31 17:23:27
* @LastEditors: huyue
* @LastEditTime: 2022-06-07 18:53:43
-->
<template>
<div class="solicit-container">
<tab :list="['总览', `跟进(${countData.tabPageFollowUpCount})`, `结果(${countData.tabPageResultCount})`]" :index="currentIndex" @change="changeIndex"></tab>
<div class="solicit-content">
<overview v-if="currentIndex == 0" @getCountInfo="getCountInfo"></overview>
<follow v-if="currentIndex == 1"></follow>
<result v-if="currentIndex == 2"></result>
</div>
</div>
</template>
<script>
import overview from './overview.vue'
import follow from './follow.vue'
import result from './result.vue'
import { mapState, mapMutations } from 'vuex'
export default {
name: 'index',
data() {
return {
tabList: ['总览', '跟进', '结果'],
countData: {
tabPageFollowUpCount: 0,
tabPageResultCount: 0
}
}
},
watch: {
overviewCountInfo: {
handler(n) {
this.countData = n
},
immediate: true,
deep: true
}
},
components: {
overview,
follow,
result
},
computed: {
...mapState({
currentIndex: state => state.solicit.currentIndex,
overviewCountInfo: state => state.solicit.overviewCountInfo
})
},
methods: {
...mapMutations({
SET_TAB_INDEX: 'solicit/SET_TAB_INDEX',
SET_OVERVIEW_COUNT_INFO: 'solicit/SET_OVERVIEW_COUNT_INFO'
}),
changeIndex(index) {
this.SET_TAB_INDEX({ currentIndex: index })
},
getCountInfo(val) {
this.SET_OVERVIEW_COUNT_INFO({
overviewCountInfo: val
})
}
}
}
</script>
<style lang="scss" scoped>
.solicit-container {
.solicit-content {
padding: 16px;
width: 100%;
box-sizing: border-box;
}
}
</style>
<template>
<div class="customer-container" v-if="flag">
<div class="customer-container-head">
<div class="font-16 color54 line-24 title">{{ groupName }}</div>
<div class="search-head flex">
<van-dropdown-menu active-color="#3369B1">
<van-dropdown-item v-model="searchType" :options="seachArray" @change="selectType" />
</van-dropdown-menu>
<search :keyword="keyWord" placeholder="请输入关键字" @search="searchkeyWord"></search>
</div>
<drop-down :selectOption1="statusList" :selectOption2="resultList" :currentValue1="status" :currentValue2="result" @changeFirst="changeFirst" @changeSecond="selectSecondChange"></drop-down>
</div>
<scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
<customer-card v-if="customerInfo.length > 0" :customerInfo="customerInfo" @showFollowPop="showFollowPop" @showInfoPop="showInfoPop"></customer-card>
<empty v-else></empty>
</scroll-view>
<!-- 跟进弹窗 -->
<customer-follow-popup ref="customerFollowRef" :info="followCustomerData" @changeIndexEvent="changeIndexEvent"></customer-follow-popup>
<!-- 客户信息弹窗 -->
<customer-info-popup ref="customerInfoRef"></customer-info-popup>
</div>
</template>
<script>
import { mapState } from 'vuex'
import { solicitApi } from '@/api'
import { Notify } from 'vant'
export default {
data() {
return {
flag: false,
keyWord: '',
status: 0,
result: 0,
searchType: 0,
seachArray: [
{ text: '客户姓名', value: 0 },
{ text: '车牌号', value: 1 },
{ text: '车架号', value: 2 },
{ text: '手机号码', value: 3 }
],
customerInfo: [],
statusList: [
{ text: '全部状态', value: 0 },
{ text: '已跟进', value: 1 },
{ text: '未跟进', value: 2 }
],
resultList: [{ text: '全部结果', value: 0 }],
followCustomerData: {},
customerIndex: 0
}
},
computed: {
...mapState({
followResultList: state => state.solicit.followResultList,
staffId: state => state.solicit.staffId,
activityId: state => state.solicit.activityId
})
},
created() {
this.groupId = this.getQuery().groupId ? this.getQuery().groupId : ''
this.groupName = this.getQuery().groupName ? this.getQuery().groupName : ''
},
mounted() {
this.initOption()
this.showLoading()
this.getSendCustomerList()
},
methods: {
showFollowPop(data) {
this.$refs.customerFollowRef.init()
this.customerIndex = data.customerIndex
this.followCustomerData = data.followCustomerData
},
showInfoPop(data) {
this.$refs.customerInfoRef.getCustomerDetail(data.followCustomerData)
},
changeIndexEvent() {
let params = {
customerId: this.followCustomerData.actCutId
}
solicitApi.getCustomerDetail(params).then(({ code, data, message }) => {
if (code == 0) {
data.solicitTime = data.solicitTime ? data.solicitTime.slice(0, 11) : data.solicitTime
data.updatedTime = data.updatedTime ? data.updatedTime.slice(0, 11) : data.updatedTime
this.customerInfo[this.customerIndex] = data
this.$set(this.customerInfo, this.customerIndex, data)
} else {
Notify(message)
}
})
},
// 获取送达客户信息
getSendCustomerList(index) {
this.hideLoading()
let params = {
keyWord: this.keyWord,
type: this.searchType + 1,
customerGroupType: 2,
id: this.activityId,
staffId: this.staffId,
groupId: this.groupId,
followFlag: this.status != 0 ? this.status : ''
}
if (this.status != 2) {
params.followResult = this.result != 0 ? this.result : ''
}
console.log(params)
solicitApi.getCustomerList(params).then(({ code, data, message }) => {
if (code == 0) {
data.map(item => {
item.solicitTime = item.solicitTime ? item.solicitTime.slice(0, 11) : item.solicitTime
item.updatedTime = item.updatedTime ? item.updatedTime.slice(0, 11) : item.updatedTime
})
this.customerInfo = data
} else {
Notify(message)
}
this.flag = true
})
},
onReachBottom() {
this.$refs.scrollView.loading = false
this.$refs.scrollView.finished = true
},
searchkeyWord(e) {
this.keyWord = e
if (this.searchType != 0 && this.keyWord.length <= 2) {
return
}
this.getSendCustomerList()
},
selectType() {
this.keyWord = ''
},
changeFirst(index) {
this.status = index
this.result = 0
this.getSendCustomerList()
},
selectSecondChange(index) {
this.result = index
this.getSendCustomerList()
},
initOption() {
this.followResultList.forEach(item => {
this.resultList.push({
text: item.dictLabel,
value: item.dictValue
})
})
}
}
}
</script>
<style lang="scss" scoped>
.customer-container {
&-head {
height: 142px;
background: #fff;
margin-bottom: 12px;
.search-head {
padding: 0 16px;
height: 50px;
box-sizing: border-box;
border-bottom: 1px solid rgba(216, 216, 216, 0.3);
/deep/.van-dropdown-menu__bar {
box-shadow: 0 0 0 #fff;
font-size: 14px;
font-weight: 400;
color: #333333;
margin-right: 13px;
}
/deep/ .van-search {
width: 250px;
padding: 0;
}
/deep/ .van-dropdown-item__content {
width: 160px;
background: #ffffff;
border-radius: 8px;
margin: 4px 0 0 8px;
/deep/ .van-cell__title {
text-align: center;
}
/deep/ .van-cell__value {
display: none;
width: 0;
}
}
}
.title {
padding: 10px 16px;
}
}
.content {
height: calc(100vh - 154px);
/deep/ .van-list {
background: #f7f7f7;
}
}
}
</style>
<template>
<div class="marking-container" v-if="flag">
<div class="marking-container-content m-b-16">
<div class="font-16 color-3 fw5 m-b-12 line-24">发送内容</div>
<template v-if="marketingDetails.attachmentList && marketingDetails.attachmentList.length > 0">
<div v-for="(item, index) in marketingDetails.attachmentList" :key="index">
<template v-if="item.attType == 1">
<div class="font-14 color-3 m-b-12" v-html="item.attContent"></div>
</template>
<template v-else-if="item.attType == 2">
<div class="marking-image m-b-12">
<img :src="item.attContent" />
</div>
</template>
<template v-else-if="item.attType == 7">
<div class="preview-activity">
<img class="applet-logo" src="@/assets/images/solicit/icon-applet.png" alt />
<span style="color: #999">小程序</span>
<div class="activity-name">{{ activityContent[item.attContent.marketingType] }}</div>
<img v-if="item.attContent.marketingType == 1 || item.attContent.marketingType == 2" class="activity-logo" src="@/assets/images/solicit/activity-logo.png" alt />
<img v-if="item.attContent.marketingType == 3 || item.attContent.marketingType == 4" class="activity-logo" src="@/assets/images/solicit/activity-equity.png" alt />
<img v-if="item.attContent.marketingType == 5" class="activity-logo" src="@/assets/images/solicit/activity-spike.png" alt />
<div class="activity-footer">
<img src="@/assets/images/solicit/applet-footer.png" alt />
<span>小程序</span>
</div>
</div>
</template>
</div>
<!-- <div class="font-14 color-3">尊敬的客户,您好!我店本月推出自费喷漆特惠活动,折扣后单面喷漆低至200元,点击下方链接享受优惠:</div> -->
</template>
<template v-else>
<empty class="marking-empty" description="门店尚未针对该人群设置营销物料"></empty>
</template>
</div>
<div class="marking-container-customer flex-between">
<div class="font-16 color-3 fw5">发送客户</div>
<div class="color-2f font-14 flex" @click="goTo('solicit.customer')">
共{{ marketingDetails.customerInfoList ? marketingDetails.customerInfoList.length : 0 }}人
<div class="sprite-icon icon-arrow m-l-8"></div>
</div>
</div>
<div class="footer">
<div
:class="{
'marking-button': true,
disabled: !marketingDetails.attachmentList || !marketingDetails.customerInfoList || (marketingDetails.customerInfoList && marketingDetails.customerInfoList.length == 0)
}"
@click="sendHandle"
>
一键发送
</div>
</div>
</div>
</template>
<script>
const activityContent = {
2: '送您一张商城优惠券',
3: '送您一张专属权益服务卡',
4: '专属权益服务套餐',
5: '您有一个秒杀活动可参加'
}
import { solicitApi } from '@/api'
import { Toast, Notify } from 'vant'
import { mapState, mapMutations } from 'vuex'
import emoji from '@/utils/emo'
export default {
data() {
return {
flag:false,
activityContent,
isEmpty: true,
marketingDetails: {
customerInfoList: [],
attachmentList: []
}
}
},
created() {
this.groupId = this.getQuery().groupId ? this.getQuery().groupId : ''
this.getocmarketingList()
},
computed: {
...mapState({
activityId: state => state.solicit.activityId,
staffId: state => state.solicit.staffId
})
},
methods: {
...mapMutations({
SET_COUSTOMER_LIST: 'solicit/SET_COUSTOMER_LIST'
}),
//一键营销内容回显
getocmarketingList() {
let params = {
id: this.activityId,
staffId: this.staffId,
groupId: this.groupId
}
this.showLoading()
solicitApi.getocmarketingList(params).then(({ code, data, message }) => {
this.hideLoading()
if (code == '0') {
this.marketingDetails = data
if (data.attachmentList) {
const attachmentList = this.marketingDetails.attachmentList.map(item => {
if (item.attType == 1) {
this.getEmoImg()
} else if (item.attType == 7) {
item.attContent = JSON.parse(item.attContent)
}
return item
})
this.$set(this.marketingDetails, 'attachmentList', attachmentList)
this.$set(this.marketingDetails, 'customerInfoList', data.customerInfoList)
}
this.SET_COUSTOMER_LIST({ customerInfoList: data.customerInfoList })
} else {
Notify(message)
}
this.flag = true
})
},
// 一键营销
sendHandle() {
if (!this.marketingDetails.attachmentList.length) {
return
}
if (this.marketingDetails.massFlag) {
Toast('您已进行企微营销,请查看营销统计')
return
}
if (this.marketingDetails.customerInfoList.length > 0) {
let params = {
groupId: this.groupId,
id: this.activityId,
businessUuid: this.marketingDetails.businessUuid,
configId: this.marketingDetails.configId,
staffId: this.staffId
}
solicitApi.createdOcmarketing(params).then(res => {
if (res) {
Toast('营销活动已创建,请及时在「企业微信-群发助手」中确认发送')
setTimeout(() => {
this.$router.go(-1)
}, 1000)
} else {
Notify('营销活动创建失败')
}
})
}
},
goTo(name) {
this.$router.push({ name })
},
// 表情包转化图片
getEmoImg() {
const attContent = this.marketingDetails.attachmentList[0].attContent
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function (res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img class="emo_img" src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
this.marketingDetails.attachmentList[0].attContent = htm
this.$set(this.marketingDetails.attachmentList, 0, {
attType: 1,
attContent: htm
})
}
}
}
</script>
<style lang="scss" scoped>
.marking-container {
padding: 16px;
&-content {
background: #fff;
padding: 16px;
box-shadow: 0px 3px 10px 0px rgba(223, 228, 234, 0.81);
border-radius: 4px;
.marking-image {
width: 152px;
height: auto;
// margin: 12px 32px 16px 32px;
img {
width: 100%;
height: 100%;
}
}
.marking-empty {
padding: 39px 0 24px 0 !important;
/deep/ .van-empty__description {
padding: 0;
}
}
}
&-customer {
height: 56px;
background: #ffffff;
box-shadow: 0px 3px 10px 0px rgba(223, 228, 234, 0.81);
border-radius: 4px;
padding: 0 16px;
margin-bottom: 50px;
}
.footer {
width: 343px;
height: 58px;
background: #f7f7f7;
z-index: 100;
position: fixed;
bottom: 0;
}
.marking-button {
width: 343px;
height: 42px;
background: #3975c6;
border-radius: 21px;
font-size: 14px;
font-weight: 500;
color: #ffffff;
line-height: 42px;
text-align: center;
margin-bottom: 16px;
}
.disabled {
background: #d5d8db !important;
}
.preview-activity {
width: 232px;
// height: 184px;
background-color: #fff;
border-radius: 4px;
border: 1px solid #e8e8ea;
padding: 12px 12px 0;
font-size: 11px;
box-sizing: border-box;
.applet-logo {
width: 18px;
height: 18px;
margin-right: 4px;
}
.activity-logo {
width: 208px;
height: 166px;
margin-bottom: 8px;
}
.activity-name {
font-size: 12px;
color: #333;
margin: 7px 0 4px;
width: 160px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.activity-footer {
display: flex;
align-items: center;
padding: 3px 0;
img {
width: 10px;
height: 10px;
margin-right: 3px;
}
margin-top: 4px;
border-top: 1px solid #dfe4ea;
}
}
}
</style>
<template>
<div class="overview-container" v-if="flag">
<div class="overview-wrap m-b-16">
<div class="title-info">客户招揽概况</div>
<div class="overview-content">
<template v-if="chart.pieData.length > 0">
<pieChart :color="chart.pieColor" id="overviewRef" :list="chart.pieData" :centerData="chart.centerData"></pieChart>
</template>
<template v-else>
<empty></empty>
</template>
</div>
</div>
<div class="overview-wrap m-b-16">
<div class="title-info">客户分群</div>
<div class="overview-group">
<template v-if="chart.barData.length > 0">
<barChart :color="chart.barColor" :tickCount="7" id="groupingRef" :list="chart.barData"></barChart>
</template>
<template v-else>
<empty></empty>
</template>
</div>
</div>
<div class="overview-wrap m-b-16">
<div class="title-info">工作简报</div>
<div class="bulletin flex">
<template v-for="(item, index) in bulletinList">
<div class="bulletin-single flex-top m-b-16" :key="index">
<div :class="['logo', 'sprite-icon', item.icon]"></div>
<div class="bulletin-info">
<div class="color-2f font-12">{{ item.todayText }}</div>
<div class="number color-3 font-24 fw7">{{ item.todayValue(overviewInfo) }}</div>
<div class="color-2f font-12 m-t-8">
{{ item.currentMonth }}
<span class="font-14 color-3 fw5">{{ item.currentValue(overviewInfo) }}</span>
</div>
</div>
</div>
</template>
</div>
</div>
</div>
</template>
<script>
import pieChart from '../solicit/components/pie.vue'
import barChart from '../solicit/components/bar.vue'
import { solicitApi } from '@/api'
import { mapState, mapActions } from 'vuex'
import { Notify } from 'vant'
export default {
components: {
pieChart,
barChart
},
data() {
return {
flag: true,
bulletinList: [],
activityId: '',
chart: {
pieColor: ['#3975C6', '#E6E7EB'],
pieData: [],
centerData: {},
barData: [],
barColor: '#3975C6'
},
overviewInfo: {
followedUpCount: 0,
notFollowedUpCount: 0,
followedUpPercent: '',
customerGroupList: [],
workBriefingFollowUpTodayCount: 0,
workBriefingFollowUpMonthCount: 0,
workBriefingAddedTodayCount: 0,
workBriefingAddedMonthCount: 0,
workBriefingAppointmentTodayCount: 0,
workBriefingAppointmentMonthCount: 0,
workBriefingReturnFactoryTodayCount: 0,
workBriefingReturnFactoryMonthCount: 0
}
}
},
created() {
this.bulletinList = this.$constants.BULLETINLIST
let { taskId } = this.getQuery()
if (taskId) {
this.findActivityIdByUUID({
uuid: taskId,
success: res => {
this.activityId = res
this.getStaffId({
success: res => {
this.getTaskOverviewData()
}
})
}
})
} else {
this.activityId = window.localStorage.getItem('dj_scrm_activityId') ? JSON.parse(window.localStorage.getItem('dj_scrm_activityId')) : ''
this.getStaffId({
success: res => {
this.getTaskOverviewData()
}
})
}
},
computed: {
...mapState({
staffId: state => state.solicit.staffId
})
},
methods: {
...mapActions({
getStaffId: 'solicit/getStaffId',
findActivityIdByUUID: 'solicit/findActivityIdByUUID'
}),
getTaskOverviewData() {
let params = {
activityId: this.activityId,
staffId: this.staffId
}
this.showLoading()
solicitApi.taskOverviewData(params).then(({ code, data, message }) => {
this.hideLoading()
if (code == '0') {
this.overviewInfo = data
this.$emit('getCountInfo', {
tabPageFollowUpCount: data.tabPageFollowUpCount,
tabPageResultCount: data.tabPageResultCount
})
this.initChartData()
} else {
Notify(message)
}
this.flag = true
})
},
initChartData() {
let { overviewInfo } = this
// legendData
if (overviewInfo.followedUpCount != 0 || overviewInfo.notFollowedUpCount != 0) {
this.chart.pieData = [
{
const: 'const',
text: ' 已跟进 (人)',
value: overviewInfo.followedUpCount
},
{
const: 'const',
text: '本月指标 (人)',
value: overviewInfo.notFollowedUpCount + overviewInfo.followedUpCount
}
]
this.chart.centerData = {
text: '达成率',
rate: overviewInfo.followedUpPercent
}
overviewInfo.customerGroupList.length > 0 &&
overviewInfo.customerGroupList.forEach(item => {
this.chart.barData.push({
text: item.groupName.slice(0, 10),
value: item.groupCount
})
})
}
}
}
}
</script>
<style lang="scss" scoped>
.overview-container {
.overview-wrap {
background: #fff;
.overview-content {
height: 160px;
box-sizing: border-box;
}
.overview-group {
box-sizing: border-box;
}
.bulletin {
height: 236px;
padding: 16px 0;
box-sizing: border-box;
flex-wrap: wrap;
&-single {
width: 50%;
height: 98px;
padding-left: 16px;
box-sizing: border-box;
.bulletin-info {
margin-left: 12px;
}
.number {
height: 36px;
line-height: 36px;
}
}
}
}
}
</style>
<template>
<div class="result-container">
<scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
<template v-if="getCustomerFollow&&getCustomerFollow.length>0">
<div class="result-container-content">
<template v-for="(item, i) in getCustomerFollow">
<div :key="i" class="result-container-content-item">
<div class="title-info">{{ item.groupName }}</div>
<div class="result-content flex-between">
<div class="result-content-list flex-top" @click="goto('solicit.succeed', 1, item.groupId, item.groupName)">
<div class="sprite-icon icon-succeed"></div>
<div class="m-l-8">
<div class="font-14 color-3 fw5">成功到店</div>
<div class="font-12 color-2f m-t-4">客户:{{ item.successCustomerNums }}人</div>
</div>
</div>
<div class="result-content-list flex-top" @click="goto('solicit.succeed', 2, item.groupId, item.groupName)">
<div class="sprite-icon icon-fail"></div>
<div class="m-l-8">
<div class="font-14 color-3 fw5">战败分析</div>
<div class="font-12 color-2f m-t-4">客户:{{ item.defeatCustomerNums }}人</div>
</div>
</div>
</div>
</div>
</template>
</div>
</template>
<template v-else>
<empty description="暂无数据" />
</template>
</scroll-view>
</div>
</template>
<script>
import { solicitApi } from '@/api'
export default {
data() {
return {
getCustomerFollow: []
}
},
created() {
this.getCustomerFollowTotal()
},
methods: {
// 获取跟进结果字典数据
getCustomerFollowTotal() {
const { activityId, staffId } = this.$store.state.solicit
var params = {
activityId,
followFlag: 0,
retFacFlag: 0,
staffId
}
solicitApi.getCustomerFollowTotal(params).then(res => {
this.getCustomerFollow = res.data
})
},
goto(name, status, groupId, groupName) {
this.$router.push({ name, query: { status, groupId, groupName } })
},
onReachBottom() {
this.$refs.scrollView.loading = false
this.$refs.scrollView.finished = true
}
}
}
</script>
<style lang="scss" scoped>
.result-container {
/deep/ .van-list {
background: #f7f7f7;
}
.content {
height: calc(100vh - 82px);
}
&-content-item {
background: #fff;
height: 144px;
margin-bottom: 16px;
overflow: hidden;
box-shadow: 0px 3px 10px 0px rgba(223, 228, 234, 0.81);
border-radius: 4px;
.title-info::before {
content: '';
width: 3px;
height: 14px;
background: #fff;
border-radius: 1.5px;
margin-right: 13px;
display: inline-block;
}
.result-content {
padding: 16px;
&-list {
width: 150px;
height: 68px;
background: #f7f7f7;
border-radius: 6px;
padding: 12px;
box-sizing: border-box;
}
}
}
.custom-image {
background: #fff;
height: 100%;
}
}
</style>
<template>
<div class="statisic-container">
<van-tabs v-model="tabIndex" sticky @change="tabChange">
<van-tab :title="'未送达(' + deliveredData.undelivered + ')'">
<scroll-view @ReachBottom="onReachBottom" ref="scrollView">
<div class="reason">
<div>未送达可能原因:</div>
<div>1. 客户开启消息免打扰,消息发送失败;</div>
<div>2. 群发次数达到上限,上限次数为每个客户每天仅可接收1条群发消息。(系统将连续重试3天)</div>
</div>
<customer-card v-if="customerInfo1.length > 0" :customerInfo="customerInfo1" @showFollowPop="showFollowPop" @showInfoPop="showInfoPop"></customer-card>
<empty v-else></empty>
</scroll-view>
</van-tab>
<van-tab :title="'已送达(' + deliveredData.delivered + ')'">
<div class="statistic-pic flex">
<div class="funnel-logo">
<img v-if="activityGroupType" src="@/assets/images/funnel.png" alt="" />
<img v-else src="@/assets/images/funnel2.png" alt="" />
</div>
<div class="statistic-list">
<template v-for="(status, index) in reachStatus">
<div class="font-12 color-2f flex m-b-14" :key="index">
<div class="circle" :style="{ background: status.color }"></div>
{{ status.text }}
<span class="font-16 color-3 m-l-8 bold">{{ status.value(deliveredData) }}</span>
<span class="font-10 color39 m-l-4 fw5">
({{ Number(status.proportion(deliveredData)) == 0 ? '0' : parseInt((Number(status.value(deliveredData)) / Number(status.proportion(deliveredData))) * 100) }}%)
</span>
</div>
</template>
</div>
</div>
<select-bar :index="alreadyIndex" :list="selectBarList" @change="changeSelectTab"></select-bar>
<customer-card v-if="customerInfo2.length > 0" :customerInfo="customerInfo2" @showFollowPop="showFollowPop" @showInfoPop="showInfoPop"></customer-card>
<empty v-else></empty>
</van-tab>
</van-tabs>
<!-- 跟进弹窗 -->
<customer-follow-popup ref="customerFollowRef" :info="followCustomerData" @changeIndexEvent="changeIndexEvent"></customer-follow-popup>
<!-- 客户信息弹窗 -->
<customer-info-popup ref="customerInfoRef"></customer-info-popup>
</div>
</template>
<script>
import Empty from '../../components/Empty.vue'
import ScrollView from '../../components/ScrollView.vue'
import SelectBar from '../../components/SelectBar.vue'
import { solicitApi } from '@/api'
import { mapState } from 'vuex'
import { Notify } from 'vant'
export default {
components: { SelectBar, Empty, ScrollView },
data() {
return {
tabIndex: 0,
alreadyIndex: 0,
deliveredNum: 0,
selectBarList: [
{
text: '已送达',
value: 0
},
{ text: '已查看', value: 1 },
{
text: '已领取',
value: 2
},
{
text: '已到店',
value: 3
}
],
// 未送达客户列表
customerInfo1: [],
// 已送达客户列表
customerInfo2: [],
followCustomerData: {},
customerIndex: 0,
// 客户送达分层
deliveredData: {},
// 套餐类型是否不是权益套餐或秒杀活动
activityGroupType: true,
reachStatus: [
{
text: '已送达',
value: obj => {
return obj.delivered
},
proportion: obj => {
return obj.delivered
},
color: '#3975C6'
},
{
text: '已查看',
value: obj => {
return obj.viewed
},
proportion: obj => {
return obj.delivered
},
color: '#59BCFF'
},
{
text: '已领取',
value: obj => {
return obj.received
},
proportion: obj => {
return obj.delivered
},
color: '#33C1B9'
},
{
text: '已到店',
value: obj => {
return obj.arrived
},
proportion: obj => {
return obj.delivered
},
color: '#82D876'
}
]
}
},
computed: {
...mapState({
activityId: state => state.solicit.activityId,
staffId: state => state.solicit.staffId
})
},
created() {
this.groupId = this.getQuery().groupId ? this.getQuery().groupId : ''
},
mounted() {
this.showLoading()
// 触达统计-客户送达分层
this.deliveredStatistics()
this.getSendCustomerList(0) // 未送达
this.getSendCustomerList(1) // 已送达
},
methods: {
showFollowPop(data) {
this.$refs.customerFollowRef.init()
this.customerIndex = data.customerIndex
this.followCustomerData = data.followCustomerData
},
showInfoPop(data) {
this.$refs.customerInfoRef.getCustomerDetail(data.followCustomerData)
},
changeIndexEvent() {
let params = {
customerId: this.followCustomerData.actCutId
}
let target = ['customerInfo1', 'customerInfo2']
solicitApi.getCustomerDetail(params).then(({ code, data, message }) => {
if (code == 0) {
data.solicitTime = data.solicitTime ? data.solicitTime.slice(0, 11) : data.solicitTime
data.updatedTime = data.updatedTime ? data.updatedTime.slice(0, 11) : data.updatedTime
this[target[this.tabIndex]][this.customerIndex] = data
this.$set(this[target[this.tabIndex]], this.customerIndex, data)
} else {
Notify(message)
}
})
},
// tab栏切换
tabChange(e) {
this.tabIndex = e
},
// 已送达Tab四种状态
changeSelectTab(e) {
this.alreadyIndex = e
this.getSendCustomerList(1)
},
// 获取送达客户信息
getSendCustomerList(index) {
this.hideLoading()
let target = ['customerInfo1', 'customerInfo2']
let { alreadyIndex } = this
let params = {
customerGroupType: 2,
id: this.activityId,
staffId: this.staffId,
groupId: this.groupId,
sendStatus: index // 发送状态 0-未发送 1-已发送
}
if (index === 1) {
// 0-未查看 1-已查看
if (alreadyIndex === 1) params.checkStatus = 1
// 0-未领取 1-已领取
if (alreadyIndex === 2) params.receiveStatus = 1
// 0.未到店 1.已到店
if (alreadyIndex === 3) params.retFacFlag = 1
}
solicitApi.getCustomerList(params).then(({ code, data, message }) => {
if (code == 0) {
data.map(item => {
item.solicitTime = item.solicitTime ? item.solicitTime.slice(0, 11) : item.solicitTime
item.updatedTime = item.updatedTime ? item.updatedTime.slice(0, 11) : item.updatedTime
})
this[target[index]] = data
} else {
Notify(message)
}
})
},
// 客户送达分层
deliveredStatistics() {
let params = {
id: this.activityId,
staffId: this.staffId,
groupId: this.groupId
}
solicitApi.deliveredStatistics(params).then(({ code, data, message }) => {
if (code == 0) {
this.deliveredData = data
// 判断发送方式是否为权益套餐或秒杀活动
if ((data.activityGroupType && data.activityGroupType == 4) || (data.activityGroupType && data.activityGroupType == 5)) {
this.activityGroupType = false
this.reachStatus.splice(2, 1)
this.selectBarList.splice(2, 1)
}
}
})
},
// 下拉触底刷新
onReachBottom() {
this.$refs.scrollView.loading = false
this.$refs.scrollView.finished = true
}
}
}
</script>
<style lang="scss" scoped>
.statisic-container {
/deep/ .van-list {
background: #f7f7f7;
}
}
.reason {
padding: 16px;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(47, 64, 86, 0.7);
line-height: 18px;
}
.statistic-pic {
width: 100%;
height: 172px;
background: #ffffff;
box-shadow: 0px 1px 0px 0px rgba(233, 233, 233, 1);
padding: 16px 40px;
box-sizing: border-box;
.funnel-logo {
width: 144px;
height: 140px;
margin-right: 24px;
img {
width: 100%;
height: 100%;
}
}
.statistic-list {
white-space: nowrap;
width: calc(100% - 190px);
.circle {
width: 8px;
height: 8px;
background: #3975c6;
border-radius: 2px;
margin-right: 6px;
}
}
.statistic-list div:nth-child(4) {
margin-bottom: 0;
}
}
/deep/ .van-tabs__line {
background-color: #3975c6;
}
</style>
<template>
<div class="succeed-container">
<div class="succeed-title font-20 color-3 fw5">
{{ groupName }}
<span class="color39 font-16 m-l-8">- {{ customeStatus == 1 ? '成功到店' : '战败分析' }}</span>
</div>
<div class="succeed-content">
<div class="succeed-wrap m-b-16">
<div class="title-info">客户分布</div>
<div class="succeed-wrap-info">
<template v-if="pieData.length > 0">
<pieChart :color="styleColor" id="customerRef" :list="pieData" :centerData="centerData"></pieChart>
</template>
<template v-else>
<empty></empty>
</template>
</div>
</div>
<div class="succeed-wrap m-b-16">
<div class="title-info">跟进频次</div>
<div class="succeed-wrap-frequency flex-between">
<div class="succeed-wrap-frequency-single">
<div class="font-16 color-3 bold line-24">{{ getFollowResultDetail.averageFollows }}次/人</div>
<div class="font-12 color-2f m-t-6">平均跟进</div>
</div>
<div class="succeed-wrap-frequency-single">
<div class="font-16 color-3 bold line-24">{{ getFollowResultDetail.mostFollows }}次</div>
<div class="font-12 color-2f m-t-6">最多跟进</div>
</div>
<div class="succeed-wrap-frequency-single">
<div class="font-16 color-3 bold line-24">{{ getFollowResultDetail.leastFollows }}次</div>
<div class="font-12 color-2f m-t-6">最少跟进</div>
</div>
</div>
</div>
<div class="succeed-wrap m-b-16" v-if="customeStatus == 1">
<div class="title-info">
预约与到店
<div class="flex fact-wrap">
<div class="fact flex">
<div class="reserved"></div>
预约到店
</div>
<div class="fact flex m-l-16">
<div class="arrive"></div>
实际到店
</div>
</div>
</div>
<div class="succeed-wrap-order-info">
<template v-if="appointmentDailyCharts">
<lineChart id="orderRef" :lineData="lineData"></lineChart>
</template>
<template v-else>
<empty></empty>
</template>
</div>
</div>
<div class="succeed-wrap m-b-16" v-if="customeStatus == 2 && reasonBar.length">
<div class="title-info">原因统计</div>
<barChart color="#3975C6" id="reasonRef" :list="reasonBar"></barChart>
</div>
<div class="succeed-wrap m-b-16" v-if="markingBar.length">
<div class="title-info">企微营销</div>
<barChart color="#3975C6" id="markingRef" :list="markingBar"></barChart>
</div>
</div>
</div>
</template>
<script>
import { solicitApi } from '@/api'
import pieChart from '../solicit/components/pie.vue'
import lineChart from '../solicit/components/line.vue'
import barChart from '../solicit/components/bar.vue'
export default {
components: {
pieChart,
lineChart,
barChart
},
data() {
return {
styleColor: ['#3975C6', '#FDB757'],
appointmentDailyCharts:'',
pieData: [],
centerData: {},
followList: [],
customeStatus: 1,
getFollowResultDetail: {},
groupId: '',
groupName: '',
reasonBar: [],
markingBar: [],
lineData: []
}
},
created() {
this.followList = this.$constants.FOLLOWLIST
this.customeStatus = this.$route.query.status
this.groupId = this.$route.query.status
this.groupName = this.$route.query.groupName
this.getFollowResult()
this.deliveredStatistics()
},
methods: {
deliveredStatistics() {
const { activityId, staffId } = this.$store.state.solicit
var params = {
id: activityId,
groupId: this.groupId,
typeFlag: this.customeStatus,
staffId
}
solicitApi.deliveredStatistics(params).then(res => {
const { delivered, received, undelivered, viewed } = res.data
this.markingBar = [
{ value: +received, text: '已领取' },
{ value: +viewed, text: '已查阅' },
{ value: +delivered, text: '已送达' },
{ value: +undelivered, text: '未送达' }
]
})
},
// 获取跟进结果字典数据
getFollowResult() {
const { activityId, staffId } = this.$store.state.solicit
var params = {
activityId,
customerFollowStatus: this.customeStatus == 1 ? 1 : 0,
// followFlag: this.customeStatus == 1 ? '' : 0,
// retFacFlag: this.customeStatus == 1 ? 1 : 0,
staffId
}
solicitApi.getFollowResult(params).then(res => {
this.getFollowResultDetail = res.data
const { joinEntmicroCustomerNums, notYetJoinEntmicroCustomerNums, followResultsAnalyzeVos, appointmentDailyCharts, successDailyCharts } = this.getFollowResultDetail
if (joinEntmicroCustomerNums || notYetJoinEntmicroCustomerNums) {
this.pieData = [
{
const: 'const',
text: ' 企微客户 (人)',
value: joinEntmicroCustomerNums
},
{
const: 'const',
text: '非企微客户 (人)',
value: notYetJoinEntmicroCustomerNums
}
]
this.centerData = {
text: '企微占比',
rate: parseInt((joinEntmicroCustomerNums / (joinEntmicroCustomerNums + notYetJoinEntmicroCustomerNums)) * 100) + '%'
}
}
if (appointmentDailyCharts) {
const appointmentDaily = appointmentDailyCharts.map((item, index) => {
return {
date: item.dailyDate,
value: item.times,
type: '预约到店'
}
})
const successDaily = successDailyCharts.map((item, index) => {
return {
date: item.dailyDate,
value: item.times,
type: '实际到店'
}
})
this.lineData = [...appointmentDaily, ...successDaily]
}
if (followResultsAnalyzeVos) {
const followResultList = window.localStorage.getItem('followResultList') ? JSON.parse(window.localStorage.getItem('followResultList'), '', null) : []
this.reasonBar = followResultsAnalyzeVos.map(item => {
return { value: item.times, text: followResultList.find(follow => follow.dictValue == item.followResult).dictLabel }
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.succeed-container {
.succeed-title {
height: 52px;
background: #ffffff;
box-shadow: 0px 1px 0px 0px #e9e9e9;
padding: 11px 16px;
box-sizing: border-box;
}
.succeed-content {
padding: 12px;
.succeed-wrap {
background: #fff;
.title-info {
position: relative;
}
.title-info::before {
content: '';
width: 3px;
height: 14px;
background: #fff;
border-radius: 1.5px;
margin-right: 13px;
display: inline-block;
}
&-order-info {
height: 180px;
box-sizing: border-box;
}
&-info {
height: 160px;
box-sizing: border-box;
}
&-frequency {
padding: 24px 45px;
height: 96px;
box-sizing: border-box;
&-single {
width: auto;
div {
text-align: center;
}
}
}
.fact-wrap {
position: absolute;
right: 16px;
top: 13px;
.fact {
font-size: 12px;
font-weight: 400;
color: rgba(47, 64, 86, 0.7);
line-height: 18px;
}
.reserved {
width: 8px;
height: 3px;
background: #fa7c0b;
border-radius: 2px;
margin-right: 6px;
}
.arrive {
width: 8px;
height: 3px;
background: #3975c6;
border-radius: 2px;
margin-right: 6px;
display: inline-block;
}
}
}
}
}
</style>
...@@ -4,48 +4,50 @@ const defaultSettings = require('./src/config/conf.js') ...@@ -4,48 +4,50 @@ const defaultSettings = require('./src/config/conf.js')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const resolve = dir => path.join(__dirname, dir) const resolve = dir => path.join(__dirname, dir)
// page title // page title
const name = defaultSettings.title || 'vue mobile template' const name = defaultSettings.title || 'vue mobile template'
// 生产环境,测试和正式 // 生产环境,测试和正式
const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV) const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV)
// externals // externals
// const externals = { // const externals = {
// vue: 'Vue', // vue: 'Vue',
// 'vue-router': 'VueRouter', // 'vue-router': 'VueRouter',
// vuex: 'Vuex', // vuex: 'Vuex',
// vant: 'vant', // vant: 'vant',
// axios: 'axios' // axios: 'axios'
// } // }
// CDN外链,会插入到index.html中 // CDN外链,会插入到index.html中
// const cdn = { // const cdn = {
// // 开发环境 // // 开发环境
// dev: { // dev: {
// css: [], // css: [],
// js: [] // js: []
// }, // },
// // 生产环境 // // 生产环境
// build: { // build: {
// css: ['https://cdn.jsdelivr.net/npm/vant@2.4.7/lib/index.css'], // css: ['https://cdn.jsdelivr.net/npm/vant@2.4.7/lib/index.css'],
// js: [ // js: [
// 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js', // 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
// 'https://cdn.jsdelivr.net/npm/vue-router@3.1.5/dist/vue-router.min.js', // 'https://cdn.jsdelivr.net/npm/vue-router@3.1.5/dist/vue-router.min.js',
// 'https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js', // 'https://cdn.jsdelivr.net/npm/axios@0.19.2/dist/axios.min.js',
// 'https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js', // 'https://cdn.jsdelivr.net/npm/vuex@3.1.2/dist/vuex.min.js',
// 'https://cdn.jsdelivr.net/npm/vant@2.4.7/lib/index.min.js' // 'https://cdn.jsdelivr.net/npm/vant@2.4.7/lib/index.min.js'
// ] // ]
// } // }
// } // }
/** /**
* 雪碧图插件 * 雪碧图插件
*/ */
const SpritesmithPlugin = require('webpack-spritesmith') const SpritesmithPlugin = require('webpack-spritesmith')
const spritesmithFunction = data => { const spritesmithFunction = data => {
let { spritesheet, sprites } = data let { spritesheet, sprites } = data
let shared = `.sprite-icon { background-image: url(${data.sprites[0].image});background-size: ${spritesheet.width / 2}px ${spritesheet.height / 2}px;}` let shared = `.sprite-icon { background-image: url(${data.sprites[0].image});background-size: ${spritesheet.width / 2}px ${spritesheet.height / 2}px;}`
let perSprite = sprites.map(sprite => { let perSprite = sprites
let { name, width, height, offset_x, offset_y } = sprite .map(sprite => {
return `.icon-${name} { width: ${width / 2}px; height: ${height / 2}px; background-position: ${offset_x / 2}px ${offset_y / 2}px;}` let { name, width, height, offset_x, offset_y } = sprite
}).join('\n') return `.icon-${name} { width: ${width / 2}px; height: ${height / 2}px; background-position: ${offset_x / 2}px ${offset_y / 2}px;}`
})
.join('\n')
return `${shared}\n${perSprite}` return `${shared}\n${perSprite}`
} }
module.exports = { module.exports = {
...@@ -106,13 +108,16 @@ module.exports = { ...@@ -106,13 +108,16 @@ module.exports = {
image: path.resolve(__dirname, './src/assets/images/sprite.png'), image: path.resolve(__dirname, './src/assets/images/sprite.png'),
// 生成SCSS // 生成SCSS
css: [ css: [
[path.resolve(__dirname, './src/assets/css/sprite.scss'), { [
format: 'function_based_template' path.resolve(__dirname, './src/assets/css/sprite.scss'),
}] {
format: 'function_based_template'
}
]
] ]
}, },
customTemplates: { customTemplates: {
'function_based_template': spritesmithFunction, function_based_template: spritesmithFunction
}, },
//background引用路径 //background引用路径
apiOptions: { apiOptions: {
...@@ -125,11 +130,11 @@ module.exports = { ...@@ -125,11 +130,11 @@ module.exports = {
}) })
] ]
config.plugins = [...config.plugins, ...Plugins] config.plugins = [...config.plugins, ...Plugins]
// 为生产环境修改配置... // 为生产环境修改配置...
// if (IS_PROD) { // if (IS_PROD) {
// // externals // // externals
// config.externals = externals // config.externals = externals
// } // }
}, },
chainWebpack: config => { chainWebpack: config => {
...@@ -170,26 +175,30 @@ module.exports = { ...@@ -170,26 +175,30 @@ module.exports = {
return options return options
}) })
.end() .end()
/** /**
* 打包分析 * 打包分析
*/ */
if (IS_PROD) { if (IS_PROD) {
config.plugin('webpack-report').use(BundleAnalyzerPlugin, [{ config.plugin('webpack-report').use(BundleAnalyzerPlugin, [
analyzerMode: 'static' {
}]) analyzerMode: 'static'
}
])
} }
config config
// https://webpack.js.org/configuration/devtool/#development // https://webpack.js.org/configuration/devtool/#development
.when(!IS_PROD, config => config.devtool('cheap-source-map')) .when(!IS_PROD, config => config.devtool('cheap-source-map'))
config.when(IS_PROD, config => { config.when(IS_PROD, config => {
config config
.plugin('ScriptExtHtmlWebpackPlugin') .plugin('ScriptExtHtmlWebpackPlugin')
.after('html') .after('html')
.use('script-ext-html-webpack-plugin', [{ .use('script-ext-html-webpack-plugin', [
// 将 runtime 作为内联引入不单独存在 {
inline: /runtime\..*\.js$/ // 将 runtime 作为内联引入不单独存在
}]) inline: /runtime\..*\.js$/
}
])
.end() .end()
config.optimization.splitChunks({ config.optimization.splitChunks({
chunks: 'all', chunks: 'all',
...@@ -218,4 +227,4 @@ module.exports = { ...@@ -218,4 +227,4 @@ module.exports = {
config.optimization.runtimeChunk('single') config.optimization.runtimeChunk('single')
}) })
} }
}
\ No newline at end of file \ No newline at end of file
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!