Commit 81d36165 by ext.wangyuman1

朋友圈模块

1 parent 511eafef
......@@ -104,7 +104,7 @@ export function getCustomerList(data) {
params: data,
})
}
// 互动记录导出
// 客户记录导出
export function exportCustomer(data) {
return request({
url: service + '/moments/statistic/customer/export',
......
......@@ -64,8 +64,8 @@ let config = {
services: {
wecom: '/open',
// system: env.SYSTEM_API,
system: 'http://192.168.1.90:6180',
system: env.SYSTEM_API,
// system: 'http://192.168.4.168:6180',
common: '/common',
},
......
......@@ -15,13 +15,14 @@
placeholder="请选择成员"
/>
<el-select
v-model="query.surveyState"
v-model="query.deliveryStatus"
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-option label="已送达" :value="0"></el-option>
<el-option label="未送达" :value="1"></el-option>
<el-option label="送达失败" :value="2"></el-option>
</el-select>
<el-button type="primary" @click="handleSearch">查询</el-button>
<el-button @click="resetQuery">清空</el-button>
......@@ -47,7 +48,7 @@
<el-table-column label="送达状态" align="center" prop="timeOutNum" show-overflow-tooltip>
<template #default="{ row }">
<div>
{{ row }}
{{ dealStatus(row.deliveryStatus) }}
</div>
</template>
</el-table-column>
......@@ -71,8 +72,8 @@
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 { statisticCustomer } from '@/api/circle'
import { dateFormat } from '@/utils/index'
import { statisticCustomer, getCustomerList, exportCustomer } from '@/api/circle'
export default {
name: 'scene-statistics-scene',
......@@ -83,7 +84,7 @@ export default {
},
data() {
return {
deptArray: [],
// deptArray: [],
dialogVisible: false,
userArray: [],
userName: '',
......@@ -123,25 +124,42 @@ export default {
query: {
pageSize: 10,
pageNum: 1,
beginTime: '',
endTime: '',
deptIds: '',
userIds: '',
weUserIds: '',
deliveryStatus: '',
},
tableSearch: {},
id: undefined,
type: undefined, // 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
name: '',
}
},
mounted() {
this.type = this.$route.query.type
this.id = this.$route.query.id
this.name = this.$route.query.name
if (this.type === 3) {
this.cardData.shift()
}
this.getTabTotalFn()
this.getTableChangeSize()
},
methods: {
dealStatus(type) {
switch (type) {
case 0:
return '已送达'
break
case 1:
return '未送达'
break
case 2:
return '送达失败'
break
default:
break
}
},
getTabTotalFn() {
statisticCustomer(this.id).then((res) => {
this.cardData[0].value = res.data.predictSend
......@@ -161,20 +179,21 @@ export default {
})
.then(() => {
this.exportLoading = true
return getTableExport(this.id, Object.assign({}, this.query))
this.query.weMomentsTaskId = this.id
return exportCustomer(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, '质检详情')
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.download = dateFormat(new Date(), 'YYYY-MM-DD') + '-' + this.name + '-客户统计.xlsx' //指定下载文件名
a.click() //触发下载
URL.revokeObjectURL(a.href) //释放URL对象
}
......@@ -193,7 +212,7 @@ export default {
return obj.name
})
.join(',')
this.query.userIds = this.userArray
this.query.weUserIds = this.userArray
.map(function (obj, index) {
return obj.userId
})
......@@ -207,8 +226,10 @@ export default {
// },
getTableChangeSize() {
this.loading = true
getTableTotal(this.query).then((res) => {
this.tableList = res.data
this.query.weMomentsTaskId = this.id
getCustomerList(this.query).then((res) => {
this.tableList = res.rows
this.total = +res.total
this.loading = false
})
},
......@@ -216,14 +237,12 @@ export default {
this.query = {
pageSize: 10,
pageNum: 1,
beginTime: '',
endTime: '',
deptIds: '',
userIds: '',
weUserIds: '',
deliveryStatus: '',
}
this.userArray = []
this.userName = ''
this.deptArray = []
// this.deptArray = []
this.getTableChangeSize()
},
handleSearch() {
......@@ -231,12 +250,11 @@ export default {
},
},
created() {
this.getTableChangeSize()
this.$store.setBusininessDesc(
`
<div>全部素材发送与查看情况数据统计与分析</div>
`
)
// this.$store.setBusininessDesc(
// `
// <div>全部素材发送与查看情况数据统计与分析</div>
// `
// )
},
}
</script>
......
......@@ -2,11 +2,11 @@
<div>
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div class="g-card">
<el-tabs v-model="activeName" @tab-click="handleClick" v-if="this.type === 1">
<!-- <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 />
</el-tabs> -->
<Record />
</div>
</div>
</template>
......@@ -51,7 +51,7 @@ export default {
}
},
mounted() {
this.type = this.$route.query.type
this.type = +this.$route.query.type
this.id = this.$route.query.id
if (this.type !== 1) {
......
......@@ -4,6 +4,7 @@
<div style="display: flex; align-items: center">
<el-date-picker
v-model="dateRange"
value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange"
range-separator="-"
start-placeholder="开始时间"
......@@ -38,7 +39,7 @@
<el-table-column
label="客户名称"
align="center"
prop="userName"
prop="customerName"
min-width="100"
show-overflow-tooltip
></el-table-column>
......@@ -49,17 +50,17 @@
min-width="100"
show-overflow-tooltip
></el-table-column>
<el-table-column label="互动类型" align="center" prop="timeOutNum" show-overflow-tooltip>
<el-table-column label="互动类型" align="center" prop="type" show-overflow-tooltip>
<template #default="{ row }">
<div>
{{ row }}
{{ row.type }}
</div>
</template>
</el-table-column>
<el-table-column
label="互动时间"
align="center"
prop="timeOutNum"
prop="interactTime"
show-overflow-tooltip
></el-table-column>
</el-table>
......@@ -69,23 +70,96 @@
v-model:limit="query.pageSize"
@pagination="getList()"
/>
<SelectUser
v-model:visible="dialogVisible"
title="组织架构"
:defaultValues="userArray"
@success="getSelectUser"
></SelectUser>
</div>
</template>
<script>
import { dateFormat } from '@/utils/index'
import { getInteractList, exportInteract } from '@/api/circle'
export default {
data() {
return {
dateRange: [],
query: {
pageNum: 1,
pageSize: 10,
pageNum: 1,
beginTime: '',
endTime: '',
status: '',
weUserIds: [],
},
loading: false,
tableList: [],
userName: '',
userArray: [],
dialogVisible: false,
id: undefined,
type: undefined, // 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
name: '',
total: 0,
exportLoading: false,
}
},
mounted() {
this.type = this.$route.query.type
this.id = this.$route.query.id
this.name = this.$route.query.name
this.getList()
},
methods: {
getSelectUser(data) {
this.userArray = data
this.userName = this.userArray
.map(function (obj, index) {
return obj.name
})
.join(',')
this.query.weUserIds = this.userArray
.map(function (obj, index) {
return obj.userId
})
.join(',')
},
exportFn() {
this.$confirm('确认导出吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
this.exportLoading = true
this.query.weMomentsTaskId = this.id
return exportInteract(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') + '-' + this.name + '-互动统计.xlsx' //指定下载文件名
a.click() //触发下载
URL.revokeObjectURL(a.href) //释放URL对象
}
})
.catch((error) => {
console.error(error)
})
.finally(() => {
this.exportLoading = false
})
},
getList() {
if (this.dateRange) {
this.query.beginTime = this.dateRange[0]
......@@ -95,17 +169,28 @@ export default {
this.query.endTime = ''
}
this.loading = true
getTableTotal(this.query).then((res) => {
this.tableList = res.data
this.query.weMomentsTaskId = this.id
getInteractList(this.query).then((res) => {
this.tableList = res.rows
this.total = +res.total
this.loading = false
})
},
handleSearch() {
this.getList()
},
resetQuery() {
this.query = {
pageSize: 10,
pageNum: 1,
beginTime: '',
endTime: '',
interactType: '',
weUserIds: '',
}
this.userName = ''
this.dateRange = []
this.userArray = []
this.getList()
},
},
......
......@@ -22,7 +22,7 @@
placeholder="请选择部门"
/>
<el-select
v-model="query.surveyState"
v-model="query.status"
placeholder="请选择状态"
style="width: 150px; margin-right: 20px"
>
......@@ -51,17 +51,17 @@
prop="deptName"
show-overflow-tooltip
></el-table-column>
<el-table-column label="执行状态" align="center" prop="timeOutNum" show-overflow-tooltip>
<el-table-column label="执行状态" align="center" prop="executeStatus" show-overflow-tooltip>
<template #default="{ row }">
<div>
{{ row }}
{{ dealStatus(row.executeStatus) }}
</div>
</template>
</el-table-column>
<el-table-column
label="提醒执行次数"
align="center"
prop="timeOutNum"
prop="executeCount"
show-overflow-tooltip
></el-table-column>
</el-table>
......@@ -88,8 +88,8 @@
</template>
<script>
import SelectDept from '@/components/SelectDept'
import { getTableTotal } from '@/api/contentCenter/common.js'
import { reminderMoments, statisticMoments } from '@/api/circle'
import { dateFormat } from '@/utils/index'
import { reminderMoments, statisticMoments, getRecordList, exportUser } from '@/api/circle'
export default {
name: 'scene-statistics-scene',
......@@ -140,22 +140,38 @@ export default {
query: {
pageSize: 10,
pageNum: 1,
beginTime: '',
endTime: '',
// beginTime: '',
// endTime: '',
status: '',
deptIds: '',
userIds: '',
weUserIds: [],
},
tableSearch: {},
id: undefined,
type: undefined, // 朋友圈类型 1:非同步型 2:企业同步型 3:个人同步型
name: '',
}
},
mounted() {
this.type = this.$route.query.type
this.id = this.$route.query.id
this.name = this.$route.query.name
this.getTabTotalFn()
this.getTableChangeSize()
},
methods: {
dealStatus(type) {
switch (type) {
case 0:
return '未执行'
break
case 1:
return '已执行'
break
default:
break
}
},
getTabTotalFn() {
statisticMoments(this.id).then((res) => {
this.cardData[0].value = res.data.targetExecute
......@@ -187,20 +203,21 @@ export default {
})
.then(() => {
this.exportLoading = true
return getTableExport(this.id, Object.assign({}, this.query))
this.query.weMomentsTaskId = this.id
return exportUser(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, '质检详情')
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.download = dateFormat(new Date(), 'YYYY-MM-DD') + '-' + this.name + '-员工统计.xlsx' //指定下载文件名
a.click() //触发下载
URL.revokeObjectURL(a.href) //释放URL对象
}
......@@ -219,7 +236,7 @@ export default {
return obj.name
})
.join(',')
this.query.userIds = this.userArray
this.query.weUserIds = this.userArray
.map(function (obj, index) {
return obj.userId
})
......@@ -232,7 +249,7 @@ export default {
return obj.deptName
})
.join(',')
this.query.deptIds = this.userArray
this.query.deptIds = this.deptArray
.map(function (obj, index) {
return obj.deptId
})
......@@ -246,8 +263,10 @@ export default {
// },
getTableChangeSize() {
this.loading = true
getTableTotal(this.query).then((res) => {
this.tableList = res.data
this.query.weMomentsTaskId = this.id
getRecordList(this.query).then((res) => {
this.tableList = res.rows
this.total = +res.total
this.loading = false
})
},
......@@ -255,10 +274,11 @@ export default {
this.query = {
pageSize: 10,
pageNum: 1,
beginTime: '',
endTime: '',
// beginTime: '',
// endTime: '',
status: '',
deptIds: '',
userIds: '',
weUserIds: '',
}
this.userArray = []
this.userName = ''
......@@ -271,12 +291,11 @@ export default {
},
},
created() {
this.getTableChangeSize()
this.$store.setBusininessDesc(
`
<div>全部素材发送与查看情况数据统计与分析</div>
`
)
// this.$store.setBusininessDesc(
// `
// <div>全部素材发送与查看情况数据统计与分析</div>
// `
// )
},
}
</script>
......
......@@ -273,6 +273,7 @@ export default {
query: {
type,
id: row.id,
name:row.name
},
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!