Commit f5589a7c by 王志慧

朋友圈需求开发

1 parent bb6de49a
......@@ -51,7 +51,30 @@ const momentStaffCustomers = params => {
sign: true
})
}
//朋友圈任务详情 互动客户列表视图
const momentCommentView = params => {
params.method = 'marketing.api.moment.comment.view'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
// returnAll:true
})
}
// 互动列表导出
const commentExport = params => {
params.method = 'marketing.api.moment.comment.export'
params.sessionId = session
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
// returnAll:true
})
}
//朋友圈任务详情统计数据
const momentStatistic = params => {
params.method = 'marketing.api.moment.detail.statistic'
......@@ -152,5 +175,7 @@ export default {
getListApi,
momentCancel,
createStatus,
publicStatus
publicStatus,
momentCommentView,
commentExport
}
......@@ -84,30 +84,30 @@
<img src="@/assets/friendGroup/icon-interaction.png" />
</div>
<div class="statistics-number">
<span>{{ basicInfo.sendStaffCount }}</span>
<span>{{ basicInfo.interactCount }}</span>
</div>
<div class="statistics-text">互动客户/人</div>
<div class="statistics-ratio">互动率:78.35%</div>
<div class="statistics-ratio">互动率:{{ ((basicInfo.interactRatio)*100).toFixed(2) }}%</div>
</div>
<div class="statistics-li statistics-border" @click="getStatistics(2)">
<div class="statistics-img">
<img src="@/assets/friendGroup/icon-like.png" />
</div>
<div class="statistics-number">
<span>{{ basicInfo.unSendStaffCount }}</span>
<span>{{ basicInfo.likeCount }}</span>
</div>
<div class="statistics-text">点赞客户/人</div>
<div class="statistics-ratio">互动率:78.35%</div>
<div class="statistics-ratio">互动率:{{ ((basicInfo.likeRatio)*100).toFixed(2) }}%</div>
</div>
<div class="statistics-li" @click="getStatistics(3)">
<div class="statistics-img">
<img src="@/assets/friendGroup/icon-comment.png" />
</div>
<div class="statistics-number">
<span>{{ basicInfo.unSendStaffCount }}</span>
<span>{{ basicInfo.commentCount }}</span>
</div>
<div class="statistics-text">评论客户/人</div>
<div class="statistics-ratio">互动率:78.35%</div>
<div class="statistics-ratio">互动率:{{ ((basicInfo.commentRatio)*100).toFixed(2) }}%</div>
</div>
</div>
</div>
......@@ -178,7 +178,9 @@ export default {
},
methods: {
getStatistics(value) {
this.$emit('getStatistics', value)
this.$emit('getStatistics', {
activeName: value
})
},
handleRefresh: utils.debounce(function () {
this.publicStatus()
......@@ -199,7 +201,7 @@ export default {
this.$apis.friendGroup.momentDetail({ id }).then(res => {
this.updatedTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
this.basicInfo = res
// console.log(this.basicInfo, '123');
console.log(this.basicInfo, '123')
// this.basicInfo.sendTime = dayjs(this.basicInfo.sendTime).format('YYYY-MM-DD HH:mm:ss')
const previewList = res.attachmentList.map(item => {
if (item.attType == 7 && item.attContent) item.attContent = JSON.parse(item.attContent)
......
......@@ -108,7 +108,6 @@ export default {
},
methods: {
selectionTable(val) {
console.log(val)
this.innerTags = val
// this.$emit('selectTable', val)
},
......
<template>
<div>
<BasicInof :id="$route.query.id" :form="'customer'" @refreshList="refreshList" @getStatistics="getStatistics"></BasicInof>
<BasicInof :id="$route.query.id" :form="'customer'" ref="basicInfo" @refreshList="refreshList" @getStatistics="getStatistics"></BasicInof>
<div class="detail-container">
<div class="detail-modular">
<div class="title">成员详情</div>
......@@ -12,7 +12,7 @@
</el-menu>
<GLTable style="margin-top: 20px" ref="table" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :hasPage="false" :pageConf="pageConf">
<div class="table-btns" slot="customerCount" slot-scope="scope">
<span class="customer-detail" @click="handleCustomer(scope.scope.id, 4)" v-if="scope.scope.customerCount">{{ scope.scope.customerCount }}</span>
<span class="customer-detail" @click="getStatistics({ ...scope.scope, activeName: 4 })" v-if="scope.scope.customerCount">{{ scope.scope.customerCount }}</span>
<span v-else>{{ scope.scope.customerCount }}</span>
</div>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
......@@ -44,17 +44,28 @@
</div>
</div>
</el-dialog> -->
<el-drawer class="drawerWrap marketing" :title="infoTitle" :visible.sync="dialogVisible" direction="rtl" :before-close="handleClose">
<div class="gl-form-page">
<el-drawer class="drawerWrap marketing" size="50%" :title="infoTitle" :visible.sync="dialogVisible" direction="rtl" :before-close="handleClose">
<div class="gl-form-page gl-form-min">
<el-form :inline="true" :model="drawerSearchForm" size="small" class="demo-form-inline">
<el-form-item label="是否互动:">
<el-select v-model="drawerSearchForm.region" placeholder="">
<el-option label="是" value="shanghai"></el-option>
<el-option label="否" value="beijing"></el-option>
</el-select>
</el-form-item>
<template v-if="activeName == 1 || activeName == 4">
<el-form-item label="是否互动:">
<el-select v-model="drawerSearchForm.isInteract" placeholder="">
<el-option label="是" value="true"></el-option>
<el-option label="否" value="false"></el-option>
</el-select>
</el-form-item>
</template>
<template v-else>
<el-form-item label="员工:">
<el-select v-model="drawerSearchForm.momentStaffId" placeholder="">
<template v-for="staff in tableEmpData">
<el-option :label="staff.staffName" :value="staff.staffId" :key="staff.staffId"></el-option>
</template>
</el-select>
</el-form-item>
</template>
<el-form-item>
<el-button type="primary" @click="onSubmit">查询</el-button>
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
</div>
......@@ -62,7 +73,12 @@
<div class="text-16 color-3 weight-6">客户列表</div>
<div class="export" @click="handleExport">导出</div>
</div>
<GLTable class="pd-20" refs="drawerRef" :tableData="userList" :searchForm="drawerSearchForm" :tableParams="drawerTableParams" :hasPage="false" :pageConf="pageConf"></GLTable>
<GLTable class="pd-20" ref="drawerRef" :getListApi="getDrawerListApi" :searchForm="drawerSearchForm" :tableParams="drawerTableParams" :hasPage="true" :pageConf="pageConf">
<div slot="customerName" class="customer-wrap" slot-scope="scope">
<img :src="scope.scope.avatar" class="avatar" />
<span>{{ scope.scope.customerName }}</span>
</div>
</GLTable>
</el-drawer>
</div>
</template>
......@@ -79,7 +95,7 @@ export default {
activeName: '1',
infoTitle: '已送达客户',
userList: [],
dialogVisible: true,
dialogVisible: false,
activeIndex: '',
customIndex: '',
employeelist: [],
......@@ -176,64 +192,61 @@ export default {
optionsName: 'interactionList'
}
],
drawerSearchForm: {},
drawerSearchForm: {
scrmMomentId: '',
isInteract: '',
type: '',
momentStaffId: ''
},
tableData: [],
tableEmpData: [],
drawerTableParams: {
listName: 'data',
tableOption: false,
tableColumns: []
},
tableColumns: [
{
label: '送达客户',
prop: 'staffName',
filter: '1,2,4'
prop: 'customerName',
filter: '1,2,4',
addHtml: 'customerName'
},
{
label: '评论客户',
prop: 'staffName',
filter: '3'
prop: 'customerName',
filter: '3',
addHtml: 'customerName'
},
{
label: '是否互动',
prop: 'status',
formatter: cellValue => {
return {
0: '未发送',
1: '已发送',
2: '发送失败'
}[cellValue.status]
},
prop: 'isInteract',
filter: '1,2,3,4'
},
{
label: '累计点赞次数',
prop: 'sendTime',
prop: 'likeCount',
filter: '1'
},
{
label: '累计评论次数',
prop: 'customerCount',
prop: 'commentCount',
filter: '1'
},
{
label: '员工',
prop: 'sendStaffCount',
width: '110',
prop: 'staffName',
filter: '2,3'
},
{
label: '点赞时间',
prop: 'sendStaffCount',
prop: 'likeTime',
filter: '2'
},
{
label: '评论时间',
prop: 'sendStaffCount',
filter: '3'
},
{
label: '评论内容',
prop: 'sendStaffCount',
prop: 'commentTime',
filter: '3'
},
{
......@@ -243,14 +256,12 @@ export default {
},
{
label: '评论次数',
prop: 'unSendStaffCount',
width: '110',
prop: 'commentCount',
filter: '4'
},
{
label: '最近评论时间',
prop: 'copyCustomerCount',
width: '110',
prop: 'commentTime',
filter: '4'
}
],
......@@ -266,28 +277,55 @@ export default {
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
getListApi: this.$apis.friendGroup.momentStaff,
getDrawerListApi: this.$apis.friendGroup.momentCommentView,
footerLeft: 0,
footerWidth: 0
}
},
mounted() {
// this.getCustomerDetail(() => {
// // this.getStaffList()
// // this.getCustomerList()
// })
let clientHeight = document.documentElement.clientHeight
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200
},
methods: {
listDepartmentTree(isFollowerStaff) {
const params = { addChildrensFlag: true }
this.loading = true
params.isHavCustomer = true
params.isEntmicroCustomer = true
params.isFollowerStaff = isFollowerStaff
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
if (res) {
this.tableEmpData = this.getEmployee(res)
} else {
this.treeData = []
}
})
},
getEmployee(d, arr = []) {
d.reverse().forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
handleExport(row) {
var params = this.getParams()
// memberExportApi(params).then(res => {
// exportFn(res)
// })
var params = this.drawerSearchForm
this.$apis.friendGroup.commentExport(params).then(res => {
exportFn(res)
})
},
handleSearch() {
this.$refs.drawerRef.refreshTable()
......@@ -332,20 +370,31 @@ export default {
return !item.filter || item.filter.indexOf(this.activeName) != -1
})
},
getStatistics(value) {
this.activeName = value
getStatistics(data) {
//朋友圈id
this.drawerSearchForm.scrmMomentId = this.$refs.basicInfo.basicInfo.id
this.drawerSearchForm.type = ''
this.drawerSearchForm.isInteract = ''
this.drawerSearchForm.momentStaffId = ''
this.activeName = data.activeName
if (data.activeName == 2) {
this.drawerSearchForm.type == 1
}
if (data.activeName == 3) {
this.drawerSearchForm.type == 2
}
if (data.activeName == 4) {
this.drawerSearchForm.momentStaffId = data.staffId
}
this.initParams()
if (this.activeName == 2 || this.activeName == 3) {
this.listDepartmentTree(false)
}
this.dialogVisible = true
},
handleCustomer(id, value) {
this.activeName = value
this.$apis.friendGroup.momentStaffCustomers({ id }).then(res => {
if (res) {
this.initParams()
this.dialogVisible = true
this.userList = res
console.log(this.userList)
}
this.$nextTick(() => {
this.$refs.drawerRef.refreshTable()
})
},
getCustomerDetail(callback) {
......@@ -622,4 +671,13 @@ export default {
cursor: pointer;
}
}
.customer-wrap {
display: flex;
align-items: center;
.avatar {
width: 36px;
height: 36px;
margin-right: 8px;
}
}
</style>
......@@ -7,7 +7,7 @@
<span class="friend-tip-text">管理员可直接在后台为员工创建朋友圈,员工收到朋友圈新消息提醒后,可快捷将管理员创建的朋友圈发送到自己朋友圈中。</span>
</div>
<div class="title">
<span class="info-time">最近更新:{{ this.updatedTime }}</span>
<span class="info-time">{{this.sendType}}:{{ this.updatedTime }}</span>
<span class="info-refresh" @click="handleRefresh">
刷新数据
......@@ -100,6 +100,7 @@ export default {
offReason: [{ required: true, message: '请输入下架备注', trigger: 'change' }]
},
updatedTime: '',
sendType:'',
// 分享
isShareVisible: false,
shareForm: {},
......@@ -252,7 +253,7 @@ export default {
formatter: cellValue => {
return this.baseData.typeStatusList.find(item => item.confId == cellValue.type).confName
},
width: '110'
width: '110'
},
{
label: '创建人',
......@@ -279,19 +280,19 @@ export default {
prop: 'copyCustomerCount',
width: '110'
},
{
{
label: '互动客户',
prop: 'sendStaffCount',
prop: 'interactCount',
width: '110'
},
{
label: '点赞客户',
prop: 'unSendStaffCount',
prop: 'likeCount',
width: '110'
},
{
label: '评论客户',
prop: 'copyCustomerCount',
prop: 'commentCount',
width: '110'
}
]
......@@ -341,7 +342,11 @@ export default {
async createStatus() {
this.updatedTime = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
await this.$apis.friendGroup.createStatus({})
await this.$apis.friendGroup.publicStatus({})
let res = await this.$apis.friendGroup.publicStatus({})
this.updatedTime = res.syncTime
this.sendType = res.sendType == 1 ? '更新中' : '已更新'
console.log(res)
this.getListData()
},
getListData() {
......@@ -368,9 +373,7 @@ export default {
})
previewListFilter = previewListFilter.reduce((prev, cur) => {
let index = prev.findIndex(item => item.attType == 2)
console.log(prev, cur, index)
if (index != -1 && prev.length) {
console.log(prev[index].attContent.concat(cur.attContent))
return prev.concat({ attType: cur.attType, attContent: prev[index].attContent.concat(cur.attContent) })
}
return prev.concat(cur)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!