Commit d741374f by ext.wangyuman1

朋友圈模块

1 parent 471f581b
......@@ -70,3 +70,9 @@ export function reminderMoments(data) {
url: service + '/moments/reminder/execution/' + data,
})
}
// 朋友圈 员工统计
export function statisticMoments(id) {
return request({
url: service + '/moments/statistic/user/' + id,
})
}
<template>
<div>员工统计</div>
<div>
<!-- 素材分析 -->
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div class="g-card">
<div class="g-card-title">客户记录</div>
<div style="display: flex; align-items: center; justify-content: space-between">
<div style="display: flex; align-items: center">
<!-- <search-title :showMore="true" @search="getTableFn"></search-title> -->
<el-input
style="width: 150px"
:model-value="userName"
readonly
@click="dialogVisible = true"
placeholder="请选择成员"
/>
<el-select
v-model="query.surveyState"
placeholder="请选择状态"
style="width: 150px; margin-right: 20px"
v-if="type !== 3"
>
<el-option label="未执行" :value="0"></el-option>
<el-option label="已执行" :value="1"></el-option>
</el-select>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button @click="resetQuery">清空</el-button>
</div>
<div>
<el-button type="primary" @click="exportFn" v-loading="exportLoading">导出</el-button>
</div>
</div>
<el-table v-loading="loading" :data="tableList" style="width: 100%">
<el-table-column
label="客户名称"
align="center"
prop="userName"
min-width="100"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="对应成员"
align="center"
prop="deptName"
show-overflow-tooltip
></el-table-column>
<el-table-column label="送达状态" align="center" prop="timeOutNum" show-overflow-tooltip>
<template #default="{ row }">
<div>
{{ row }}
</div>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
v-model:page="query.pageNum"
v-model:limit="query.pageSize"
@pagination="getTableChangeSize()"
/>
</div>
<SelectUser
v-model:visible="dialogVisible"
title="组织架构"
:defaultValues="userArray"
@success="getSelectUser"
></SelectUser>
</div>
</template>
<script>
export default {}
</script>
import ChartBar from '@/components/ChartBar.vue'
import ChartLine from '@/components/ChartLine.vue'
import SelectDept from '@/components/SelectDept'
import { getTableTotal } from '@/api/contentCenter/common.js'
import { statisticMoments } from '@/api/circle'
<style lang="scss" scoped></style>
\ No newline at end of file
export default {
name: 'scene-statistics-scene',
components: {
ChartLine,
ChartBar,
SelectDept,
},
data() {
return {
deptArray: [],
dialogVisible: false,
userArray: [],
userName: '',
cardData: [
{
title: '预计送达客户数 ',
tips: '预计能够看到本朋友圈推送的客户数(不去重)',
value: 0,
noArrow: true,
},
{
title: '未送达客户数',
tips: '员工未执行该朋友圈任务而未收到相应推送的客户数(不去重)',
value: 0,
},
{
title: '已送达客户数',
tips: '员工已执行该朋友圈任务而已收到相应推送的客户数(不去重)',
value: 0,
},
{
title: '送达失败客户数',
tips: '因已达送但超过朋友圈可见数量上限导致送达失败的客户数(不去重)',
value: 0,
},
{
title: '今日送达客户数',
tips: '员工今日已执行该朋友圈任务并成功收到推送的客户数(不去重)',
value: 0,
},
],
value: [],
exportLoading: false,
tableList: [],
loading: false,
total: 0,
query: {
pageSize: 10,
pageNum: 1,
beginTime: '',
endTime: '',
deptIds: '',
userIds: '',
},
tableSearch: {},
id: undefined,
type: undefined, // 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
}
},
mounted() {
this.type = this.$route.query.type
this.id = this.$route.query.id
if (this.type === 3) {
this.cardData.shift()
}
this.getTabTotalFn()
},
methods: {
getTabTotalFn() {
statisticMoments(this.id).then((res) => {
this.cardData[0].value = res.data.inviterOldCustomerNum
this.cardData[1].value = res.data.completeTaskOldCustomerNum
this.cardData[2].value = res.data.fissionCustomerNum
this.cardData[3].value = res.data.tdCompleteTaskOldCustomerNum
if (this.type !== 3) {
this.cardData[4].value = res.data.tdCompleteTaskOldCustomerNum
}
})
},
exportFn() {
this.$confirm('确认导出吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.exportLoading = true
return getTableExport(this.id, Object.assign({}, this.query))
})
.then((res) => {
if (!res) return
const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) // 构造一个blob对象来处理数据,并设置文件类型
if (window.navigator.msSaveOrOpenBlob) {
//兼容IE10
navigator.msSaveBlob(blob, '质检详情')
} else {
const href = URL.createObjectURL(blob) //创建新的URL表示指定的blob对象
const a = document.createElement('a') //创建a标签
a.style.display = 'none'
a.href = href // 指定下载链接
a.download = dateFormat(new Date(), 'YYYY-MM-DD') + '-质检详情.xlsx' //指定下载文件名
a.click() //触发下载
URL.revokeObjectURL(a.href) //释放URL对象
}
})
.catch((error) => {
console.error(error)
})
.finally(() => {
this.exportLoading = false
})
},
getSelectUser(data) {
this.userArray = data
this.userName = this.userArray
.map(function (obj, index) {
return obj.name
})
.join(',')
this.query.userIds = this.userArray
.map(function (obj, index) {
return obj.userId
})
.join(',')
},
// getTableFn(data) {
// this.loading = true
// this.query.beginTime = data.beginTime
// this.query.endTime = data.endTime
// this.getTableChangeSize()
// },
getTableChangeSize() {
this.loading = true
getTableTotal(this.query).then((res) => {
this.tableList = res.data
this.loading = false
})
},
resetQuery() {
this.query = {
pageSize: 10,
pageNum: 1,
beginTime: '',
endTime: '',
deptIds: '',
userIds: '',
}
this.userArray = []
this.userName = ''
this.deptArray = []
this.getTableChangeSize()
},
handleSearch() {
this.getTableChangeSize()
},
},
created() {
this.getTableChangeSize()
this.$store.setBusininessDesc(
`
<div>全部素材发送与查看情况数据统计与分析</div>
`
)
},
}
</script>
<style lang="scss" scoped></style>
<template>
<div>员工统计</div>
<div>
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div class="g-card">
<el-tabs v-model="activeName" @tab-click="handleClick" v-if="this.type === 1">
<el-tab-pane label="互动记录" name="first"><Record /></el-tab-pane>
<el-tab-pane label="查看明细" name="second"><ViewDetail /></el-tab-pane>
</el-tabs>
<Record v-else />
</div>
</div>
</template>
<script>
export default {}
import { statisticMoments } from '@/api/circle'
export default {
data() {
return {
activeName: 'first',
cardData: [
{
title: '点赞客户数 ',
tips: '该朋友圈任务点赞的客户数',
value: 0,
noArrow: true,
},
{
title: '评论客户数',
tips: '该朋友圈任务评论的客户数',
value: 0,
},
{
title: '附件浏览人数',
tips: '该朋友圈任务附带的视频/图文/文章/文件/海报的UV量',
value: 0,
},
{
title: '附件浏览次数',
tips: '该朋友圈任务附带的视频/图文/文章/文件/海报的PV量',
value: 0,
},
],
id: undefined,
type: undefined, // 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
}
},
mounted() {
this.type = this.$route.query.type
this.id = this.$route.query.id
if (this.type !== 1) {
this.cardData = this.cardData.slice(0, 2)
}
this.getTabTotalFn()
},
methods: {
getTabTotalFn() {
statisticMoments(this.id).then((res) => {
this.cardData[0].value = res.data.inviterOldCustomerNum
this.cardData[1].value = res.data.completeTaskOldCustomerNum
if (this.type === 1) {
this.cardData[2].value = res.data.fissionCustomerNum
this.cardData[3].value = res.data.tdCompleteTaskOldCustomerNum
}
})
},
},
}
</script>
<style lang="scss" scoped></style>
<template>
<div>
<div style="display: flex; align-items: center; justify-content: space-between">
<div style="display: flex; align-items: center">
<el-date-picker
clearable
v-model="dateRange"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
v-bind="pickerOptions"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
align="right"
></el-date-picker>
<el-input
style="width: 150px"
:model-value="userName"
readonly
@click="dialogVisible = true"
placeholder="请选择成员"
/>
<el-select
v-model="query.surveyState"
placeholder="请选择状态"
style="width: 150px; margin-right: 20px"
>
<el-option label="未执行" :value="0"></el-option>
<el-option label="已执行" :value="1"></el-option>
</el-select>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button @click="resetQuery">清空</el-button>
</div>
<div>
<el-button type="primary" @click="remind(id)">提醒执行</el-button>
<el-button type="primary" @click="exportFn" v-loading="exportLoading">导出</el-button>
</div>
</div>
<el-table v-loading="loading" :data="tableList" style="width: 100%">
<el-table-column
label="客户名称"
align="center"
prop="userName"
min-width="100"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="对应成员"
align="center"
prop="userName"
min-width="100"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="执行人所属部门"
align="center"
prop="deptName"
show-overflow-tooltip
></el-table-column>
<el-table-column label="执行状态" align="center" prop="timeOutNum" show-overflow-tooltip>
<template #default="{ row }">
<div>
{{ row }}
</div>
</template>
</el-table-column>
<el-table-column
label="互动时间"
align="center"
prop="timeOutNum"
show-overflow-tooltip
></el-table-column>
</el-table>
<pagination
:total="total"
v-model:page="query.pageNum"
v-model:limit="query.pageSize"
@pagination="getTableChangeSize()"
/>
</div>
</template>
<script>
export default {
data() {
return {
dateRange: [],
query: {
pageNum: 1,
pageSize: 10,
},
loading: false,
tableList: [],
}
},
methods: {
getList() {
if (this.dateRange) {
this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]
} else {
this.query.beginTime = ''
this.query.endTime = ''
}
},
getTableChangeSize() {
this.loading = true
getTableTotal(this.query).then((res) => {
this.tableList = res.data
this.loading = false
})
},
},
}
</script>
<style></style>
......@@ -33,7 +33,7 @@
<el-button @click="resetQuery">清空</el-button>
</div>
<div>
<el-button type="primary">提醒执行</el-button>
<el-button type="primary" @click="remind(id)">提醒执行</el-button>
<el-button type="primary" @click="exportFn" v-loading="exportLoading">导出</el-button>
</div>
</div>
......@@ -87,15 +87,13 @@
</div>
</template>
<script>
import ChartBar from '@/components/ChartBar.vue'
import ChartLine from '@/components/ChartLine.vue'
import SelectDept from '@/components/SelectDept'
import { getTableTotal } from '@/api/contentCenter/common.js'
import { reminderMoments, statisticMoments } from '@/api/circle'
export default {
name: 'scene-statistics-scene',
components: {
ChartLine,
ChartBar,
SelectDept,
},
data() {
......@@ -135,7 +133,6 @@ export default {
},
],
value: [],
id: '',
exportLoading: false,
tableList: [],
loading: false,
......@@ -149,9 +146,38 @@ export default {
userIds: '',
},
tableSearch: {},
id: undefined,
type: undefined, // 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
}
},
mounted() {
this.type = this.$route.query.type
this.id = this.$route.query.id
this.getTabTotalFn()
},
methods: {
getTabTotalFn() {
statisticMoments(this.id).then((res) => {
this.cardData[0].value = res.data.inviterOldCustomerNum
this.cardData[1].value = res.data.completeTaskOldCustomerNum
this.cardData[2].value = res.data.fissionCustomerNum
this.cardData[3].value = res.data.tdCompleteTaskOldCustomerNum
})
},
remind(id) {
this.$confirm('提醒执行将针对本任务未执行的成员再次催促执行,是否确认提醒?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
})
.then(() => {
reminderMoments(id).then((res) => {
if (res.code === 200) {
this.msgSuccess(res.msg)
}
})
})
.catch(() => {})
},
exportFn() {
this.$confirm('确认导出吗?', '提示', {
confirmButtonText: '确定',
......
<template>
<div>
<el-table v-loading="loading" :data="tableList" style="width: 100%">
<el-table-column
label="查看用户"
align="center"
min-width="100"
prop="viewBy"
show-overflow-tooltip
/>
<el-table-column
label="是否是企业客户"
align="center"
min-width="100"
prop="isCustomer"
show-overflow-tooltip
>
<template #default="scope">
{{ scope.row.isCustomer ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column
label="查看次数"
align="center"
min-width="100"
prop="viewTotalNum"
show-overflow-tooltip
/>
<el-table-column
label="查看时长"
align="center"
min-width="100"
prop="viewDurationCpt"
show-overflow-tooltip
/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button text @click="goDetail(scope.row.id)" v-if="scope.row.isCustomer"
>客户详情</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
v-model:page="query.pageNum"
v-model:limit="query.pageSize"
@pagination="getTableChangeSize()"
/>
</div>
</template>
<script>
export default {
data() {
return {
loading: false,
query: {
pageSize: 10,
pageNum: 1,
},
tableList: [],
total: 0,
}
},
methods: {
getTableChangeSize() {
this.loading = true
getTableDetail(this.query).then((res) => {
this.tableList = res.rows
this.total = Number(res.total)
this.loading = false
})
},
goDetail(row) {
let { externalUserid, firstUserId: userId } = row
this.$router.push({
path: '/operateCenter/customerManage/customerDetail',
query: { externalUserid, userId },
})
},
},
}
</script>
<style></style>
......@@ -96,7 +96,7 @@
<el-table-column label="操作" align="center" width="200">
<template #default="{ row }">
<el-button text @click="remind(row.id)" v-if="row.status === 2">提醒执行</el-button>
<el-button text @click="detailFn(row.id)">统计</el-button>
<el-button text @click="statistics(row)">统计</el-button>
<el-button text @click="detailFn(row)">查看</el-button>
<el-button text @click="cease(row.id)" v-if="row.status !== 3">停止</el-button>
</template>
......@@ -281,21 +281,26 @@ export default {
this.query.executeEndTime = ''
}
},
detailFn(row) {
let type = '' // 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
determineType(row) {
let determineType = '' // 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
if (row.isLwPush === 1) {
// 非同步型
type = 1
determineType = 1
} else if (row.isLwPush === 0) {
// 同步型
if (row.type === 0) {
// 企业同步型
type = 2
determineType = 2
} else if (row.type === 1) {
// 个人同步型
type = 3
determineType = 3
}
}
return determineType
},
detailFn(row) {
// 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
let type = this.determineType(row)
this.$router.push({
path: '/customerMaintain/friendCircle/publish',
query: {
......@@ -303,12 +308,18 @@ export default {
id: row.id,
},
})
// this.detailDialogVisible = true
// getDetail(id).then((dd) => {
// if (dd.code === 200) {
// this.detail = dd.data
// }
// })
},
// 统计
statistics(row) {
// 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
let type = this.determineType(row)
this.$router.push({
path: '/customerMaintain/friendCircle/statistics',
query: {
type,
id: row.id,
},
})
},
syncFn() {
syncHMoments(2).then((res) => {
......
<template>
<div class="g-card">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="员工统计" name="first"><Staff /></el-tab-pane>
<el-tab-pane label="员工统计" name="first" v-if="this.type !== 3"><Staff /></el-tab-pane>
<el-tab-pane label="客户统计" name="second"><Custom /></el-tab-pane>
<el-tab-pane label="互动统计" name="third"><Interaction /></el-tab-pane>
</el-tabs>
......@@ -13,9 +13,18 @@ import Custom from './components/Custom.vue'
import Interaction from './components/Interaction.vue'
export default {
components: { Staff, Custom, Interaction },
mounted() {
this.type = this.$route.query.type
if (this.type === 3) {
this.activeName = 'second'
}
},
data() {
return {
activeName: 'first',
// id: undefined,
type: undefined, // 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
}
},
methods: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!