Commit c2c7d4cc by xinla

修改bug

1 parent 9f5cb278
......@@ -14,16 +14,18 @@ export default {
type: String,
default: '选择标签'
},
// selected: {
// type: Array,
// default: () => [],
// },
// "标签分组类型(1:客户标签;2:群标签)"
type: {
type: String,
default: '1'
},
destroyOnClose: Boolean,
// 已选中的标签,一般用于回显
selected: {
type: Array,
default: () => []
},
// 已选中的标签,一般用于回显,(下一主版本弃用)
defaultValues: {
type: Array,
default: () => []
......@@ -38,6 +40,13 @@ export default {
}
},
watch: {
selected: {
handler(val = []) {
this.selectedList = [...val]
},
immediate: true
},
// 下一主版本弃用
defaultValues: {
handler(val = []) {
this.selectedList = [...val]
......
<script>
import { upload } from '@/api/material'
import Video from 'video.js'
import BenzAMRRecorder from 'benz-amr-recorder'
export default {
name: 'Upload',
components: {},
......@@ -50,7 +51,7 @@ export default {
created() {},
mounted() {},
methods: {
handleBeforeUpload(file) {
async handleBeforeUpload(file) {
this.loading = true
let isFormat = true,
isSize = true
......@@ -76,6 +77,17 @@ export default {
if (!isSize) {
this.$message.error('上传文件大小不能超过 2MB!')
}
let amr = new BenzAMRRecorder()
try {
await amr.initWithBlob(file)
isSize = amr.getDuration() <= 60
if (!isSize) {
this.$message.error('上传文件时长不能超过 60秒!')
}
} catch (error) {
console.log(error)
this.$message.error('文件损坏')
}
} else if (this.type === '2') {
// 视频
isFormat = file.type === 'video/mp4'
......
......@@ -40,9 +40,10 @@ export default {
this.$playRec.onEnded(() => {
this.actived = false
})
console.log('amr 时长:' + this.$playRec.getDuration())
})
.catch(e => {
this.$message.error('播放录音失败')
.catch((e) => {
this.$message.error('播放录音失败,或文件损坏')
})
}
// this.audioSrc = [JSON.parse(this.message.contact)[type]]
......
......@@ -9,6 +9,10 @@ $yellow: #ffcf0e;
$panGreen: #30b08f;
$grayBg: #efeff4;
$sub-text-color: #999;
.sub-text-color {
color: $sub-text-color;
}
// sidebar
$menuText: #333;
$menuActiveText: #333;
......
......@@ -193,7 +193,7 @@ export default {
<div class="mid-action">
<div>
<el-button type="primary" @click="goRoute()">新建自动拉群</el-button>
<el-button type="primary" @click="goRoute()">新建活码</el-button>
</div>
<div>
<el-button type="primary" :disabled="!ids.length" @click="downloadBatch()"
......@@ -224,28 +224,20 @@ export default {
</el-image>
</template> -->
</el-table-column>
<el-table-column
prop="emplList"
label="使用员工"
align="center"
:show-overflow-tooltip="true"
>
<div v-if="row.emplList" slot-scope="{ row }">
<el-popover placement="bottom" trigger="hover" :disabled="row.emplList.length < 3">
<div>
<el-tag v-for="(unit, unique) in row.emplList" :key="unique">
{{ unit.businessName }}
</el-tag>
</div>
<div slot="reference">
<el-tag v-for="(unit, unique) in row.emplList.slice(0, 2)" :key="unique">
{{ unit.businessName }}
</el-tag>
<el-tag key="a" v-if="row.emplList.length > 2">...</el-tag>
<el-table-column prop="emplList" label="使用员工" align="center">
<template #default="{ row }">
<el-popover
v-if="row.emplList"
placement="bottom"
trigger="hover"
:content="row.emplList.map((d) => d.businessName).join()"
>
<div slot="reference" class="table-desc toe">
<!-- {{ getDisplayRealGroups(row) }} -->
{{ row.emplList.map((d) => d.businessName).join() }}
</div>
</el-popover>
</div>
<span v-else>无</span>
</template>
</el-table-column>
<el-table-column label="客户标签" align="center">
<div v-if="row.tagList" slot-scope="{ row }">
......
......@@ -291,15 +291,15 @@ export default {
<div v-if="row.tagList" slot-scope="{ row }">
<el-popover placement="bottom" trigger="hover" :disabled="row.tagList.length < 3">
<div>
<el-tag type="info" v-for="(unit, unique) in row.tagList" :key="unique">
<el-tag v-for="(unit, unique) in row.tagList" :key="unique">
{{ unit.name }}
</el-tag>
</div>
<div slot="reference">
<el-tag type="info" v-for="(unit, unique) in row.tagList.slice(0, 2)" :key="unique">
<el-tag v-for="(unit, unique) in row.tagList.slice(0, 2)" :key="unique">
{{ unit.name }}
</el-tag>
<el-tag type="info" key="a" v-if="row.tagList.length > 2">...</el-tag>
<el-tag key="a" v-if="row.tagList.length > 2">...</el-tag>
</div>
</el-popover>
</div>
......
......@@ -206,6 +206,10 @@ export default {
// this.$refs.selectTag.$forceUpdate()
},
sync() {
if (this.isSync) {
this.msgError('由于企业微信开放平台的限制,两小时内不得重复同步操作')
return
}
const loading = this.$loading({
lock: true,
text: 'Loading',
......@@ -216,6 +220,7 @@ export default {
.sync()
.then(() => {
loading.close()
this.getList(1)
this.msgSuccess('后台开始同步数据,请稍后关注进度')
})
.catch((fail) => {
......@@ -344,9 +349,7 @@ export default {
<div class="tag-input" @click="showTagDialog">
<span class="tag-place" v-if="!queryTag.length">请选择</span>
<template v-else>
<el-tag type="info" v-for="(unit, unique) in queryTag" :key="unique">{{
unit.name
}}</el-tag>
<el-tag v-for="(unit, unique) in queryTag" :key="unique">{{ unit.name }}</el-tag>
</template>
</div>
</el-form-item>
......@@ -354,9 +357,7 @@ export default {
<div class="tag-input" @click="dialogVisibleSelectUser = true">
<span class="tag-place" v-if="!queryUser.length">请选择</span>
<template v-else>
<el-tag type="info" v-for="(unit, unique) in queryUser" :key="unique">{{
unit.name
}}</el-tag>
<el-tag v-for="(unit, unique) in queryUser" :key="unique">{{ unit.name }}</el-tag>
</template>
</div>
</el-form-item>
......@@ -418,7 +419,8 @@ export default {
<span class="num">{{ total }}</span> 位客户,实际客户
<span class="num">{{ total }}</span> 位。 -->
<el-tooltip
:disabled="isSync"
effect="light"
:disabled="!isSync"
class="item"
content="由于企业微信开放平台的限制,两小时内不得重复同步操作"
placement="top-start"
......@@ -426,18 +428,17 @@ export default {
<el-button
v-hasPermi="['customerManage:customer:sync']"
v-preventReClick
:disabled="isSync"
type="primary"
@click="sync"
>同步客户</el-button
>
</el-tooltip>
<!-- <el-button v-hasPermi="['customerManage:customer:checkRepeat']" type="primary">查看重复客户</el-button> -->
<span> 最近同步:{{ lastSyncTime }} </span>
<span class="sub-text-color"> 最近同步:{{ lastSyncTime }} </span>
</div>
</div>
<div>客户总数(去重):{{ noRepeatCustomerTotal }}</div>
<div class="sub-text-color">客户总数(去重):{{ noRepeatCustomerTotal }}</div>
<el-table
ref="table"
......@@ -451,7 +452,11 @@ export default {
<el-table-column label="客户" prop="customerName" align="center">
<template slot-scope="{ row }">
<div class="cp flex aic" @click="goRoute(row)">
<el-image style="width: 50px; height: 50px;" :src="row.avatar" fit="fit"></el-image>
<el-image
style="width: 50px; height: 50px; flex:none;"
:src="row.avatar"
fit="fit"
></el-image>
<div class="ml10">
{{ row.customerName }}
<span :style="{ color: row.customerType === 1 ? '#4bde03' : '#f9a90b' }">{{
......@@ -462,19 +467,19 @@ export default {
</div>
</template>
</el-table-column>
<el-table-column prop="tagNames" label="客户标签" align="center">
<el-table-column prop="tagNames" label="客户标签" align="center" width="220">
<div v-if="row.tagNames" slot-scope="{ row }">
<el-popover placement="bottom" trigger="hover" :disabled="row.tagNames.length < 3">
<div>
<el-tag type="info" v-for="(unit, unique) in row.tagNames" :key="unique">
<el-tag v-for="(unit, unique) in row.tagNames" :key="unique">
{{ unit }}
</el-tag>
</div>
<div slot="reference">
<el-tag type="info" v-for="(unit, unique) in row.tagNames.slice(0, 2)" :key="unique">
<el-tag v-for="(unit, unique) in row.tagNames.slice(0, 2)" :key="unique">
{{ unit }}
</el-tag>
<el-tag type="info" key="a" v-if="row.tagNames.length > 2">...</el-tag>
<el-tag key="a" v-if="row.tagNames.length > 2">...</el-tag>
</div>
</el-popover>
</div>
......@@ -502,7 +507,7 @@ export default {
}}</template> -->
</el-table-column>
<el-table-column label="操作" width="160" align="center">
<el-table-column label="操作" width="200" align="center">
<template slot-scope="{ row }">
<el-button
v-hasPermi="['customerManage:customer:view']"
......
......@@ -25,10 +25,15 @@ export default {
},
recod: [],
active: '0',
openTrack: ['0']
openTrack: ['0'],
lastSyncTime: 0
}
},
computed: {
isSync() {
return (+new Date() - +new Date(this.lastSyncTime)) / 3600000 < 2
}
},
computed: {},
watch: {},
created() {
this.userId ? this.getCustomerInfoByUserId() : this.getSummary()
......@@ -77,8 +82,13 @@ export default {
this.active = type
},
sync() {
this.openTrack = [null]
if (this.isSync) {
this.msgError('由于企业微信开放平台的限制,两小时内不得重复同步操作')
return
}
this.openTrack = ['0']
this.active = '0'
this.$refs['record'][0].$forceUpdate()
}
}
}
......@@ -96,7 +106,8 @@ export default {
:key="index"
:class="['flex', index && 'mt20']"
>
<div style="width:60px;flex: none;">{{ item.userName }}:</div>
<div class="name oe">{{ item.userName }}</div>
:
<template v-if="item.tagNames">
<el-tag
type="info"
......@@ -105,7 +116,7 @@ export default {
>{{ unit }}</el-tag
>
</template>
<div v-else>
<div v-else class="sub-text-color">
暂无标签
</div>
</div>
......@@ -118,7 +129,8 @@ export default {
:key="index"
:class="['flex', index && 'mt20']"
>
<div style="width:60px;flex: none;">{{ item.userName }}:</div>
<div class="name oe">{{ item.userName }}</div>
:
<template v-if="item.tagNames">
<el-tag
type="info"
......@@ -127,7 +139,7 @@ export default {
>{{ unit }}</el-tag
>
</template>
<div v-else>
<div v-else class="sub-text-color">
暂无标签
</div>
</div>
......@@ -135,26 +147,30 @@ export default {
<el-card class="mb10" shadow="never">
<div slot="header" class="card-title">跟进状态</div>
<div class="fxbw mb20" v-for="(item, index) of portrayalSum.trackStates" :key="index">
<div style="width:60px;flex: none;">{{ item.userName }}:</div>
<el-steps
style="flex:auto;"
:active="item.trackStateList.length"
finish-status="success"
>
<el-step
v-for="(unit, unique) of item.trackStateList"
:key="unique"
:title="dictTrackState[~~unit.trackState + ''].name"
:description="unit.trackTime"
></el-step>
</el-steps>
</div>
<template v-if="portrayalSum.trackStates && portrayalSum.trackStates.length">
<div class="fxbw mb20" v-for="(item, index) of portrayalSum.trackStates" :key="index">
<div class="name oe">{{ item.userName }}</div>
:
<el-steps
style="flex:auto;"
:active="item.trackStateList.length"
finish-status="success"
>
<el-step
v-for="(unit, unique) of item.trackStateList"
:key="unique"
:title="dictTrackState[~~unit.trackState + ''].name"
:description="unit.trackTime"
></el-step>
</el-steps>
</div>
</template>
<div v-else class="ac sub-text-color">暂无数据</div>
</el-card>
<el-card shadow="never">
<div slot="header" class="card-title">跟进记录</div>
<el-tabs value="0">
<el-tabs v-if="portrayalSum.trackStates && portrayalSum.trackStates.length" value="0">
<el-tab-pane
v-for="(item, index) in portrayalSum.trackStates"
:key="index"
......@@ -163,15 +179,32 @@ export default {
<record :userId="item.userId" viewType="1"></record>
</el-tab-pane>
</el-tabs>
<div v-else class="ac sub-text-color">暂无数据</div>
</el-card>
</div>
</el-col>
<el-col :span="10">
<div class="right">
<el-card>
<div slot="header">
<span class="card-title">客户轨迹</span>
<span style=" color: #13a2e8;" class="fr cp" @click="sync">同步</span>
<el-tooltip
effect="light"
:disabled="!isSync"
class="item"
content="由于企业微信开放平台的限制,两小时内不得重复同步操作"
placement="top-start"
>
<el-button
v-preventReClick
style="color: #13a2e8;padding: 0;"
class="fr cp"
type="text"
@click="sync"
>同步</el-button
>
</el-tooltip>
</div>
<div class="flex track-tab-wrap mb15">
<div
......@@ -185,6 +218,7 @@ export default {
</div>
<template v-for="(item, index) in openTrack">
<record
ref="record"
v-show="item === active"
:key="index"
:userId="userId"
......@@ -199,6 +233,11 @@ export default {
</template>
<style lang="scss" scoped>
.name {
width: 65px;
flex: none;
text-align: right;
}
.el-card {
.el-row {
color: #666;
......
......@@ -83,16 +83,16 @@ export default {
<div class="ml10">
<div>
{{ customer.customerName + (customer.corpName ? '-' + customer.corpName : '') }}
<span :style="{ color: customer.customerType === 1 ? '#4bde03' : '#f9a90b' }">{{
{ 1: '@微信', 2: '@企业微信' }[customer.customerType]
}}</span>
<span :style="{ color: customer.customerType === 1 ? '#4bde03' : '#f9a90b' }">
{{ { 1: '@微信', 2: '@企业微信' }[customer.customerType] }}
</span>
<i :class="['el-icon-s-custom', { 1: 'man', 2: 'woman' }[customer.gender]]"></i>
</div>
<div class="mt10">
<template v-if="customer.tagNames">
<el-tag v-for="(unit, unique) in customer.tagNames.split(',')" :key="unique">{{
unit
}}</el-tag>
<el-tag v-for="(unit, unique) in customer.tagNames.split(',')" :key="unique">
{{ unit }}
</el-tag>
</template>
<div v-else>
暂无标签
......
......@@ -26,8 +26,8 @@ export default {
ids: [],
// 非多个禁用
multiple: true,
// 总条数
lastSyncTime: '',
// 总条数
total: 0,
// 表格数据
list: [],
......@@ -41,6 +41,11 @@ export default {
makeLabelCustomerList: []
}
},
computed: {
isSync() {
return (+new Date() - +new Date(this.lastSyncTime)) / 3600000 < 2
}
},
created() {
this.getList()
},
......@@ -138,6 +143,10 @@ export default {
this.getList(1)
},
sync() {
if (this.isSync) {
this.msgError('由于企业微信开放平台的限制,两小时内不得重复同步操作')
return
}
const loading = this.$loading({
lock: true,
text: 'Loading',
......@@ -187,9 +196,7 @@ export default {
<div class="tag-input" @click="showTagDialog">
<span class="tag-place" v-if="!queryTag.length">请选择</span>
<template v-else>
<el-tag type="info" v-for="(unit, unique) in queryTag" :key="unique">{{
unit.name
}}</el-tag>
<el-tag v-for="(unit, unique) in queryTag" :key="unique">{{ unit.name }}</el-tag>
</template>
</div>
</el-form-item>
......@@ -224,7 +231,7 @@ export default {
<el-button v-hasPermi="['customerManage:group:sync']" type="primary" @click="sync"
>同步客户群</el-button
>
<span>
<span class="sub-text-color">
最近同步:{{ lastSyncTime }}
<!-- <span class="num">{{total}}</span> 条信息 ,
共
......@@ -244,22 +251,22 @@ export default {
<el-table-column label="群主" align="center" prop="groupLeaderName" />
<el-table-column label="群人数" align="center" prop="memberNum" />
<el-table-column prop="tagNames" label="群标签" align="center">
<template slot-scope="{ row }">
<template v-if="row.tags">
<template v-for="(item, index) in row.tags">
<el-tag size="mini" v-if="index < 2" :key="index">{{ item }}</el-tag>
</template>
<el-popover trigger="hover" width="200" v-if="row.tags.length > 2">
<template v-for="(unit, index) in row.tags">
<el-tag class="mb5" :key="index" v-if="index > 1" size="mini">{{ unit }}</el-tag>
</template>
<div style="display:inline;" slot="reference">
<el-tag size="mini">...</el-tag>
</div>
</el-popover>
</template>
<span v-else>无标签</span>
</template>
<div v-if="row.tagNames" slot-scope="{ row }">
<el-popover placement="bottom" trigger="hover">
<div>
<el-tag v-for="(unit, unique) in row.tags" :key="unique">
{{ unit }}
</el-tag>
</div>
<div slot="reference">
<el-tag v-for="(unit, unique) in row.tags.slice(0, 2)" :key="unique">
{{ unit }}
</el-tag>
<el-tag key="a" v-if="row.tags.length > 2">...</el-tag>
</div>
</el-popover>
</div>
<span v-else>无标签</span>
</el-table-column>
<el-table-column
label="创建时间"
......
......@@ -222,9 +222,10 @@ export default {
<!-- 选择标签弹窗 -->
<SelectTag
ref="selectTag"
type="2"
:visible.sync="dialogVisible"
:title="tagDialogType.title"
:selected="selectedTag"
:defaultValues="selectedTag"
@success="submitSelectTag"
>
</SelectTag>
......
......@@ -42,7 +42,13 @@ export default {
// 总条数
total: 0,
// 表格数据
list: []
list: [],
lastSyncTime: 0
}
},
computed: {
isSync() {
return (+new Date() - +new Date(this.lastSyncTime)) / 3600000 < 2
}
},
created() {
......@@ -55,9 +61,10 @@ export default {
this.loading = true
api
.getList(this.query)
.then(({ rows, total }) => {
.then(({ rows, total, lastSyncTime }) => {
this.list = rows
this.total = +total
this.lastSyncTime = lastSyncTime
this.loading = false
})
.catch(() => {
......@@ -71,17 +78,26 @@ export default {
this.dialogVisible = true
},
syncTag() {
if (this.isSync) {
this.msgError('由于企业微信开放平台的限制,两小时内不得重复同步操作')
return
}
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
api.syncTag().then(() => {
loading.close()
this.msgSuccess('操作成功')
this.getList()
})
api
.syncTag()
.then(() => {
loading.close()
this.msgSuccess('后台开始同步数据,请稍后关注进度')
this.getList()
})
.catch(() => {
loading.close()
})
},
// 多选框选中数据
handleSelectionChange(selection) {
......@@ -112,14 +128,17 @@ export default {
<el-button v-hasPermi="['customerManage:tag:add']" type="primary" @click="edit()"
>新建标签组</el-button
>
<el-button
v-if="type == 1"
v-hasPermi="['customerManage:tag:sync']"
type="primary"
plain
@click="syncTag"
>同步企微标签</el-button
<el-tooltip
effect="light"
:disabled="!isSync"
class="item"
content="由于企业微信开放平台的限制,两小时内不得重复同步操作"
placement="top-start"
>
<el-button v-if="type == 1" v-preventReClick type="primary" plain @click="syncTag">
同步企微标签
</el-button>
</el-tooltip>
</div>
<div>
<el-button
......@@ -136,19 +155,22 @@ export default {
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="标签组" align="center" prop="gourpName" />
<el-table-column label="标签" align="center" prop="weTags">
<template slot-scope="scope">
<template v-for="(item, index) in scope.row.weTags">
<el-tag v-if="index < 3" type="primary" :key="index">{{ item.name }}</el-tag>
</template>
<el-popover trigger="hover" width="200">
<template v-for="(unit, index) in scope.row.weTags">
<el-tag :key="index" v-if="index >= 3" size="mini">{{ unit.name }}</el-tag>
</template>
<div style="display:inline;" slot="reference">
<el-tag v-if="scope.row.weTags.length > 3" size="mini">...</el-tag>
<div v-if="row.weTags" slot-scope="{ row }">
<el-popover placement="bottom" trigger="hover" :disabled="row.weTags.length < 3">
<div>
<el-tag v-for="(unit, unique) in row.weTags" :key="unique">
{{ unit.name }}
</el-tag>
</div>
<div slot="reference">
<el-tag v-for="(unit, unique) in row.weTags.slice(0, 2)" :key="unique">
{{ unit.name }}
</el-tag>
<el-tag key="a" v-if="row.weTags.length > 2">...</el-tag>
</div>
</el-popover>
</template>
</div>
<span v-else>无标签</span>
</el-table-column>
<!-- <el-table-column label="创建人" align="center" prop="createBy" /> -->
<!-- <el-table-column label="创建时间" align="center" prop="operTime" width="180">
......
<script>
import MaPage from '@/views/material/components/MaPage'
import Voice from '@/components/Voice'
export default {
name: 'Audio',
components: { MaPage },
components: { MaPage, Voice },
data() {
return {
ids: [] // 选中数组
......@@ -24,7 +25,11 @@ export default {
<MaPage ref="page" type="1" :selected="ids" v-slot="{ list }">
<el-table :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="语音" align="center" prop="materialName" />
<el-table-column label="语音" align="center" prop="materialUrl">
<template slot-scope="{ row }">
<Voice :amrUrl="row.materialUrl"></Voice>
</template>
</el-table-column>
<el-table-column label="时长" align="center" prop="audioTime" />
<el-table-column label="最近更新时间" align="center" prop="updateTime" width="160">
</el-table-column>
......
......@@ -18,6 +18,7 @@ import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import { quillEditor } from 'vue-quill-editor'
import Voice from '@/components/Voice'
// import {
// getList
......@@ -39,7 +40,7 @@ var validateHttp = (rule, value, callback) => {
}
export default {
name: 'MaPage',
components: { quillEditor },
components: { quillEditor, Voice },
props: {
// 0 图片(image)、1 语音(voice)、2 视频(video),3 普通文件(file), 4 文本, 5 海报, 6 海报字体", 7 图文, 8 链接,9 小程序
type: {
......@@ -149,7 +150,7 @@ export default {
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.list = rows.sort((a, b) => +new Date(b.updateTime) - +new Date(a.updateTime))
this.total = +total
this.loading = false
this.$emit('listChange', this.list)
......@@ -535,6 +536,7 @@ export default {
<template v-else-if="type === '1'">
<el-form-item label="语音" prop="materialUrl">
<Voice v-if="form.materialUrl" :amrUrl="form.materialUrl"></Voice>
<upload
:fileUrl.sync="form.materialUrl"
:fileName.sync="form.materialName"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!