Commit 277850be by 王玉曼 Committed by Coding

Accept Merge Request #24: (dev-wangyuman-外链 -> vue3-master)

Merge Request: 代客下单

Created By: @王玉曼
Accepted By: @王玉曼
URL: https://linkwechat.coding.net/p/linkwechat-front/d/linkwechat/git/merge/24?initial=true
2 parents 5cf0ea52 98294072
import request from '@/utils/request' import request from '@/utils/request'
let getway = window.lwConfig.services.wecom let getway = window.lwConfig.services.wecom
const service = getway + '/customer' const service = getway + '/customer'
const order = getway + '/weSubstitute/customer/order'
/** /**
* 客户列表 * 客户列表
...@@ -280,3 +281,41 @@ export function findCustomerAddWay(params) { ...@@ -280,3 +281,41 @@ export function findCustomerAddWay(params) {
params, params,
}) })
} }
// 订单 - 订单状态
export function orderStatus(params) {
return request({
url: getway + '/substitute/customer/order/property/order/status',
params,
})
}
// 订单 - 订单列表
export function orderList(params) {
return request({
url: order,
params,
})
}
// 订单 - 详情
export function orderDetail(id) {
return request({
url: order + '/' + id,
})
}
// 移动端-全部字段信息
export function getProperties() {
return request({
url: getway + '/substitute/customer/order/property/properties',
})
}
// 获取与外部联系人会话列表
export function chatList(params) {
return request({
url: getway + '/chat/msg/selectFullSearchChatList',
params,
})
}
import request from '@/utils/request'
const base = window.lwConfig.services.wecom
const groundBase = window.lwConfig.services.wecom + '/substitute/customer/order'
// 2.0
// 分组list
export function getCodeCategoryList() {
return request({
url: groundBase + '/catalogue',
})
}
// 新增分组
export function addCodeCategory(data) {
return request({
url: groundBase + '/catalogue',
method: 'post',
data: data,
})
}
// 更新分组
export function updateCodeCategory(data) {
return request({
url: groundBase + '/catalogue',
method: 'put',
data: data,
})
}
// 删除分组
export function removeCodeCategory(id) {
return request({
url: groundBase + '/catalogue/' + id,
method: 'delete',
})
}
// 移动分组
export function moveCodeCategory(data) {
return request({
url: groundBase + '/catalogue/move',
method: 'put',
data: data,
})
}
// 列表
export function getList(params) {
return request({
url: groundBase + '/property',
params,
})
}
// 列表删除
export function remove(id) {
return request({
url: groundBase + '/property/' + id,
method: 'delete',
})
}
export function fnRemove(ids) {
return request({
url: groundBase + '/property',
method: 'delete',
params: { ids },
})
}
// 列表新增
export function add(data) {
return request({
url: groundBase + '/property',
method: 'post',
data,
})
}
// 列表修改
export function update(data) {
return request({
url: groundBase + '/property',
method: 'put',
data,
})
}
// 列表详情
export function getDetail(id) {
return request({
url: groundBase + '/property/' + id,
})
}
// 字段类型列表
export function getTypeList() {
return request({
url: groundBase + '/property/type',
})
}
// 列表修改
export function listMove(data) {
return request({
url: groundBase + '/property/move',
method: 'put',
data,
})
}
<template>
<div class="takecontent">
<ul>
<li v-for="(item, index) in data" :key="index">
<div :class="['mb10', queryChat.fromId === item.fromId && 'ar']">
<span :class="['', queryChat.fromId === item.fromId && 'fr']" style="color: #4e5969">{{
item.name
}}</span>
<span :style="{ color: item.action == 'send' ? '#86909C' : '#999', margin: '0 8px' }">
{{ item.msgTime }}
</span>
</div>
<div :class="['', queryChat.fromId === item.fromId && 'ar']">
<img
:class="['image', queryChat.fromId === item.fromId && 'fr']"
:src="item.avatar || '@/assets/image/profile.jpg'"
/>
<ChatContent :queryChat="queryChat" :message="item"></ChatContent>
</div>
</li>
</ul>
</div>
</template>
<script>
import ChatContent from '@/components/ChatContent'
export default {
components: {
ChatContent,
},
props: {
data: {
type: Array,
defluat: () => [],
},
queryChat: {
type: Object,
default: () => ({}),
},
},
mounted() {},
data() {
return {}
},
methods: {},
}
</script>
<style lang="scss" scoped>
.image {
width: 40px;
height: 40px;
vertical-align: top;
box-shadow: 0px 6px 8px 0px rgba(78, 89, 105, 0.3);
border-radius: 8px 8px 8px 8px;
border: 1px solid var(--border-white);
background: var(--bg-white);
}
.shabowbox {
position: fixed;
width: 100%;
height: 100%;
background: var(--bg-black-6);
left: 0;
top: 0;
z-index: 2000;
}
.shabowboxvidoe {
position: fixed;
width: 800px;
height: 475px;
left: 50%;
margin-left: -400px;
top: 50%;
margin-top: -235px;
z-index: 2001;
background: var(--bg-white);
}
.shabowboxaudio {
height: 125px;
padding: 12px;
}
.close {
position: fixed;
width: 50px;
height: 50px;
right: 10px;
z-index: 2012;
top: 10px;
text-align: center;
line-height: 50px;
font-size: 20px;
color: var(--font-white, #fff);
cursor: pointer;
font-size: 43px;
}
.takecontent {
border-radius: 3px;
background-color: var(--bg-black-9);
position: relative;
text-align: left;
height: 100%;
width: 100%;
overflow-y: scroll;
::-webkit-scrollbar {
display: none;
}
ul li {
padding: 10px;
}
}
</style>
<template>
<div class="chatListClassTab" v-loading="loading">
<!-- <el-date-picker
v-model="dateRange"
type="daterange"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
@change="getList(1)"
></el-date-picker> -->
<div class="list">
<template v-if="list.length">
<chatList
:queryChat="queryChat"
v-if="'all,image,video,link,'.includes(type)"
:data="list"
></chatList>
<el-table
v-else-if="type == 'file'"
:data="list"
stripe
style="width: 100%"
:header-cell-style="{ background: '#fff' }"
>
<!-- <el-table-column prop="msgtype" label="类型"> </el-table-column> -->
<el-table-column label="名称">
<template #default="{ row }">
{{ JSON.parse(row.contact).filename }}
</template>
</el-table-column>
<el-table-column label="大小">
<template #default="{ row }">
{{ filterSize(JSON.parse(row.contact).filesize) }}
</template>
</el-table-column>
<el-table-column label="来源">
<template #default="{ row }">
{{ row.name }}
</template>
</el-table-column>
<el-table-column prop="name" label="发送时间">
<template #default="{ row }">
{{ row.msgTime }}
</template>
</el-table-column>
<el-table-column prop="action" label="操作">
<template #default="{ row }">
<el-button text @click="downloadFile(row)">下载</el-button>
</template>
</el-table-column>
</el-table>
<el-table
v-else-if="'voice,meeting_voice_call'.includes(type)"
:data="list"
stripe
:header-cell-style="{ background: '#fff' }"
>
<el-table-column prop="date" label="发起人">
<template #default="{ row }">
{{ row.name }}
</template>
</el-table-column>
<el-table-column prop="name" label="通话时间">
<template #default="{ row }">
{{ row.msgTime }}
</template>
</el-table-column>
<el-table-column prop="address" label="时长" min-width="50">
<template #default="{ row }">
<span v-if="row.msgType == 'voice'">{{ JSON.parse(row.contact).play_length }}s</span>
<span v-else>
{{ setDate(JSON.parse(row.contact).endtime, row.msgTime) }}
</span>
</template>
</el-table-column>
<el-table-column prop="msgType" label="类型">
<template #default="{ row }">
{{ row.msgType === 'voice' ? '语音消息' : '语音通话' }}
</template>
</el-table-column>
<el-table-column prop="address" min-width="80" label="操作">
<template #default="{ row }">
<!-- <el-button
text
@click="voiceLook(JSON.parse(row.contact))"
>查看</el-button
> -->
<!-- <AudioPlayer
:audio-list="[JSON.parse(row.contact).attachment]"
ref="AudioPlayer"
/> -->
<voice :amrUrl="JSON.parse(row.contact)['attachment']"></voice>
<!-- <audio controls>
<source :src="JSON.parse(row.contact).attachment" type="audio/mpeg" />
</audio> -->
</template>
</el-table-column>
</el-table>
</template>
<el-empty v-else :image-size="100"></el-empty>
</div>
<el-pagination
v-if="total"
layout="prev, pager, next"
v-model:current-page="currentPage"
@current-change="getList"
:total="total"
/>
</div>
</template>
<script>
import chatList from './chatList.vue'
import * as api from '@/api/conversation/content.js'
import Voice from '@/components/Voice'
import { download } from '@/api/common.js'
import { diffDate } from '@/utils/index'
import { parseTime } from '@/utils/common'
export default {
name: '',
components: { chatList, Voice },
props: {
// 消息收发者
queryChat: {
type: Object,
default: () => ({}),
},
// 消息类型
type: {
type: [String, Number],
default: 0,
},
},
data() {
return {
loading: false,
currentPage: 1,
// dateRange: [],
list: [],
total: 0,
}
},
computed: {},
watch: {
queryChat() {
this.getList(1)
},
type() {
this.getList(1)
},
},
created() {
this.getList(1)
},
mounted() {},
methods: {
setDate(start, end) {
return diffDate(end, parseTime(start))
},
getList(page) {
// if (!this.queryChat.fromId) {
// return //没有选择人
// }
this.loading = true
console.log(this.type)
let query = {
msgType: this.type == 'all' ? '' : this.type,
pageSize: '10',
orderByColumn: 't.msg_time',
isAsc: 'desc',
}
// if (this.dateRange) {
// query.beginTime = this.dateRange[0]
// query.endTime = this.dateRange[1]
// } else {
// query.beginTime = ''
// query.endTime = ''
// }
page && (query.pageNum = this.currentPage = page)
Object.assign(query, this.queryChat)
api
.getChatList(query)
.then((res) => {
this.total = ~~res.total
this.list = res.rows
this.loading = false
})
.catch((err) => {
this.loading = false
})
},
filterSize(size) {
if (!size) return ''
if (size < pow1024(1)) return size + ' B'
if (size < pow1024(2)) return (size / pow1024(1)).toFixed(2) + ' KB'
if (size < pow1024(3)) return (size / pow1024(2)).toFixed(2) + ' MB'
if (size < pow1024(4)) return (size / pow1024(3)).toFixed(2) + ' GB'
return (size / pow1024(4)).toFixed(2) + ' TB'
function pow1024(num) {
return Math.pow(1024, num)
}
},
downloadFile(row) {
this.$confirm('是否确认下载该文件?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then((response) => {
this.downloadNet(JSON.parse(row.contact).attachment, JSON.parse(row.contact).filename)
})
.catch(function () {})
},
},
}
</script>
<style lang="scss" scoped>
.list {
height: calc(100vh - 370px);
margin-top: 10px;
background: var(--bg-white);
overflow-y: scroll;
border-bottom: 1px solid var(--border-black-10);
color: var(--font-black-6);
text-align: center;
::-webkit-scrollbar {
display: none;
}
}
.chatListClassTab {
padding: 10px 10px 0;
background: var(--bg-white);
text-align: left;
}
</style>
<template>
<div>
<el-dialog
title="订单详情"
v-model="dialogVisible"
width="30%"
v-if="dialogVisible"
:before-close="handleClose"
>
<div class="g-card" v-for="(item, index) in detailList" :key="index">
<div class="title">{{ item.name }}</div>
<div class="content">
<div class="content-item" v-for="(obj, i) in item.properties" :key="i">
<template v-if="obj.type !== 7">
<span>{{ obj.name }} :</span>
<span>{{ obj.actualValue }}</span>
</template>
<template v-else>
<!-- 附件 -->
<span>{{ obj.name }} :</span>
<template v-for="(item2, j) in dealValue(obj.actualValue)" :key="j">
<!-- 图片 -->
<el-image
:src="obj.actualValue"
fit="contain"
class="imgsize"
v-if="item2 && chargeType(item2)"
></el-image>
<!-- 文件/doc/xls/pdf -->
<a :href="obj.actualValue" v-else>{{ obj.actualValue }}</a>
</template>
</template>
</div>
</div>
</div>
<!-- <div class="g-card">
        <div class="title">商品信息</div>
      </div> -->
</el-dialog>
</div>
</template>
<script>
import { orderDetail, getProperties } from '@/api/customer'
export default {
data() {
return {
dialogVisible: false,
ruleForm: {},
detailList: [],
query: {},
}
},
props: {
visible: {
type: Boolean,
default: false,
},
id: {
type: String,
default: '',
},
},
watch: {
visible: {
handler(val) {
this.dialogVisible = val
if (!val) {
this.ruleForm = {}
} else {
this.getDetail(this.id)
this.getProperties()
}
},
},
},
created() {
// this.getDetail()
},
methods: {
dealValue(val) {
let url = []
if (val) {
url = val.split(',')
}
return url
},
chargeType(val) {
if (val) {
let url = val.split('.')
if (['jpg', 'jpeg', 'png'].includes(url[url.length - 1])) {
return true
} else {
return false
}
}
},
// 点击×按钮
handleClose() {
this.$emit('close', false)
},
//  获取全部属性
getProperties() {
getProperties().then((res) => {
console.log(res)
this.query = res.data
})
},
// 获取详情
getDetail(id) {
orderDetail(id).then((res) => {
console.log(res)
this.detailList = res.data
})
},
},
}
</script>
<style lang="scss" scoped>
.g-card {
.title {
font-size: 16px;
margin-bottom: 16px;
}
.content-item {
line-height: 34px;
}
}
.imgsize {
width: 120px;
height: 120px;
}
</style>
<script>
import { updateBirthday, getDetail, getSummary, getFollowUpRecord, getCustomerInfoByUserId } from '@/api/customer'
import { getList } from '@/api/salesCenter/businessConver.js'
import { dictAddType, dictJoinGroupType, dictTrackState } from '@/utils/dictionary'
import InfoTab from './customer/infoTab.vue'
export default {
name: 'CustomerDetail',
components: { InfoTab },
data() {
return {
datePickerVisible: false,
customer: {
// weFlowerCustomerRels: [{}]
},
birthday: '',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now()
},
},
dictAddType,
dictJoinGroupType,
dictTrackState,
active: 0,
// openedTabs: ['0'],
}
},
created() {
dictAddType.then((res) => (this.dictAddType = res))
this.getDetail()
this.getStage()
},
methods: {
getStage() {
getList().then((res) => {
this.stageList = res.data
})
},
setValue(data) {
let str = ''
this.stageList.forEach((dd) => {
if (dd.stageVal == data) {
str = dd.stageKey
}
})
return str
},
// updateBirthday() {
// if (!this.birthday || this.birthday == this.customer.birthday) {
// return
// }
// let data = {
// externalUserid: this.customer.externalUserid,
// birthday: this.birthday,
// firstUserId: this.customer.firstUserId
// }
// updateBirthday(data).then((response) => {
// this.msgSuccess('操作成功')
// // this.getDetail()
// this.customer['birthday'] = this.birthday
// // this.datePickerVisible = false
// })
// },
/**
*客户详情基础(基础信息+社交关系)
* @param {*}
* externalUserid 是 当前客户id
* userId 是 当前跟进人id
*/
getDetail() {
getDetail({ ...this.$route.query, delFlag: this.$route.query.isDelete ? 1 : 0 }).then(({ data }) => {
data.companyTags && (data.companyTags = data.companyTags.split(','))
this.customer = data
// if (data.trackUsers && data.trackUsers.length === 1) {
// this.openedTabs = [data.trackUsers[0].trackUserId]
// }
this.birthday = data.birthday
})
},
// changeTab(tab) {
// this.openedTabs.includes(tab.paneName) || this.openedTabs.push(tab.paneName)
// },
// remark(item) {
// return (
// item.remark ||
// this.customer.customerName + (item.remarkCorpName ? '-' + item.remarkCorpName : '')
// )
// }
},
}
</script>
<template>
<div>
<!-- <el-button slot="append" circle icon="el-icon-back" @click="$router.back()"></el-button>返回 -->
<div class="g-card flex aic mb20" @click="goRoute(customer)">
<el-image class="avatar" :src="customer.avatar" fit="fill"></el-image>
<div class="ml10">
<div>
{{ customer.customerName + (customer.corpName ? '-' + customer.corpName : '') }}
<el-icon-Avatar :class="['el-icon-Avatar', { 1: 'man', 2: 'woman' }[customer.gender]]" />
</div>
<div class="mt10">
<span :style="{ color: customer.customerType === 1 ? '#4bde03' : '#f9a90b' }">
{{ { 1: '@微信', 2: '@企业微信' }[customer.customerType] }}
</span>
</div>
<div class="mt10 gap10">
<template v-if="customer.tagNames">
<el-tag v-for="(unit, unique) in customer.tagNames.split(',')" :key="unique">
{{ unit }}
</el-tag>
</template>
<div v-else>暂无标签</div>
</div>
</div>
</div>
<div class="g-card">
<div class="g-card-title">社交关系</div>
<el-tabs model-value="1">
<el-tab-pane :label="`跟进员工(${customer.trackUsers ? customer.trackUsers.length : 0})`" name="1">
<el-table :data="customer.trackUsers">
<el-table-column label="员工" align="center" prop="userName" />
<el-table-column prop="addMethod" label="添加方式" align="center">
<template #default="{ row }">{{ dictAddType[row.addMethod + ''] }}</template>
</el-table-column>
<el-table-column label="添加时间" align="center" prop="firstAddTime" />
<el-table-column prop="trackState" label="商机阶段" align="center">
<template #default="{ row }">
<!-- <el-tag v-if="row.trackState" :type="dictTrackState[~~row.trackState + ''].color">
{{ dictTrackState[~~row.trackState + ''].name }}
</el-tag> -->
<el-tag v-if="row.trackState">
{{ setValue(row.trackState) }}
</el-tag>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane :label="`所在客群(${customer.groups ? customer.groups.length : 0})`" name="2">
<el-table :data="customer.groups">
<el-table-column label="群名" align="center" prop="groupName" />
<el-table-column label="群主" align="center" prop="leaderName" />
<el-table-column label="入群时间" align="center" prop="joinTime" />
<el-table-column prop="joinScene" label="入群方式" align="center">
<template #default="{ row }">{{ dictJoinGroupType[row.joinScene + ''] }}</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
<div class="g-card">
<div class="g-card-title">客户画像</div>
<el-tabs model-value="0">
<el-tab-pane v-if="customer.trackUsers && customer.trackUsers.length > 1" label="客户画像汇总" lazy data-id="0">
<info-tab :stageList="stageList" :trackUsers="customer.trackUsers"></info-tab>
</el-tab-pane>
<el-tab-pane
v-for="(item, index) of customer.trackUsers"
:key="index"
:label="item.userName"
lazy
:data-id="item.trackUserId">
<info-tab :stageList="stageList" :userId="item.trackUserId"></info-tab>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<style lang="scss" scoped>
.avatar {
width: 80px;
height: 80px;
border-radius: var(--border-radius-big);
flex: none;
}
.info-wrap {
margin-left: 20px;
.info {
color: var(--font-black-7);
line-height: 32px;
}
}
.el-icon-s-custom {
font-size: 16px;
margin-left: 4px;
color: var(--font-black-6);
&.man {
color: #13a2e8;
}
&.woman {
color: #f753b2;
}
}
.g-card-title {
margin-bottom: 5px;
}
</style>
<script> <script>
import { updateBirthday, getDetail, getSummary, getFollowUpRecord, getCustomerInfoByUserId } from '@/api/customer' import {
updateBirthday,
getDetail,
getSummary,
getFollowUpRecord,
getCustomerInfoByUserId,
} from '@/api/customer'
import { getList } from '@/api/salesCenter/businessConver.js' import { getList } from '@/api/salesCenter/businessConver.js'
import { dictAddType, dictJoinGroupType, dictTrackState } from '@/utils/dictionary' import { dictAddType, dictJoinGroupType, dictTrackState } from '@/utils/dictionary'
import InfoTab from './customer/infoTab.vue' import InfoTab from './customer/infoTab.vue'
import record from './customer/record'
export default { export default {
name: 'CustomerDetail', name: 'CustomerDetail',
components: { InfoTab }, components: { InfoTab, record },
data() { data() {
return { return {
datePickerVisible: false, datePickerVisible: false,
...@@ -24,8 +31,17 @@ export default { ...@@ -24,8 +31,17 @@ export default {
dictJoinGroupType, dictJoinGroupType,
dictTrackState, dictTrackState,
active: 0, active: '0',
// openedTabs: ['0'], // openedTabs: ['0'],
lastSyncTime: null,
openTrack: ['0'],
trajectoryType: {
0: '全部',
1: '客户动态',
2: '员工动态',
3: '互动动态',
4: '商机阶段',
},
} }
}, },
created() { created() {
...@@ -71,7 +87,8 @@ export default { ...@@ -71,7 +87,8 @@ export default {
* userId 是 当前跟进人id * userId 是 当前跟进人id
*/ */
getDetail() { getDetail() {
getDetail({ ...this.$route.query, delFlag: this.$route.query.isDelete ? 1 : 0 }).then(({ data }) => { getDetail({ ...this.$route.query, delFlag: this.$route.query.isDelete ? 1 : 0 }).then(
({ data }) => {
data.companyTags && (data.companyTags = data.companyTags.split(',')) data.companyTags && (data.companyTags = data.companyTags.split(','))
this.customer = data this.customer = data
...@@ -79,7 +96,8 @@ export default { ...@@ -79,7 +96,8 @@ export default {
// this.openedTabs = [data.trackUsers[0].trackUserId] // this.openedTabs = [data.trackUsers[0].trackUserId]
// } // }
this.birthday = data.birthday this.birthday = data.birthday
}) }
)
}, },
// changeTab(tab) { // changeTab(tab) {
// this.openedTabs.includes(tab.paneName) || this.openedTabs.push(tab.paneName) // this.openedTabs.includes(tab.paneName) || this.openedTabs.push(tab.paneName)
...@@ -91,6 +109,11 @@ export default { ...@@ -91,6 +109,11 @@ export default {
// this.customer.customerName + (item.remarkCorpName ? '-' + item.remarkCorpName : '') // this.customer.customerName + (item.remarkCorpName ? '-' + item.remarkCorpName : '')
// ) // )
// } // }
changeTrack(type) {
console.log(114, type)
this.openTrack.includes(type) || this.openTrack.push(type)
this.active = type
},
}, },
} }
</script> </script>
...@@ -121,11 +144,15 @@ export default { ...@@ -121,11 +144,15 @@ export default {
</div> </div>
</div> </div>
</div> </div>
<div class="flex">
<div style="width: calc(100% - 425px); padding-right: var(--card-margin)">
<div class="g-card"> <div class="g-card">
<div class="g-card-title">社交关系</div> <div class="g-card-title">社交关系</div>
<el-tabs model-value="1"> <el-tabs model-value="1">
<el-tab-pane :label="`跟进员工(${customer.trackUsers ? customer.trackUsers.length : 0})`" name="1"> <el-tab-pane
:label="`跟进员工(${customer.trackUsers ? customer.trackUsers.length : 0})`"
name="1"
>
<el-table :data="customer.trackUsers"> <el-table :data="customer.trackUsers">
<el-table-column label="员工" align="center" prop="userName" /> <el-table-column label="员工" align="center" prop="userName" />
<el-table-column prop="addMethod" label="添加方式" align="center"> <el-table-column prop="addMethod" label="添加方式" align="center">
...@@ -144,13 +171,18 @@ export default { ...@@ -144,13 +171,18 @@ export default {
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="`所在客群(${customer.groups ? customer.groups.length : 0})`" name="2"> <el-tab-pane
:label="`所在客群(${customer.groups ? customer.groups.length : 0})`"
name="2"
>
<el-table :data="customer.groups"> <el-table :data="customer.groups">
<el-table-column label="群名" align="center" prop="groupName" /> <el-table-column label="群名" align="center" prop="groupName" />
<el-table-column label="群主" align="center" prop="leaderName" /> <el-table-column label="群主" align="center" prop="leaderName" />
<el-table-column label="入群时间" align="center" prop="joinTime" /> <el-table-column label="入群时间" align="center" prop="joinTime" />
<el-table-column prop="joinScene" label="入群方式" align="center"> <el-table-column prop="joinScene" label="入群方式" align="center">
<template #default="{ row }">{{ dictJoinGroupType[row.joinScene + ''] }}</template> <template #default="{ row }">{{
dictJoinGroupType[row.joinScene + '']
}}</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-tab-pane> </el-tab-pane>
...@@ -160,20 +192,71 @@ export default { ...@@ -160,20 +192,71 @@ export default {
<div class="g-card"> <div class="g-card">
<div class="g-card-title">客户画像</div> <div class="g-card-title">客户画像</div>
<el-tabs model-value="0"> <el-tabs model-value="0">
<el-tab-pane v-if="customer.trackUsers && customer.trackUsers.length > 1" label="客户画像汇总" lazy data-id="0"> <!-- <el-tab-pane
v-if="customer.trackUsers && customer.trackUsers.length > 1"
label="客户画像汇总"
lazy
data-id="0"
>
<info-tab :stageList="stageList" :trackUsers="customer.trackUsers"></info-tab> <info-tab :stageList="stageList" :trackUsers="customer.trackUsers"></info-tab>
</el-tab-pane> </el-tab-pane> -->
<el-tab-pane <el-tab-pane
v-for="(item, index) of customer.trackUsers" v-for="(item, index) of customer.trackUsers"
:key="index" :key="index"
:label="item.userName" :label="item.userName"
lazy lazy
:data-id="item.trackUserId"> :data-id="item.trackUserId"
>
<info-tab :stageList="stageList" :userId="item.trackUserId"></info-tab> <info-tab :stageList="stageList" :userId="item.trackUserId"></info-tab>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</div> </div>
<div style="width: 425px; margin-top: 0">
<el-card>
<template #header>
<div class="fcbw">
<span class="card-title" @click="sync">客户轨迹</span>
<ButtonSync class="btn-sync" :lastSyncTime="lastSyncTime" @click="sync"
>同步</ButtonSync
>
</div>
</template>
<div class="flex track-tab-wrap mb15">
<!-- <div
v-for="(value, type) of trajectoryType"
:key="type"
:class="['track-tab', type == active && 'active']"
@click="changeTrack(type)"
>
{{ value }}
{{ type }}
</div> -->
<el-select v-model="active" placeholder="请选择" @change="changeTrack">
<el-option
v-for="(value, type) of trajectoryType"
:key="type"
:label="value"
:value="type"
>
</el-option>
</el-select>
</div>
<template v-for="(item, index) in openTrack" :key="index">
<record
ref="record"
v-show="item === active"
v-if="customer.trackUsers"
:userId="userId"
:userIdAll="customer.trackUsers.map((e) => e.trackUserId).join()"
v-model:lastSyncTime="lastSyncTime"
:trajectoryType="item == 0 ? null : item"
></record>
</template>
</el-card>
</div>
</div>
</div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -205,4 +288,19 @@ export default { ...@@ -205,4 +288,19 @@ export default {
.g-card-title { .g-card-title {
margin-bottom: 5px; margin-bottom: 5px;
} }
.track-tab-wrap {
.track-tab {
background: var(--bg-black-8);
border-radius: 50px;
padding: 5px 10px;
cursor: pointer;
& + .track-tab {
margin-left: 10px;
}
&.active {
background: var(--color);
color: var(--font-white, #fff);
}
}
}
</style> </style>
<template> <template>
<div> <div>
<el-form-item :label="lableOne" required style="margin-right: 200px !important;" :error="templateInfo"> <el-form-item
<div v-if="showModle" style="margin-bottom: 10px;"> :label="lableOne"
required
style="margin-right: 200px !important"
:error="templateInfo"
>
<div v-if="showModle" style="margin-bottom: 10px">
<el-button type="primary" @click="welcomVisible = true">从模板库中选择</el-button> <el-button type="primary" @click="welcomVisible = true">从模板库中选择</el-button>
</div> </div>
<TextareaExtend <TextareaExtend
...@@ -19,7 +24,11 @@ ...@@ -19,7 +24,11 @@
<template #label> <template #label>
<div class="title" v-if="otherType !== 3"> <div class="title" v-if="otherType !== 3">
{{ titleTwo }} {{ titleTwo }}
<el-popover trigger="hover" :content="'最多添加' + maxlength + '个素材'" placement="top-start"> <el-popover
trigger="hover"
:content="'最多添加' + maxlength + '个素材'"
placement="top-start"
>
<template #reference> <template #reference>
<el-icon-QuestionFilled class="el-icon-QuestionFilled"></el-icon-QuestionFilled> <el-icon-QuestionFilled class="el-icon-QuestionFilled"></el-icon-QuestionFilled>
</template> </template>
...@@ -28,10 +37,18 @@ ...@@ -28,10 +37,18 @@
</template> </template>
<div> <div>
<div> <div>
<div style="text-align: left;" class="flex"> <div style="text-align: left" class="flex">
<el-popover <el-popover
trigger="hover" trigger="hover"
:content="'最多添加' + maxlength + '个' + fontType + ',如需修改请删除已有' + fontType + '后重新尝试'" :content="
'最多添加' +
maxlength +
'个' +
fontType +
',如需修改请删除已有' +
fontType +
'后重新尝试'
"
placement="top-start" placement="top-start"
:disabled="talkList.length < maxlength" :disabled="talkList.length < maxlength"
> >
...@@ -74,7 +91,15 @@ ...@@ -74,7 +91,15 @@
</el-popover> </el-popover>
<el-popover <el-popover
trigger="hover" trigger="hover"
:content="'最多添加' + maxlength + '个' + fontType + ',如需修改请删除已有' + fontType + '后重新尝试'" :content="
'最多添加' +
maxlength +
'个' +
fontType +
',如需修改请删除已有' +
fontType +
'后重新尝试'
"
placement="top-start" placement="top-start"
:disabled="talkList.length < maxlength" :disabled="talkList.length < maxlength"
> >
...@@ -94,8 +119,13 @@ ...@@ -94,8 +119,13 @@
</div> </div>
</el-form-item> </el-form-item>
<div style="margin-top: 10px; margin-left: 150px;" v-show="talkList.length"> <div style="margin-top: 10px; margin-left: 150px" v-show="talkList.length">
<DragTable :tableData2="talkList" @setData="setData" @getEdit="getEdit" :dargAble="[2].includes(moduleType)" /> <DragTable
:tableData2="talkList"
@setData="setData"
@getEdit="getEdit"
:dargAble="[2].includes(moduleType)"
/>
</div> </div>
<!-- <el-col :span="8" class="g-card" style="margin-top: 20px; padding: 20px;" v-if="showPhone"> <!-- <el-col :span="8" class="g-card" style="margin-top: 20px; padding: 20px;" v-if="showPhone">
<PreviewInPhone :list="talkList" :templateInfo="talkForm.templateInfo" :liveUrl="liveUrl" /> <PreviewInPhone :list="talkList" :templateInfo="talkForm.templateInfo" :liveUrl="liveUrl" />
...@@ -148,17 +178,17 @@ ...@@ -148,17 +178,17 @@
</template> </template>
<script> <script>
import PreviewInPhone from '@/components/ContentCenter/PreviewInPhone' import PreviewInPhone from '@/components/ContentCenter/PreviewInPhone'
import { getTree } from '@/api/material' import { getTree } from '@/api/material'
import { lexicalAdd, lexicalDetail } from '@/api/contentCenter/scriptCenter' import { lexicalAdd, lexicalDetail } from '@/api/contentCenter/scriptCenter'
import { templateAdd, templateDetail } from '@/api/contentCenter/modleCenter' import { templateAdd, templateDetail } from '@/api/contentCenter/modleCenter'
import DragTable from '@/components/DragTable' import DragTable from '@/components/DragTable'
import MaterialCenter from '@/components/ContentCenter/MaterialCenter' import MaterialCenter from '@/components/ContentCenter/MaterialCenter'
import { string } from 'clipboard' import { string } from 'clipboard'
import { getPosterInfo } from '@/api/material/poster' import { getPosterInfo } from '@/api/material/poster'
import TemplateLibrary from '@/components/ContentCenter/TemplateLibrary' import TemplateLibrary from '@/components/ContentCenter/TemplateLibrary'
import MessageContentForm from '@/components/MessageContentForm' import MessageContentForm from '@/components/MessageContentForm'
export default { export default {
name: 'add-material', name: 'add-material',
components: { components: {
PreviewInPhone, PreviewInPhone,
...@@ -166,7 +196,7 @@ ...@@ -166,7 +196,7 @@
MaterialCenter, MaterialCenter,
getPosterInfo, getPosterInfo,
TemplateLibrary, TemplateLibrary,
MessageContentForm MessageContentForm,
}, },
data() { data() {
return { return {
...@@ -186,22 +216,22 @@ ...@@ -186,22 +216,22 @@
children: 'children', children: 'children',
label: 'name', label: 'name',
value: 'id', value: 'id',
emitPath: false emitPath: false,
}, },
mobForm: { mobForm: {
welcomeMsg: '', welcomeMsg: '',
materialMsgList: [], materialMsgList: [],
userIds: '', userIds: '',
userNames: '' userNames: '',
}, },
form: { form: {
weMaterialImgAoList: [] weMaterialImgAoList: [],
}, },
talkForm: {}, // 话术表单 talkForm: {}, // 话术表单
treeData: [{}], // 树 treeData: [{}], // 树
talkRules: Object.freeze({ talkRules: Object.freeze({
categoryId: [{ required: true, message: '不能为空', trigger: 'change' }], categoryId: [{ required: true, message: '不能为空', trigger: 'change' }],
talkTitle: [{ required: true, message: '不能为空', trigger: 'blur' }] talkTitle: [{ required: true, message: '不能为空', trigger: 'blur' }],
}), }),
type: undefined, type: undefined,
dialogVisible: false, // 新建素材表格对话框显隐 dialogVisible: false, // 新建素材表格对话框显隐
...@@ -214,7 +244,7 @@ ...@@ -214,7 +244,7 @@
welcomVisible: false, welcomVisible: false,
fontType: '', fontType: '',
maxlength: 9, maxlength: 9,
libraryLoading: false libraryLoading: false,
} }
}, },
props: { props: {
...@@ -223,88 +253,88 @@ ...@@ -223,88 +253,88 @@
default: () => { default: () => {
return { return {
templateInfo: '', templateInfo: '',
attachments: [] attachments: [],
}
} }
}, },
},
// 最多上传的素材数 // 最多上传的素材数
maxlengthTwo: { maxlengthTwo: {
type: Number, type: Number,
default: 9 default: 9,
}, },
// 查询会话详情的id // 查询会话详情的id
talkId: { talkId: {
type: string, type: string,
default: null default: null,
}, },
// 查询模板中心详情的id // 查询模板中心详情的id
modelId: { modelId: {
type: string, type: string,
default: null default: null,
}, },
// 话术类形 0企业话术1客服话术 // 话术类形 0企业话术1客服话术
talkType: { talkType: {
type: string, type: string,
default: null default: null,
}, },
// 1欢迎语 2群发 3sop // 1欢迎语 2群发 3sop
templateType: { templateType: {
type: Number, type: Number,
default: 1 default: 1,
}, },
// 1:活码欢迎语;2:员工欢迎语;3:入群欢迎语 // 1:活码欢迎语;2:员工欢迎语;3:入群欢迎语
tplType: { tplType: {
type: String, type: String,
default: null default: null,
}, },
// 模块类型 1:素材;2:话术;3:模板;4:其他模块 // 模块类型 1:素材;2:话术;3:模板;4:其他模块
moduleType: { moduleType: {
type: Number, type: Number,
default: 4 default: 4,
}, },
// 是否为欢迎语模板 // 是否为欢迎语模板
iswelcom: { iswelcom: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
// 是否显示模板库 // 是否显示模板库
showModle: { showModle: {
type: Boolean, type: Boolean,
default: true default: true,
}, },
// 1.员工活码;2:企微营销;3:企业动态;4:门店活码 // 1.员工活码;2:企微营销;3:企业动态;4:门店活码
otherType: { otherType: {
type: Number, type: Number,
default: null default: null,
}, },
// 是否显示手机 // 是否显示手机
showPhone: { showPhone: {
type: Boolean, type: Boolean,
default: true default: true,
}, },
// 直播链接 // 直播链接
liveUrl: { liveUrl: {
type: String, type: String,
default: null default: null,
}, },
// 是否显示提交取消按钮 // 是否显示提交取消按钮
showFooter: { showFooter: {
type: Boolean, type: Boolean,
default: true default: true,
} },
}, },
watch: { watch: {
talkForm: { talkForm: {
handler(val) { handler(val) {
this.changeInfo(val.templateInfo) this.changeInfo(val.templateInfo)
}, },
deep: true deep: true,
}, },
maxlengthTwo: { maxlengthTwo: {
handler(val) { handler(val) {
this.maxlength = val this.maxlength = val
}, },
immediate: true immediate: true,
}, },
baseData(val) { baseData(val) {
if (val.templateInfo) { if (val.templateInfo) {
...@@ -324,7 +354,7 @@ ...@@ -324,7 +354,7 @@
this.getDeatil(val) this.getDeatil(val)
} }
}, },
immediate: true immediate: true,
}, },
modelId: { modelId: {
handler(val) { handler(val) {
...@@ -332,8 +362,8 @@ ...@@ -332,8 +362,8 @@
this.getTelDeatil(val) this.getTelDeatil(val)
} }
}, },
immediate: true immediate: true,
} },
}, },
methods: { methods: {
changeInfo(val) { changeInfo(val) {
...@@ -492,7 +522,7 @@ ...@@ -492,7 +522,7 @@
arr = this.talkForm.userIds.split(',').map((dd, index) => { arr = this.talkForm.userIds.split(',').map((dd, index) => {
return { return {
userId: dd, userId: dd,
name: this.talkForm.userNames.split(',')[index] name: this.talkForm.userNames.split(',')[index],
} }
}) })
} }
...@@ -505,7 +535,7 @@ ...@@ -505,7 +535,7 @@
arr = this.talkForm.userIds.split(',').map((dd, index) => { arr = this.talkForm.userIds.split(',').map((dd, index) => {
return { return {
userId: dd, userId: dd,
name: this.talkForm.userNames.split(',')[index] name: this.talkForm.userNames.split(',')[index],
} }
}) })
} }
...@@ -520,7 +550,7 @@ ...@@ -520,7 +550,7 @@
names.push(d.name) names.push(d.name)
return { return {
userId: d.userId, userId: d.userId,
name: d.name name: d.name,
} }
}) })
this.users = selectedUserList this.users = selectedUserList
...@@ -599,8 +629,8 @@ ...@@ -599,8 +629,8 @@
parentId: '0', parentId: '0',
hasParent: false, hasParent: false,
hasChildren: true, hasChildren: true,
children: data || [] children: data || [],
} },
] ]
}) })
}, },
...@@ -809,7 +839,7 @@ ...@@ -809,7 +839,7 @@
this.dealOtherModleType(talkForm) this.dealOtherModleType(talkForm)
} }
this.$emit('update', talkForm) this.$emit('update', talkForm)
} },
}, },
mounted() { mounted() {
if (this.$route.query.categoryId) { if (this.$route.query.categoryId) {
...@@ -835,12 +865,12 @@ ...@@ -835,12 +865,12 @@
} else { } else {
this.fontType = '素材' this.fontType = '素材'
} }
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .ql-editor { ::v-deep .ql-editor {
min-height: 200px; min-height: 200px;
.ql-container { .ql-container {
.ql-snow { .ql-snow {
...@@ -849,31 +879,31 @@ ...@@ -849,31 +879,31 @@
} }
} }
} }
} }
::v-deep .el-button.is-disabled { ::v-deep .el-button.is-disabled {
color: var(--font-white, #fff); color: var(--font-white, #fff);
background-color: var(--bg-black-8); background-color: var(--bg-black-8);
border-color: var(--border-black-8); border-color: var(--border-black-8);
} }
::v-deep.el-dropdown [disabled] { ::v-deep.el-dropdown [disabled] {
color: var(--font-white, #fff); color: var(--font-white, #fff);
background-color: var(--bg-black-8); background-color: var(--bg-black-8);
border-color: var(--border-black-8); border-color: var(--border-black-8);
} }
.footer { .footer {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.footerColor { .footerColor {
font-weight: 500; font-weight: 500;
font-size: 18px; font-size: 18px;
color: var(--color); color: var(--color);
margin: 0 4px; margin: 0 4px;
} }
.radius { .radius {
border-radius: 4px; border-radius: 4px;
} }
.boxClass { .boxClass {
padding: 20px 10px 0 0; padding: 20px 10px 0 0;
} }
</style> </style>
<template>
<div>
<!-- -->
<el-dialog
title="新建字段"
v-model="dialogVisible"
width="30%"
v-if="dialogVisible"
:before-close="handleClose"
>
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="120px"
class="demo-ruleForm"
>
<el-form-item label="字段名称:" prop="name">
<el-input
v-model="ruleForm.name"
placeholder="请输入字段名称"
maxlength="10"
show-word-limit
:disabled="ruleForm.fixed || id"
></el-input>
</el-form-item>
<el-form-item label="字段类型:" prop="type">
<el-select v-model="ruleForm.type" :disabled="ruleForm.fixed || id">
<el-option
:label="item.value"
:value="item.key"
v-for="(item, index) in typeList"
:key="index"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否是金额:" prop="money" v-if="ruleForm.type == 6">
<el-radio-group v-model="ruleForm.money">
<el-radio :label="1">是</el-radio>
<el-radio :label="0">否</el-radio>
</el-radio-group>
<div class="tips">金额需精确到小数点后两位</div>
</el-form-item>
<el-form-item label="是否精确到时间:" prop="toTime" v-if="ruleForm.type == 3">
<el-radio-group v-model="ruleForm.toTime">
<el-radio :label="1">是</el-radio>
<el-radio :label="0">否</el-radio>
</el-radio-group>
<div class="tips">金额需精确到小数点后两位</div>
</el-form-item>
<el-form-item
label="是否多选:"
prop="multipleChoice"
v-if="[2, 4, 5].includes(ruleForm.type)"
>
<el-radio-group v-model="ruleForm.multipleChoice">
<el-radio :label="1">是</el-radio>
<el-radio :label="0">否</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否支持多个:" prop="more" v-if="ruleForm.type == 7">
<el-radio-group v-model="ruleForm.more">
<el-radio :label="1">是</el-radio>
<el-radio :label="0">否</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否必填:" prop="required">
<el-radio-group v-model="ruleForm.required" :disabled="id">
<el-radio :label="1">是</el-radio>
<el-radio :label="0">否</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="字段说明:" prop="expound" v-if="[0, 1, 3, 6].includes(ruleForm.type)">
<el-input
v-model="ruleForm.expound"
placeholder="请输入字段说明"
maxlength="20"
show-word-limit
></el-input>
</el-form-item>
<el-form-item label="字段值:" prop="value" v-if="ruleForm.type == 2">
<el-input
v-model="ruleForm.value"
placeholder="请输入选项,多个选项用英文逗号隔开"
type="textarea"
:rows="4"
></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer fr">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="submit">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { add, update, getDetail, getTypeList } from '@/api/salesCenter/orderInfo'
export default {
props: {
visible: {
type: Boolean,
default: false,
},
catalogueId: {
type: String,
default: '',
},
editId: {
type: String,
default: '',
},
},
watch: {
visible: {
handler(data) {
this.dialogVisible = data
if (!data) {
this.ruleForm = {
type: 0,
money: 1,
required: 1,
multipleChoice: 0,
more: 0,
toTime: 0,
}
this.$refs['ruleForm'].resetFields()
this.id = 0
}
},
},
editId: {
handler(val) {
this.id = val
this.getDetail(val)
},
},
},
data() {
return {
dialogVisible: false,
ruleForm: {
type: 0,
money: 1,
required: 1,
multipleChoice: 0,
more: 0,
toTime: 0,
},
rules: {
name: [{ required: true, message: '请输入字段名称', trigger: 'blur' }],
type: [{ required: true, message: '请选择字段类型', trigger: 'change' }],
money: [{ required: true, message: '请选择', trigger: 'change' }],
required: [{ required: true, message: '请选择', trigger: 'change' }],
multipleChoice: [{ required: true, message: '请选择', trigger: 'change' }],
more: [{ required: true, message: '请选择', trigger: 'change' }],
toTime: [{ required: true, message: '请选择', trigger: 'change' }],
expound: [{ required: true, message: '请输入字段说明', trigger: 'blur' }],
value: [{ required: true, message: '请输入字段值', trigger: 'blur' }],
},
typeList: [],
id: undefined,
}
},
methods: {
getDetail(id) {
getDetail(id).then((res) => {
this.ruleForm = res.data
})
},
// 点击×按钮
handleClose() {
this.$emit('close', false)
},
cancel() {
this.dialogVisible = false
this.$emit('close', false)
},
submit() {
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
this.ruleForm.catalogueId = this.catalogueId
if (this.id) {
this.ruleForm.id = this.id
delete this.ruleForm.typeStr
}
;(this.id ? update : add)(this.ruleForm).then((res) => {
if (res.code === 200) {
this.msgSuccess(res.msg)
this.dialogVisible = false
this.$emit('close', true)
}
})
}
})
// this.dialogVisible = false
// this.$emit('close', false)
},
getTypeList() {
getTypeList().then((res) => {
this.typeList = []
let listKey = Object.keys(res.data)
listKey.forEach((item) => {
let obj = { key: +item, value: '' }
this.typeList.push(obj)
})
let listValue = Object.values(res.data)
listValue.forEach((item2, i) => {
this.typeList[i].value = item2
})
})
},
},
mounted() {
this.getTypeList()
},
}
</script>
<style lang="scss" scoped>
.tips {
color: #aaa;
font-size: 12px;
line-height: 30px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!