Commit 69b175d6 by 前端

Merge branch 'v3.0.0' into 'develop'

V3.0.0

See merge request !73
2 parents f2685efd 7cbcd4da
Showing 75 changed files with 4111 additions and 266 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",
......
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
to continue.</strong> to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> <!-- <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script> -->
<script src="https://wwcdn.weixin.qq.com/node/wwopen/wwopenmng/js/jsapi/wecomtest$433252bc.js"></script>
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script> <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
<!-- 使用CDN加速的JS文件,配置在vue.config.js下 --> <!-- 使用CDN加速的JS文件,配置在vue.config.js下 -->
<% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %> <% for (var i in htmlWebpackPlugin.options.cdn&&htmlWebpackPlugin.options.cdn.js) { %>
......
const url = '/rop-scrm-entmicro/router'
// const url = 'http://192.168.1.78:8064/rop-scrm-entmicro/router'
export default {
/** 访客记录分页列表 */
cardRecordPage(data) {
data.method = 'entmicro.api.business.cardRecord.page'
return window.$HTTP({
url,
data
})
},
/** 访客记录 */
cardRecord(data) {
data.method = 'entmicro.api.business.card.cardRecord'
return window.$HTTP({
url,
data
})
}
}
...@@ -25,5 +25,13 @@ export default { ...@@ -25,5 +25,13 @@ export default {
url, url,
data data
}) })
},
/**变更客户车牌号信息 */
editplatCustomer(data) {
data.method = 'entmicro.api.customer.editdata'
return window.$HTTP({
url,
data
})
} }
} }
\ No newline at end of file \ No newline at end of file
// const url = 'http://192.168.3.191:8064/rop-scrm-entmicro/router' // const url = 'http://192.168.3.191:8064/rop-scrm-entmicro/router'
const url = '/rop-scrm-entmicro/router' const url = '/rop-scrm-entmicro/router'
const recordUrl = '/rop-scrm-shopmall/router'
export default { export default {
/**消息盒子-好友列表 */ /**消息盒子-好友列表 */
...@@ -17,5 +18,14 @@ export default { ...@@ -17,5 +18,14 @@ export default {
url, url,
data data
}) })
},
//客户动态记录列表
getcustomerRecordList(data = {}) {
data.method = 'scrm.api.shopmall.customer.dynamic.record.list'
return window.$HTTP({
url: recordUrl,
data,
returnAll: true
})
} }
} }
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* @version: 1.0.0 * @version: 1.0.0
* @Author: limin * @Author: limin
* @Date: 2021-06-07 14:12:32 * @Date: 2021-06-07 14:12:32
* @LastEditors: limin * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2021-06-17 18:23:27 * @LastEditTime: 2022-09-07 14:27:07
*/ */
import groupChat from './groupChat' import groupChat from './groupChat'
import ssoApi from './ssoApi' import ssoApi from './ssoApi'
...@@ -14,13 +14,6 @@ import groupCustomer from './groupCustomer' ...@@ -14,13 +14,6 @@ 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'
import businessApi from './business'
export { ssoApi, groupChat, wxConfig, liveBroadcast, groupCustomer, groupTag, entmicroApi, detailApi, solicitApi, businessApi }
/*
* @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
})
},
//一键营销状态回收
ocmarketingRecovery(data) {
data.method = 'marketing.api.solicit.ocmarketing.status.recovery'
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
})
},
// 一键营销-员工发送状态判断
staffSendStatus(data) {
data.method = 'marketing.api.solicit.ocmarketing.staff.sendStatus'
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
})
}
}
...@@ -20,9 +20,8 @@ export default { ...@@ -20,9 +20,8 @@ export default {
returnAll returnAll
}) })
}, },
/** 获取userid */ /** 获取userid */
getuserInfo(data={}) { getuserInfo(data = {}) {
data.method = 'scrm.api.sso.user.getLoginInfo' data.method = 'scrm.api.sso.user.getLoginInfo'
return window.$HTTP({ return window.$HTTP({
url, url,
......
@import './normalize.scss'; @import './normalize.scss';
@import './sprite.scss'; @import './sprite.scss';
*{ * {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
...@@ -25,12 +25,33 @@ img { ...@@ -25,12 +25,33 @@ 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;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.nowrap{
white-space: nowrap;
}
.text-two-line { .text-two-line {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -40,12 +61,6 @@ img { ...@@ -40,12 +61,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 +76,174 @@ img { ...@@ -61,47 +76,174 @@ 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;
}
.color6 {
color: #666666;
}
.color9 {
color: #999999;
}
.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-22{
line-height: 22px;
}
.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{ .bottom {
vertical-align: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;
}
.p52{
padding:11px 52px;
} }
\ 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: 186px 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: -168px -24px;}
.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-delete { width: 18px; height: 14px; background-position: -168px 0px;}
.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: -168px -45px;}
.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;}
.icon-tip { width: 16px; height: 16px; background-position: -140px -130px;}
\ No newline at end of file \ No newline at end of file

7.63 KB | W: | H:

39.5 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 text-hide">{{ 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.receiveStatus == 1 ? '已领取' : item.checkStatus == 1 ? '已查看' : item.sendStatus == 1 ? '已送达' : item.sendStatus == 0 ? '未送达' : '' }}
</div>
</div>
</div>
<div class="customer-info-right">
<div class="customer-info-label">
<div class="customer-info-name">企微账号:</div>
<div v-if="item.type">
<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 text-hide">{{ item.solicitTime }}</div>
</div>
<div class="customer-info-label">
<div class="customer-info-name">更新日期:</div>
<div class="customer-info-message text-hide">{{ 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 { ssoApi } 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) {
this.customerData = n
}
},
data() {
return {
// 电话营销弹窗
show: false,
actions: [{ name: '呼叫' }, { name: '复制' }],
chatParams: {
externalUserIds: [],
groupName: '',
userIds: [],
chatId: ''
},
phoneNumber: null,
customerData: this.customerInfo,
customerIndex: 0,
workUserId: ''
}
},
mounted() {
this.initWx()
this.getuserInfo()
},
methods: {
// 初始化微信接口
initWx() {
window.$wx = wxConfig
window.$wx.init(['setClipboardData', 'navigateToAddCustomer', 'openEnterpriseChat', 'makePhoneCall']).then(() => {})
},
getuserInfo() {
ssoApi.getuserInfo().then(res => {
this.workUserId = res.data.workUserId
})
},
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
this.$emit('showAction', { phoneNumber: this.phoneNumber })
},
// 选择电话营销方式
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) {
wx.setClipboardData({
data: val.phoneNumber,
success(res) {
Toast('已复制手机号,请尝试通过用户手机号来添加好友')
},
fail(res) {}
})
} 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;
height: 39px;
}
.customer-name {
width: calc(100% - 120px);
font-size: 14px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #282829;
line-height: 39px;
padding-left: 12px;
}
.customer-carnumber {
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 39px;
white-space: nowrap;
padding-right: 12px;
}
.customer-info {
display: flex;
padding: 12px;
border-bottom: 1px solid rgba(195, 195, 195, 0.3);
border-top: 1px solid rgba(195, 195, 195, 0.3);
&-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: #2cca74;
}
&-qiwechat {
vertical-align: bottom;
color: #3975c6;
}
}
.customer-marketing {
display: flex;
justify-content: space-around;
padding: 11px 0;
}
.customer-info-qiwechat {
vertical-align: bottom;
// color: #2cca74;
}
</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-dropdown-menu__title {
font-size: 14px !important;
font-weight: 400 !important;
color: #333333 !important;
}
</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="enter-wrap">
<div class="plateInput" id="plateInput">
<div class="item" :class="{ active: plateInput.input.type === 'p1' }" @click.stop="clickInput('p1')">
<span id="p1">{{ plateInput.input.value.p1 }}</span>
</div>
<div class="item" :class="{ active: plateInput.input.type === 'p2' }" @click.stop="clickInput('p2')">
<span id="p2">{{ plateInput.input.value.p2 }}</span>
</div>
<div class="icon-black"></div>
<div class="item" :class="{ active: plateInput.input.type === 'p3' }" @click.stop="clickInput('p3')">
<span id="p3">{{ plateInput.input.value.p3 }}</span>
</div>
<div class="item" :class="{ active: plateInput.input.type === 'p4' }" @click.stop="clickInput('p4')">
<span id="p4">{{ plateInput.input.value.p4 }}</span>
</div>
<div class="item" :class="{ active: plateInput.input.type === 'p5' }" @click.stop="clickInput('p5')">
<span id="p5">{{ plateInput.input.value.p5 }}</span>
</div>
<div class="item" :class="{ active: plateInput.input.type === 'p6' }" @click.stop="clickInput('p6')">
<span id="p6">{{ plateInput.input.value.p6 }}</span>
</div>
<div class="item" :class="{ active: plateInput.input.type === 'p7' }" @click.stop="clickInput('p7')">
<span id="p7">{{ plateInput.input.value.p7 }}</span>
</div>
<div class="item" :class="{ active: plateInput.input.type === 'p8', new: !plateInput.input.value.p8 }" @click.stop="clickInput('p8')">
<span id="p8">{{ plateInput.input.value.p8 }}</span>
</div>
</div>
<div class="bords" v-if="plateInput.input.dialogVisible">
<div class="bor">
<div class="btns">
<button type="primary" size="small" plain @click="hiddenKeybord">取消</button>
<button type="primary" class="success" size="small" plain @click="enterWord">完成</button>
</div>
<ul class="keyboard province" id="province" v-if="plateInput.input.dialogVisible && plateInput.input.type === 'p1'">
<li v-for="i in Keyboard.province" @click.stop="clickKeyboard(i)" :key="i">{{ i }}</li>
<li class="delete" @click.stop="clickDelete">
<div class="sprite-icon icon-delete"></div>
<!-- 删 -->
</li>
</ul>
<ul class="keyboard province" id="number" v-if="plateInput.input.dialogVisible && plateInput.input.type !== 'p1'">
<li
:key="i"
v-for="i in Keyboard.number"
:class="{
num:
(plateInput.input.type === 'p2' && parseInt(i) >= 0 && parseInt(i) <= 9) ||
(['学', '港', '澳', '挂'].includes(i) && ['p1', 'p2', 'p3', 'p4', 'p5', 'p6'].includes(plateInput.input.type)),
lastBtn: lastBtn
}"
@click.stop="clickKeyboard(i)"
>
{{ i }}
</li>
<li class="delete deletes" @click.stop="clickDelete">
<div class="sprite-icon icon-delete"></div>
<!-- 删 -->
</li>
</ul>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'PlatNum',
data() {
return {
currentPlate: undefined,
plateInput: {
input: {
value: {
p1: '',
p2: '',
p3: '',
p4: '',
p5: '',
p6: '',
p7: '',
p8: ''
},
type: 'p1',
dialogVisible: false
}
},
Keyboard: {
province: [
'京',
'粤',
'津',
'晋',
'冀',
'蒙',
'辽',
'吉',
'黑',
'渝',
'苏',
'浙',
'皖',
'闽',
'赣',
'鲁',
'鄂',
'沪',
'宁',
'桂',
'琼',
'川',
'贵',
'云',
'藏',
'陕',
'新',
'豫',
'湘',
'青',
'甘'
],
number: [
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'J',
'K',
'L',
'M',
'N',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
'学',
'港',
'澳',
'挂'
]
},
lastBtn: false
}
},
props: ['name', 'plateNumber', 'noRightPart'],
computed: {
plateNumber1: {
get() {
return this.plateNumber || ''
},
set(val) {
this.$emit('update:plateNumber', val)
}
}
},
methods: {
clickInput(type) {
this.plateInput.input.type = type
let val = this.plateInput.input.value['p' + (Number(type.split('')[1]) - 1)]
if (['学', '港', '澳', '挂'].includes(val) && this.plateInput.input.type == 'p8') {
this.lastBtn = true
} else {
this.lastBtn = false
}
this.plateInput.input.dialogVisible = true
},
hiddenKeybord() {
this.plateInput.input.dialogVisible = false
},
enterWord() {
this.$emit('updateChange', this.plateInput.input.value)
},
clickKeyboard(val) {
if (this.plateInput.input.type === 'p2' && parseInt(val) >= 0 && parseInt(val) <= 9) {
return
}
if (['学', '港', '澳', '挂'].includes(val) && ['p1', 'p2', 'p3', 'p4', 'p5', 'p6'].includes(this.plateInput.input.type)) {
return
}
if (['学', '港', '澳', '挂'].includes(val) && this.plateInput.input.type == 'p7') {
this.lastBtn = true
}
if (this.lastBtn && this.plateInput.input.type == 'p8') {
return
}
this.plateInput.input.value[this.plateInput.input.type] = val
let type = this.plateInput.input.type.split('p')[1]
if (type !== '8') {
this.plateInput.input.type = 'p' + (parseInt(type) + 1)
}
},
clickDelete() {
this.plateInput.input.value[this.plateInput.input.type] = undefined
let nu = this.plateInput.input.type.split('p')[1] - 1
if (nu >= 0) {
this.plateInput.input.value['p' + nu] = undefined
}
let type = this.plateInput.input.type.split('p')[1]
if (type !== '1') {
this.plateInput.input.type = 'p' + (parseInt(type) - 1)
}
},
setPlateNumber() {
if (this.plateInput.input.plateNumber) {
this.plateNumber1 = this.plateInput.input.plateNumber
} else {
this.plateNumber1 = undefined
}
},
setDirectIssuedPlateNumber() {
if (this.plateInput.input.plateNumber) {
this.plateNumber1 = this.plateInput.input.plateNumber
} else {
this.plateNumber1 = undefined
}
}
}
}
</script>
<style scoped lang='scss'>
.enter-wrap {
.plateInput {
padding: 0 32px;
display: flex;
justify-content: space-around;
align-items: center;
.item {
width: 30px;
height: 40px;
background: rgba(50, 127, 250, 0.1);
border: 0.5px solid rgba(50, 127, 250, 0.15);
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
font-size: 18px;
color: #282829;
&:last-child {
background: #f3ffe7;
border: 0.5px solid #e0f8c9;
}
}
.icon-black {
height: 8px;
width: 8px;
background: #282829;
border-radius: 100%;
}
.active {
border: 1.5px solid #327ffa !important;
}
}
.bords {
position: fixed;
bottom: 0;
left: 0;
z-index: 999;
.bor {
position: relative;
.btns {
width: 375px;
height: 38px;
background: #ffffff;
position: absolute;
display: flex;
justify-content: space-between;
align-items: center;
top: -35px;
left: 0;
padding: 0 15px;
box-sizing: border-box;
button {
background: #f2f2f2;
border-radius: 4px;
padding: 5px 12px;
box-sizing: border-box;
font-weight: 600;
font-size: 14px;
color: #3b3b3d;
text-align: center;
border: 0;
}
.success {
background: #07c160;
border-radius: 4px;
color: #ffffff;
}
}
}
// 键盘
.keyboard {
position: fixed;
bottom: 0;
left: 0;
background: #f7f7f7;
width: 100%;
height: 180px;
margin: 0;
padding: 0;
font-size: 18px;
z-index: 1;
}
.keyboard li {
list-style: none;
border-radius: 4px;
}
.keyboard li {
float: left;
background: #ffffff;
border-radius: 4px;
margin-left: 7px;
margin-top: 8px;
font-size: 16px;
color: #333333;
}
.num {
background: #ffffff;
border-radius: 4px;
font-size: 16px;
color: #cacacc !important;
}
.lastBtn {
background: #ffffff !important;
border-radius: 4px;
font-size: 16px;
color: #cacacc !important;
}
.province {
position: relative;
}
.provinces {
position: relative;
}
.province li {
width: calc((100% - 8px * 11) / 10);
height: calc((100% - 8px * 5) / 4);
display: flex;
display: -webkit-flex;
align-items: center;
-webkit-align-items: center;
justify-content: center;
-webkit-justify-content: center;
}
.province li.delete {
width: calc((100% - 8px * 11) / 10 * 2);
}
.province li.deletes {
width: calc((100% - 8px * 11) / 10 * 2 + 10px);
}
.disabled {
color: rgba(0, 0, 0, 0.15);
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<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;
......
...@@ -70,10 +70,10 @@ export default { ...@@ -70,10 +70,10 @@ export default {
width: 100%; width: 100%;
height: 50px; height: 50px;
box-sizing: border-box; box-sizing: border-box;
background-color: #dfe7f1; background-color: #EBEFF5;
.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,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
// 本地环境配置 // 本地环境配置
module.exports = { module.exports = {
envVersion: "develop", envVersion: 'develop',
title: '嘀加企微管家', title: '嘀加企微管家',
request: { request: {
baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址, baseURL: 'http://scrm.test.glsx.com.cn', // 本地测试项目地址,
...@@ -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
} }
...@@ -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 DatetimePicker,
Toast,
Switch,
Form,
Sticky
] ]
...@@ -37,7 +37,7 @@ router.beforeEach((to, from, next) => { ...@@ -37,7 +37,7 @@ router.beforeEach((to, from, next) => {
if (to.meta.title) { if (to.meta.title) {
store.dispatch('setPageMeta', to.meta) store.dispatch('setPageMeta', to.meta)
} else { } else {
store.dispatch('setPageMeta', { title: '客户跟进' }) store.dispatch('setPageMeta', { title: '' })
} }
store.commit('SET_LAST_PATH', to.name) store.commit('SET_LAST_PATH', to.name)
/* 路由发生变化修改页面背景色 */ /* 路由发生变化修改页面背景色 */
......
const pages = { const pages = {
customerGroup: [{ customerGroup: [
{
name: 'index', name: 'index',
meta: { meta: {
title: '一客一群', title: '一客一群',
backgroundColor: '#F7F7F7', backgroundColor: '#F7F7F7',
keepAlive: true, keepAlive: true
} }
}, },
{ name: 'mass' } { name: 'mass' }
], ],
attractCustomer: [{ attractCustomer: [
{
name: 'index', name: 'index',
meta: { meta: {
title: '渠道活码', title: '渠道活码',
backgroundColor: '#F7F7F7', backgroundColor: '#F7F7F7',
keepAlive: true, keepAlive: true
} }
}, { },
{
name: 'detail', name: 'detail',
meta: { meta: {
title: '渠道活码', title: '渠道活码',
keepAlive: true, keepAlive: true
}
} }
}], ],
customer: [{ customer: [
{
name: 'index', name: 'index',
meta: { meta: {
title: '查看客户详情', title: '查看客户详情',
backgroundColor: '#F7F7F7', backgroundColor: '#F7F7F7'
} }
}, { },
{
name: 'information', name: 'information',
meta: { meta: {
title: '完善信息', title: '完善信息',
backgroundColor: '#F7F7F7' backgroundColor: '#F7F7F7'
} }
}, { },
{
name: 'detail', name: 'detail',
meta: { meta: {
title: '客户跟进', title: '客户跟进',
backgroundColor: '#F7F7F7', backgroundColor: '#F7F7F7'
// keepAlive: true, // keepAlive: true,
} }
}, { },
{
name: 'groupDetail', name: 'groupDetail',
meta: { meta: {
title: '客户跟进', title: '客户跟进',
backgroundColor: '#F7F7F7', backgroundColor: '#F7F7F7',
keepAlive: true, keepAlive: true
} }
}, { },
{
name: 'editDetail', name: 'editDetail',
meta: { meta: {
backgroundColor: '#F7F7F7', backgroundColor: '#F7F7F7',
keepAlive: true, keepAlive: true
}
},
{
name: 'editPlat',
meta: {
backgroundColor: '#F7F7F7',
keepAlive: true
}
},
{
name: 'record',
meta: {
title: '客户记录',
backgroundColor: '#F7F7F7'
}
} }
}], ],
tag: [{ tag: [
{
name: 'index', name: 'index',
meta: { meta: {
title: '批量打标签', title: '批量打标签',
backgroundColor: '#F7F7F7' backgroundColor: '#F7F7F7'
} }
}], }
customerDetails: [{ ],
friends: [
{
name: 'index',
meta: {
title: '发布朋友圈任务',
backgroundColor: '#F7F7F7'
}
}
],
proxy: [
{
name: 'index',
meta: {
title: '名片访问记录',
backgroundColor: '#F7F7F7'
}
}
],
customerDetails: [
{
name: 'index', name: 'index',
meta: { meta: {
title: '查看客户详情', title: '查看客户详情',
backgroundColor: '#F7F7F7' backgroundColor: '#F7F7F7'
} }
}, { },
{
name: 'detail', name: 'detail',
meta: { meta: {
title: '查看客户详情', title: '查看客户详情',
backgroundColor: '#F7F7F7' backgroundColor: '#F7F7F7'
} }
}] }
],
solicit: [
{
name: 'index',
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'
}
}
],
other:[
{
name: 'index',
meta: {
title: '自定义',
backgroundColor: '#F7F7F7'
}
}
]
} }
const redirect = '' const redirect = ''
...@@ -87,9 +187,7 @@ Object.keys(pages).map(parent => { ...@@ -87,9 +187,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 = {
......
...@@ -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({
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* @version: * @version:
* @Author: limin * @Author: limin
* @Date: 2021-06-07 14:12:32 * @Date: 2021-06-07 14:12:32
* @LastEditors: limin * @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2021-07-06 12:02:21 * @LastEditTime: 2022-09-02 17:34:51
*/ */
import { ssoApi } from '@/api' import { ssoApi } from '@/api'
import { store, util } from 'utils' import { store, util } from 'utils'
...@@ -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}`)
} }
...@@ -121,14 +120,14 @@ const actions = { ...@@ -121,14 +120,14 @@ const actions = {
window.location.href = `${wxUrl}?appid=${appid}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect` window.location.href = `${wxUrl}?appid=${appid}&redirect_uri=${encodeURIComponent(redirectUrl)}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
} }
} else { } else {
const storage_corpId = util.getLocalStorage('dj_scrm_corpId') const { corpId, agentId } = util.getLocalStorage('dj_scrm_corpId')
const { baseURL } = window.$fetchConfig.request const { baseURL } = window.$fetchConfig.request
let url = `${baseURL}/dj-scrm-wx-work-main/#/` let url = `${baseURL}/dj-scrm-wx-work-main/#/`
window.location.href = `${url}?redirect_uri=${redirectUrl}&corpId=${storage_corpId.corpId}` window.location.href = `${url}?redirect_uri=${encodeURIComponent(redirectUrl)}&corpId=${corpId}&agentId=${agentId}`
} }
}, },
navigation({ dispatch }) { navigation({ dispatch }) {
let { sessionId, corpId ,id} = getParams() let { sessionId, corpId, id, activityId, agentId } = 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) {
...@@ -137,7 +136,10 @@ const actions = { ...@@ -137,7 +136,10 @@ const actions = {
util.clearSessionId() util.clearSessionId()
} }
} }
util.setLocalStorage('dj_scrm_corpId', { corpId }) let dj_scrm_storage = { corpId }
if (agentId) dj_scrm_storage.agentId = agentId
util.setLocalStorage('dj_scrm_corpId', dj_scrm_storage)
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) {
......
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()
}
} else if (res.code == 21) {
if (payload.fail) {
payload.fail()
}
}
})
},
// 获取跟进结果字典数据
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 if (res.code == 21) {
if (payload.fail) {
payload.fail()
}
} 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(), //日
...@@ -17,14 +14,14 @@ Date.prototype.format = function(fmt) { ...@@ -17,14 +14,14 @@ Date.prototype.format = function(fmt) {
'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
...@@ -34,15 +31,15 @@ const throttle = (fn, gapTime) => { ...@@ -34,15 +31,15 @@ const throttle = (fn, gapTime) => {
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',
...@@ -53,8 +50,8 @@ const showLoading = (title = '加载中...') => { ...@@ -53,8 +50,8 @@ 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
...@@ -71,8 +68,8 @@ const showToast = (message = '', callBack) => { ...@@ -71,8 +68,8 @@ const showToast = (message = '', callBack) => {
callBack() callBack()
}, 1500) }, 1500)
} }
} }
/**触摸样式 */ /**触摸样式 */
const touchstart = e => { const touchstart = e => {
e.target.classList.add('btn-on-leave') e.target.classList.add('btn-on-leave')
} }
...@@ -100,15 +97,15 @@ const removeLocalStorage = key => { ...@@ -100,15 +97,15 @@ const removeLocalStorage = 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
...@@ -118,8 +115,8 @@ const isFullSucreen = () => { ...@@ -118,8 +115,8 @@ const isFullSucreen = () => {
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,
......
...@@ -161,6 +161,18 @@ export default { ...@@ -161,6 +161,18 @@ export default {
key: 'customerPhone' key: 'customerPhone'
}, },
{ {
title: '车牌号',
type: 'platNumber',
value: obj => {
return obj.vehicleInfo.vehicleNo
},
save_key: 'audi',
placeholder: '请输入',
// placeholder: '',
key: 'vehicleTrain',
maxlength: 10
},
{
title: '购车日期', title: '购车日期',
type: 'date', type: 'date',
value: obj => { value: obj => {
...@@ -204,18 +216,6 @@ export default { ...@@ -204,18 +216,6 @@ export default {
key: 'insEndTime' key: 'insEndTime'
}, },
{ {
title: '车牌号',
type: 'platNumber',
value: obj => {
return obj.vehicleInfo.vehicleNo
},
save_key: 'audi',
// placeholder: '请输入',
placeholder: '',
key: 'vehicleTrain',
maxlength: 10
},
{
title: '车架号', title: '车架号',
type: 'standNo', type: 'standNo',
value: obj => { value: obj => {
...@@ -263,7 +263,6 @@ export default { ...@@ -263,7 +263,6 @@ export default {
}, },
activated() { activated() {
this.watchPageBack().then(() => { this.watchPageBack().then(() => {
console.log(this.id)
this.showToast('更新成功', () => { this.showToast('更新成功', () => {
this.showLoading() this.showLoading()
this.getCustomerDetail(this.id) this.getCustomerDetail(this.id)
...@@ -317,9 +316,13 @@ export default { ...@@ -317,9 +316,13 @@ export default {
this.$router.back() this.$router.back()
}, },
moreInfo() { moreInfo() {
let { customerPhone } = this.userInfo.info let {
if (!customerPhone && this.customerId == 0) { info: { customerPhone },
this.showToast('请完善手机号码,系统将自动关联更多客户信息') vehicleInfo: { vehicleNo }
} = this.userInfo
this.customerId = 0
if (!customerPhone && !vehicleNo && this.customerId == 0) {
this.showToast('请完善客户的联系电话或车牌号,系统将自动关联更多的客户信息')
return return
} }
this.isMore = !this.isMore this.isMore = !this.isMore
...@@ -328,6 +331,7 @@ export default { ...@@ -328,6 +331,7 @@ export default {
this.labelArray[index].isShow = !this.labelArray[index].isShow this.labelArray[index].isShow = !this.labelArray[index].isShow
}, },
getCustomerDetail(userId) { getCustomerDetail(userId) {
setTimeout(() => {
this.hideLoading() this.hideLoading()
detailApi.getCustomerDetail({ userId }).then(res => { detailApi.getCustomerDetail({ userId }).then(res => {
if (res) { if (res) {
...@@ -346,10 +350,10 @@ export default { ...@@ -346,10 +350,10 @@ export default {
this.initLabel() this.initLabel()
} }
}) })
}, 3000)
}, },
//标签分组 //标签分组
initLabel() { initLabel() {
console.log('this.userInfo.labelInfos', this.userInfo.labelInfos)
let labelArray = [ let labelArray = [
{ {
labelGroupType: '企业标签', labelGroupType: '企业标签',
...@@ -376,7 +380,7 @@ export default { ...@@ -376,7 +380,7 @@ export default {
} }
}) })
}) })
console.log(labelArray) // console.log(labelArray)
this.labelArray = labelArray this.labelArray = labelArray
}, },
setDetail({ type, title, save_key, maxlength }) { setDetail({ type, title, save_key, maxlength }) {
...@@ -386,10 +390,12 @@ export default { ...@@ -386,10 +390,12 @@ export default {
} = this } = this
let userId = this.id let userId = this.id
if (this.customerId == -1) return if (this.customerId == -1) return
if (type == 'tel') { if (type == 'tel' || type == 'platNumber') {
if (info.customerPhone && save_key == 'customerPhone') return if (info.customerPhone && save_key == 'customerPhone') return
if (vehicleInfo.vehicleNo && save_key == 'audi') return
let name = type == 'platNumber' ? 'customer.editPlat' : 'customer.editDetail'
this.$router.push({ this.$router.push({
name: 'customer.editDetail', name,
params: { params: {
title, title,
type, type,
...@@ -467,7 +473,6 @@ export default { ...@@ -467,7 +473,6 @@ export default {
...obj ...obj
}) })
.then(res => { .then(res => {
console.log(res)
this.showToast('更新成功', () => { this.showToast('更新成功', () => {
this.showLoading() this.showLoading()
this.getCustomerDetail(id) this.getCustomerDetail(id)
...@@ -581,7 +586,7 @@ export default { ...@@ -581,7 +586,7 @@ export default {
} }
} }
.more-hidden { .more-hidden {
max-height: 180px; max-height: 240px;
} }
.placeholder { .placeholder {
color: #ccc; color: #ccc;
......
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
let { value } = this let { value } = this
const phoneRex = /^[1]([3-9])[0-9]{9}$/ const phoneRex = /^[1]([3-9])[0-9]{9}$/
let obj = { let obj = {
customerSex: info.customerSex // customerSex: info.customerSex
} }
if (type == 'tel') { if (type == 'tel') {
if (!phoneRex.test(value)) { if (!phoneRex.test(value)) {
...@@ -47,17 +47,18 @@ export default { ...@@ -47,17 +47,18 @@ export default {
obj.customerPhone = info.customerPhone obj.customerPhone = info.customerPhone
} }
if (vehicleInfo) { if (vehicleInfo) {
Object.keys(vehicleInfo).map(i => { // Object.keys(vehicleInfo).map(i => {
if (vehicleInfo[i]) { // if (vehicleInfo[i]) {
detailObj.map(k => { // detailObj.map(k => {
if (k.key == i && save_key != k.save_key) { // if (k.key == i && save_key != k.save_key) {
if (!obj[k.save_key]) obj[k.save_key] = k.type == 'date' ? vehicleInfo[i].replace(/-/g, '/') : vehicleInfo[i] // if (!obj[k.save_key]) obj[k.save_key] = k.type == 'date' ? vehicleInfo[i].replace(/-/g, '/') : vehicleInfo[i]
} // }
}) // })
} // }
}) // })
if(vehicleInfo.vehicleNo) obj.carNumber = vehicleInfo.vehicleNo
} }
console.log(obj)
let staffUserId = this.getLocalStorage('dj_scrm_userInfo').workUserId let staffUserId = this.getLocalStorage('dj_scrm_userInfo').workUserId
entmicroApi entmicroApi
.editCustomer({ .editCustomer({
......
<template>
<div class="plat-wrapper">
<div class="title">输入车牌号码</div>
<plat-num ref="platNum" :plateNumber.sync="plateNumber" @updateChange="updateData"></plat-num>
<div class="tip flex">
<div class="sprite-icon icon-tip"></div>
请确认绑定车辆的信息,绑定后暂不支持变更
</div>
</div>
</template>
<script>
import { entmicroApi } from '@/api'
export default {
data() {
return {
plateNumber: ''
}
},
methods: {
updateData(val) {
let plateNum = Object.values(val).join('')
var regExp = /(^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1,2}$)/
if (!regExp.test(plateNum)) {
this.showToast('请输入正确的车牌号')
return
}
this.$refs.platNum.plateInput.input.dialogVisible = false
let {
userId,
info: { customerPhone }
} = this.getParams()
// console.log(customerPhone, 'customerPhone', this.getParams())
let staffUserId = this.getLocalStorage('dj_scrm_userInfo').workUserId
entmicroApi
.editplatCustomer({
staffUserId,
userId,
customerPhone,
carNumber: plateNum,
addWay: 1
})
.then(res => {
window.$back = true
this.$router.back(-1)
})
}
}
}
</script>
<style lang="scss" scoped>
.plat-wrapper {
.title {
font-size: 18px;
font-weight: 600;
color: #333;
text-align: center;
margin: 42px 0;
letter-spacing: 1px;
}
.tip {
font-weight: 400;
font-size: 12px;
color: #cacaca;
text-align: left;
padding:10px 32px 0 32px;
}
.icon-tip{
margin-right:4px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="record-container" v-if="flag">
<scroll-view class="content" @ReachBottom="onReachBottom" ref="scrollView">
<template v-if="recordList.length > 0">
<div class="record-container-content">
<!-- <div class="font-16 color-3 fw5 line-22 m-l-4">2021-12-31</div> -->
<template v-for="(item, index) in recordList">
<div class="record-container-content-item" :key="index">
<div class="portrait">
<img :src="item.avatar" alt="" v-if="item.avatar" />
<img v-else src="../../assets/images/user.png" />
</div>
<div class="m-t-4 font-14 line-22">
<div class="color-3 customerName text-hide">{{ item.customerName }}</div>
<div class="color6 m-t-4">
{{ item.operationType == 1 ? '浏览了' : item.operationType == 2 ? '领取优惠券' : '下单购买' }}
<span class="color-3 m-l-4">{{ item.goodsName }}</span>
</div>
<div class="font-12 color9 m-t-4" v-if="item.operationType == 3">订单编号:{{ item.orderCode }}</div>
</div>
<div class="font-12 color9 time">{{ item.operationDate }}</div>
</div>
</template>
</div>
</template>
<template v-else>
<empty description="暂无数据" />
</template>
</scroll-view>
</div>
</template>
<script>
import { groupCustomer } from '@/api'
import { Notify } from 'vant'
import { util } from '../../utils'
import { mapActions } from 'vuex'
export default {
data() {
return {
flag: false,
recordList: [],
page: {
pageNum: 1,
pageSize: 10
}
}
},
mounted() {
this.showLoading()
this.getcustomerRecordList()
},
methods: {
...mapActions({
navigation: 'navigation'
}),
//重新登录
reLogin() {
/**登录过期 重新登录 */
util.clearSessionId()
this.navigation()
},
getcustomerRecordList() {
let list = this.recordList
groupCustomer.getcustomerRecordList({ ...this.page }).then(({ code, data, message }) => {
this.hideLoading()
if (code == 0) {
this.recordList = [...list, ...data.list]
if (this.page.pageNum > 1) this.$refs.scrollView.loading = false
if (data.list == 0 && this.flag) {
this.$refs.scrollView.finished = true
}
} else if(code == 21) {
this.reLogin()
}else{
Notify(message)
}
this.flag = true
})
},
onReachBottom() {
this.page.pageNum++
this.getcustomerRecordList()
}
}
}
</script>
<style lang="scss" scoped>
.record-container {
padding: 0 12px;
/deep/ .van-list {
background: #f7f7f7;
height: 100%;
.van-empty {
height: 100%;
}
}
&-content-item {
background: #ffffff;
border-radius: 6px;
margin: 8px 0;
padding: 8px 12px 12px 12px;
display: flex;
position: relative;
.customerName {
max-width: 160px;
}
.portrait {
width: 40px;
height: 40px;
margin-right: 6px;
img {
width: 100%;
border-radius: 50%;
}
}
.time {
position: absolute;
top: 14px;
right: 12px;
line-height: 18px;
}
}
}
</style>
...@@ -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;
......
<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>
<tab :list="['已跟进','未跟进']" :index="1" :sticky="true">测试</tab>
</div>
</template>
<template>
<div>
<template v-if="count">
<div class="proxy-list proxy-header">
<div class="proxy-item">访客</div>
<div class="proxy-item">联系电话</div>
<div class="proxy-item">最后访问日期</div>
<div class="proxy-item">操作</div>
</div>
<div class="proxy-body">
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list v-model="loading" :finished="finished" finished-text="已经到底啦" @load="onLoad">
<div class="proxy-list" v-for="item in dataList" :key="item.id">
<div class="proxy-item proxy-nickname">
<label>{{ item.nickName }}</label>
{{ item.type == 1 ? '@微信' : '' }}
</div>
<div class="proxy-item">{{ item.phone }}</div>
<div class="proxy-item">{{ item.lastTime }}</div>
<div class="proxy-item" @click="popupShow(item)">访问记录</div>
</div>
</van-list>
</van-pull-refresh>
</div>
<van-popup v-model="show" position="bottom" round :style="{ 'min-height': '40%', 'max-height': '80%', 'overflow-y': 'hidden', 'padding-bottom': '30px' }">
<div class="popup-header">
<div class="popup-title">访问记录</div>
<div class="popup-icon"><van-icon name="cross" @click="show = false" /></div>
</div>
<div class="popup-content">
<div class="popup-content-header">
<div class="popup-item">序号</div>
<div class="popup-item">访问页面</div>
<div class="popup-item">访问时间</div>
</div>
<div class="popup-content-body" v-for="(item, index) in detailList" :key="item.id">
<div class="popup-item">{{ index + 1 }}</div>
<div class="popup-item">{{ item.pageName }}</div>
<div class="popup-item">{{ item.createdTime }}</div>
</div>
</div>
</van-popup>
</template>
<van-empty description="暂无数据" v-else />
</div>
</template>
<script>
import { businessApi } from '@/api'
export default {
data() {
return {
dataList: [],
detailList: [],
loading: false,
finished: false,
refreshing: false,
show: false,
count: 1,
pageNum: 0,
pageSize: 20
}
},
methods: {
cardRecordPage() {
this.loading = true
const { pageNum, pageSize } = this
businessApi.cardRecordPage({ pageNum, pageSize }).then(res => {
if (res) {
const dataList = res.data
this.dataList = this.dataList.concat(dataList)
this.count = res.count
if (this.dataList.length <= this.count) {
if (this.count === 0) {
this.finished = true
} else {
this.finished = false
}
}
this.loading = false
}
})
},
popupShow(item) {
this.show = true
this.detailList = item.recordRelationList
},
onLoad() {
this.pageNum++
this.loading = true
const num = this.count / this.pageSize
if (Number.isInteger(num)) {
this.number = num
} else {
this.number = parseInt(num) + 1
}
if (this.dataList.length < this.count) {
if (this.pageNum <= this.number) {
this.cardRecordPage()
this.loading = false
}
} else {
this.loading = false
this.finished = true
}
},
onRefresh() {
this.dataList = []
this.pageNum = 1
this.cardRecordPage()
if (this.refreshing) {
this.content = this.dataList
this.dataList = this.content
this.refreshing = false
}
this.loading = false
}
}
}
</script>
<style lang="scss" scoped>
.proxy-body {
position: absolute;
top: 48px;
height: calc(100% - 48px);
width: 100%;
left: 0px;
::v-deep {
.van-pull-refresh__track {
overflow: auto;
}
}
}
.proxy-list {
height: 48px;
line-height: 48px;
background: #ffffff;
box-shadow: inset 0 -1px 0 0 #f2f2f2;
display: flex;
&.proxy-header {
position: fixed;
width: 100%;
top: 0px;
left: 0px;
background: #f2f2f2;
.proxy-item {
&:last-child {
color: #414141;
}
}
}
.proxy-item {
font-size: 13px;
color: #414141;
text-align: center;
&.proxy-nickname {
color: #2cca74;
label {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
color: #414141;
max-width: 70px;
}
}
&:first-child {
width: 120px;
display: flex;
align-items: center;
justify-content: center;
}
&:last-child,
&:nth-child(2),
&:nth-child(3) {
flex: 1;
}
&:last-child {
color: #3975c6;
}
}
}
.popup-header {
height: 56px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0px 16px;
.popup-title {
font-weight: 500;
font-size: 16px;
color: #222222;
}
}
.popup-content {
max-height: calc(80vh - 50px);
overflow: auto;
&-header {
display: flex;
height: 40px;
line-height: 48px;
background: #f2f2f2;
text-align: center;
.popup-item {
font-weight: 600;
font-size: 14px;
color: #333333;
}
}
&-body {
display: flex;
height: 48px;
line-height: 48px;
background: #ffffff;
border: 1px solid #e5e5e5;
text-align: center;
}
.popup-item {
font-size: 14px;
color: #666666;
&:first-child {
width: 60px;
}
&:nth-child(2),
&:nth-child(3) {
flex: 1;
}
}
}
</style>
<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).style({
height: 16,
})
this.chart.render()
// 绘制柱状图文本
const offset = -5
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:#FA7C0B;">●</span>预约到店:${ev.items[0].value}</div>
<div class="item flex"><span class="arc" style="color:#3975C6;">●</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', [ '#FA7C0B','#3975C6'])
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: () => []
},
specialData: {
type: Array,
default: () => []
},
id: {
type: String,
default: ''
},
centerData: {
type: Object,
default: () => {}
}
},
watch: {
list() {
this.initCanvas()
}
},
mounted() {
this.initCanvas()
},
methods: {
initCanvas() {
let id = this.refId
let { chartData, chartColor, specialData,centerData } = this
let data = specialData.length>0?specialData:chartData
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(data)
this.chart.coord('polar', {
transposed: true,
radius: 0.9,
innerRadius: 0.74
})
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>`
})
this.chart.interval().position('const*value').adjust('stack').color('text', chartColor)
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 fw4">个企微客户</span>
</div>
<div class="font-12 color-2f fw4">招揽月份:{{ item.solicitationMonth }}月</div>
</div>
</div>
<template v-if="follewIndex == 0">
<div class="flex">
<div class="color39 font-14 p52 nowrap" @click="goTo('solicit.marketing', item)">一键营销</div>
<div class="colord8">|</div>
<div class="color39 font-14 p52 nowrap" @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;
box-shadow: 0px 3px 10px 0px rgba(223, 228, 234, 0.81);
border-radius: 4px;
&-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 text-hide">{{ 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" @showAction="showAction"></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>
<van-action-sheet v-model:show="show" :actions="actions" @select="onSelect" cancel-text="取消" close-on-click-action @cancel="onCancel" />
</div>
</template>
<script>
import { mapState } from 'vuex'
import { solicitApi } from '@/api'
import { Notify } from 'vant'
export default {
data() {
return {
// 电话营销弹窗
show: false,
actions: [{ name: '呼叫' }, { name: '复制' }],
phoneNumber: '',
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.groupName = this.getQuery().groupName ? this.getQuery().groupName : ''
},
mounted() {
this.initOption()
this.showLoading()
this.getSendCustomerList()
},
methods: {
// 初始化微信接口
initWx() {
window.$wx = wxConfig
window.$wx.init(['setClipboardData', 'navigateToAddCustomer', 'openEnterpriseChat', 'makePhoneCall']).then(() => {})
},
// 电话招揽弹窗关闭
onCancel() {
this.show = false
},
// 选择电话营销方式
onSelect(e) {
// 呼叫
if (e.name === '呼叫') {
// window.location.href = 'tel://' + this.telNumber
this.makePhoneCall(this.phoneNumber)
return
}
// 复制
this.setClipboardData(this.phoneNumber)
},
showFollowPop(data) {
this.$refs.customerFollowRef.init()
this.customerIndex = data.customerIndex
this.followCustomerData = data.followCustomerData
},
showInfoPop(data) {
this.$refs.customerInfoRef.getCustomerDetail(data.followCustomerData)
},
showAction(data) {
this.show = true
this.phoneNumber = data.phoneNumber
},
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
if (data.followFlag == 2) {
this.customerInfo.splice(this.customerIndex, 1)
} else {
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 ? 10 : this.status == 2 ? 0 : this.status //0未跟进、1已跟进
}
if (this.status != 2) {
params.followResult = this.result != 0 ? this.result : ''
}
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 && this.keyWord != '') {
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-weight: 400;
margin-right: 13px;
}
/deep/ .van-dropdown-menu__title {
font-size: 14px !important;
color: #333333 !important;
}
/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; line-height:18px">小程序</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.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" :specialData="chart.specialData"></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 { util } from '../../utils'
import { Notify } from 'vant'
export default {
components: {
pieChart,
barChart
},
data() {
return {
flag: true,
bulletinList: [],
activityId: '',
chart: {
pieColor: ['#3975C6', '#E6E7EB'],
pieData: [],
specialData:[],
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()
}
})
},
fail: () => {
this.hideLoading()
this.reLogin()
}
})
} 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',
navigation: 'navigation'
}),
//重新登录
reLogin() {
/**登录过期 重新登录 */
util.clearSessionId()
this.navigation()
},
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
}
]
this.chart.specialData = [
{
const: 'const',
text: ' 已跟进 (人)',
value: overviewInfo.followedUpCount
},
{
const: 'const',
text: '未跟进',
value: parseInt(overviewInfo.notFollowedUpCount-overviewInfo.followedUpCount)
}
]
this.chart.centerData = {
text: '达成率',
rate: overviewInfo.followedUpPercent ? parseInt(overviewInfo.followedUpPercent * 100) + '%' : 0
}
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;
box-shadow: 0px 3px 10px 0px rgba(223, 228, 234, 0.81);
border-radius: 4px;
.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 text-hide">{{ item.groupName }}</div>
<div class="result-content flex-between">
<div class="result-content-list flex-top" @click="goto('solicit.succeed', 2, item.groupId, item.groupName)">
<div class="sprite-icon icon-succeed"></div>
<div class="m-l-8">
<div class="font-14 color-3 fw5 line-22">成功到店</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', 1, item.groupId, item.groupName)">
<div class="sprite-icon icon-fail"></div>
<div class="m-l-8">
<div class="font-14 color-3 fw5 line-22">战败分析</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,
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="succeed-container">
<div class="succeed-title flex font-20 color-3 fw5">
<span class="groupName text-hide">{{ groupName }}</span>
<span class="color39 font-16 m-l-8">- {{ customeStatus == 2 ? '成功到店' : '战败分析' }}</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 ? getFollowResultDetail.averageFollows : 0 }}次/人</div>
<div class="font-12 color-2f m-t-6 line-18">平均跟进</div>
</div>
<div class="succeed-wrap-frequency-single">
<div class="font-16 color-3 bold line-24">{{ getFollowResultDetail.mostFollows ? getFollowResultDetail.mostFollows : 0 }}次</div>
<div class="font-12 color-2f m-t-6 line-18">最多跟进</div>
</div>
<div class="succeed-wrap-frequency-single">
<div class="font-16 color-3 bold line-24">{{ getFollowResultDetail.leastFollows ? getFollowResultDetail.leastFollows : 0 }}次</div>
<div class="font-12 color-2f m-t-6">最少跟进</div>
</div>
</div>
</div>
<div class="succeed-wrap m-b-16" v-if="customeStatus == 2">
<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="getFollowResultDetail.appointmentDailyCharts&&getFollowResultDetail.appointmentDailyCharts.length>0">
<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 == 1 && 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.groupId
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,
groupId: this.groupId,
customerFollowStatus: this.customeStatus == 2 ? 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;
.groupName{
max-width: 200px;
display: inline-block;
}
}
.succeed-content {
padding: 12px;
.succeed-wrap {
background: #fff;
box-shadow: 0px 3px 10px 0px rgba(223, 228, 234, 0.81);
border-radius: 4px;
.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 || ''
// 生产环境,测试和正式 // 生产环境,测试和正式
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
.map(sprite => {
let { name, width, height, offset_x, offset_y } = sprite let { name, width, height, offset_x, offset_y } = sprite
return `.icon-${name} { width: ${width / 2}px; height: ${height / 2}px; background-position: ${offset_x / 2}px ${offset_y / 2}px;}` return `.icon-${name} { width: ${width / 2}px; height: ${height / 2}px; background-position: ${offset_x / 2}px ${offset_y / 2}px;}`
}).join('\n') })
.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'), { [
path.resolve(__dirname, './src/assets/css/sprite.scss'),
{
format: 'function_based_template' format: 'function_based_template'
}] }
]
] ]
}, },
customTemplates: { customTemplates: {
'function_based_template': spritesmithFunction, function_based_template: spritesmithFunction
}, },
//background引用路径 //background引用路径
apiOptions: { apiOptions: {
...@@ -174,9 +179,11 @@ module.exports = { ...@@ -174,9 +179,11 @@ module.exports = {
* 打包分析 * 打包分析
*/ */
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
...@@ -186,10 +193,12 @@ module.exports = { ...@@ -186,10 +193,12 @@ module.exports = {
config config
.plugin('ScriptExtHtmlWebpackPlugin') .plugin('ScriptExtHtmlWebpackPlugin')
.after('html') .after('html')
.use('script-ext-html-webpack-plugin', [{ .use('script-ext-html-webpack-plugin', [
{
// 将 runtime 作为内联引入不单独存在 // 将 runtime 作为内联引入不单独存在
inline: /runtime\..*\.js$/ inline: /runtime\..*\.js$/
}]) }
])
.end() .end()
config.optimization.splitChunks({ config.optimization.splitChunks({
chunks: 'all', chunks: 'all',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!