Commit 81d36165 by ext.wangyuman1

朋友圈模块

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