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 {
getSummary,
getFollowUpRecord,
getCustomerInfoByUserId,
getRecordList,
getFieldFn,
} from '@/api/customer'
import { dictTrackState } from '@/utils/dictionary'
import record from './record'
import RecordTable from './record-table'
export default {
name: '',
props: {
stageList: {
type: Array,
default: [],
},
// 当前跟进人id
userId: {
type: String,
default: '',
},
trackUsers: {
type: Array,
default: [],
},
},
components: {
record,
RecordTable,
},
data() {
return {
portrayalSum: { companyTags: [], personTags: [], trackStates: [], trackUsers: [] }, // 客户画像汇总
trajectoryType: {
0: '全部',
1: '客户动态',
2: '员工动态',
3: '互动动态',
4: '商机阶段',
},
recod: [],
active: '0',
openedTabs: ['0'],
openTrack: ['0'],
lastSyncTime: null,
dictTrackState,
fieldList: [],
stage: [],
}
},
computed: {},
watch: {
stageList: {
deep: true,
immediate: true,
handler(val) {
if (val) {
this.stage = val
}
},
},
},
created() {
this.userId ? this.getCustomerInfoByUserId() : this.getSummary()
},
mounted() {},
methods: {
setList(key) {
let order = 0
this.stage.forEach((dd, index) => {
if (dd.stageVal == key) {
order = index
}
})
return order + 1
},
setActive(key) {
let arr = this.stage.map((dd) => {
return dd.stageState == 2
})
return arr.length + 2
},
/**
*客户画像汇总
* @param {*}
* externalUserid 是 当前客户id
*/
getSummary() {
getSummary(this.$route.query).then(({ data }) => {
// {
// 'companyTags':[{ //企业标签
// 'userName':'',//添加人
// 'tagsNames':'',//标签名多个标签使用逗号隔开
// 'tagIds':''//多个标签id使用逗号隔开
// }],
// 'personTags':[{ //个人标签
// 'userName':'',//添加人
// 'tagsNames':'',//标签名多个标签使用逗号隔开
// 'tagIds':''//多个标签id使用逗号隔开
// }],
// 'trackStates':[{
// 'userName':'',//跟进人
// 'trackStateList':[{ //跟进状态列表
// 'trackState':'',//跟进状态
// 'trackTime':''//跟进时间
// }]
// }]
// }
this.portrayalSum = data
})
},
/**
*客户画像单个跟进人
*/
getCustomerInfoByUserId() {
getCustomerInfoByUserId({
externalUserid: this.$route.query.externalUserid,
weUserId: this.userId,
}).then(({ data }) => {
this.portrayalSum = data
getFieldFn({
externalUserId: this.$route.query.externalUserid,
weUserId: this.userId,
}).then((dd) => {
// this.fieldList = dd.data
this.setData(dd.data)
})
})
},
setData(data) {
let arr = data
arr.forEach((dd, index) => {
if (dd.isDefault == 0) {
let obj = this.getEditValue(dd)
let ff = { ...dd, ...obj }
arr[index] = ff
}
})
this.fieldList = arr
},
getEditValue(data) {
let obj = {
value: data.type !== 3 ? '' : data.typeSub == 1 ? '' : [],
}
this.portrayalSum.weCustomerInfoExpands &&
this.portrayalSum.weCustomerInfoExpands.forEach((dd, index) => {
if (dd.fieldTemplateId === data.id) {
// dd.id
if (dd.fieldCustomerInfoVal && dd.fieldCustomerInfoVal.length) {
if (data.type !== 3) {
obj.value = dd.fieldCustomerInfoVal[0].infoVal
} else {
obj.value = dd.fieldCustomerInfoVal.map((item) => {
return item.infoVal
})
if (data.typeSub == 1) {
obj.value = obj.value[0]
}
}
}
}
})
return obj
},
changeTab(tab) {
this.openedTabs.includes(tab.index) || this.openedTabs.push(tab.index)
},
changeTrack(type) {
this.openTrack.includes(type) || this.openTrack.push(type)
this.active = type
},
sync() {
this.$refs['record'][this.active].sync()
},
// 根据生日计算年龄
jsGetAge(strBirthday) {
if (!strBirthday) {
return '无'
}
let returnAge
let strBirthdayArr = strBirthday.split('-')
let birthYear = strBirthdayArr[0]
let birthMonth = strBirthdayArr[1]
let birthDay = strBirthdayArr[2]
let d = new Date()
let nowYear = d.getFullYear()
let nowMonth = d.getMonth() + 1
let nowDay = d.getDate()
if (nowYear == birthYear) {
returnAge = 0 //同年 则为0岁
} else {
let ageDiff = nowYear - birthYear //年之差
if (ageDiff > 0) {
if (nowMonth == birthMonth) {
let dayDiff = nowDay - birthDay //日之差
if (dayDiff < 0) {
returnAge = ageDiff - 1
} else {
returnAge = ageDiff
}
} else {
let monthDiff = nowMonth - birthMonth //月之差
if (monthDiff < 0) {
returnAge = ageDiff - 1
} else {
returnAge = ageDiff
}
}
} else {
returnAge = -1 //返回-1 表示出生日期输入错误 晚于今天
}
}
return returnAge //返回周岁年龄
},
},
}
</script>
<template>
<div>
<el-row :gutter="10">
<el-col :span="24">
<div class="left">
<el-card class="mb10" shadow="never">
<template #header><div class="card-title">企业标签</div></template>
<template v-if="portrayalSum.companyTags && portrayalSum.companyTags.length">
<div
v-for="(item, index) of portrayalSum.companyTags"
:key="index"
:class="['flex ait', index && 'mt20']"
>
<!-- 汇总的场景显示名字 -->
<template v-if="!userId">
<div class="name oe g-bg-lg">{{ item.userName }}</div>
</template>
<div v-if="item.tagNames" class="gap10">
<el-tag v-for="(unit, unique) in item.tagNames.split(',')" :key="unique">{{
unit
}}</el-tag>
</div>
<div v-else class="g-tip-color ac">暂无标签</div>
</div>
</template>
<div v-else class="g-tip-color ac">暂无标签</div>
</el-card>
<el-card class="mb10" shadow="never">
<template #header><div class="card-title">个人标签</div></template>
<template v-if="portrayalSum.personTags && portrayalSum.personTags.length">
<div
v-for="(item, index) of portrayalSum.personTags"
:key="index"
:class="['flex aic', index && 'mt20']"
>
<!-- 汇总的场景显示名字 -->
<template v-if="!userId">
<div class="name oe g-bg-lg">{{ item.userName }}</div>
</template>
<div v-if="item.tagNames" class="gap10">
<el-tag v-for="(unit, unique) in item.tagNames.split(',')" :key="unique">{{
unit
}}</el-tag>
</div>
<div v-else class="g-tip-color ac">暂无标签</div>
</div>
</template>
<div v-else class="g-tip-color ac">暂无标签</div>
</el-card>
<template v-if="userId">
<el-card class="mb10" shadow="never">
<template #header><div class="card-title">共同群聊</div></template>
<template v-if="portrayalSum.commonGroupChat">
<el-tag
type="info"
v-for="(unit, unique) in portrayalSum.commonGroupChat.split(',')"
:key="unique"
>
{{ unit }}
</el-tag>
</template>
<div v-else class="g-tip-color ac">暂无数据</div>
</el-card>
<el-card class="mb10" shadow="never">
<template #header><div class="card-title">详细资料</div></template>
<div style="max-height: 450px; overflow: hidden auto">
<el-row
:gutter="20"
type="type"
class="pad10"
justify="space-between"
style="flex-wrap: wrap"
>
<template v-for="(item, index) in fieldList" :key="index">
<template v-if="!['address', 'customerFullName'].includes(item.labelVal)">
<el-col :span="12" v-if="item.isDefault == 1">
<!-- <el-row class="baseinfo-row" v-if="item.labelVal == 'customerFullName'">
<!- 姓名 ->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.customerFullName || '无' }}</el-col>
</el-row> -->
<el-row class="baseinfo-row" v-if="item.labelVal == 'remarkMobiles'">
<!-- 手机号 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.phone || '无' }}</el-col>
</el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'age'">
<!-- 年龄 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ jsGetAge(portrayalSum.birthday) }}</el-col>
</el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'birthday'">
<!-- 生日 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.birthday || '无' }}</el-col>
</el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'email'">
<!-- 邮箱 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.email || '无' }}</el-col>
</el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'area'">
<!-- 地址 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.address || '无' }}</el-col>
</el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'qq'">
<!-- QQ -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.qq || '无' }}</el-col>
</el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'position'">
<!-- 职业 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.position || '无' }}</el-col>
</el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'remarkCorpName'">
<!-- 公司 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.corpName || '无' }}</el-col>
</el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'otherDescr'">
<!-- 其他描述 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.otherDescr || '无' }}</el-col>
</el-row>
</el-col>
<el-col :span="12" v-else>
<template v-if="item.type !== 3">
<el-row class="baseinfo-row">
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">
{{ item.value || '无' }}
</el-col>
</el-row>
</template>
<template v-else>
<template v-if="item.typeSub == 1">
<el-row class="baseinfo-row">
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">
{{ item.value || '无' }}
</el-col>
</el-row>
</template>
<template v-else>
<el-row class="baseinfo-row">
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">
{{ item.value.join(',') || '无' }}
</el-col>
</el-row>
</template>
</template>
</el-col>
</template>
</template>
</el-row>
</div>
</el-card>
</template>
<el-card class="mb10" shadow="never">
<template #header><div class="card-title">商机阶段</div></template>
<template v-if="trackUsers && trackUsers.length">
<div
v-for="(item, index) of trackUsers"
:key="index"
:class="['flex aic', index && 'mt20']"
>
<!-- 汇总的场景显示名字 -->
<template v-if="!userId">
<div class="name oe g-bg-lg">{{ item.userName }}</div>
</template>
<template v-if="item.trackState === 1">
<el-steps style="flex: auto" :active="1">
<el-step title="待跟进"></el-step>
</el-steps>
</template>
<template
v-else-if="
item.trackState === 3 || item.trackState === 4 || item.trackState === 5
"
>
<el-steps style="flex: auto" :active="setActive(item.trackState)">
<el-step title="待跟进"></el-step>
<template v-for="(data, or) in stage">
<el-step
:title="data.stageKey"
:key="or"
v-if="data.stageState == 2"
></el-step>
</template>
<template v-for="(data, or) in stage">
<el-step
:title="data.stageKey"
:key="or"
v-if="item.trackState == data.stageVal"
></el-step>
</template>
</el-steps>
</template>
<template v-else-if="item.trackState">
<el-steps style="flex: auto" :active="setList(item.trackState)">
<template v-for="(data, or) in stage">
<el-step
:title="data.stageKey"
:key="or"
v-if="setList(item.trackState) <= or + 1"
></el-step>
</template>
</el-steps>
</template>
<!-- </el-steps> -->
<!-- </template> -->
<div v-else class="g-tip-color ac">暂无数据</div>
</div>
</template>
<div v-else class="g-tip-color ac">暂无数据</div>
</el-card>
<el-card shadow="never">
<template #header><div class="card-title">跟进记录</div></template>
<!-- 单个人的场景 -->
<record-table v-if="userId" :stageList="stage" :userId="userId"></record-table>
<!-- 汇总的场景 -->
<el-tabs
v-else-if="trackUsers && trackUsers.length"
model-value="0"
@tab-click="changeTab"
>
<el-tab-pane v-for="(item, index) in trackUsers" :key="index" :label="item.userName">
<record-table
:stageList="stage"
v-if="openedTabs.includes(index + '')"
:userId="item.trackUserId"
></record-table>
</el-tab-pane>
</el-tabs>
<div v-else class="g-tip-color ac">暂无数据</div>
</el-card>
</div>
</el-col>
<!-- <el-col :span="10">
<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 }}
</div>
</div>
<template v-for="(item, index) in openTrack" :key="index">
<record
ref="record"
v-show="item === active"
:userId="userId"
:userIdAll="trackUsers.map((e) => e.trackUserId).join()"
v-model:lastSyncTime="lastSyncTime"
:trajectoryType="item == 0 ? null : item"
></record>
</template>
</el-card>
</el-col> -->
</el-row>
</div>
</template>
<style lang="scss" scoped>
.name {
width: 65px;
flex: none;
text-align: center;
line-height: 24px;
padding: 0 5px;
margin-right: 10px;
color: var(--font-white, #fff);
border-radius: var(--border-radius-small);
}
.el-card {
// .el-tag {
// margin-bottom: 5px;
// }
// .el-card {
// .el-tag {
// 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);
}
}
}
// .btn-sync {
// position: relative;
// float: right;
// top: -11px;
// }
.g-tip-color {
flex: auto;
}
.baseinfo-row {
position: relative;
padding-left: 10px;
line-height: 50px;
.el-col {
box-shadow: 0px 1px 0px 0px #f1f1f1;
&:first-child {
color: var(--font-black-6);
}
}
&::before {
content: '';
position: absolute;
top: 22.5px;
left: 0;
width: 5px;
height: 5px;
background: #76abf4;
border-radius: 50%;
}
> .el-col:last-child {
text-align: right;
}
}
}
</style>
<script> <script>
import { getSummary, getFollowUpRecord, getCustomerInfoByUserId, getRecordList, getFieldFn } from '@/api/customer' import {
getSummary,
getFollowUpRecord,
getCustomerInfoByUserId,
getRecordList,
getFieldFn,
orderDetail,
orderList,
orderStatus,
} from '@/api/customer'
import { dictTrackState } from '@/utils/dictionary' import { dictTrackState } from '@/utils/dictionary'
import record from './record' import record from './record'
import RecordTable from './record-table' import RecordTable from './record-table'
import Detail from './detail'
import chatListClassTab from './chatListClassTab.vue'
export default { export default {
name: '', name: '',
props: { props: {
...@@ -23,6 +34,8 @@ export default { ...@@ -23,6 +34,8 @@ export default {
components: { components: {
record, record,
RecordTable, RecordTable,
Detail,
chatListClassTab,
}, },
data() { data() {
return { return {
...@@ -42,6 +55,27 @@ export default { ...@@ -42,6 +55,27 @@ export default {
dictTrackState, dictTrackState,
fieldList: [], fieldList: [],
stage: [], stage: [],
activeName: 'first',
query: {
pageNum: 1,
pageSize: 10,
orderStatus: '',
},
orderStateList: [],
loading: false,
total: 0,
list: [],
visible: false,
orderId: undefined,
chatTab: [
{ checked: true, lable: '全部', type: 'all' },
{ checked: false, lable: '图片&视频', type: 'image,video' },
{ checked: false, lable: '文件', type: 'file' },
{ checked: false, lable: '链接', type: 'link' },
{ checked: false, lable: '语音', type: 'voice,meeting_voice_call' },
],
queryChat: {},
tabType: 'all',
} }
}, },
computed: {}, computed: {},
...@@ -58,9 +92,43 @@ export default { ...@@ -58,9 +92,43 @@ export default {
}, },
created() { created() {
this.userId ? this.getCustomerInfoByUserId() : this.getSummary() this.userId ? this.getCustomerInfoByUserId() : this.getSummary()
this.getOrderStatus()
this.getList()
this.getChatList()
}, },
mounted() {}, mounted() {},
methods: { methods: {
resetFn() {
;(this.query = {
pageNum: 1,
pageSize: 10,
orderStatus: '',
}),
this.getList()
},
search() {
this.query.pageNum = 1
this.getList()
},
getList() {
this.loading = true
this.query.userId = this.userId
orderList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = Number(total)
this.loading = false
})
.catch(() => {})
},
getOrderStatus() {
orderStatus().then((res) => {
this.orderStateList = res.data
})
},
getChatList() {
this.queryChat = { fromId: this.userId, toList: this.$route.query.externalUserid }
},
setList(key) { setList(key) {
let order = 0 let order = 0
this.stage.forEach((dd, index) => { this.stage.forEach((dd, index) => {
...@@ -109,15 +177,19 @@ export default { ...@@ -109,15 +177,19 @@ export default {
*客户画像单个跟进人 *客户画像单个跟进人
*/ */
getCustomerInfoByUserId() { getCustomerInfoByUserId() {
getCustomerInfoByUserId({ externalUserid: this.$route.query.externalUserid, weUserId: this.userId }).then( getCustomerInfoByUserId({
({ data }) => { externalUserid: this.$route.query.externalUserid,
this.portrayalSum = data weUserId: this.userId,
getFieldFn({ externalUserId: this.$route.query.externalUserid, weUserId: this.userId }).then((dd) => { }).then(({ data }) => {
// this.fieldList = dd.data this.portrayalSum = data
this.setData(dd.data) getFieldFn({
}) externalUserId: this.$route.query.externalUserid,
}, weUserId: this.userId,
) }).then((dd) => {
// this.fieldList = dd.data
this.setData(dd.data)
})
})
}, },
setData(data) { setData(data) {
let arr = data let arr = data
...@@ -205,6 +277,20 @@ export default { ...@@ -205,6 +277,20 @@ export default {
} }
return returnAge //返回周岁年龄 return returnAge //返回周岁年龄
}, },
getDetail(id) {
this.visible = true
this.orderId = id
},
chatTabClick(i, type) {
this.tabType = type
this.chatTab = this.chatTab.map((item, j) => {
item.checked = false
if (i === j) {
item.checked = true
}
return item
})
},
}, },
} }
</script> </script>
...@@ -212,125 +298,93 @@ export default { ...@@ -212,125 +298,93 @@ export default {
<template> <template>
<div> <div>
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="14"> <el-col :span="24">
<div class="left"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-card class="mb10" shadow="never"> <el-tab-pane label="资料" name="first">
<template #header><div class="card-title">企业标签</div></template> <template v-if="userId">
<template v-if="portrayalSum.companyTags && portrayalSum.companyTags.length"> <!-- <el-card class="mb10" shadow="never">
<div
v-for="(item, index) of portrayalSum.companyTags"
:key="index"
:class="['flex ait', index && 'mt20']">
<!-- 汇总的场景显示名字 -->
<template v-if="!userId">
<div class="name oe g-bg-lg">{{ item.userName }}</div>
</template>
<div v-if="item.tagNames" class="gap10">
<el-tag v-for="(unit, unique) in item.tagNames.split(',')" :key="unique">{{ unit }}</el-tag>
</div>
<div v-else class="g-tip-color ac">暂无标签</div>
</div>
</template>
<div v-else class="g-tip-color ac">暂无标签</div>
</el-card>
<el-card class="mb10" shadow="never">
<template #header><div class="card-title">个人标签</div></template>
<template v-if="portrayalSum.personTags && portrayalSum.personTags.length">
<div v-for="(item, index) of portrayalSum.personTags" :key="index" :class="['flex aic', index && 'mt20']">
<!-- 汇总的场景显示名字 -->
<template v-if="!userId">
<div class="name oe g-bg-lg">{{ item.userName }}</div>
</template>
<div v-if="item.tagNames" class="gap10">
<el-tag v-for="(unit, unique) in item.tagNames.split(',')" :key="unique">{{ unit }}</el-tag>
</div>
<div v-else class="g-tip-color ac">暂无标签</div>
</div>
</template>
<div v-else class="g-tip-color ac">暂无标签</div>
</el-card>
<template v-if="userId">
<el-card class="mb10" shadow="never">
<template #header><div class="card-title">共同群聊</div></template> <template #header><div class="card-title">共同群聊</div></template>
<template v-if="portrayalSum.commonGroupChat"> <template v-if="portrayalSum.commonGroupChat">
<el-tag type="info" v-for="(unit, unique) in portrayalSum.commonGroupChat.split(',')" :key="unique"> <el-tag
type="info"
v-for="(unit, unique) in portrayalSum.commonGroupChat.split(',')"
:key="unique"
>
{{ unit }} {{ unit }}
</el-tag> </el-tag>
</template> </template>
<div v-else class="g-tip-color ac">暂无数据</div> <div v-else class="g-tip-color ac">暂无数据</div>
</el-card> </el-card> -->
<el-card class="mb10" shadow="never"> <el-card class="mb10" shadow="never">
<template #header><div class="card-title">详细资料</div></template> <template #header><div class="card-title">详细资料</div></template>
<div style="max-height: 450px; overflow: hidden auto"> <div style="max-height: 450px; overflow: hidden auto">
<el-row :gutter="20" type="type" class="pad10" justify="space-between" style="flex-wrap: wrap"> <el-row
<template v-for="(item, index) in fieldList" :key="index"> :gutter="20"
<template v-if="!['address', 'customerFullName'].includes(item.labelVal)"> type="type"
<el-col :span="12" v-if="item.isDefault == 1"> class="pad10"
<!-- <el-row class="baseinfo-row" v-if="item.labelVal == 'customerFullName'"> justify="space-between"
style="flex-wrap: wrap"
>
<template v-for="(item, index) in fieldList" :key="index">
<template v-if="!['address', 'customerFullName'].includes(item.labelVal)">
<el-col :span="12" v-if="item.isDefault == 1">
<!-- <el-row class="baseinfo-row" v-if="item.labelVal == 'customerFullName'">
<!- 姓名 -> <!- 姓名 ->
<el-col :span="6">{{ item.labelName }}</el-col> <el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.customerFullName || '无' }}</el-col> <el-col :span="18">{{ portrayalSum.customerFullName || '无' }}</el-col>
</el-row> --> </el-row> -->
<el-row class="baseinfo-row" v-if="item.labelVal == 'remarkMobiles'"> <el-row class="baseinfo-row" v-if="item.labelVal == 'remarkMobiles'">
<!-- 手机号 --> <!-- 手机号 -->
<el-col :span="6">{{ item.labelName }}</el-col> <el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.phone || '无' }}</el-col> <el-col :span="18">{{ portrayalSum.phone || '无' }}</el-col>
</el-row> </el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'age'"> <el-row class="baseinfo-row" v-else-if="item.labelVal == 'age'">
<!-- 年龄 --> <!-- 年龄 -->
<el-col :span="6">{{ item.labelName }}</el-col> <el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ jsGetAge(portrayalSum.birthday) }}</el-col> <el-col :span="18">{{ jsGetAge(portrayalSum.birthday) }}</el-col>
</el-row> </el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'birthday'"> <el-row class="baseinfo-row" v-else-if="item.labelVal == 'birthday'">
<!-- 生日 --> <!-- 生日 -->
<el-col :span="6">{{ item.labelName }}</el-col> <el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.birthday || '无' }}</el-col> <el-col :span="18">{{ portrayalSum.birthday || '无' }}</el-col>
</el-row> </el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'email'"> <el-row class="baseinfo-row" v-else-if="item.labelVal == 'email'">
<!-- 邮箱 --> <!-- 邮箱 -->
<el-col :span="6">{{ item.labelName }}</el-col> <el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.email || '无' }}</el-col> <el-col :span="18">{{ portrayalSum.email || '无' }}</el-col>
</el-row> </el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'area'"> <el-row class="baseinfo-row" v-else-if="item.labelVal == 'area'">
<!-- 地址 --> <!-- 地址 -->
<el-col :span="6">{{ item.labelName }}</el-col> <el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.address || '无' }}</el-col> <el-col :span="18">{{ portrayalSum.address || '无' }}</el-col>
</el-row> </el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'qq'"> <el-row class="baseinfo-row" v-else-if="item.labelVal == 'qq'">
<!-- QQ --> <!-- QQ -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.qq || '无' }}</el-col>
</el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'position'">
<!-- 职业 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.position || '无' }}</el-col>
</el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'remarkCorpName'">
<!-- 公司 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.corpName || '无' }}</el-col>
</el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'otherDescr'">
<!-- 其他描述 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.otherDescr || '无' }}</el-col>
</el-row>
</el-col>
<el-col :span="12" v-else>
<template v-if="item.type !== 3">
<el-row class="baseinfo-row">
<el-col :span="6">{{ item.labelName }}</el-col> <el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18"> <el-col :span="18">{{ portrayalSum.qq || '无' }}</el-col>
{{ item.value || '无' }}
</el-col>
</el-row> </el-row>
</template> <el-row class="baseinfo-row" v-else-if="item.labelVal == 'position'">
<template v-else> <!-- 职业 -->
<template v-if="item.typeSub == 1"> <el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.position || '无' }}</el-col>
</el-row>
<el-row
class="baseinfo-row"
v-else-if="item.labelVal == 'remarkCorpName'"
>
<!-- 公司 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.corpName || '无' }}</el-col>
</el-row>
<el-row class="baseinfo-row" v-else-if="item.labelVal == 'otherDescr'">
<!-- 其他描述 -->
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">{{ portrayalSum.otherDescr || '无' }}</el-col>
</el-row>
</el-col>
<el-col :span="12" v-else>
<template v-if="item.type !== 3">
<el-row class="baseinfo-row"> <el-row class="baseinfo-row">
<el-col :span="6">{{ item.labelName }}</el-col> <el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18"> <el-col :span="18">
...@@ -339,86 +393,280 @@ export default { ...@@ -339,86 +393,280 @@ export default {
</el-row> </el-row>
</template> </template>
<template v-else> <template v-else>
<el-row class="baseinfo-row"> <template v-if="item.typeSub == 1">
<el-col :span="6">{{ item.labelName }}</el-col> <el-row class="baseinfo-row">
<el-col :span="18"> <el-col :span="6">{{ item.labelName }}</el-col>
{{ item.value.join(',') || '无' }} <el-col :span="18">
</el-col> {{ item.value || '无' }}
</el-row> </el-col>
</el-row>
</template>
<template v-else>
<el-row class="baseinfo-row">
<el-col :span="6">{{ item.labelName }}</el-col>
<el-col :span="18">
{{ item.value.join(',') || '无' }}
</el-col>
</el-row>
</template>
</template> </template>
</template> </el-col>
</el-col> </template>
</template> </template>
</el-row>
</div>
</el-card>
</template></el-tab-pane
>
<el-tab-pane label="跟进" name="second">
<el-card class="mb10" shadow="never">
<template #header><div class="card-title">商机阶段</div></template>
<template v-if="trackUsers && trackUsers.length">
<div
v-for="(item, index) of trackUsers"
:key="index"
:class="['flex aic', index && 'mt20']"
>
汇总的场景显示名字
<template v-if="!userId">
<div class="name oe g-bg-lg">{{ item.userName }}</div>
</template> </template>
</el-row> <template v-if="item.trackState === 1">
</div> <el-steps style="flex: auto" :active="1">
<el-step title="待跟进"></el-step>
</el-steps>
</template>
<template
v-else-if="
item.trackState === 3 || item.trackState === 4 || item.trackState === 5
"
>
<el-steps style="flex: auto" :active="setActive(item.trackState)">
<el-step title="待跟进"></el-step>
<template v-for="(data, or) in stage">
<el-step
:title="data.stageKey"
:key="or"
v-if="data.stageState == 2"
></el-step>
</template>
<template v-for="(data, or) in stage">
<el-step
:title="data.stageKey"
:key="or"
v-if="item.trackState == data.stageVal"
></el-step>
</template>
</el-steps>
</template>
<template v-else-if="item.trackState">
<el-steps style="flex: auto" :active="setList(item.trackState)">
<template v-for="(data, or) in stage">
<el-step
:title="data.stageKey"
:key="or"
v-if="setList(item.trackState) <= or + 1"
></el-step>
</template>
</el-steps>
</template>
<div v-else class="g-tip-color ac">暂无数据</div>
</div>
</template>
<div v-else class="g-tip-color ac">暂无数据</div>
</el-card> </el-card>
</template>
<el-card class="mb10" shadow="never"> <el-card shadow="never">
<template #header><div class="card-title">商机阶段</div></template> <template #header><div class="card-title">跟进记录</div></template>
<template v-if="trackUsers && trackUsers.length"> <!-- 单个人的场景 -->
<div v-for="(item, index) of trackUsers" :key="index" :class="['flex aic', index && 'mt20']"> <record-table v-if="userId" :stageList="stage" :userId="userId"></record-table>
<!-- 汇总的场景显示名字 --> <!-- 汇总的场景 -->
<template v-if="!userId"> <el-tabs
<div class="name oe g-bg-lg">{{ item.userName }}</div> v-else-if="trackUsers && trackUsers.length"
model-value="0"
@tab-click="changeTab"
>
<el-tab-pane
v-for="(item, index) in trackUsers"
:key="index"
:label="item.userName"
>
<record-table
:stageList="stage"
v-if="openedTabs.includes(index + '')"
:userId="item.trackUserId"
></record-table>
</el-tab-pane>
</el-tabs>
<div v-else class="g-tip-color ac">暂无数据</div>
</el-card></el-tab-pane
>
<el-tab-pane label="订单" name="third">
<el-form
:inline="true"
label-width="80px"
label-position="left"
class="top-search mt20"
>
<el-form-item label="" label-width="0px">
<el-select v-model="query.orderStatus" :popper-append-to-body="false">
<el-option label="全部状态" value=""></el-option>
<el-option
:label="item"
:value="item"
v-for="(item, index) in orderStateList"
:key="index"
></el-option>
</el-select>
</el-form-item>
<el-form-item label-width="0">
<el-button type="primary" @click="search">查询</el-button>
<el-button @click="resetFn">清空</el-button>
<!-- <el-button @click="getDetail('1694259619920498688')">详情</el-button> -->
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
style="width: 100%"
>
<el-table-column
label="商品名称"
align="center"
min-width="100"
prop="productName"
show-overflow-tooltip
>
<template #default="{ row }">
<div class="flex">
<el-image :src="row.productUrl" class="code-image"></el-image>
<span class="code-content">{{ row.productName }}</span>
</div>
</template> </template>
<template v-if="item.trackState === 1"> </el-table-column>
<el-steps style="flex: auto" :active="1"> <el-table-column
<el-step title="待跟进"></el-step> label="商品数量"
</el-steps> align="center"
min-width="120"
prop="amount"
show-overflow-tooltip
/>
<el-table-column
label="订单状态"
align="center"
prop="orderStatus"
width="180"
></el-table-column>
<el-table-column
label="订单金额(元)"
align="center"
prop="address"
width="180"
></el-table-column>
<el-table-column
label="购买人/下单时间"
align="center"
min-width="100"
show-overflow-tooltip
>
<template #default="{ row }">
{{ row.purchaser }}
{{ row.orderTime }}
</template> </template>
<template v-else-if="item.trackState === 3 || item.trackState === 4 || item.trackState === 5"> </el-table-column>
<el-steps style="flex: auto" :active="setActive(item.trackState)"> <el-table-column
<el-step title="待跟进"></el-step> label="操作"
<template v-for="(data, or) in stage"> align="center"
<el-step :title="data.stageKey" :key="or" v-if="data.stageState == 2"></el-step> fixed="right"
</template> width="180"
<template v-for="(data, or) in stage"> class-name="small-padding fixed-width"
<el-step :title="data.stageKey" :key="or" v-if="item.trackState == data.stageVal"></el-step> >
</template> <template #default="{ row }">
</el-steps> <el-button text @click="getDetail(row.id)"> 详情 </el-button>
</template> </template>
<template v-else-if="item.trackState"> </el-table-column>
<el-steps style="flex: auto" :active="setList(item.trackState)"> </el-table>
<template v-for="(data, or) in stage"> <pagination
<el-step :title="data.stageKey" :key="or" v-if="setList(item.trackState) <= or + 1"></el-step> :total="total"
</template> v-model:page="query.pageNum"
</el-steps> v-model:limit="query.pageSize"
@pagination="getList()"
/>
<Detail :visible="visible" @close="visible = false" :id="orderId" />
</el-tab-pane>
<el-tab-pane label="会话" name="fourth">
<div class="flex track-tab-wrap mb15">
<div
:class="['track-tab', item.checked && 'active']"
v-for="(item, i) in chatTab"
:key="i"
@click="chatTabClick(i, item.type)"
>
{{ item.lable }}
</div>
</div>
<chatListClassTab :queryChat="queryChat" :type="tabType"></chatListClassTab>
</el-tab-pane>
</el-tabs>
<!-- <div class="left">
<el-card class="mb10" shadow="never">
<template #header><div class="card-title">企业标签</div></template>
<template v-if="portrayalSum.companyTags && portrayalSum.companyTags.length">
<div
v-for="(item, index) of portrayalSum.companyTags"
:key="index"
:class="['flex ait', index && 'mt20']"
>
汇总的场景显示名字
<template v-if="!userId">
<div class="name oe g-bg-lg">{{ item.userName }}</div>
</template> </template>
<!-- </el-steps> --> <div v-if="item.tagNames" class="gap10">
<!-- </template> --> <el-tag v-for="(unit, unique) in item.tagNames.split(',')" :key="unique">{{
<div v-else class="g-tip-color ac">暂无数据</div> unit
}}</el-tag>
</div>
<div v-else class="g-tip-color ac">暂无标签</div>
</div> </div>
</template> </template>
<div v-else class="g-tip-color ac">暂无数据</div> <div v-else class="g-tip-color ac">暂无标签</div>
</el-card> </el-card>
<el-card shadow="never"> <el-card class="mb10" shadow="never">
<template #header><div class="card-title">跟进记录</div></template> <template #header><div class="card-title">个人标签</div></template>
<!-- 单个人的场景 --> <template v-if="portrayalSum.personTags && portrayalSum.personTags.length">
<record-table v-if="userId" :stageList="stage" :userId="userId"></record-table> <div
<!-- 汇总的场景 --> v-for="(item, index) of portrayalSum.personTags"
<el-tabs v-else-if="trackUsers && trackUsers.length" model-value="0" @tab-click="changeTab"> :key="index"
<el-tab-pane v-for="(item, index) in trackUsers" :key="index" :label="item.userName"> :class="['flex aic', index && 'mt20']"
<record-table >
:stageList="stage" 汇总的场景显示名字
v-if="openedTabs.includes(index + '')" <template v-if="!userId">
:userId="item.trackUserId"></record-table> <div class="name oe g-bg-lg">{{ item.userName }}</div>
</el-tab-pane> </template>
</el-tabs> <div v-if="item.tagNames" class="gap10">
<div v-else class="g-tip-color ac">暂无数据</div> <el-tag v-for="(unit, unique) in item.tagNames.split(',')" :key="unique">{{
unit
}}</el-tag>
</div>
<div v-else class="g-tip-color ac">暂无标签</div>
</div>
</template>
<div v-else class="g-tip-color ac">暂无标签</div>
</el-card> </el-card>
</div> </div> -->
</el-col> </el-col>
<el-col :span="10"> <!-- <el-col :span="10">
<el-card> <el-card>
<template #header> <template #header>
<div class="fcbw"> <div class="fcbw">
<span class="card-title" @click="sync">客户轨迹</span> <span class="card-title" @click="sync">客户轨迹</span>
<ButtonSync class="btn-sync" :lastSyncTime="lastSyncTime" @click="sync"
<ButtonSync class="btn-sync" :lastSyncTime="lastSyncTime" @click="sync">同步</ButtonSync> >同步</ButtonSync
>
</div> </div>
</template> </template>
<div class="flex track-tab-wrap mb15"> <div class="flex track-tab-wrap mb15">
...@@ -426,7 +674,8 @@ export default { ...@@ -426,7 +674,8 @@ export default {
v-for="(value, type) of trajectoryType" v-for="(value, type) of trajectoryType"
:key="type" :key="type"
:class="['track-tab', type === active && 'active']" :class="['track-tab', type === active && 'active']"
@click="changeTrack(type)"> @click="changeTrack(type)"
>
{{ value }} {{ value }}
</div> </div>
</div> </div>
...@@ -437,15 +686,44 @@ export default { ...@@ -437,15 +686,44 @@ export default {
:userId="userId" :userId="userId"
:userIdAll="trackUsers.map((e) => e.trackUserId).join()" :userIdAll="trackUsers.map((e) => e.trackUserId).join()"
v-model:lastSyncTime="lastSyncTime" v-model:lastSyncTime="lastSyncTime"
:trajectoryType="item == 0 ? null : item"></record> :trajectoryType="item == 0 ? null : item"
></record>
</template> </template>
</el-card> </el-card>
</el-col> </el-col> -->
</el-row> </el-row>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.track-tab-wrap {
.track-tab {
background: var(--bg-black-8);
border-radius: 50px;
padding: 5px 10px;
cursor: pointer;
& + .track-tab {
margin-left: 30px;
}
&.active {
background: var(--color);
color: var(--font-white, #fff);
}
}
}
.content-box {
width: 80%;
border: 1px solid var(--bg-black-8);
}
.code-image {
width: 50px;
height: 50px;
}
.code-content {
color: var(--font-black-7);
font-size: 12px;
}
.name { .name {
width: 65px; width: 65px;
flex: none; flex: none;
......
<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,15 +87,17 @@ export default { ...@@ -71,15 +87,17 @@ 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.companyTags && (data.companyTags = data.companyTags.split(',')) ({ data }) => {
this.customer = data data.companyTags && (data.companyTags = data.companyTags.split(','))
this.customer = data
// if (data.trackUsers && data.trackUsers.length === 1) { // if (data.trackUsers && data.trackUsers.length === 1) {
// 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,57 +144,117 @@ export default { ...@@ -121,57 +144,117 @@ export default {
</div> </div>
</div> </div>
</div> </div>
<div class="flex">
<div class="g-card"> <div style="width: calc(100% - 425px); padding-right: var(--card-margin)">
<div class="g-card-title">社交关系</div> <div class="g-card">
<el-tabs model-value="1"> <div class="g-card-title">社交关系</div>
<el-tab-pane :label="`跟进员工(${customer.trackUsers ? customer.trackUsers.length : 0})`" name="1"> <el-tabs model-value="1">
<el-table :data="customer.trackUsers"> <el-tab-pane
<el-table-column label="员工" align="center" prop="userName" /> :label="`跟进员工(${customer.trackUsers ? customer.trackUsers.length : 0})`"
<el-table-column prop="addMethod" label="添加方式" align="center"> name="1"
<template #default="{ row }">{{ dictAddType[row.addMethod + ''] }}</template> >
</el-table-column> <el-table :data="customer.trackUsers">
<el-table-column label="添加时间" align="center" prop="firstAddTime" /> <el-table-column label="员工" align="center" prop="userName" />
<el-table-column prop="trackState" label="商机阶段" align="center"> <el-table-column prop="addMethod" label="添加方式" align="center">
<template #default="{ row }"> <template #default="{ row }">{{ dictAddType[row.addMethod + ''] }}</template>
<!-- <el-tag v-if="row.trackState" :type="dictTrackState[~~row.trackState + ''].color"> </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 }} {{ dictTrackState[~~row.trackState + ''].name }}
</el-tag> --> </el-tag> -->
<el-tag v-if="row.trackState"> <el-tag v-if="row.trackState">
{{ setValue(row.trackState) }} {{ setValue(row.trackState) }}
</el-tag> </el-tag>
</template> </template>
</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
<el-table :data="customer.groups"> :label="`所在客群(${customer.groups ? customer.groups.length : 0})`"
<el-table-column label="群名" align="center" prop="groupName" /> name="2"
<el-table-column label="群主" align="center" prop="leaderName" /> >
<el-table-column label="入群时间" align="center" prop="joinTime" /> <el-table :data="customer.groups">
<el-table-column prop="joinScene" label="入群方式" align="center"> <el-table-column label="群名" align="center" prop="groupName" />
<template #default="{ row }">{{ dictJoinGroupType[row.joinScene + ''] }}</template> <el-table-column label="群主" align="center" prop="leaderName" />
</el-table-column> <el-table-column label="入群时间" align="center" prop="joinTime" />
</el-table> <el-table-column prop="joinScene" label="入群方式" align="center">
</el-tab-pane> <template #default="{ row }">{{
</el-tabs> dictJoinGroupType[row.joinScene + '']
</div> }}</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
<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
<info-tab :stageList="stageList" :trackUsers="customer.trackUsers"></info-tab> v-if="customer.trackUsers && customer.trackUsers.length > 1"
</el-tab-pane> label="客户画像汇总"
<el-tab-pane lazy
v-for="(item, index) of customer.trackUsers" data-id="0"
:key="index" >
:label="item.userName" <info-tab :stageList="stageList" :trackUsers="customer.trackUsers"></info-tab>
lazy </el-tab-pane> -->
:data-id="item.trackUserId"> <el-tab-pane
<info-tab :stageList="stageList" :userId="item.trackUserId"></info-tab> v-for="(item, index) of customer.trackUsers"
</el-tab-pane> :key="index"
</el-tabs> :label="item.userName"
lazy
:data-id="item.trackUserId"
>
<info-tab :stageList="stageList" :userId="item.trackUserId"></info-tab>
</el-tab-pane>
</el-tabs>
</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>
</div> </div>
</template> </template>
...@@ -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,732 +178,732 @@ ...@@ -148,732 +178,732 @@
</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,
DragTable, DragTable,
MaterialCenter, MaterialCenter,
getPosterInfo, getPosterInfo,
TemplateLibrary, TemplateLibrary,
MessageContentForm MessageContentForm,
}, },
data() { data() {
return { return {
titleOne: '欢迎语', titleOne: '欢迎语',
lableOne: '欢迎语', lableOne: '欢迎语',
titleTwo: '欢迎语附件', titleTwo: '欢迎语附件',
templateInfo: '', templateInfo: '',
userInfo: '', userInfo: '',
editMaterialForm: {}, editMaterialForm: {},
choseDialog: false, choseDialog: false,
ids: [], ids: [],
// materialIds: [], //素材id // materialIds: [], //素材id
// 分组props // 分组props
groupProps: { groupProps: {
expandTrigger: 'hover', expandTrigger: 'hover',
checkStrictly: true, checkStrictly: true,
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, // 新建素材表格对话框显隐
talkLoading: false, talkLoading: false,
talkList: [], talkList: [],
users: [], users: [],
selectedUserList: [], selectedUserList: [],
dialogVisibleSelectUser: false, dialogVisibleSelectUser: false,
isedit: false, // 是否为图片编辑 isedit: false, // 是否为图片编辑
welcomVisible: false, welcomVisible: false,
fontType: '', fontType: '',
maxlength: 9, maxlength: 9,
libraryLoading: false libraryLoading: false,
} }
}, },
props: { props: {
baseData: { baseData: {
type: Object, type: Object,
default: () => { default: () => {
return { return {
templateInfo: '', templateInfo: '',
attachments: [] attachments: [],
}
} }
}, },
// 最多上传的素材数
maxlengthTwo: {
type: Number,
default: 9
},
// 查询会话详情的id
talkId: {
type: string,
default: null
},
// 查询模板中心详情的id
modelId: {
type: string,
default: null
},
// 话术类形 0企业话术1客服话术
talkType: {
type: string,
default: null
},
// 1欢迎语 2群发 3sop
templateType: {
type: Number,
default: 1
},
// 1:活码欢迎语;2:员工欢迎语;3:入群欢迎语
tplType: {
type: String,
default: null
},
// 模块类型 1:素材;2:话术;3:模板;4:其他模块
moduleType: {
type: Number,
default: 4
},
// 是否为欢迎语模板
iswelcom: {
type: Boolean,
default: false
},
// 是否显示模板库
showModle: {
type: Boolean,
default: true
},
// 1.员工活码;2:企微营销;3:企业动态;4:门店活码
otherType: {
type: Number,
default: null
},
// 是否显示手机
showPhone: {
type: Boolean,
default: true
},
// 直播链接
liveUrl: {
type: String,
default: null
},
// 是否显示提交取消按钮
showFooter: {
type: Boolean,
default: true
}
}, },
watch: { // 最多上传的素材数
talkForm: { maxlengthTwo: {
handler(val) { type: Number,
this.changeInfo(val.templateInfo) default: 9,
}, },
deep: true // 查询会话详情的id
talkId: {
type: string,
default: null,
},
// 查询模板中心详情的id
modelId: {
type: string,
default: null,
},
// 话术类形 0企业话术1客服话术
talkType: {
type: string,
default: null,
},
// 1欢迎语 2群发 3sop
templateType: {
type: Number,
default: 1,
},
// 1:活码欢迎语;2:员工欢迎语;3:入群欢迎语
tplType: {
type: String,
default: null,
},
// 模块类型 1:素材;2:话术;3:模板;4:其他模块
moduleType: {
type: Number,
default: 4,
},
// 是否为欢迎语模板
iswelcom: {
type: Boolean,
default: false,
},
// 是否显示模板库
showModle: {
type: Boolean,
default: true,
},
// 1.员工活码;2:企微营销;3:企业动态;4:门店活码
otherType: {
type: Number,
default: null,
},
// 是否显示手机
showPhone: {
type: Boolean,
default: true,
},
// 直播链接
liveUrl: {
type: String,
default: null,
},
// 是否显示提交取消按钮
showFooter: {
type: Boolean,
default: true,
},
},
watch: {
talkForm: {
handler(val) {
this.changeInfo(val.templateInfo)
}, },
maxlengthTwo: { deep: true,
handler(val) { },
this.maxlength = val maxlengthTwo: {
}, handler(val) {
immediate: true this.maxlength = val
}, },
baseData(val) { immediate: true,
if (val.templateInfo) { },
this.form.templateInfo = val.templateInfo baseData(val) {
this.form.attachments = val.attachments if (val.templateInfo) {
if (this.form.templateInfo) { this.form.templateInfo = val.templateInfo
// this.form.templateInfo = this.baseData.templateInfo this.form.attachments = val.attachments
this.talkForm = this.form if (this.form.templateInfo) {
this.talkList = this.form.attachments // this.form.templateInfo = this.baseData.templateInfo
} this.talkForm = this.form
// this.$forceUpdate() this.talkList = this.form.attachments
} }
}, // this.$forceUpdate()
talkId: {
handler(val) {
if (val) {
this.getDeatil(val)
}
},
immediate: true
},
modelId: {
handler(val) {
if (val) {
this.getTelDeatil(val)
}
},
immediate: true
} }
}, },
methods: { talkId: {
changeInfo(val) { handler(val) {
this.$emit('changeInfo', val) if (val) {
}, this.getDeatil(val)
dialogClose(val, list) {
this.dialogVisible = val
if (list) {
this.talkList = [...list]
this.$emit('phoneData', this.talkList)
this.$emit('success', this.setResult())
} }
}, },
setResult() { immediate: true,
let arr = [] },
this.talkList.forEach((item) => { modelId: {
let attachments = {} handler(val) {
attachments.materialId = item.id if (val) {
switch (item.mediaType) { this.getTelDeatil(val)
case '0':
// 图片
attachments.picUrl = item.materialUrl
attachments.msgType = 'image'
break
case '2':
// 视频
attachments.picUrl = item.coverUrl
attachments.fileUrl = item.materialUrl
attachments.description = item.digest
attachments.title = item.materialName
attachments.msgType = 'video'
break
case '3':
// 文件
attachments.picUrl = this.filPicType(item.materialUrl)
attachments.fileUrl = item.materialUrl
attachments.description = item.digest
attachments.title = item.materialName
attachments.msgType = 'file'
break
case '4':
// 文本
attachments.content = item.content
attachments.msgType = 'text'
break
case '5':
// 海报
attachments.fileUrl = item.materialUrl
attachments.msgType = 'posters'
break
case '9':
// 图文
attachments.content = item.content
attachments.picUrl = item.coverUrl
attachments.linkUrl = item.materialUrl
attachments.title = item.materialName
attachments.msgType = 'link'
break
case '11':
// 小程序
attachments.picUrl = item.coverUrl
attachments.fileUrl = item.materialUrl
attachments.appId = item.digest
attachments.title = item.materialName
attachments.msgType = 'miniprogram'
break
case '12':
// 文章
attachments.fileUrl = item.materialUrl
attachments.description = item.digest
attachments.content = item.content
attachments.picUrl = item.coverUrl
attachments.title = item.materialName
attachments.msgType = 'news'
break
}
arr.push(attachments)
})
return arr
},
filPicType(file) {
let filecontent = JSON.parse(JSON.stringify(file))
filecontent = filecontent.split('.')
let type = filecontent[filecontent.length - 1]
if (type === 'pdf') {
return window.lwConfig.DEFAULT_H5_PDF
} else if (['doc', 'docx'].includes(type)) {
return window.lwConfig.DEFAULT_H5_WORDE
} else if (['ppt', 'pptx', 'pps', 'pptsx'].includes(type)) {
return window.lwConfig.DEFAULT_H5_PPT
} else {
return ''
}
},
dealType() {
if (this.moduleType === 4) {
switch (this.otherType) {
case 1:
case 4:
this.titleOne = '欢迎语'
this.lableOne = '欢迎语'
this.titleTwo = '欢迎语附件'
break
case 2:
this.titleOne = '群发内容'
this.lableOne = '内容'
this.titleTwo = '群发附件'
break
case 3:
this.titleOne = '动态内容'
this.lableOne = '动态文本'
break
}
} else if (this.iswelcom) {
this.titleOne = '欢迎语'
this.lableOne = '欢迎语'
this.titleTwo = '欢迎语附件'
} else if (this.templateType === 2) {
this.lableOne = '群发内容'
this.titleTwo = '群发附件'
} else if (this.templateType === 3) {
this.lableOne = ' SOP内容'
this.titleTwo = '群发附件'
} else {
this.titleOne = '欢迎语'
this.lableOne = '消息内容'
this.titleTwo = '话术素材'
}
},
// 模板库点击确定
selectModle() {
this.libraryLoading = true
if (this.selectObj) {
this.talkForm = this.selectObj
this.welcomVisible = false
this.talkList = [...this.selectObj.weMaterialList]
this.$emit('phoneData', [...this.selectObj.weMaterialList])
this.$emit('changeInfo', this.selectObj.templateInfo)
this.$emit('success', this.setResult())
} else {
this.$message.error('请选择模板')
}
this.libraryLoading = false
},
changeObj(id) {
if (id) {
templateDetail(id).then((res) => {
this.selectObj = res.data
})
}
},
setUserData() {
this.selectedUserList = []
let arr = []
if (this.talkForm.userIds) {
arr = this.talkForm.userIds.split(',').map((dd, index) => {
return {
userId: dd,
name: this.talkForm.userNames.split(',')[index]
}
})
}
this.users = arr
},
onSelectUser() {
this.selectedUserList = []
let arr = []
if (this.talkForm.userIds) {
arr = this.talkForm.userIds.split(',').map((dd, index) => {
return {
userId: dd,
name: this.talkForm.userNames.split(',')[index]
}
})
} }
this.selectedUserList = arr
this.dialogVisibleSelectUser = true
},
selectedUser(users) {
let ids = []
let names = []
const selectedUserList = users.map((d) => {
ids.push(d.userId)
names.push(d.name)
return {
userId: d.userId,
name: d.name
}
})
this.users = selectedUserList
this.talkForm.userIds = ids.join(',')
this.talkForm.userNames = names.join(',')
},
// 获取详情
getDeatil(id) {
lexicalDetail(id)
.then((res) => {
this.talkForm = res.data
this.talkList = res.data.weMaterialList
})
.catch(() => {})
},
// 获取模板中心详情
getTelDeatil(id) {
templateDetail(id)
.then((res) => {
this.talkForm = res.data
this.talkList = res.data.weMaterialList
this.setUserData()
})
.catch(() => {})
}, },
getEdit(val) { immediate: true,
this.type = val.mediaType },
this.editMaterialForm = JSON.parse(JSON.stringify(val)) },
}, methods: {
setData(val) { changeInfo(val) {
this.talkList = val this.$emit('changeInfo', val)
this.$emit('phoneData', this.talkList) },
this.$emit('success', this.setResult()) dialogClose(val, list) {
}, this.dialogVisible = val
getItemArry(val) { if (list) {
this.talkList = this.talkList.concat(val) this.talkList = [...list]
// 当手机为非内嵌时
this.$emit('phoneData', this.talkList) this.$emit('phoneData', this.talkList)
this.$emit('success', this.setResult()) this.$emit('success', this.setResult())
}, }
centerSubmit() {}, },
selectCenter() {}, setResult() {
choseCenter() { let arr = []
this.choseDialog = true this.talkList.forEach((item) => {
}, let attachments = {}
getIds(value) { attachments.materialId = item.id
this.ids = value switch (item.mediaType) {
}, case '0':
moveGroup(type) { // 图片
this.type = '' attachments.picUrl = item.materialUrl
this.type = type attachments.msgType = 'image'
if (this.otherType === 3 && type == '2') { break
this.choseDialog = true case '2':
} else { // 视频
this.dialogVisible = true attachments.picUrl = item.coverUrl
} attachments.fileUrl = item.materialUrl
}, attachments.description = item.digest
// 获取类目树 attachments.title = item.materialName
getTree() { attachments.msgType = 'video'
var mediaType = null break
if (this.talkType == 0) { case '3':
mediaType = 13 // 文件
} else if (this.talkType == 1) { attachments.picUrl = this.filPicType(item.materialUrl)
mediaType = 14 attachments.fileUrl = item.materialUrl
} attachments.description = item.digest
if (this.templateType == 2) { attachments.title = item.materialName
mediaType = 17 attachments.msgType = 'file'
} else if (this.templateType == 3) { break
mediaType = 16 case '4':
} // 文本
getTree(mediaType).then(({ data }) => { attachments.content = item.content
this.treeData = [ attachments.msgType = 'text'
{ break
id: '', case '5':
name: '全部', // 海报
parentId: '0', attachments.fileUrl = item.materialUrl
hasParent: false, attachments.msgType = 'posters'
hasChildren: true, break
children: data || [] case '9':
} // 图文
] attachments.content = item.content
}) attachments.picUrl = item.coverUrl
}, attachments.linkUrl = item.materialUrl
// 新建话术 attachments.title = item.materialName
tackSubmit() { attachments.msgType = 'link'
this.talkLoading = true break
if ([3, 4].includes(this.moduleType) && !this.talkForm.templateInfo) { case '11':
this.templateInfo = '请输入' + this.lableOne // 小程序
this.talkLoading = false attachments.picUrl = item.coverUrl
return attachments.fileUrl = item.materialUrl
} else { attachments.appId = item.digest
this.templateInfo = '' attachments.title = item.materialName
} attachments.msgType = 'miniprogram'
if (!this.talkForm.userIds && this.tplType == 2) { break
this.userInfo = '请选择员工' case '12':
this.talkLoading = false // 文章
return attachments.fileUrl = item.materialUrl
} else { attachments.description = item.digest
this.userInfo = '' attachments.content = item.content
} attachments.picUrl = item.coverUrl
if (this.talkType === '0') { attachments.title = item.materialName
this.talkForm.talkType = 0 attachments.msgType = 'news'
} else if (this.talkType === '1') { break
this.talkForm.talkType = 1
} }
if (!this.templateType) { arr.push(attachments)
this.talkForm.talkMaterialList = [] })
this.talkList.forEach((item, index) => { return arr
this.talkForm.talkMaterialList.push({ materialId: item.id, sort: index }) },
}) filPicType(file) {
let filecontent = JSON.parse(JSON.stringify(file))
filecontent = filecontent.split('.')
let type = filecontent[filecontent.length - 1]
if (type === 'pdf') {
return window.lwConfig.DEFAULT_H5_PDF
} else if (['doc', 'docx'].includes(type)) {
return window.lwConfig.DEFAULT_H5_WORDE
} else if (['ppt', 'pptx', 'pps', 'pptsx'].includes(type)) {
return window.lwConfig.DEFAULT_H5_PPT
} else {
return ''
}
},
dealType() {
if (this.moduleType === 4) {
switch (this.otherType) {
case 1:
case 4:
this.titleOne = '欢迎语'
this.lableOne = '欢迎语'
this.titleTwo = '欢迎语附件'
break
case 2:
this.titleOne = '群发内容'
this.lableOne = '内容'
this.titleTwo = '群发附件'
break
case 3:
this.titleOne = '动态内容'
this.lableOne = '动态文本'
break
} }
this.$refs['talkform'].validate((valid) => { } else if (this.iswelcom) {
if (valid) { this.titleOne = '欢迎语'
let talkForm = JSON.parse(JSON.stringify(this.talkForm)) this.lableOne = '欢迎语'
// 如果是关联模块 this.titleTwo = '欢迎语附件'
if (this.moduleType === 4) { } else if (this.templateType === 2) {
this.talkLoading = true this.lableOne = '群发内容'
talkForm.attachments = [] this.titleTwo = '群发附件'
if (this.talkList.length !== 0) { } else if (this.templateType === 3) {
this.dealOtherModleType(talkForm) this.lableOne = ' SOP内容'
} this.titleTwo = '群发附件'
this.$emit('submit', talkForm) } else {
// this.$refs['talkForm'].resetFields() this.titleOne = '欢迎语'
// this.talkForm = {} this.lableOne = '消息内容'
setTimeout(() => { this.titleTwo = '话术素材'
this.talkLoading = false }
}, 5000) },
} else { // 模板库点击确定
talkForm.attachmentList = [] selectModle() {
talkForm.weTlpMaterialList = [] this.libraryLoading = true
this.talkId ? (talkForm.talkId = this.talkId) : '' if (this.selectObj) {
this.modelId ? (talkForm.modelId = this.modelId) : '' this.talkForm = this.selectObj
if (this.templateType) { this.welcomVisible = false
// 如果是模板中心 this.talkList = [...this.selectObj.weMaterialList]
this.talkForm.weTlpMaterialList = [] this.$emit('phoneData', [...this.selectObj.weMaterialList])
this.dealTemplateType(talkForm) this.$emit('changeInfo', this.selectObj.templateInfo)
} this.$emit('success', this.setResult())
;(this.templateType ? templateAdd : lexicalAdd)(talkForm) } else {
.then(() => { this.$message.error('请选择模板')
this.msgSuccess('操作成功') }
// this.getList() this.libraryLoading = false
this.$router.push('list') },
this.$refs['talkForm'].resetFields() changeObj(id) {
this.talkForm = {} if (id) {
this.talkLoading = false templateDetail(id).then((res) => {
}) this.selectObj = res.data
.catch(() => {
this.talkLoading = false
})
}
} else {
this.talkLoading = false
}
}) })
}, }
dealOtherModleType(talkForm) { },
this.talkList.forEach((item) => { setUserData() {
let attachments = {} this.selectedUserList = []
attachments.title = item.materialName let arr = []
attachments.realType = +item.mediaType if (this.talkForm.userIds) {
attachments.materialId = item.id //素材 arr = this.talkForm.userIds.split(',').map((dd, index) => {
switch (item.mediaType) { return {
case '0': userId: dd,
// 图片 name: this.talkForm.userNames.split(',')[index],
attachments.picUrl = item.materialUrl
attachments.msgType = 'image'
break
case '2':
// 视频
attachments.picUrl = item.coverUrl
attachments.fileUrl = item.materialUrl
attachments.description = item.digest
attachments.msgType = 'video'
break
case '3':
// 文件
attachments.picUrl = this.filPicType(item.materialUrl)
attachments.fileUrl = item.materialUrl
attachments.description = item.digest
attachments.msgType = 'file'
break
case '4':
// 文本
attachments.content = item.content
attachments.msgType = 'text'
break
case '5':
// 海报
attachments.fileUrl = item.materialUrl
attachments.msgType = 'posters'
break
case '9':
// 图文
attachments.content = item.content
attachments.picUrl = item.coverUrl
attachments.linkUrl = item.materialUrl
attachments.msgType = 'link'
if (this.otherType === 3) {
attachments.materialName = item.materialName
}
break
case '11':
// 小程序
attachments.picUrl = item.coverUrl
attachments.fileUrl = item.materialUrl
attachments.appId = item.digest
attachments.msgType = 'miniprogram'
break
case '12':
// 文章
attachments.fileUrl = item.materialUrl
attachments.description = item.digest
attachments.content = item.content
attachments.picUrl = item.coverUrl
attachments.msgType = 'news'
break
} }
talkForm.attachments.push(attachments)
}) })
}, }
dealTemplateType(talkForm) { this.users = arr
this.talkList.forEach((item) => { },
let attachmentFrom = {} onSelectUser() {
attachmentFrom.msgType = item.mediaType this.selectedUserList = []
attachmentFrom.materialId = item.id let arr = []
if (item.mediaType != '0') { if (this.talkForm.userIds) {
attachmentFrom.title = item.materialName arr = this.talkForm.userIds.split(',').map((dd, index) => {
} return {
switch (item.mediaType) { userId: dd,
case '0': name: this.talkForm.userNames.split(',')[index],
case '5':
// 图片
attachmentFrom.picUrl = item.materialUrl
break
case '2':
// 视频
attachmentFrom.picUrl = item.coverUrl
attachmentFrom.fileUrl = item.materialUrl
attachmentFrom.description = item.digest
break
case '3':
// 文件
attachmentFrom.fileUrl = item.materialUrl
attachmentFrom.description = item.digest
break
case '4':
// 文本
attachmentFrom.content = item.content
break
case '4':
// 海报
break
case '9':
// 图文
attachmentFrom.content = item.content
attachmentFrom.picUrl = item.coverUrl
attachmentFrom.linkUrl = item.materialUrl
break
case '11':
// 小程序
attachmentFrom.picUrl = item.coverUrl
attachmentFrom.fileUrl = item.materialUrl
attachmentFrom.appId = item.digest
break
case '12':
// 文章
attachmentFrom.fileUrl = item.materialUrl
attachmentFrom.description = item.digest
attachmentFrom.content = item.content
attachmentFrom.picUrl = item.coverUrl
break
} }
talkForm.attachmentList.push(attachmentFrom)
talkForm.weTlpMaterialList.push({ materialId: item.id })
}) })
talkForm.templateType = this.templateType
talkForm.tplType = this.tplType
},
getCancel() {
this.$router.back()
},
goBack() {
let talkForm = JSON.parse(JSON.stringify(this.talkForm))
talkForm.attachments = []
if (this.talkList.length !== 0) {
this.dealOtherModleType(talkForm)
}
this.$emit('update', talkForm)
} }
this.selectedUserList = arr
this.dialogVisibleSelectUser = true
},
selectedUser(users) {
let ids = []
let names = []
const selectedUserList = users.map((d) => {
ids.push(d.userId)
names.push(d.name)
return {
userId: d.userId,
name: d.name,
}
})
this.users = selectedUserList
this.talkForm.userIds = ids.join(',')
this.talkForm.userNames = names.join(',')
},
// 获取详情
getDeatil(id) {
lexicalDetail(id)
.then((res) => {
this.talkForm = res.data
this.talkList = res.data.weMaterialList
})
.catch(() => {})
},
// 获取模板中心详情
getTelDeatil(id) {
templateDetail(id)
.then((res) => {
this.talkForm = res.data
this.talkList = res.data.weMaterialList
this.setUserData()
})
.catch(() => {})
},
getEdit(val) {
this.type = val.mediaType
this.editMaterialForm = JSON.parse(JSON.stringify(val))
}, },
mounted() { setData(val) {
if (this.$route.query.categoryId) { this.talkList = val
let form = { categoryId: this.$route.query.categoryId } this.$emit('phoneData', this.talkList)
this.talkForm = { ...form } this.$emit('success', this.setResult())
},
getItemArry(val) {
this.talkList = this.talkList.concat(val)
// 当手机为非内嵌时
this.$emit('phoneData', this.talkList)
this.$emit('success', this.setResult())
},
centerSubmit() {},
selectCenter() {},
choseCenter() {
this.choseDialog = true
},
getIds(value) {
this.ids = value
},
moveGroup(type) {
this.type = ''
this.type = type
if (this.otherType === 3 && type == '2') {
this.choseDialog = true
} else {
this.dialogVisible = true
} }
if (this.templateType != 1 && this.moduleType != 4) { },
this.getTree() // 获取类目树
getTree() {
var mediaType = null
if (this.talkType == 0) {
mediaType = 13
} else if (this.talkType == 1) {
mediaType = 14
} }
if (this.baseData.templateInfo) { if (this.templateType == 2) {
// this.form.templateInfo = this.baseData.templateInfo mediaType = 17
this.talkForm = this.baseData } else if (this.templateType == 3) {
this.talkList = this.baseData.attachments mediaType = 16
} }
// this.dealType() getTree(mediaType).then(({ data }) => {
if (this.otherType === 3 || this.tplType == 3) { this.treeData = [
this.maxlength = 1 {
id: '',
name: '全部',
parentId: '0',
hasParent: false,
hasChildren: true,
children: data || [],
},
]
})
},
// 新建话术
tackSubmit() {
this.talkLoading = true
if ([3, 4].includes(this.moduleType) && !this.talkForm.templateInfo) {
this.templateInfo = '请输入' + this.lableOne
this.talkLoading = false
return
} else { } else {
this.maxlength = this.maxlengthTwo this.templateInfo = ''
} }
if ([3, 4].includes(this.moduleType)) { if (!this.talkForm.userIds && this.tplType == 2) {
this.fontType = '附件' this.userInfo = '请选择员工'
this.talkLoading = false
return
} else { } else {
this.fontType = '素材' this.userInfo = ''
}
if (this.talkType === '0') {
this.talkForm.talkType = 0
} else if (this.talkType === '1') {
this.talkForm.talkType = 1
}
if (!this.templateType) {
this.talkForm.talkMaterialList = []
this.talkList.forEach((item, index) => {
this.talkForm.talkMaterialList.push({ materialId: item.id, sort: index })
})
}
this.$refs['talkform'].validate((valid) => {
if (valid) {
let talkForm = JSON.parse(JSON.stringify(this.talkForm))
// 如果是关联模块
if (this.moduleType === 4) {
this.talkLoading = true
talkForm.attachments = []
if (this.talkList.length !== 0) {
this.dealOtherModleType(talkForm)
}
this.$emit('submit', talkForm)
// this.$refs['talkForm'].resetFields()
// this.talkForm = {}
setTimeout(() => {
this.talkLoading = false
}, 5000)
} else {
talkForm.attachmentList = []
talkForm.weTlpMaterialList = []
this.talkId ? (talkForm.talkId = this.talkId) : ''
this.modelId ? (talkForm.modelId = this.modelId) : ''
if (this.templateType) {
// 如果是模板中心
this.talkForm.weTlpMaterialList = []
this.dealTemplateType(talkForm)
}
;(this.templateType ? templateAdd : lexicalAdd)(talkForm)
.then(() => {
this.msgSuccess('操作成功')
// this.getList()
this.$router.push('list')
this.$refs['talkForm'].resetFields()
this.talkForm = {}
this.talkLoading = false
})
.catch(() => {
this.talkLoading = false
})
}
} else {
this.talkLoading = false
}
})
},
dealOtherModleType(talkForm) {
this.talkList.forEach((item) => {
let attachments = {}
attachments.title = item.materialName
attachments.realType = +item.mediaType
attachments.materialId = item.id //素材
switch (item.mediaType) {
case '0':
// 图片
attachments.picUrl = item.materialUrl
attachments.msgType = 'image'
break
case '2':
// 视频
attachments.picUrl = item.coverUrl
attachments.fileUrl = item.materialUrl
attachments.description = item.digest
attachments.msgType = 'video'
break
case '3':
// 文件
attachments.picUrl = this.filPicType(item.materialUrl)
attachments.fileUrl = item.materialUrl
attachments.description = item.digest
attachments.msgType = 'file'
break
case '4':
// 文本
attachments.content = item.content
attachments.msgType = 'text'
break
case '5':
// 海报
attachments.fileUrl = item.materialUrl
attachments.msgType = 'posters'
break
case '9':
// 图文
attachments.content = item.content
attachments.picUrl = item.coverUrl
attachments.linkUrl = item.materialUrl
attachments.msgType = 'link'
if (this.otherType === 3) {
attachments.materialName = item.materialName
}
break
case '11':
// 小程序
attachments.picUrl = item.coverUrl
attachments.fileUrl = item.materialUrl
attachments.appId = item.digest
attachments.msgType = 'miniprogram'
break
case '12':
// 文章
attachments.fileUrl = item.materialUrl
attachments.description = item.digest
attachments.content = item.content
attachments.picUrl = item.coverUrl
attachments.msgType = 'news'
break
}
talkForm.attachments.push(attachments)
})
},
dealTemplateType(talkForm) {
this.talkList.forEach((item) => {
let attachmentFrom = {}
attachmentFrom.msgType = item.mediaType
attachmentFrom.materialId = item.id
if (item.mediaType != '0') {
attachmentFrom.title = item.materialName
}
switch (item.mediaType) {
case '0':
case '5':
// 图片
attachmentFrom.picUrl = item.materialUrl
break
case '2':
// 视频
attachmentFrom.picUrl = item.coverUrl
attachmentFrom.fileUrl = item.materialUrl
attachmentFrom.description = item.digest
break
case '3':
// 文件
attachmentFrom.fileUrl = item.materialUrl
attachmentFrom.description = item.digest
break
case '4':
// 文本
attachmentFrom.content = item.content
break
case '4':
// 海报
break
case '9':
// 图文
attachmentFrom.content = item.content
attachmentFrom.picUrl = item.coverUrl
attachmentFrom.linkUrl = item.materialUrl
break
case '11':
// 小程序
attachmentFrom.picUrl = item.coverUrl
attachmentFrom.fileUrl = item.materialUrl
attachmentFrom.appId = item.digest
break
case '12':
// 文章
attachmentFrom.fileUrl = item.materialUrl
attachmentFrom.description = item.digest
attachmentFrom.content = item.content
attachmentFrom.picUrl = item.coverUrl
break
}
talkForm.attachmentList.push(attachmentFrom)
talkForm.weTlpMaterialList.push({ materialId: item.id })
})
talkForm.templateType = this.templateType
talkForm.tplType = this.tplType
},
getCancel() {
this.$router.back()
},
goBack() {
let talkForm = JSON.parse(JSON.stringify(this.talkForm))
talkForm.attachments = []
if (this.talkList.length !== 0) {
this.dealOtherModleType(talkForm)
} }
this.$emit('update', talkForm)
},
},
mounted() {
if (this.$route.query.categoryId) {
let form = { categoryId: this.$route.query.categoryId }
this.talkForm = { ...form }
} }
} if (this.templateType != 1 && this.moduleType != 4) {
this.getTree()
}
if (this.baseData.templateInfo) {
// this.form.templateInfo = this.baseData.templateInfo
this.talkForm = this.baseData
this.talkList = this.baseData.attachments
}
// this.dealType()
if (this.otherType === 3 || this.tplType == 3) {
this.maxlength = 1
} else {
this.maxlength = this.maxlengthTwo
}
if ([3, 4].includes(this.moduleType)) {
this.fontType = '附件'
} else {
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 {
.ql-tooltip { .ql-tooltip {
left: 0px !important; left: 0px !important;
}
} }
} }
} }
::v-deep .el-button.is-disabled { }
color: var(--font-white, #fff); ::v-deep .el-button.is-disabled {
background-color: var(--bg-black-8); color: var(--font-white, #fff);
border-color: var(--border-black-8); background-color: var(--bg-black-8);
} border-color: var(--border-black-8);
::v-deep.el-dropdown [disabled] { }
color: var(--font-white, #fff); ::v-deep.el-dropdown [disabled] {
background-color: var(--bg-black-8); color: var(--font-white, #fff);
border-color: var(--border-black-8); background-color: var(--bg-black-8);
} border-color: var(--border-black-8);
.footer { }
display: flex; .footer {
justify-content: space-between; display: flex;
} justify-content: space-between;
.footerColor { }
font-weight: 500; .footerColor {
font-size: 18px; font-weight: 500;
color: var(--color); font-size: 18px;
margin: 0 4px; color: var(--color);
} margin: 0 4px;
.radius { }
border-radius: 4px; .radius {
} border-radius: 4px;
.boxClass { }
padding: 20px 10px 0 0; .boxClass {
} 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>
<template>
<div style="height: 100%">
<div class="g-left-right">
<div class="left g-card">
<div class="title">
<div class="title-name">
<el-icon-arrow-up class="el-icon-arrow-up mr5"></el-icon-arrow-up>
全部
</div>
<div class="title-btn" @click="addGroup(0)">添加</div>
</div>
<el-scrollbar class="item-list">
<div
class="item"
:class="{ active: groupIndex == key }"
v-for="(group, key) in groupList"
:key="group.id"
@click="switchGroup(key, group)"
>
<div class="name">{{ group.name }}</div>
<el-dropdown
v-if="groupIndex == key"
class="dropdown"
@command="onGroupCommand($event, group)"
>
<span class="dot">
<el-icon-MoreFilled class="el-icon-MoreFilled"></el-icon-MoreFilled>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="moveUp" v-if="key !== 0">上移</el-dropdown-item>
<el-dropdown-item command="moveDown" v-if="key !== groupList.length - 1"
>下移</el-dropdown-item
>
<el-dropdown-item command="edit">修改分组</el-dropdown-item>
<el-dropdown-item command="remove" v-if="group.fixed !== 1"
>删除分组</el-dropdown-item
>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</el-scrollbar>
</div>
<div class="right">
<div class="g-card">
<div class="mid-action">
<el-button type="primary" @click="add(0)">新建字段</el-button>
<div>
<el-button type="primary" plain @click="removeFn('mult')">批量删除</el-button>
</div>
</div>
<el-table
v-loading="loading"
:data="list"
@selection-change="handleSelectionChange"
:default-sort="{ prop: 'sort', order: 'descending' }"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column
label="字段名称"
align="center"
min-width="100"
prop="name"
show-overflow-tooltip
/>
<el-table-column
label="字段类型"
align="center"
min-width="100"
prop="type"
show-overflow-tooltip
>
<template #default="{ row }">
{{ row.typeStr }}
</template>
</el-table-column>
<el-table-column
label="字段说明/字段值"
align="center"
min-width="100"
prop="type"
show-overflow-tooltip
>
<template #default="{ row }">
{{ row.expound ? row.expound : row.value ? row.value : '-' }}
</template>
</el-table-column>
<el-table-column label="最近操作记录" align="center" width="180">
<template #default="{ row }">
<div>{{ row.updateBy }}</div>
<div>{{ row.updateTime }}</div>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
fixed="right"
width="180"
class-name="small-padding fixed-width"
>
<template #default="{ row }">
<el-button text @click="getListMove(row.catalogueId, row.id, 0)" v-if="!row.isFirst"
>上移</el-button
>
<el-button text @click="getListMove(row.catalogueId, row.id, 1)" v-if="!row.isLast"
>下移</el-button
>
<el-button text @click="add(row.id)">编辑</el-button>
<el-button text @click="removeFn('single', row.id)" v-if="row.fixed !== 1"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
v-model:page="query.pageNum"
v-model:limit="query.pageSize"
@pagination="getList()"
/>
</div>
</div>
</div>
<el-dialog :title="`${groupForm.id ? '修改' : '新建'}分组`" v-model="groupVisible" width="30%">
<el-form :model="groupForm" :rules="rules" ref="groupForm">
<el-form-item label="分组名称" prop="name" label-width="80px">
<el-input
v-model="groupForm.name"
clearable
autocomplete="off"
maxlength="15"
show-word-limit
></el-input>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="groupVisible = false">取 消</el-button>
<el-button type="primary" @click="onAddOrUpdateGroup">确 定</el-button>
</div>
</template>
</el-dialog>
<Add
:visible="visible"
:catalogueId="query.catalogueId"
:editId="editId"
@close="handleClose"
/>
</div>
</template>
<script>
import Add from './add'
import {
getList,
remove,
listMove,
fnRemove,
getCodeCategoryList,
addCodeCategory,
updateCodeCategory,
removeCodeCategory,
moveCodeCategory,
} from '@/api/salesCenter/orderInfo'
//
export default {
name: 'OrderInfo', // 订单信息
components: { Add },
data() {
return {
// 查询参数
query: {
pageNum: 1,
pageSize: 10,
catalogueId: '',
},
qrUserName: undefined,
userArray: [], // 选择人员
userArrayStr: '',
dialogVisible: false,
// 遮罩层
loading: false,
// 选中数组
ids: [],
// 总条数
total: 0,
// 表格数据
list: [],
// 表单参数
form: {
codeType: 3,
qrcode: '',
isJoinConfirmFriends: 0,
weEmpleCodeTags: [],
weEmpleCodeUseScops: [],
},
groupList: [],
groupVisible: false,
groupForm: {
name: '',
},
rules: {
name: [
{
required: true,
message: '请输入分组名称',
trigger: 'blur',
},
{
min: 1,
max: 15,
message: '长度在 1 到 15 个字符',
trigger: 'blur',
},
],
},
groupIndex: 0,
visible: false,
typeList: [],
editId: undefined,
}
},
created() {
this.getCodeCategoryListFn()
this.$store.setBusininessDesc(
`
<div>可自定义修改客户画像中的订单信息项供企业个性化使用</div>
`
)
},
mounted() {},
methods: {
getListMove(catalogueId, id, direction) {
let obj = { id, direction, catalogueId }
listMove(obj).then((res) => {
if (res.code === 200) {
this.getList()
}
})
},
handleClose(val) {
if (val) {
// 新建字段提交
this.getList()
}
this.visible = false
},
add(id) {
this.visible = true
if (id) {
// 编辑
this.editId = id
}
},
move(direction, id) {
let obj = { direction, id }
moveCodeCategory(obj).then((res) => {
if (res.code === 200) {
this.getCodeCategoryListFn()
}
})
},
addGroup() {
this.groupForm = {
name: '',
}
this.groupVisible = true
},
getCodeCategoryListFn() {
getCodeCategoryList().then((res) => {
if (res.code == 200) {
this.groupList = res.data
this.query.catalogueId = this.groupList[0].id
this.groupIndex = 0
this.query.pageNum = 1
this.getList()
}
})
},
switchGroup(index, data) {
this.groupIndex = index
this.query.catalogueId = data.id
this.getList()
},
getList() {
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
rows[0].isFirst = true
rows[rows.length - 1].isLast = true
this.list = rows
this.total = Number(total)
this.loading = false
this.ids = []
})
.catch(() => {
this.loading = false
})
},
/** 重置按钮操作 */
resetQuery() {
// this.query.qrName = ''
this.userArray = []
// this.query.qrUserIds = ''
this.qrUserName = ''
// this.query.userArrayStr = ''
// this.search()
},
goRoute(path, id) {
this.$router.push({ path: path, query: { id, catalogueId: this.query.catalogueId } })
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id)
},
/** 删除按钮操作 */
removeFn(type, id) {
if (type === 'mult' && !this.ids.length) {
this.msgInfo('请选择要删除项!')
return
}
const ids = this.ids.join(',')
this.$confirm('是否确认删除?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
if (id) {
return remove(id)
} else {
return fnRemove(ids)
}
})
.then(() => {
this.msgSuccess('删除成功')
this.getList()
})
.catch(function () {})
},
// download(qrCode, qrName) {
// let name = qrName + '.png'
// this.downloadByBlob(qrCode, name)
// },
// downloadByBlob(url, name) {
// let image = new Image()
// image.setAttribute('crossOrigin', 'anonymous')
// image.src = url
// image.onload = () => {
// let canvas = document.createElement('canvas')
// canvas.width = image.width
// canvas.height = image.height
// let ctx = canvas.getContext('2d')
// ctx.drawImage(image, 0, 0, image.width, image.height)
// canvas.toBlob((blob) => {
// let url = URL.createObjectURL(blob)
// this.downloadFn(url, name)
// // 用完释放URL对象
// URL.revokeObjectURL(url)
// })
// }
// },
// downloadFn(href, name) {
// let eleLink = document.createElement('a')
// eleLink.download = name
// eleLink.href = href
// eleLink.click()
// eleLink.remove()
// },
// 新增分组
onAddOrUpdateGroup() {
this.$refs.groupForm.validate((validate) => {
console.log(this.groupForm)
if (this.groupForm.id) {
let obj = {
id: this.groupForm.id,
name: this.groupForm.name,
}
this.groupForm = obj
}
if (validate) {
;(this.groupForm.id ? updateCodeCategory : addCodeCategory)(this.groupForm).then(
(res) => {
this.groupVisible = false
this.groupForm = {
name: '',
}
this.$refs.groupForm.clearValidate()
this.getCodeCategoryListFn()
}
)
}
})
},
onGroupCommand(e, group) {
if (group.id === '1') {
this.msgInfo('默认分组不可操作!')
return
}
if (e == 'edit') {
this.editGroup(group)
} else if (e == 'remove') {
this.removeGroup(group.id)
} else if (e == 'moveUp') {
// 上移
this.move(0, group.id)
} else if (e == 'moveDown') {
// 下移
this.move(1, group.id)
}
},
editGroup(group) {
this.groupForm = JSON.parse(JSON.stringify(group))
this.groupVisible = true
},
removeGroup(id) {
// this.$confirm('确认删除当前分组? 删除后其下活码将移至默认分组!', '提示', {
this.$confirm(
'是否确认删除当前分组?删除后该分组下所有字段同步删除,该操作不可撤销,请谨慎操作。',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
removeCodeCategory(id).then((res) => {
this.getCodeCategoryListFn()
})
})
.catch(() => {})
},
},
}
</script>
<style lang="scss" scoped>
[class*='el-col-'] {
overflow: auto;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
}
.my-divider {
display: block;
height: 1px;
width: 100%;
background-color: var(--bg-black-9);
}
.hover-item {
font-size: 12px;
font-weight: 400;
color: var(--color);
padding: 6px 15px;
cursor: pointer;
&:hover {
background-color: var(--bg-black-11);
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!