Commit ac862076 by 前端

Merge branch 'v3.16.0' into 'master'

合并

See merge request !78
2 parents 9bc02682 8849fb09
const url = '/rop-scrm-datahub/router'
export default {
/**标签列表 */
getTagsList (labelTreeReq) {
const data = {
method: 'scrm.api.datahub.labelgroup.queryLabelTree',
labelTreeReq: {
labelGroupName: '',
pageNum: 1,
pageSize: 10000,
...labelTreeReq
}
}
return window.$HTTP({
url,
data
})
},
}
\ No newline at end of file
const url = '/rop-scrm-entmicro/router'
// const url = 'http://192.168.1.78:8064/rop-scrm-entmicro/router'
// const url = 'http://192.168.1.163:8080/rop-scrm-entmicro/router'
export default {
/** 侧边栏-客户跟进 */
getCustomerDetail(data) {
......@@ -42,5 +43,14 @@ export default {
url,
data,
})
},
/** 根据Id获取客户跟进记录列表 */
getCustomerRecord (data) {
data.method = 'entmicro.api.customer.record'
return window.$HTTP({
url,
data
})
}
}
const url = '/rop-scrm-entmicro/router'
// const url = 'http://192.168.1.163:8080/rop-scrm-entmicro/router'
export default {
/**全部活码接口 */
getAllEntmicroChannelCodeList(data) {
data.method = 'entmicro.api.code.listEntmicroChannelCodeList'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**引流获客列表 */
getEntmicroChannelCodeList(data) {
data.method = 'entmicro.api.code.listStaffEntmicroChannelCodeList'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**变更客户信息 */
editCustomer(data) {
data.method = 'entmicro.api.customer.editcustomer'
return window.$HTTP({
url,
data
})
},
/**变更客户车牌号信息 */
editplatCustomer(data) {
data.method = 'entmicro.api.customer.editdata'
return window.$HTTP({
url,
data
})
}
/**全部活码接口 */
getAllEntmicroChannelCodeList (data) {
data.method = 'entmicro.api.code.listEntmicroChannelCodeList'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**引流获客列表 */
getEntmicroChannelCodeList (data) {
data.method = 'entmicro.api.code.listStaffEntmicroChannelCodeList'
return window.$HTTP({
url,
data,
returnAll: true
})
},
/**变更客户信息 */
editCustomer (data) {
data.method = 'entmicro.api.customer.editcustomer'
return window.$HTTP({
url,
data
})
},
/**变更客户车牌号信息 */
editplatCustomer (data) {
data.method = 'entmicro.api.customer.editdata'
return window.$HTTP({
url,
data
})
},
}
\ No newline at end of file
// const url = 'http://192.168.2.42:8064/rop-scrm-entmicro/router'
// const url = 'http://192.168.1.163:8080/rop-scrm-entmicro/router'
const url = '/rop-scrm-entmicro/router'
// const url = window.$fetchConfig ? window.$fetchConfig.tagUrl + '/rop-scrm-entmicro/router' : 'http://oin7.branch.glsx.com.cn/rop-scrm-entmicro/router'
export default {
......
......@@ -16,4 +16,6 @@ import entmicroApi from './entmicroApi'
import detailApi from './detail'
import solicitApi from './solicit'
import businessApi from './business'
export { ssoApi, groupChat, wxConfig, liveBroadcast, groupCustomer, groupTag, entmicroApi, detailApi, solicitApi, businessApi }
import datahubApi from './datahubApi'
export { ssoApi, groupChat, wxConfig, liveBroadcast, groupCustomer, groupTag, entmicroApi, detailApi, solicitApi, businessApi, datahubApi }
......@@ -12,8 +12,15 @@ body .app {
-webkit-overflow-scrolling: touch;
height: 100%;
// overflow: hidden;
/* 兼容 IOS<11.2 先constant再env */
--constantSafeAreaInsetBottom: constant(safe-area-inset-bottom);
/* 兼容 IOS>11.2 */
--envSafeAreaInsetBottom: env(safe-area-inset-bottom);
}
.isFullSucreen{
padding-bottom: var(--constantSafeAreaInsetBottom);
padding-bottom: var(--envSafeAreaInsetBottom);
}
img {
width: 100%;
height: 100%;
......
.sprite-icon { background-image: url(../images/sprite.png);background-size: 194px 154px;}
.icon-active { width: 20px; height: 20px; background-position: -138px -30px;}
.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: -176px -104px;}
.icon-avatar { width: 44px; height: 44px; background-position: 0px 0px;}
.icon-collect { width: 32px; height: 28px; background-position: -96px -42px;}
.icon-customer-active { width: 16px; height: 16px; background-position: -176px -28px;}
.icon-customer-add { width: 28px; height: 20px; background-position: -138px 0px;}
.icon-customer-copy { width: 18px; height: 20px; background-position: -110px -96px;}
.icon-customer-phone { width: 20px; height: 20px; background-position: -138px -60px;}
.icon-delete { width: 18px; height: 14px; background-position: -176px -80px;}
.icon-factory { width: 32px; height: 32px; background-position: -42px -54px;}
.icon-fail { width: 24px; height: 24px; background-position: -42px -96px;}
.icon-fllow { width: 18px; height: 18px; background-position: -120px -134px;}
.icon-follow { width: 32px; height: 32px; background-position: -96px 0px;}
.icon-followRecord { width: 20px; height: 20px; background-position: -138px -90px;}
.icon-identifier { width: 20px; height: 20px; background-position: 0px -134px;}
.icon-maintant { width: 20px; height: 20px; background-position: -30px -134px;}
.icon-message { width: 18px; height: 18px; background-position: -148px -134px;}
.icon-open-arrow { width: 8px; height: 7px; background-position: -176px -125px;}
.icon-phone { width: 20px; height: 20px; background-position: -60px -134px;}
.icon-remove { width: 32px; height: 28px; background-position: 0px -96px;}
.icon-sendwechat { width: 20px; height: 18px; background-position: -90px -134px;}
.icon-succeed { width: 24px; height: 24px; background-position: -76px -96px;}
.icon-tel { width: 18px; height: 18px; background-position: -176px 0px;}
.icon-tip { width: 16px; height: 16px; background-position: -176px -54px;}
\ No newline at end of file
.sprite-icon { background-image: url(../images/sprite.png);background-size: 221px 220px;}
.icon-active { width: 20px; height: 20px; background-position: -201px 0px;}
.icon-append { width: 32px; height: 32px; background-position: -105px -58px;}
.icon-appoint { width: 32px; height: 32px; background-position: -51px -112px;}
.icon-arrow { width: 7px; height: 11px; background-position: -177px -112px;}
.icon-avatar { width: 44px; height: 44px; background-position: 0px -58px;}
.icon-collect { width: 32px; height: 28px; background-position: 0px -162px;}
.icon-coupon { width: 41px; height: 40px; background-position: -54px -58px;}
.icon-customer-active { width: 16px; height: 16px; background-position: -142px -200px;}
.icon-customer-add { width: 28px; height: 20px; background-position: -152px -162px;}
.icon-customer-copy { width: 18px; height: 20px; background-position: 0px -200px;}
.icon-customer-phone { width: 20px; height: 20px; background-position: -201px -30px;}
.icon-delete { width: 18px; height: 14px; background-position: -194px -200px;}
.icon-factory { width: 32px; height: 32px; background-position: -93px -112px;}
.icon-fail { width: 24px; height: 24px; background-position: -84px -162px;}
.icon-fllow { width: 18px; height: 18px; background-position: -58px -200px;}
.icon-follow { width: 32px; height: 32px; background-position: -135px -112px;}
.icon-followRecord { width: 20px; height: 20px; background-position: -201px -60px;}
.icon-group { width: 41px; height: 40px; background-position: -150px 0px;}
.icon-identifier { width: 20px; height: 20px; background-position: -201px -90px;}
.icon-maintant { width: 20px; height: 20px; background-position: -201px -120px;}
.icon-merchant { width: 41px; height: 40px; background-position: -150px -50px;}
.icon-message { width: 18px; height: 18px; background-position: -86px -200px;}
.icon-nophone { width: 65px; height: 48px; background-position: 0px 0px;}
.icon-notag { width: 65px; height: 47px; background-position: -75px 0px;}
.icon-phone { width: 20px; height: 20px; background-position: -201px -150px;}
.icon-psd { width: 41px; height: 40px; background-position: 0px -112px;}
.icon-remove { width: 32px; height: 28px; background-position: -42px -162px;}
.icon-sendwechat { width: 20px; height: 18px; background-position: -28px -200px;}
.icon-succeed { width: 24px; height: 24px; background-position: -118px -162px;}
.icon-tel { width: 18px; height: 18px; background-position: -114px -200px;}
.icon-tip { width: 16px; height: 16px; background-position: -168px -200px;}
\ No newline at end of file

44.7 KB | W: | H:

84.8 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
......@@ -10,13 +10,13 @@
let config = require('./conf.js')
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
if (isEnv) {
let { request } = config
Object.assign(request, { timeout })
return Promise.resolve(config)
}
// return window.fetch('http://192.168.3.171:7300/mock/617918601072f92988f05a11/base/scrm-wx-work-customer-config', {}).then(res => res.json())
return window.fetch('https://oss-config.dev.glsx.com.cn/mock/617918601072f92988f05a11/base/scrm-wx-work-customer-config', {}).then(res => res.json())
// if (isEnv) {
// let { request } = config
// Object.assign(request, { timeout })
// return Promise.resolve(config)
// }
let url = 'https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=scrm-wx-work-customer'
return window.fetch(url, {}).then(res => res.json())
}
export const cfg = {
install(vue, config) {
......
......@@ -46,8 +46,8 @@ const pages = {
name: 'detail',
meta: {
title: '客户跟进',
backgroundColor: '#F7F7F7'
// keepAlive: true,
backgroundColor: '#F7F7F7',
keepAlive: true,
}
},
{
......@@ -62,6 +62,7 @@ const pages = {
name: 'editDetail',
meta: {
backgroundColor: '#F7F7F7',
title:'编辑',
keepAlive: true
}
},
......@@ -78,6 +79,14 @@ const pages = {
title: '客户记录',
backgroundColor: '#F7F7F7'
}
},
{
name: 'tags',
meta: {
title: '客户标签',
backgroundColor: '#ffffff',
keepAlive: true
}
}
],
tag: [
......@@ -174,7 +183,7 @@ const pages = {
}
}
],
other:[
other: [
{
name: 'index',
meta: {
......
<template>
<div class="edit-wrapper">
<van-field
v-model="value"
placeholder="请输入"
clearable
:type="type"
:maxlength="maxlength"
/>
<div
class="submit"
@click="save"
>保存</div>
<div class="layout">
<template v-if="userInfo.info">
<div class="box">
<template v-for="(i,index) in userObj">
<template>
<div
:key="index"
class="item flex"
@click="itemClick(i.click)"
>
<div class="label">{{ i.label }}</div>
<template v-if="i.format">
<div
class="value"
v-html="i.format(userInfo)"
></div>
</template>
<template v-else>
<div class="value">
{{ userInfo.info[i.key] || '--' }}
</div>
</template>
</div>
</template>
</template>
</div>
</template>
<van-dialog
v-model="show"
title="请填写客户手机号"
show-cancel-button
confirm-button-text="确定"
confirm-button-color="#3975C6"
cancel-button-color="#999999”"
:before-close="save"
>
<div class="input">
<van-field
v-model="value"
placeholder="请输入"
clearable
type="tel"
:maxlength="11"
/>
</div>
</van-dialog>
</div>
</template>
<script>
import { entmicroApi } from '@/api'
export default {
data() {
data () {
return {
value: '',
type: 'text',
maxlength: 30
userInfo: {},
userObj: [
{
label: '头像',
format ({ info }) {
return info.avatar ? `<img src="${info.avatar}" />` : '<div class="sprite-icon icon-avatar"></div>'
}
},
{
label: '昵称',
key: 'nickName'
},
// {
// label: '客户姓名',
// key: 'customerName'
// },
{
label: '电话',
format ({ info }) {
return info.customerPhone ? info.customerPhone : '<div class="edit">填写客户手机号</div>'
},
click: true
},
{
label: '性别',
format ({ info }) {
return {
0: '性别未知',
1: '男',
2: '女'
}[info.customerSex]
}
},
{
label: '关联员工',
format (cell) {
let staffNameList = []
if (cell.staffFollows) cell.staffFollows.map(e => {
staffNameList.push(e.staffName)
})
return staffNameList.length ? staffNameList.join(';') : ''
}
}
],
show: false
}
},
activated() {
let { title, type, maxlength } = this.getParams()
document.title = `设置${title}`
this.type = type
if (maxlength) this.maxlength = maxlength
this.value = ''
activated () {
let { userInfo, show } = this.getParams()
this.userInfo = userInfo
this.show = show
},
methods: {
save() {
let { save_key, userId, type, vehicleInfo, detailObj, info } = this.getParams()
itemClick (e) {
if (this.userInfo.info.customerPhone) return
this.show = e
},
async save (action, done) {
console.log(action)
if (action == 'cancel') return done()
let { userId } = this.getParams()
let { value } = this
const phoneRex = /^[1]([3-9])[0-9]{9}$/
let obj = {
// customerSex: info.customerSex
}
if (type == 'tel') {
if (!phoneRex.test(value)) {
this.showToast('请输入正确的手机号')
return
}
} else {
obj.customerPhone = info.customerPhone
}
if (vehicleInfo) {
// Object.keys(vehicleInfo).map(i => {
// if (vehicleInfo[i]) {
// detailObj.map(k => {
// 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(vehicleInfo.vehicleNo) obj.carNumber = vehicleInfo.vehicleNo
if (!phoneRex.test(value)) {
this.showToast('请输入正确的手机号')
done(false)
return
}
let staffUserId = this.getLocalStorage('dj_scrm_userInfo').workUserId
entmicroApi
.editCustomer({
try {
this.showLoading('更新中...')
const res = await entmicroApi.editCustomer({
staffUserId,
userId,
[save_key]: `${value}`,
...obj
})
.then(res => {
window.$back = true
this.$router.back(-1)
customerPhone: value,
})
window.$back = true
this.$router.back(-1)
} catch (error) {
this.showToast(error)
}
}
}
}
</script>
<style lang="scss" scope>
.edit-wrapper {
position: relative;
width: 100%;
height: 100%;
}
.submit {
display: flex;
align-items: center;
justify-content: center;
position: absolute;
bottom: 16px;
left: 50%;
transform: translateX(-50%);
width: 343px;
height: 42px;
background-color: #3975c6;
border-radius: 21px;
font-size: 14px;
color: #fff;
.layout {
padding: 10px 16px;
.box {
background: #ffffff;
box-shadow: 0 4px 8px 0 #e0e0e080;
border-radius: 4px;
.item {
padding: 5px 16px;
min-height: 59px;
border-bottom: 0.5px solid rgba(195, 195, 195, 0.3);
font-size: 14px;
color: #333333;
line-height: 20px;
box-sizing: border-box;
.label {
flex-shrink: 0;
margin-right: 10px;
}
.value {
margin-left: auto;
text-align: right;
img {
width: 48px;
height: 48px;
border-radius: 8px;
}
.edit {
color: #3975c6;
}
}
&:last-of-type {
border-bottom: none;
}
}
}
.input {
width: 266px;
height: 44px;
background: #f2f2f2;
border: 1px solid #e2e2e2;
border-radius: 4px;
margin: 24px auto;
.van-cell {
background-color: transparent;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="layout">
<template v-if="flag">
<div class="tab-box">
<template v-for="(i,index) in tab">
<template>
<div
:key="index"
:class="['tab-item',{'active':tabIndex == index}]"
@click="changeType(index)"
>
{{ i }}
</div>
</template>
</template>
</div>
<van-search
v-model="keyword"
shape="round"
placeholder="输入关键词搜索"
@search="onEmit($event)"
@clear="onEmit('')"
@blur="onEmit(keyword)"
/>
<div class="tags-view">
<template v-for="(i,index) in tagList[tabIndex]">
<template v-if="i.show">
<div
:key="index"
class="tags-box"
>
<div class="tags-title">{{ i.groupName }}</div>
<div class="tags-list">
<template v-for="(k,ind) in i.labelList">
<template v-if="k.show">
<button
:class="['tags-item text-center',{'active':labelIds.includes(k.id)}]"
:key="ind"
@click="chooseTag(k.id)"
:disabled="i.disabled"
>
{{ k.name }}
</button>
</template>
</template>
</div>
</div>
</template>
</template>
</div>
<div class="tags-buttons flex">
<div
class="reset"
@click="reset"
>重置</div>
<van-button
block
round
class="tags-btn cancel"
@click="$router.back()"
>取消</van-button>
<van-button
block
round
color="#3975C6"
class="tags-btn"
@click="confirm"
>保存</van-button>
</div>
</template>
</div>
</template>
<script type='text/ecmascript-6'>
import { datahubApi, groupTag } from '@/api'
export default {
name: '',
data () {
return {
flag: false,
keyword: '',
labelIds: [],
tab: [],
tagList: [],
tabIndex: 0,
}
},
activated(){
this.getTagList()
},
mounted () {
},
methods: {
async getTagList () {
this.showLoading()
/**merchantModel 1集团 2自店 */
const { merchantModel, merchantId } = this.getLocalStorage('dj_scrm_userInfo'),
{ labelTreeRets } = await datahubApi.getTagsList({
shopId: merchantId,
edition: merchantModel
}), tab = [],
// 1 企业标签 2 自店标签 3 系统标签
arr = [[], [], []],
tagList = []
labelTreeRets.map(e => {
e.labelList.map(k => k.show = true)
arr[{
'企业标签': '0',
'自店标签': '1',
'系统标签': '2',
}[e.labelType]].push({
groupName: e.labelGroup.name,
labelList: e.labelList,
show: true,
disabled: e.labelType == '系统标签'
})
})
arr.map((e, index) => {
if (e.length) {
if (index == 0) tab.push(merchantModel == 1 ? '集团标签' : '企业标签')
if (index == 1) tab.push('自店标签')
if (index == 2) tab.push('系统标签')
tagList.push(e)
}
})
this.tagList = tagList
this.tab = tab
this.flag = true
this.reset()
this.hideLoading()
},
async confirm () {
let { userId, userInfo: { labels } } = this.getParams()
let { labelIds } = this,
labelIdAddList = JSON.parse(JSON.stringify(labelIds)),
labelIdDelList = []
labels.map(i => {
if (!labelIds.includes(String(i.labelId))) labelIdDelList.push(i.labelId)
})
for (let index = 0; index < labelIdAddList.length; index++) {
labels.map(e => {
if (e.labelId == labelIdAddList[index]) {
labelIdAddList.splice(index, 1)
}
})
}
try {
this.showLoading('更新中...')
const res = await groupTag.putCustomertag({
externalUserIds: userId,
labelIdAddList,
labelIdDelList
})
if (res) {
this.$route.params.delay = true
this.showToast('标签更新成功',()=>{
this.$router.back()
})
}
} catch (error) {
this.showToast(error)
}
},
reset () {
let { labels } = this.getParams().userInfo,
{ labelIds } = this
labelIds = []
labels.map(k => labelIds.push(String(k.labelId)))
this.labelIds = labelIds
},
changeType (tabIndex) {
this.tabIndex = tabIndex
},
onEmit (val) {
const { tagList, tabIndex } = this
tagList[tabIndex].map(e => {
e.show = !val
let name = [e.groupName]
e.labelList.map(i => {
i.show = !val
name.push(i.name)
if (i.name.indexOf(val) != -1) i.show = true
})
if (name.join('').indexOf(val) != -1) e.show = true
})
},
chooseTag (id) {
const { labelIds } = this,
tagIndex = labelIds.findIndex(e => e == id)
if (tagIndex == -1) labelIds.push(id)
else labelIds.splice(tagIndex, 1)
},
}
}
</script>
<style scoped lang='scss'>
.layout {
padding: 0;
.van-search {
padding: 8px 16px;
.van-cell {
padding: 6px 8px 6px 0;
}
}
.tab-box {
height: 56px;
background: #ffffff;
width: 100%;
display: flex;
align-items: center;
box-sizing: border-box;
margin-bottom: 6px;
.tab-item {
font-size: 14px;
color: #a9a9a9;
flex: 1;
text-align: center;
line-height: 56px;
}
.active {
font-weight: 500;
font-size: 16px;
color: #2c2c2c;
position: relative;
transition: all 0.25s;
&::after {
position: absolute;
left: 50%;
bottom: 0;
width: 40px;
height: 3px;
background: #3975c6;
content: '';
transform: translateX(-50%);
}
}
}
.tags-view {
height: calc(100vh - 170px - var(--constantSafeAreaInsetBottom));
height: calc(100vh - 170px - var(--envSafeAreaInsetBottom));
overflow-y: scroll;
padding: 8px 20px 25px;
box-sizing: border-box;
.tags-title {
font-weight: 500;
font-size: 14px;
color: #545454;
padding: 2px 0 10px;
}
.tags-box {
.tags-list {
display: flex;
flex-wrap: wrap;
.tags-item {
height: 28px;
background: #aaaaaa26;
border-radius: 14px;
padding: 0 10px;
color: #858585;
margin: 0 8px 8px 0;
border: none;
outline: none;
}
.active {
color: #3975c6;
background: #3975c626;
}
}
}
}
.tags-buttons {
width: 100%;
padding: 10px 16px calc(var(--constantSafeAreaInsetBottom) + 10px);
padding: 10px 16px calc(var(--envSafeAreaInsetBottom) + 10px);
box-sizing: border-box;
box-shadow: 0 -0.5px 0 0 #e9e9e9;
.reset {
font-size: 16px;
color: #999999;
padding: 0 14px;
}
.tags-btn {
width: 120px;
height: 36px;
background: #3975c6;
border-radius: 21px;
font-size: 14px;
margin-left: 10px;
}
.cancel {
color: #323233;
background: #ffffff;
margin-left: auto;
}
}
}
</style>
\ No newline at end of file
......@@ -243,7 +243,7 @@ export default {
externalUserIds: this.externalUserIds.join(','),
labelIdAddList: tagIds,
labelIdDelList: deletetagIds,
taggingInfo: 1111
// taggingInfo: 1111
}
console.log(obj)
groupTag.putCustomertag(obj).then(res => {
......
......@@ -51,7 +51,7 @@ const spritesmithFunction = data => {
return `${shared}\n${perSprite}`
}
module.exports = {
publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main-test/', // 署应用包时的基本 URL。 vue-router hash 模式使用
publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main-lwk/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-main/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: IS_PROD ? './' : '/dj-scrm-wx-work-attachment-customer/', // 署应用包时的基本 URL。 vue-router hash 模式使用
// publicPath: '/dj-scrm-wx-work-attachment-customer/', // 署应用包时的基本 URL。 vue-router history模式使用
......@@ -61,7 +61,7 @@ module.exports = {
productionSourceMap: false, // 如果不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
devServer: {
disableHostCheck: true,
port: 9527, // 端口
port: 9528, // 端口
open: false, // 启动后打开浏览器
overlay: {
// 当出现编译器错误或警告时,在浏览器中显示全屏覆盖层
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!