Commit 732e509b by 怪兽?别跑

人群迁移

1 parent e90aaa78
import request from '@/utils/request'
const service = window.lwConfig.services.system + window.lwConfig.services.wecom + '/strategic/journey'
const service =
window.lwConfig.services.system + window.lwConfig.services.wecom + '/strategic/journey'
// import { get, post } from '@/plugins/axios'
......@@ -19,8 +20,8 @@ export function getCrowdPackDetail(id) {
// 计划列表查询接口
// name 任务名称 String 支持模糊查询
// startDate 开始日期 String YYYY-MM-DD
// endDate 结束日期 String YYYY-MM-DD
// startDate 开始日期 String yyyy-MM-dd
// endDate 结束日期 String yyyy-MM-dd
// status 状态 number 0:待完善,1:未开始,2:待运行,3:运行中,4:已暂停,5:已停止,6:正常结束,7:异常结束
// pageNum 页码 number
// pageSize 页大小 number
......
......@@ -84,3 +84,10 @@ export function crowdAnalyse(data) {
params: data,
})
}
export function deleteCategory(ids) {
return request({
url: base + '/strategic/crowd/categoryDel/' + ids,
method: 'delete',
})
}
<template>
<div>
<el-form :inline="true" :rules="rules" ref="channelLabel" :model="current" label-width="0" label-position="left">
<el-form-item prop="code">
<el-select :disabled="detail" @change="setValueList" v-model="current.code" placeholder="请选择渠道类型">
<el-option v-for="(item, key) in baseData" :key="key" :label="item.value" :value="item.code"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="value">
<el-select :disabled="detail" v-model="current.value" placeholder="请选择渠道来源">
<template v-if="current.code !== 1">
<el-option
v-for="(item, index) in valueList"
:key="index"
:label="item.value"
:value="item.code"
></el-option>
</template>
<template v-else>
<template v-for="(item, index) in valueList">
<el-option :key="index" :label="item.value" :value="item.code" v-if="item.code !== 1002"></el-option>
</template>
</template>
</el-select>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { getList } from '@/api/drainageCode/staff'
import { getChannelDetail } from '@/api/marketStrategy/people'
export default {
name: 'channel-label',
data() {
return {
current: {
code: null,
value: ''
},
valueList: [],
rules: {
code: [{ required: true, message: '请选择渠道类型', trigger: 'blur' }],
value: [{ required: true, message: '请选择渠道来源', trigger: 'blur' }]
}
}
},
props: {
detail: {
type: Boolean,
default: false
},
baseData: {
type: Array,
default: () => []
},
channel: {
type: Array,
default: () => []
},
currentData: {
type: Object,
default: () => {}
}
},
methods: {
handleValidateFn() {
let status = null
this.$refs['channelLabel'].validate((valid) => {
if (valid) {
status = true
} else {
status = false
}
})
return status
},
setValueList(data, state) {
if (!state) {
this.current.value = ''
}
getChannelDetail({ code: data }).then((res) => {
if (res.code === 200) {
this.valueList = res.rows
} else {
this.valueList = []
}
})
}
},
mounted() {
this.current = this.currentData
if (this.current.code) {
this.current.code = Number(this.current.code)
}
if (this.current.code === 1) {
this.current.value = Number(this.current.value)
}
if (this.current.code) {
this.setValueList(this.current.code, 'first')
}
}
}
</script>
<style lang="scss" scoped></style>
<template>
<div>
<el-form :inline="true" :rules="rules" ref="companyLabel" :model="current" label-width="0" label-position="left">
<el-form-item prop="code">
<el-select :disabled="detail" @change="setValueList" v-model="current.code" placeholder="请选择标签组">
<el-option v-for="(item, key) in baseData" :key="key" :label="item.value" :value="item.code"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="value">
<el-select :disabled="detail" v-model="current.value" placeholder="请选择标签">
<el-option v-for="(item, index) in valueList" :key="index" :label="item.value" :value="item.code"></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { getList } from '@/api/customer/tag'
export default {
name: 'company-label',
data () {
return {
current: {
code: null,
value: ''
},
valueList: [],
rules: {
code: [
{required: true, message:'请选择标签组', trigger:'blur'}
],
value: [
{required: true, message:'请选择标签', trigger:'blur'}
]
}
}
},
props: {
detail: {
type: Boolean,
default: false
},
baseData: {
type: Array,
default: () => []
},
currentData: {
type: Object,
default: () => { }
}
},
watch: {
baseData (val) {
if (val) {
this.setValueList(this.current.code, 'first')
}
}
},
methods: {
handleValidateFn () {
let status = null
this.$refs['companyLabel'].validate((valid) => {
if (valid) {
status = true
} else {
status = false
}
});
return status
},
setValueList (data, state) {
if (!state) {
this.current.value = ''
}
this.valueList = []
this.baseData.forEach(dd => {
if (dd.code === data) {
this.valueList = dd.child
}
})
}
},
mounted () {
this.current = this.currentData
if (this.current.code) {
this.setValueList(this.current.code, 'first')
}
},
}
</script>
<style lang="scss" scoped>
</style>
<template>
<div>
<el-form
:inline="true"
:rules="rules"
ref="customerBehavior"
:model="current"
label-width="0"
label-position="left"
>
<el-form-item>
在
</el-form-item>
<el-form-item prop="code">
<el-select :disabled="detail" @change="setValueList" v-model="current.code" placeholder="请选择行为时间">
<el-option v-for="(item, key) in baseData" :key="key" :label="item.value" :value="item.code"></el-option>
</el-select>
</el-form-item>
<template v-if="current.code === 5">
<el-form-item prop="startTime">
<el-date-picker
:disabled="detail"
key="2"
v-model="current.startTime"
type="date"
@change="setDateChange"
placeholder="选择日期"
></el-date-picker>
</el-form-item>
</template>
<template v-if="current.code === 6">
<el-form-item prop="startTime">
<el-date-picker
:disabled="detail"
key="1"
v-model="dateValue"
@change="setDate"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
</template>
<el-form-item prop="happenType">
<el-select :disabled="detail" @change="setValueState" v-model="current.happenType" placeholder="请选择发生类型">
<el-option
v-for="(item, index) in happenList"
:key="index"
:label="item.value"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item prop="behavior">
<el-select :disabled="detail" v-model="current.behavior" placeholder="请选择行为事件">
<template v-for="(item, index) in behaviorList">
<el-option :key="index" :label="item.value" :value="item.code" v-if="filterFn(item.code)"></el-option>
</template>
</el-select>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { dateFormat } from '@/utils/index'
export default {
name: 'customer-behavior',
data() {
return {
dateValue: [],
current: {
code: null,
behavior: '',
endTime: '',
happenType: '',
relation: '',
startTime: '',
value: '',
name: ''
},
rules: {
code: [{ required: true, message: '请选择行为时间', trigger: 'blur' }],
startTime: [{ required: true, message: '请选择时间', trigger: 'blur' }],
happenType: [{ required: true, message: '请选择发生类型', trigger: 'blur' }],
behavior: [{ required: true, message: '请选择行为事件', trigger: 'blur' }]
},
showList: [1, 2, 3, 4, 5, 6, 9]
}
},
props: {
detail: {
type: Boolean,
default: false
},
baseData: {
type: Array,
default: () => []
},
happenList: {
type: Array,
default: () => []
},
behaviorList: {
type: Array,
default: () => []
},
currentData: {
type: Object,
default: () => {}
}
},
methods: {
filterFn(code) {
return this.showList.includes(code)
},
handleValidateFn() {
let status = null
this.$refs['customerBehavior'].validate((valid) => {
if (valid) {
status = true
} else {
status = false
}
})
return status
},
setValueList() {
this.current.startTime = ''
this.current.endTime = ''
this.current.happenType = ''
this.current.behavior = ''
this.dateValue = []
},
setValueState() {
this.current.behavior = ''
},
setDate(data) {
if (!data) {
this.dateValue = []
this.current.startTime = ''
this.current.endTime = ''
} else {
if (data[0]) {
this.current.startTime = data[0]
}
if (data[1]) {
this.current.endTime = data[1]
}
}
},
setDateChange() {
this.current.startTime = dateFormat(this.current.startTime, 'yyyy-MM-dd')
}
},
mounted() {
this.current = this.currentData
if (this.current.code) {
this.current.code = Number(this.current.code)
}
if (this.current.happenType) {
this.current.happenType = Number(this.current.happenType)
}
if (this.current.behavior) {
this.current.behavior = Number(this.current.behavior)
}
if (this.current.startTime && this.current.endTime) {
this.dateValue = [this.current.startTime, this.current.endTime]
}
}
}
</script>
<style lang="scss" scoped></style>
<template>
<div>
<div class="header_content">
<div class="unit">
<div class="title">
今日净增人数
<el-popover placement="top" trigger="hover">
<div slot="reference" style="margin-left: 8px; cursor: pointer">
<img src="../../../assets/marketstrategy/help.svg" alt="" />
</div>
<div>本策略人群当天净增的总人数</div>
</el-popover>
</div>
<div class="value">
{{ data.netAddNum }}
</div>
</div>
<div class="unit">
<div class="title">
今日新增人数
<el-popover placement="top" trigger="hover">
<div slot="reference" style="margin-left: 8px; cursor: pointer">
<img src="../../../assets/marketstrategy/help.svg" alt="" />
</div>
<div>本策略人群当天增加的总人数</div>
</el-popover>
</div>
<div class="value">
{{ data.addNum }}
</div>
</div>
<div class="unit">
<div class="title">
今日减少人数
<el-popover placement="top" trigger="hover">
<div slot="reference" style="margin-left: 8px; cursor: pointer">
<img src="../../../assets/marketstrategy/help.svg" alt="" />
</div>
<div>本策略人群当天减少的总人数</div>
</el-popover>
</div>
<div class="value">
{{ data.reduceNum }}
</div>
</div>
</div>
<div class="bar_content pad20">
<search-title @search="getTime"></search-title>
<chart-bar :xData="xData" :legend="legend" :series="series"></chart-bar>
</div>
</div>
</template>
<script>
import SearchTitle from '@/views/customerService/components/SearchTitle'
import { crowdAnalyse } from '@/api/marketStrategy/people'
export default {
name: 'people-analyse',
data() {
return {
xData: [],
series: [],
legend: ['人群总人数'],
query: {
beginTime: '',
endTime: '',
id: '',
},
data: {
addNum: 0,
netAddNum: 0,
reduceNum: 0,
},
}
},
components: {
ChartBar: () => import('@/components/ChartBar'),
SearchTitle,
},
methods: {
getTime(data) {
this.query.beginTime = data.beginTime
this.query.endTime = data.endTime
if (this.query.id) {
this.getData()
}
},
getData() {
crowdAnalyse(this.query).then((res) => {
if (res.code === 200) {
this.data.netAddNum = res.data.netAddNum
this.data.addNum = res.data.addNum
this.data.reduceNum = res.data.reduceNum
this.xData = res.data.crowdAnalyzels.map((dd) => {
return dd.dateTime
})
this.series = res.data.crowdAnalyzels.map((dd) => {
return dd.total
})
}
})
},
},
created() {
this.query.id = this.$route.query.id
},
}
</script>
<style lang="scss" scoped>
.header_content {
display: flex;
.unit {
background: #ffffff;
// box-shadow: 0px 6px 30px 5px rgba(59, 59, 59, 0.05);
border-radius: 8px;
margin-right: 16px;
width: 210px;
height: 100px;
padding: 18px 20px;
display: flex;
flex-direction: column;
justify-content: space-between;
.title {
font-size: 14px;
font-weight: 500;
color: rgba(0, 0, 0, 0.6);
display: flex;
justify-content: space-between;
}
.value {
font-size: 28px;
font-weight: bold;
color: #0079de;
}
}
}
.bar_content {
margin-top: 16px;
background: #ffffff;
border-radius: 8px;
}
</style>
<template>
<div class="g-card">
<el-table ref="table" :data="list" tooltip-effect="dark" highlight-current-row>
<el-table-column label="客户" prop="customerName" header-align="center" align="" width="180">
<template slot-scope="{ row }">
<div class="cp flex aic" @click="goRoute(row)">
<el-image style="width: 50px; height: 50px; flex: none" :src="row.avatar" fit="fit"></el-image>
<div class="ml10">
<p>{{ row.customerName }}</p>
<i :class="['el-icon-s-custom', { 1: 'man', 2: 'woman' }[row.gender]]"></i>
<span :style="{ color: row.customerType === 1 ? '#4bde03' : '#f9a90b' }">
{{ { 1: '@微信', 2: '@企业微信' }[row.customerType] }}
</span>
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="tagNames" label="客户标签" align="center" width="220">
<div v-if="row.tagNames" slot-scope="{ row }">
<TagEllipsis :list="row.tagNames.split(',')"></TagEllipsis>
</div>
<span v-else>无标签</span>
</el-table-column>
<el-table-column prop="userName" label="跟进员工" align="center"></el-table-column>
<el-table-column prop="trackState" label="跟进状态" align="center">
<template slot-scope="{ row }">
<el-tag v-if="row.trackState" :type="dictTrackState[~~row.trackState + ''].color">
{{ dictTrackState[~~row.trackState + ''].name }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="addMethod" label="添加方式" align="center">
<template slot-scope="{ row }">{{ dictAddType[row.addMethod + ''] }}</template>
</el-table-column>
<el-table-column prop="firstAddTime" label="添加时间" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="{ row }">
<el-button @click="goRoute(row)" type="text" size="small">查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getData()" />
</div>
</template>
<script>
import { dictAddType, dictTrackState } from '@/utils/dictionary'
import { customerInCrowd } from '@/api/marketStrategy/people'
export default {
name: 'people-customer-detail',
data() {
return {
list: [],
total: 0,
query: {
pageNum: 1,
pageSize: 10,
id: '',
},
dictCustomerType: Object.freeze({ 1: '微信客户', 2: '企业客户' }),
dictAddType,
dictTrackState,
}
},
methods: {
goRoute(row) {
let { externalUserid, firstUserId: userId } = row
this.$router.push({
path: '/operateCenter/customerManage/customerDetail',
query: { externalUserid, userId },
})
},
getData() {
customerInCrowd(this.query).then((res) => {
if (res.code === 200) {
this.list = res.rows
this.total = Number(res.total)
}
})
},
},
created() {
this.query.id = this.$route.query.id
if (this.query.id) {
this.getData()
}
},
}
</script>
<style lang="scss" scoped>
.el-icon-s-custom {
font-size: 16px;
// margin-left: 4px;
color: #999;
&.man {
color: #13a2e8;
}
&.woman {
color: #f753b2;
}
}
</style>
<template>
<div>
<div v-for="(unit, key) in swipe" :key="key">
<div class="relation" v-if="key !== 0">
<span
v-if="unit.andOr === 1"
class="relation_button"
:class="{ relation_active: unit.andOr === 1 }"
style="margin-right: 16px;"
>且</span
>
<span v-if="unit.andOr === 2" class="relation_button" :class="{ relation_active: unit.andOr === 2 }">或</span>
</div>
<el-card>
<div class="card_header">
<div>
<show-people-title :titleType="unit.swipType"></show-people-title>
</div>
</div>
<template v-if="unit.swipType === 1">
<channel-label :currentData="unit" :detail="true" :baseData="baseEnum.CorpAddStateEnum"></channel-label>
</template>
<template v-if="unit.swipType === 2">
<company-label :currentData="unit" :detail="true" :baseData="baseEnum.WeCorpTagEnum"></company-label>
</template>
<template v-if="unit.swipType === 3">
<customer-attributes
:currentData="unit"
:detail="true"
:baseData="baseEnum.CustomerAttributesEnum"
:relationData="baseEnum.RelationEnum"
></customer-attributes>
</template>
<template v-if="unit.swipType === 4">
<customer-behavior
:currentData="unit"
:detail="true"
:baseData="baseEnum.CustomerBehaviorTimeEnum"
:happenList="baseEnum.CustomerBehaviorTypeEnum"
:behaviorList="baseEnum.CustomerBehaviorEnum"
></customer-behavior>
</template>
<template v-if="unit.swipType === 5">
<strategic-crowd :currentData="unit" :detail="true" :baseData="baseEnum.StrategicCrowdEnum"></strategic-crowd>
</template>
</el-card>
</div>
</div>
</template>
<script>
import ShowPeopleTitle from '../components/ShowPeopleTitle'
import ChannelLabel from '../components/ChannelLabel'
import CompanyLabel from '../components/CompanyLabel'
import CustomerAttributes from '../components/CustomerAttributes'
import CustomerBehavior from '../components/CustomerBehavior'
import StrategicCrowd from '../components/StrategicCrowd'
import { getBaseData } from '@/api/marketStrategy/people'
export default {
name: 'people-filter',
data() {
return {
baseEnum: {
CorpAddStateEnum: [],
CustomerBehaviorTypeEnum: [],
CustomerAttributesEnum: [],
CustomerBehaviorEnum: [],
CustomerBehaviorTimeEnum: [],
RelationEnum: [],
StrategicCrowdEnum: [],
WeCorpTagEnum: []
}
}
},
props: {
swipe: {
type: Array,
default: () => []
}
},
components: {
ShowPeopleTitle,
ChannelLabel,
CompanyLabel,
CustomerAttributes,
CustomerBehavior,
StrategicCrowd
},
methods: {
getInitData() {
// CorpAddStateEnum //渠道标签
// WeCorpTagEnum //企业标签
// CustomerAttributesEnum //客户属性
// CustomerBehaviorEnum //客户行为
// CustomerBehaviorTimeEnum //客户行为时间
// RelationEnum, StrategicCrowdEnum //策略人群
// CustomerBehaviorTypeEnum // 客户行为发生类型
getBaseData([
'CorpAddStateEnum',
'WeCorpTagEnum',
'CustomerAttributesEnum',
'CustomerBehaviorEnum',
'CustomerBehaviorTimeEnum',
'RelationEnum',
'StrategicCrowdEnum',
'CustomerBehaviorTypeEnum'
]).then((res) => {
if (res.code === 200) {
this.baseEnum = res.data
}
})
}
},
created() {
this.getInitData()
}
}
</script>
<style lang="scss" scoped>
.card_header {
padding-bottom: 15px;
border-bottom: 1px solid #f1f1f1;
font-size: 14px;
font-weight: 500;
display: flex;
justify-content: space-between;
align-items: center;
.delete {
color: #0079de;
font-size: 16px;
cursor: pointer;
&:hover {
opacity: 0.7;
}
}
}
.relation {
display: flex;
justify-content: center;
padding: 10px;
}
.relation_button {
height: 32px;
line-height: 32px;
border-radius: 3px 3px 3px 3px;
border: 1px solid #0079de;
color: #0079de;
font-size: 16px;
padding: 0 24px;
cursor: pointer;
&:hover {
opacity: 0.7;
}
}
.relation_active {
background-color: #0079de;
color: #fff;
}
</style>
<template>
<div class="show_title">
<div v-if="titleType === 1">
<span class="my_title">标签筛选 > </span> 渠道标签
</div>
<div v-else-if="titleType === 2">
<span class="my_title">标签筛选 > </span> 企业标签
</div>
<div v-else-if="titleType === 3">
<span class="my_title">画像筛选 > </span> 客户属性
</div>
<div v-else-if="titleType === 4">
<span class="my_title">画像筛选 > </span> 客户行为
</div>
<div v-else-if="titleType === 5">
<span class="my_title">其他筛选 > </span> 已有人群
</div>
</div>
</template>
<script>
export default {
name: 'show-people-title',
data () {
return {
}
},
props: {
titleType: {
type: Number,
default: null
}
},
methods: {
},
created () {
},
}
</script>
<style lang="scss" scoped>
.show_title {
font-size: 16px;
}
.my_title {
font-size: 16px;
font-weight: 600;
color: rgba(0, 0, 0, 0.9);
}
</style>
<template>
<div>
<el-form :inline="true" :model="current" :rules="rules" ref="strategicCrowd" label-width="0" label-position="left">
<el-form-item prop="code">
<el-select :disabled="detail" v-model="current.code" placeholder="请选择已有人群">
<el-option v-for="(item, key) in baseData" :key="key" :label="item.value" :value="item.code"></el-option>
</el-select>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name: 'strategic-crowd',
data () {
return {
current: {
code: '',
},
rules: {
code: [
{required: true, message:'请选择已有人群', trigger:'blur'}
]
}
}
},
props: {
detail: {
type: Boolean,
default: false
},
baseData: {
type: Array,
default: () => []
},
currentData: {
type: Object,
default: () => { }
}
},
methods: {
handleValidateFn () {
let status = null
this.$refs['strategicCrowd'].validate((valid) => {
if (valid) {
status = true
} else {
status = false
}
});
return status
},
},
mounted () {
this.current = this.currentData
},
}
</script>
<style lang="scss" scoped>
</style>
<template>
</template>
<script>
export default {
}
</script>
<style>
</style>
\ No newline at end of file
<template>
<div>
<el-table
ref="table"
:data="list"
tooltip-effect="dark"
highlight-current-row
v-loading="loading"
>
<el-table-column
label="客户"
prop="customerName"
header-align="center"
align=""
width="180"
>
<template slot-scope="{ row }">
<div class="cp flex aic" @click="goRoute(row)">
<el-image
style="width: 50px; height: 50px; flex: none"
:src="row.avatar"
fit="fit"
></el-image>
<div class="ml10">
<p>{{ row.customerName }}</p>
<i
:class="[
'el-icon-s-custom',
{ 1: 'man', 2: 'woman' }[row.gender],
]"
></i>
<span
:style="{
color: row.customerType === 1 ? '#4bde03' : '#f9a90b',
}"
>
{{ { 1: "@微信", 2: "@企业微信" }[row.customerType] }}
</span>
</div>
</div>
</template>
</el-table-column>
<el-table-column
prop="tagNames"
label="客户标签"
align="center"
width="220"
>
<div v-if="row.tagNames" slot-scope="{ row }">
<TagEllipsis :list="row.tagNames"></TagEllipsis>
</div>
<span v-else>无标签</span>
</el-table-column>
<!-- <el-table-column prop="corpName" label="公司名称" align="center"></el-table-column> -->
<el-table-column prop="userName" label="跟进员工" align="center">
<!-- <template slot-scope="{ row }">{{
row.weFlowerCustomerRels[0] ? row.weFlowerCustomerRels[0].userName : ''
}}</template> -->
</el-table-column>
<el-table-column prop="trackState" label="跟进状态" align="center">
<template slot-scope="{ row }">
<el-tag
v-if="row.trackState"
:type="dictTrackState[~~row.trackState + ''].color"
>{{ dictTrackState[~~row.trackState + ""].name }}
</el-tag>
</template>
</el-table-column>
<el-table-column prop="addMethod" label="添加方式" align="center">
<template slot-scope="{ row }">{{
dictAddType[row.addMethod + ""]
}}</template>
</el-table-column>
<el-table-column prop="firstAddTime" label="添加时间" align="center">
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template slot-scope="{ row }">
<!-- v-hasPermi="['customerManage:customer:view']" -->
<el-button @click="goRoute(row)" type="text" size="small"
>查看</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
</div>
</template>
<script>
// import * as api from "@/api/customer";
import { popDetails } from "@/api/marketStrategy/journey.js";
import { dictAddType, dictTrackState } from "@/utils/dictionary";
export default {
props: ["perdetail"],
data() {
return {
dictTrackState,
dictAddType,
query: {
pageNum: 1,
pageSize: 10,
},
list: [], // 客户列表
total: 0,
loading: false,
dateRange: [], // 查询日期
};
},
created() {
this.getList();
},
methods: {
getList(page) {
// console.log(this.dateRange);
if (this.dateRange) {
this.query.beginTime = this.dateRange[0];
this.query.endTime = this.dateRange[1];
} else {
this.query.beginTime = "";
this.query.endTime = "";
}
page && (this.query.pageNum = page);
// this.query.tagIds = this.queryTag.map((d) => d.tagId) + "";
// this.query.userIds = this.queryUser.map((d) => d.userId) + "";
this.loading = true;
popDetails(this.perdetail)
.then(({ rows, total }) => {
rows.forEach((element) => {
if (element.tagIds && element.tagNames) {
element.tagIds = element.tagIds.split(",");
element.tagNames = element.tagNames.split(",");
element.tags = [];
element.tagIds.forEach((unit, index) => {
element.tags.push({
tagId: unit,
tagName: element.tagNames[index],
});
});
}
});
this.list = rows;
this.total = +total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
},
goRoute(row) {
let { externalUserid, firstUserId: id } = row;
this.$router.push({
name: "CustomerDetail",
query: { externalUserid, id },
});
},
},
};
</script>
<style lang="scss" scoped>
.el-icon-s-custom {
font-size: 16px;
// margin-left: 4px;
color: #999;
&.man {
color: #13a2e8;
}
&.woman {
color: #f753b2;
}
}</style>
<template>
<div>
<el-form :inline="true" label-width="80px" label-position="left">
<el-form-item>
<!-- <el-select v-model="form.status">
<el-option
v-for="item in statusOptions"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select> -->
<el-date-picker
v-model="query.branchAwiatAccurateTime"
type="datetime"
:picker-options="pickerOptions"
format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm"
placeholder="请选择"
></el-date-picker>
</el-form-item>
</el-form>
<el-table :data="list" v-loading="loading" style="margin-top: 12px">
<el-table-column
prop="nodeName"
label="旅程节点"
align="center"
></el-table-column>
<el-table-column
prop="expectedNum"
label="预计触达数"
align="center"
></el-table-column>
<el-table-column
prop="successNum"
label="成功触达数"
align="center"
></el-table-column>
<el-table-column
prop="failNum"
label="未触达数"
align="center"
></el-table-column>
<el-table-column
prop="reachRate"
label="触达率"
align="center"
width="150"
></el-table-column>
<el-table-column label="操作" align="center" width="180" fixed="right">
<template #default="{ row }">
<el-button type="text" size="mini" @click="touchClick(row.nodeId)"
>触达内容</el-button
>
<el-button type="text" size="mini" @click="pepoleDetail(row.nodeId)"
>人群明细</el-button
>
</template>
</el-table-column>
</el-table>
<!-- <pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/> -->
<el-dialog
:title="dialogTitle"
:visible.sync="dialogTableVisible"
:width="dialogTitle === '触达内容' ? '400px' : '1236px'"
>
<div v-if="dialogTitle === '触达内容'" class="mob-style">
<!-- <div class="mob-content">
<svg-icon icon-class="phone-w" class="phone-icon" />
<div class="mob-box">
<div class="box-one">
<div class="mob-top">
<div class="mob-left">
<svg-icon icon-class="9_41" />
</div>
<div class="mob-right">
<svg-icon icon-class="signal" />
<svg-icon icon-class="Wifi" />
<svg-icon icon-class="electric" />
</div>
</div>
<div class="mob-bottom">
<span>×</span>
<span>客户</span>
<i class="el-icon-more content-icon"></i>
</div>
</div>
<div class="box-two">
<div class="time">2022-05-22 14:32:14</div>
<div class="cotent-one">
<div class="portrait"></div>
<div class="triangle"></div>
<div class="context">你好,这是一个文本信息</div>
</div>
<div class="cotent-one">
<div class="portrait"></div>
<div class="triangle"></div>
<div class="conimg"></div>
</div>
</div>
</div>
</div> -->
<preview-client :list="materialData" name="客户"></preview-client>
</div>
<div v-else class="mob-detail">
<!-- 人群明细 -->
<PopulationDetails :perdetail="perdetail" />
</div>
</el-dialog>
</div>
</template>
<script>
import PopulationDetails from "./PopulationDetails";
import { contactDetails, reachContent } from "@/api/marketStrategy/journey.js";
import PreviewClient from "@/components/previewInMobileClient.vue";
export default {
components: { PopulationDetails, PreviewClient },
data() {
return {
query: {
branchAwiatAccurateTime: '',
},
formList: {},
statusOptions: [],
list: [{ createBy: "123" }],
dialogTitle: "人群明细",
dialogTableVisible: false,
loading: false,
total: 0,
perdetail: null, //人群明细
id: null,
pickerOptions: {
disabledDate(time) {
return time.getTime() < new Date().setDate(new Date().getDate() - 1);
},
},
materialData: {
welcomeMsg: "",
materialMsgList: [],
},
};
},
created() {
this.id = this.$route.query.id;
this.getList();
},
props: ["showDatePicker"],
methods: {
pepoleDetail(nodeId) {
this.dialogTableVisible = true;
this.dialogTitle = "人群明细";
this.perdetail = nodeId;
},
getList() {
contactDetails(this.$route.query.id).then((res) => {
// console.log(res);
this.list = res.data;
});
},
// 获取触达明细内容
touchClick(nodeId) {
this.dialogTableVisible = true;
this.dialogTitle = "触达内容";
reachContent(nodeId).then((res) => {
this.formList = res.data;
if (this.formList && this.formList.length) {
this.materialData = {
welcomeMsg:
this.formList.msgType === "text" ? this.formList.content : "",
materialMsgList: this.formList
? this.setEditList(this.formList)
: [],
};
}
});
},
setEditList(list) {
let arr = [];
if (list && list.length) {
list.forEach((dd) => {
if (dd.msgType === "image") {
let obj = {
msgType: "0",
materialUrl: dd.picUrl,
};
arr.push(obj);
} else if (dd.msgType === "link") {
let ob = {
msgType: "8",
materialName: dd.title,
materialUrl: dd.linkUrl,
};
arr.push(ob);
} else if (dd.msgType === "miniprogram") {
let ff = {
msgType: "9",
digest: dd.appId,
materialName: dd.title,
coverUrl: dd.picUrl,
materialUrl: dd.linkUrl,
};
arr.push(ff);
}
});
}
return arr;
},
},
};
</script>
<style lang="scss" scoped>
.content-icon {
color: #333;
font-size: 12px;
}
.mob-style {
display: flex;
justify-content: center;
.mob-content {
width: 230px;
height: 471px;
position: relative;
.phone-icon {
width: 100%;
height: 100%;
}
.mob-box {
position: absolute;
top: 0;
left: 0;
padding: 11px 9px;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
.box-one {
padding: 0 8px;
margin-bottom: 10px;
width: 100%;
.mob-top {
padding: 8px 0;
display: flex;
justify-content: space-between;
.mob-left {
// width: 20px;
width: 14px;
height: 6px;
.svg-icon {
width: 30px;
height: 14px;
}
}
.mob-right {
display: flex;
width: 40px;
.svg-icon {
font-size: 16px;
margin-left: 4px;
}
}
}
.mob-bottom {
width: 100%;
display: flex;
justify-content: space-between;
span:nth-child(1) {
font-size: 16px;
font-weight: normal;
color: #222222;
line-height: 11px;
margin-left: 3px;
}
span:nth-child(2) {
font-size: 12px;
font-weight: 600;
color: #222222;
line-height: 11px;
}
}
}
.box-two {
height: 400px;
width: 206px;
background-color: #fafafa;
border-radius: 0 0 20px 20px;
padding: 0 8px;
.time {
font-size: 8px;
color: #cccccc;
line-height: 12px;
text-align: center;
margin-top: 20px;
margin-bottom: 20px;
}
.cotent-one {
display: flex;
.portrait {
width: 20px;
height: 20px;
border-radius: 20px;
box-shadow: 0px 1px 2px -3px rgba(0, 0, 0, 0.02);
background-color: #fff;
}
.triangle {
width: 0;
height: 0;
border: 3.5px solid;
border-color: transparent #fff transparent transparent;
margin-top: 7px;
}
.context {
font-size: 10px;
color: #222222;
line-height: 29px;
height: 29px;
background: #ffffff;
border-radius: 5px 5px 5px 5px;
text-align: center;
padding: 0 10px;
margin-bottom: 15px;
}
.conimg {
width: 93px;
height: 93px;
border-radius: 5px 5px 5px 5px;
background-color: #fff;
}
}
}
}
}
}
.el-icon-s-custom {
font-size: 16px;
// margin-left: 4px;
color: #999;
&.man {
color: #13a2e8;
}
&.woman {
color: #f753b2;
}
}
.bfc-d + .bfc-d .el-checkbox:first-child {
margin-left: 10px;
}
</style>
<template>
<div>
<div class="g-card">
<div class="card-top">
<!-- <span>每天促活新客户</span> -->
<span>{{ titleList.name }}</span>
<el-button size="mini" :type="buttomStyle">{{ titleList.statusText }}</el-button>
</div>
<div class="card-bottom">
<div>
<span class="title">旅程分组:</span>
<span class="content">{{ titleList.groupName }}</span>
<span class="title" style="margin-left: 16px">执行方式:</span>
<!-- <span class="content">每天 09:00</span> -->
<span class="content">{{ dealType }}</span>
</div>
<div>
<span class="title">起止时间:</span>
<span class="content">{{ titleList.startTime || '-' }} ~ {{ titleList.finishTime || '-' }}</span>
</div>
</div>
</div>
<div class="card-tab">
<div :class="activeIndex === 0 ? 'active' : ''" @click="activeIndex = 0">旅程画布</div>
<div :class="activeIndex === 1 ? 'active' : ''" @click="activeIndex = 1">触达明细</div>
</div>
<div class="g-card card-content pad20">
<!-- 旅程画布 -->
<Flow pageType="view" v-if="activeIndex === 0" />
<!-- 触达明细 -->
<TouchDetails :showDatePicker="showDatePicker" v-else />
</div>
</div>
</template>
<script>
import Flow from './Flow.vue'
import TouchDetails from './TouchDetails.vue'
import { getDetail } from '@/api/marketStrategy/journey.js'
export default {
components: { Flow, TouchDetails },
data() {
return {
activeIndex: 0,
id: '',
titleList: {
name: '每天促活新客户',
type: 1, // 执行方式
startTime: '_', // 开始时间
finishTime: '_', // 结束时间
status: null, // 状态
},
buttomStyle: '', // 按钮颜色
showDatePicker: false,
}
},
computed: {
dealType() {
if (this.titleList.type === 1) {
return '立即执行'
} else if (this.titleList.type === 2) {
return '定时执行 ' + this.titleList.executeTime
} else if (this.titleList.type === 3) {
this.showDatePicker = true
if (this.titleList.cycleCode === 1) {
let dealType = '每天 ' + this.titleList.executeTime
return dealType
} else if (this.titleList.cycleCode === 2) {
let week = ''
switch (this.titleList.cycleValue) {
case 1:
week = '周一 '
break
case 2:
week = '周二 '
break
case 3:
week = '周三 '
break
case 4:
week = '周四 '
break
case 5:
week = '周五 '
break
case 6:
week = '周六 '
break
case 7:
week = '周日'
break
}
return '每周 ' + week + this.titleList.executeTime
} else if (this.titleList.cycleCode === 3) {
return '每月 ' + this.titleList.cycleValue + '号 ' + this.titleList.executeTime
}
}
},
},
methods: {
getJourneyDtail() {
getDetail(this.id).then((res) => {
this.titleList = res.data
switch (this.titleList.status) {
case 0:
this.titleList.statusText = '未发布'
this.buttomStyle = 'info'
break
case 1:
this.titleList.statusText = '待执行'
this.buttomStyle = 'info'
break
case 2:
this.titleList.statusText = '执行中'
this.buttomStyle = 'primary'
break
case 3:
this.titleList.statusText = '已完成'
this.buttomStyle = 'success'
break
case 4:
this.titleList.statusText = '已暂停'
this.buttomStyle = 'primary'
break
case 5:
this.titleList.statusText = '已停用'
this.buttomStyle = 'danger'
break
case 6:
this.titleList.statusText = '执行失败'
this.buttomStyle = 'danger'
break
default:
break
}
})
},
},
created() {
this.id = this.$route.query.id
this.getJourneyDtail()
},
}
</script>
<style lang="scss" scoped>
.active {
font-weight: 600;
color: #0079de !important;
background-color: #fff !important;
box-shadow: 0px 6px 30px 5px rgba(59, 59, 59, 0.05);
}
.card-top {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
span {
font-size: 16px;
font-weight: 600;
color: rgba(0, 0, 0, 0.9);
line-height: 28px;
}
}
.card-bottom {
display: flex;
justify-content: space-between;
span {
font-size: 14px;
color: #000;
line-height: 22px;
}
.title {
opacity: 0.9;
}
.content {
opacity: 0.6;
}
}
.card-tab {
display: flex;
div {
width: 88px;
height: 30px;
background: #fafafa;
border-radius: 32px 32px 32px 32px;
font-size: 14px;
color: rgba(0, 0, 0, 0.4);
line-height: 30px;
text-align: center;
margin-top: 15px;
margin-right: 12px;
margin-bottom: 6px;
}
}
.card-tab:hover {
cursor: pointer;
box-shadow: 0px 6px 30px 5px rgba(59, 59, 59, 0.05);
}
.card-content {
::v-deep .flow-wrap {
height: calc(100vh - 345px);
}
}
</style>
<template>
<div>
<div class="head_content">
<div class="g-card" style="flex: 1">
<div class="card-top">
<span style="margin-right: 6px">{{ detail.name }}</span>
<div
class="status_button"
:class="{
color1: detail.status === 1,
color2: detail.status === 2,
color3: detail.status === 3,
color4: detail.status === 4,
}">
{{
detail.status === 1
? '待计算'
: detail.status === 2
? '计算中'
: detail.status === 3
? '计算完成'
: detail.status === 4
? '计算失败'
: ''
}}
</div>
</div>
<div class="card-bottom">
<div>
<span class="title">人群分组:</span>
<span class="content">{{ groupName }}</span>
<span class="title" style="margin-left: 16px">更新方式:</span>
<span class="content">{{ detail.type === 1 ? '手动更新' : '自动更新' }}</span>
</div>
</div>
</div>
<div class="g-card" style="margin-left: 20px; width: 180px; margin-top: 0; text-align: center">
<div class="content_number">
{{ detail.crowdNum ? detail.crowdNum : '-' }}
</div>
<div class="content_sub">
人群规模
<el-popover placement="top" trigger="hover">
<div slot="reference" style="margin-left: 8px; cursor: pointer">
<img src="../../../assets/marketstrategy/help.svg" alt="" />
</div>
<div>为上一次人群计算成功的数量,非实时数据,可手动更新</div>
</el-popover>
</div>
</div>
</div>
<div class="card-tab">
<div class="item" :class="activeIndex === 0 ? 'active' : ''" @click="activeIndex = 0">人群筛选</div>
<div class="item" :class="activeIndex === 1 ? 'active' : ''" @click="activeIndex = 1">人群分析</div>
<div class="item" :class="activeIndex === 2 ? 'active' : ''" @click="activeIndex = 2">人群明细</div>
</div>
<div style="margin-top: 10px">
<template v-if="activeIndex === 0">
<people-filter :swipe="detail.swipe"></people-filter>
</template>
<template v-if="activeIndex === 1">
<people-analyse></people-analyse>
</template>
<template v-if="activeIndex === 2">
<people-customer-detail></people-customer-detail>
</template>
</div>
</div>
</template>
<script>
import { detail } from '@/api/marketStrategy/people'
import { getCodeCategoryList } from '@/api/drainageCode/staff'
import PeopleFilter from '../components/PeopleFilter'
import PeopleAnalyse from '../components/PeopleAnalyse'
import PeopleCustomerDetail from '../components/PeopleCustomerDetail'
export default {
components: {},
name: 'people-detail',
data() {
return {
activeIndex: 0,
detail: {
crowdNum: null,
groupId: '',
name: '',
status: null,
swipe: [],
type: null,
},
groupList: [],
groupName: '',
}
},
components: {
PeopleFilter,
PeopleAnalyse,
PeopleCustomerDetail,
},
methods: {
getDetailFn(id) {
detail(id).then((res) => {
if (res.code === 200) {
this.detail = res.data
this.getCodeCategoryListFn(this.detail.groupId)
}
})
},
getCodeCategoryListFn(id) {
getCodeCategoryList({ mediaType: 7 }).then((res) => {
if (res.code == 200) {
this.groupList = res.data
this.groupList.forEach((dd) => {
if (dd.id === id) {
this.groupName = dd.name
}
})
}
})
},
},
mounted() {},
created() {
let id = this.$route.query.id
this.getDetailFn(id)
},
}
</script>
<style lang="scss" scoped>
.status_button {
height: 24px;
line-height: 24px;
font-size: 12px;
color: #ffffff;
padding: 0 8px;
border-radius: 3px;
}
.color1 {
background: #0079de;
}
.color2 {
background: #fa7216;
}
.color3 {
background: #00d695;
}
.color4 {
background: #e34d59;
}
.head_content {
width: 100%;
display: flex;
justify-content: space-between;
}
.active {
font-weight: 600;
color: #0079de !important;
background-color: #fff !important;
box-shadow: 0px 6px 30px 5px rgba(59, 59, 59, 0.05);
}
.card-top {
display: flex;
align-items: center;
margin-bottom: 15px;
span {
font-size: 16px;
font-weight: 600;
color: rgba(0, 0, 0, 0.9);
line-height: 28px;
}
}
.card-bottom {
display: flex;
justify-content: space-between;
span {
font-size: 14px;
color: #000;
line-height: 22px;
}
.title {
opacity: 0.9;
}
.content {
opacity: 0.6;
}
}
.card-tab {
margin-top: 10px;
display: flex;
div {
width: 88px;
height: 30px;
background: #fafafa;
border-radius: 32px 32px 32px 32px;
font-size: 14px;
color: rgba(0, 0, 0, 0.4);
line-height: 30px;
text-align: center;
margin-top: 15px;
margin-right: 12px;
margin-bottom: 6px;
}
.item:hover {
cursor: pointer;
opacity: 0.8;
}
}
.card-content {
height: 59vh;
}
.content_number {
font-size: 28px;
font-weight: bold;
color: #0079de;
margin-bottom: 15px;
}
.content_sub {
display: flex;
justify-content: center;
font-size: 14px;
color: #000;
opacity: 0.6;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!