Commit f5589a7c by 王志慧

朋友圈需求开发

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