Commit 8ea18ff1 by 胡悦

链条

1 parent 433a15a9
import { http } from '@/main'
const path = 'org.ore.api.mass.'
const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router'
const customerList = params => {
params.type = 1
......@@ -43,9 +43,10 @@ const detail = params => {
sign: true
})
}
const remindUserGroup = params => {
params.type = 2
params.method = `${path}remindUserGroup`
const listDepartmentTree = params => {
params.method = 'entmicro.api.department.listDepartmentTree'
return http({
url: URL,
method: 'GET',
......@@ -53,9 +54,19 @@ const remindUserGroup = params => {
sign: true
})
}
const listRemindOperate = params => {
params.type = 2
params.method = `${path}listRemindOperate`
const querylabeltree = params => {
params.method = 'scrm.api.datahub.label.querylabeltree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const groupList = params => {
params.method = 'entmicro.api.customer.group.list.by.merchant'
return http({
url: URL,
method: 'GET',
......@@ -63,9 +74,8 @@ const listRemindOperate = params => {
sign: true
})
}
const listDepartmentTree = params => {
params.method = 'cn.com.glsx.entmicro.department.listDepartmentTree'
const customerCount = params => {
params.method = 'entmicro.api.mass.detail.customer.filter.count'
return http({
url: URL,
method: 'GET',
......@@ -73,19 +83,79 @@ const listDepartmentTree = params => {
sign: true
})
}
const querylabeltree = params => {
params.method = 'datahub.api.label.querylabeltree'
// 客户群发、客户群群发基本信息详情
const customerDetail = params => {
params.method = `${path}detail`
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
url: URL,
method: 'GET',
data: params,
sign: true
})
}
const groupList = params => {
params.method = 'org.ore.api.customer.group.list.by.merchant'
// 客户群发统计
const detailStatistic = params => {
params.method = `${path}detail.statistic`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群群发统计
const groupDetailStatistic = params => {
params.method = `${path}group.detail.statistic`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群发员工列表
const staffList = params => {
params.method = `${path}staff.list`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群发客户列表
const customerDetailList = params => {
params.method = `${path}customer.list`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 客户群群发列表
const groupDetailList = params => {
params.method = `${path}group.detail.sender.list`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 根据id提醒用户
const listRemindOperate = params => {
params.method = `${path}listRemindOperate`
return http({
url: URL,
method: 'GET',
data: params,
sign: true
})
}
// 详情页客户群提醒
const remindUserGroup = params => {
params.method = `${path}remindUserGroup`
return http({
url: URL,
method: 'GET',
......@@ -102,5 +172,12 @@ export default {
listRemindOperate,
listDepartmentTree,
querylabeltree,
groupList
groupList,
customerCount,
customerDetail,
detailStatistic,
groupDetailStatistic,
staffList,
customerDetailList,
groupDetailList
}
......@@ -2,21 +2,21 @@ import { http } from '@/main'
// const defaultPath = 'scrm.api.live.'
//计算提示面板出现的次数,第一次显示,之后不显示
const getLoginCount =params=>{
params.method='org.ore.api.common.findLoginCount'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
const getLoginCount = params => {
params.method = 'entmicro.api.common.findLoginCount'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const getServiceListApi = params => {
params.method = `scrm.api.coupon.list.merchant`
return http({
url: 'rop-scrm-coupon/router',
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true
......@@ -26,45 +26,45 @@ const getServiceListApi = params => {
const effectiveService = params => {
params.method = `scrm.api.coupon.effective`
return http({
url: 'rop-scrm-coupon/router',
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
returnAll: true
})
}
//删除
const deleteService = params => {
params.method = `scrm.api.coupon.delete`
return http({
url: 'rop-scrm-coupon/router',
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
returnAll: true
})
}
//删除
const createService = params => {
params.method = `scrm.api.coupon.create`
return http({
url: 'rop-scrm-coupon/router',
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
returnAll: true
})
}
//编辑、查看
const detailService = params => {
params.method = `scrm.api.coupon.detail`
return http({
url: 'rop-scrm-coupon/router',
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
})
}
//修改
......@@ -72,13 +72,13 @@ const detailService = params => {
const updateService = params => {
params.method = `scrm.api.coupon.update`
return http({
url: 'rop-scrm-coupon/router',
url: 'rop-scrm-coupon/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
returnAll: true
})
}
export { getServiceListApi,effectiveService, deleteService,createService,detailService,updateService,getLoginCount}
\ No newline at end of file
export { getServiceListApi, effectiveService, deleteService, createService, detailService, updateService, getLoginCount }
\ No newline at end of file
......@@ -9,8 +9,9 @@
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function(isEnv = true) {
export const fetchConfig = function (isEnv = true) {
if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
......@@ -18,6 +19,7 @@ export const fetchConfig = function(isEnv = true) {
}
//return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
return new Http().get('https://oss-config.test.glsx.com.cn/mock/619c87331072f92988f05a29/marketing/config')
}
export const config = {
install(vue, cfg) {
......
......@@ -126,68 +126,68 @@ const staticRoutes = Object.freeze([
},
{
name: 'detailCustomer',
path: '/customerTransform/detailCustomer',
path: '/customerTransform/detailCustomer/:id',
component: resolve => require([`@/views/customerTransform/detailCustomer.vue`], resolve),
meta: {}
},
{
name: 'detaiCustomeGroup',
path: '/customerTransform/detaiCustomeGroup',
path: '/customerTransform/detaiCustomeGroup/:id',
component: resolve => require([`@/views/customerTransform/detaiCustomeGroup.vue`], resolve),
meta: {}
},
{
name: 'memberCenter',
path: '/memberCenter/index',
component: resolve => require([`@/views/memberCenter/index.vue`], resolve),
component: resolve => require([`@/views/memberCenter/index.vue`], resolve),
meta: {}
},
{
name: 'center',
path: '/memberCenter/center',
component: resolve => require([`@/views/memberCenter/center.vue`], resolve),
component: resolve => require([`@/views/memberCenter/center.vue`], resolve),
meta: {}
},
{
name: 'service',
path: '/memberCenter/service',
component: resolve => require([`@/views/memberCenter/service.vue`], resolve),
component: resolve => require([`@/views/memberCenter/service.vue`], resolve),
meta: {}
},
{
name: 'serviceAddUpdateLook',
path: '/memberCenter/serviceAddUpdateLook',
component: resolve => require([`@/views/memberCenter/serviceAddUpdateLook.vue`], resolve),
path: '/memberCenter/serviceAddUpdateLook',
component: resolve => require([`@/views/memberCenter/serviceAddUpdateLook.vue`], resolve),
meta: {}
},
{
name: 'setmeal',
path: '/memberCenter/setmeal',
component: resolve => require([`@/views/memberCenter/setmeal.vue`], resolve),
component: resolve => require([`@/views/memberCenter/setmeal.vue`], resolve),
meta: {}
},
{
name: 'setmealAddUpdate',
path: '/memberCenter/setmealAddUpdate',
component: resolve => require([`@/views/memberCenter/setmealAddUpdate.vue`], resolve),
component: resolve => require([`@/views/memberCenter/setmealAddUpdate.vue`], resolve),
meta: {}
},
{
name: 'order',
path: '/memberCenter/order',
component: resolve => require([`@/views/memberCenter/order.vue`], resolve),
component: resolve => require([`@/views/memberCenter/order.vue`], resolve),
meta: {}
},
{
name: 'orderDetail',
path: '/memberCenter/orderDetail',
component: resolve => require([`@/views/memberCenter/orderDetail.vue`], resolve),
component: resolve => require([`@/views/memberCenter/orderDetail.vue`], resolve),
meta: {}
},
{
name: 'record',
path: '/memberCenter/record',
component: resolve => require([`@/views/memberCenter/record.vue`], resolve),
component: resolve => require([`@/views/memberCenter/record.vue`], resolve),
meta: {}
},
])
......
......@@ -24,7 +24,7 @@ export async function start() {
// .forEach(item => {
// urlParams[item.split('=')[0]] = item.split('=')[1]
// })
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : 'mini-18d823b7-4aa9-4b69-8037-0c08cc369202-rop'
var token = Object.keys(urlParams).includes('sessionId') ? urlParams.sessionId : 'mini-619efaf8-543c-4ad6-a7dc-e73c8dd74e5e-rop'
Vue.prototype.$http = new Http({ response, request, sign, secret, alert: message.error, headers: { token: token } })
Vue.use(GLButton, { permissions: ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
render('/', routes)
......
......@@ -54,7 +54,7 @@
</el-form-item>
<el-form-item label="所在群聊">
<el-select
v-model="basicForm.condition.value"
v-model="basicForm.condition.chatId"
@change="valueChange"
multiple
collapse-tags
......@@ -135,7 +135,7 @@
<div>
<el-form :model="basicForm" :rules="basicRules" ref="groupForm" label-width="120px">
<el-form-item prop="attachmentList">
<label slot="label" class="required">入群欢迎语</label>
<label slot="label" class="required">群发内容</label>
<WelcomeWords ref="welcome" :eventBus="eventBus"></WelcomeWords>
</el-form-item>
<el-form-item label="发送时间" prop="sendType">
......@@ -197,6 +197,7 @@ import WelcomeWords from './components/welcomeWords.vue'
import SelectMembers from './components/selectMembers.vue'
import Preview from './components/preview.vue'
import SelectLabel from './components/selectLabel.vue'
import * as dayjs from 'dayjs'
export default {
components: {
WelcomeWords,
......@@ -227,7 +228,7 @@ export default {
callback()
}
} else {
callback(new Error('请输入入群欢迎语'))
callback(new Error('请输入群发内容'))
}
}
const validatorSendType = (rule, value, callback) => {
......@@ -383,7 +384,7 @@ export default {
removeTag(item, idx) {
this.tagging.splice(idx, 1)
this.isUpdate = true
// this.$refs.selectLabel.remove(item, idx)
// this.$refs.selectLabel.init(this.tagging)
},
valueChange(val) {
console.log(val)
......@@ -397,7 +398,35 @@ export default {
},
// 查看群发人数
viewMembers() {
this.isUpdate = false
console.log(this.basicForm)
if (!this.basicForm.userList || this.basicForm.userList.length == 0) {
this.$message({
type: 'error',
message: '请选择群发账号'
})
return
}
const params = {
selectType: this.basicForm.selectType,
condition: {
sex: this.basicForm.condition.sex,
chatId: this.basicForm.condition.chatId
}
}
params.condition.startTime = dayjs(this.basicForm.condition.date[0]).format('YYYY-MM-DD')
params.condition.endTime = dayjs(this.basicForm.condition.date[1]).format('YYYY-MM-DD')
params.userList = this.basicForm.userList.map(item => {
return {
staffId: item.staffId,
staffName: item.staffName
}
})
console.log(params)
this.$apis.customerTransform.customerCount(params).then(res => {
console.log(res)
this.isUpdate = false
})
}
}
}
......
......@@ -7,8 +7,8 @@
<div class="info-box">
<div class="info-content">
<el-form :model="basicForm" :rules="basicRules" ref="basicForm" label-width="120px">
<el-form-item label="群聊名称" prop="groupName">
<el-input v-model="basicForm.groupName" placeholder="群发名称仅内部可见" maxlength="10"></el-input>
<el-form-item label="群聊名称" prop="massName">
<el-input v-model="basicForm.massName" placeholder="群发名称仅内部可见" maxlength="10"></el-input>
</el-form-item>
<el-form-item prop="userList">
<label slot="label" class="required">选择群主</label>
......@@ -36,7 +36,7 @@
<div>
<el-form :model="basicForm" :rules="basicRules" ref="groupForm" label-width="120px">
<el-form-item prop="attachmentList">
<label slot="label" class="required">入群欢迎语</label>
<label slot="label" class="required">群发内容</label>
<WelcomeWords ref="welcome" :eventBus="eventBus"></WelcomeWords>
</el-form-item>
<el-form-item label="发送时间" prop="sendType">
......@@ -125,7 +125,7 @@ export default {
callback()
}
} else {
callback(new Error('请输入入群欢迎语'))
callback(new Error('请输入群发内容'))
}
}
const validatorSendType = (rule, value, callback) => {
......@@ -154,7 +154,7 @@ export default {
// { required: true, message: '请选择群发账号', trigger: 'blur' },
{ validator: validatorUser, trigger: 'change' }
],
groupName: [{ required: true, message: '请输入群聊名称', trigger: 'blur' }],
massName: [{ required: true, message: '请输入群聊名称', trigger: 'blur' }],
attachmentList: [
// { required: true, message: '请输入入群欢迎语' },
{ validator: validatorAttachment, trigger: 'change' }
......@@ -183,7 +183,17 @@ export default {
},
// 成员弹窗
handleConfirm() {
if (this.$refs.membersForm.innerTags.length != 0) {
if (this.$refs.membersForm.innerTags.length == 0) {
this.$message({
type: 'error',
message: '请选择群主'
})
} else if (this.$refs.membersForm.innerTags.length > 1) {
this.$message({
type: 'error',
message: '只可选择一个群主'
})
} else {
this.basicForm.userList = this.$refs.membersForm.innerTags
this.openMembers()
}
......@@ -201,7 +211,6 @@ export default {
const params = {
type: 2,
attachmentList: this.basicForm.attachmentList,
selectType: this.basicForm.selectType,
sendType: this.basicForm.sendType
}
params.userList = this.basicForm.userList.map(item => {
......
......@@ -6,20 +6,35 @@
<div class="content-text">
<div class="detail-item">
<div class="detail-label">创建者:</div>
<div class="detail-value">超级管理员</div>
<div class="detail-value">{{basicInfo.createdBy ? basicInfo.createdBy : '-'}}</div>
</div>
<div class="detail-item">
<div class="detail-label">群发内容:</div>
<div class="detail-value">超级管理员</div>
<div class="detail-tips">详见右侧视图</div>
<div class="detail-label">群发类型:</div>
<div class="detail-value">{{basicInfo.sendType == 1 ? '立即发送': '定时发送'}}</div>
</div>
<div class="detail-item" v-show="form == 'customer'">
<div class="detail-label">发送状态:</div>
<div class="detail-value">{{STATUS_TYPE[basicInfo.status]}}</div>
</div>
<div class="detail-item" v-show="form == 'customer' && basicInfo.sendType == 2">
<div class="detail-label">发送时间:</div>
<div class="detail-value">{{basicInfo.sendTime}}</div>
</div>
<div class="detail-item">
<div class="detail-label">创建者:</div>
<div class="detail-value">超级管理员</div>
<div class="detail-label">群发对象:</div>
<div class="detail-value">
<span v-for="(item, index) in basicInfo.userList" :key="item.id">
[{{item.staffName}}]
<span v-show="basicInfo.userList.length -1 != index">、</span>
</span>
</div>
</div>
<div class="detail-item">
<div class="detail-label">创建者:</div>
<div class="detail-value">超级管理员</div>
<div class="detail-label">群发内容:</div>
<div
class="detail-value"
>[共{{basicInfo.attachmentList ? basicInfo.attachmentList.length : '0'}}条]</div>
<div class="detail-tips">详见右侧视图</div>
</div>
</div>
<div class="title">数据统计</div>
......@@ -27,59 +42,99 @@
<div class="statistics-ul">
<div class="statistics-li statistics-border">
<div class="statistics-number">
<span>0</span>
<span>{{form == 'customer' ? statistic.senderStaffCount: statistic.senderStaffCount}}</span>
人
</div>
<div>已发送群主</div>
<div>已发送{{form == 'customer' ? '成员': '群主'}}</div>
</div>
<div class="statistics-li">
<div class="statistics-number">
<span>0</span>
<span>{{form == 'customer' ? statistic.senderCustomerCount :statistic.senderGroupCount}}</span>
人
</div>
<div>已发送群主</div>
<div>送达{{form == 'customer' ? '客户': '群聊'}}</div>
</div>
</div>
<div class="statistics-ul">
<div class="statistics-li statistics-border">
<div class="statistics-number">
<span>0</span>
<span>{{form == 'customer' ?statistic.unSenderStaffCount:statistic.unSenderStaffCount}}</span>
人
</div>
<div>已发送群主</div>
<div>未发送{{form == 'customer' ? '成员': '群主'}}</div>
</div>
<div class="statistics-li">
<div class="statistics-number">
<span>0</span>
<span>{{form == 'customer' ?statistic.unSenderCustomerCount:statistic.unSenderGroupCount}}</span>
人
</div>
<div>已发送群主</div>
<div>未送达{{form == 'customer' ? '客户': '群聊'}}</div>
</div>
</div>
<div class="statistics-ul">
<div v-if="form == 'customer'" class="statistics-ul">
<div class="statistics-li">
<div class="statistics-number">
<span>0</span>
<span>{{statistic.senderCustomerFailureCount}}</span>
人
</div>
<div>已发送群主</div>
<div>客户送达失败</div>
</div>
</div>
</div>
</div>
<Preview></Preview>
<Preview :eventBus="eventBus" :list.sync="basicInfo.attachmentList"></Preview>
</div>
</div>
</template>
<script>
const STATUS = {
'-1': '创建失败',
'0': '创建成功',
'1': '发送成功',
'2': '发送失败'
}
import Preview from '../components/preview.vue'
export default {
name: 'BasicInof',
props: ['form', 'id', 'eventBus'],
components: {
Preview
},
data() {},
methods: {}
data() {
return {
STATUS_TYPE: STATUS,
basicInfo: {},
statistic: {}
}
},
mounted() {
this.getCustomerDetail(this.id)
console.log(this.form)
this.getStatistic()
},
methods: {
getCustomerDetail(id) {
this.$apis.customerTransform.customerDetail({ id }).then(res => {
console.log(res)
this.basicInfo = res
this.eventBus.$emit('update', this.basicInfo.attachmentList)
})
},
getStatistic() {
const { id, form } = this
if (form == 'customer') {
this.$apis.customerTransform.detailStatistic({ id }).then(res => {
console.log(res)
this.statistic = res
})
} else if (form == 'customerGroup') {
this.$apis.customerTransform.groupDetailStatistic({ id }).then(res => {
console.log(res)
this.statistic = res
})
}
}
}
}
</script>
<style lang="scss" scope>
......@@ -120,7 +175,7 @@ export default {
}
.statistics-info {
display: flex;
justify-content: space-between;
justify-content: space-around;
margin-top: 24px;
margin-left: 52px;
.statistics-ul {
......
......@@ -3,14 +3,14 @@
<div class="preview-content">
<div class="preview-time">{{ currentTime }}</div>
<div class="preview-info" v-for="item in previewList" :key="item.id">
<img class="avatar" src="@/assets/logo.png" alt="" />
<img class="avatar" src="@/assets/logo.png" alt />
<template v-if="item.attType == 1">
<div class="preview-text text">{{ item.attContent }}</div>
</template>
<template v-else-if="item.attType == 4">
<div class="preview-text preview-link">
{{ item.attContent.url }}
<img src="@/assets/guestCustom/preview-link.png" alt="" />
<img src="@/assets/guestCustom/preview-link.png" alt />
</div>
</template>
<template v-else-if="item.attType == 2">
......@@ -23,7 +23,7 @@
<template v-else-if="item.attType == 5">
<div class="preview-text text preview-applet">
<div class="preview-applet-title">
<img :src="item.attContent.picUrl" alt="" />
<img :src="item.attContent.picUrl" alt />
<span>{{ item.attContent.title }}</span>
</div>
{{ item.attContent.page }}
......@@ -37,7 +37,7 @@
<script>
export default {
name: 'Preview',
props: { eventBus: Object },
props: { eventBus: Object, list: Array },
data() {
return {
previewList: [],
......@@ -45,6 +45,9 @@ export default {
}
},
created() {
this.$nextTick(() => {
console.log(1, this.list)
})
this.eventBus.$on('update', val => {
console.log(val)
this.previewList = val
......
......@@ -65,8 +65,8 @@
</div>
</template>
<script>
import { utils } from 'glsx-common'
export default {
name: 'SelectLabel',
data() {
......@@ -115,14 +115,14 @@ export default {
}
},
methods: {
init() {
init(item) {
this.dialogVisible = true
this.querylabeltree()
this.querylabeltree(item)
},
handleSearch() {
this.querylabeltree()
},
querylabeltree() {
querylabeltree(selectItem) {
this.$apis.customerTransform
.querylabeltree({
labelTreeReq: {
......@@ -133,23 +133,60 @@ export default {
}
})
.then(res => {
console.log(res)
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
if (selectItem && selectItem.length > 0) {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
//回显
selectItem.forEach(item => {
this.labelTreeRets.forEach(tag => {
if (item.labelGroup.id == tag.labelGroup.id) {
this.$nextTick(() => {
tag.tagChecked = item.labelList
})
}
})
})
this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index)
})
})
} else {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
}
})
},
remove(item, idx) {
item.tagChecked.splice(idx, 1)
if (item.tagChecked.length == 0) item.checkAll = false
if (item.tagChecked.length == 0) {
this.$nextTick(() => {
item.checkAll = false
})
}
this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index)
})
})
},
//选中
handleSelect() {
this.dialogVisible = false
let labelTreeRets = this.labelTreeRets
......@@ -157,11 +194,12 @@ export default {
if (item.tagChecked.length) {
return {
labelGroup: item.labelGroup,
labelList: item.labelList
labelList: item.tagChecked
}
}
})
.filter(item => item)
console.log(labelTreeRets)
this.$emit('tagSelected', labelTreeRets)
},
//全选
......@@ -190,7 +228,6 @@ export default {
}
</script>
<style lang="scss" scoped>
.tag-panel {
display: flex;
......@@ -199,6 +236,7 @@ export default {
/deep/ {
.el-checkbox__label {
width: 100%;
vertical-align: middle;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
......@@ -255,6 +293,8 @@ export default {
}
.tag-group {
margin-left: 40px;
display: flex;
flex-wrap: wrap;
.el-checkbox {
width: 40%;
margin-bottom: 6px;
......
<template>
<div>
<BasicInof></BasicInof>
<BasicInof :form="'customerGroup'" :eventBus="eventBus" :id="$route.params.id"></BasicInof>
<div class="detail-container">
<glsx-combi-form ref="showSearch" labelWidth="90px" :formObj="searchForm" :formData="searchFormData">
<glsx-combi-form
ref="showSearch"
labelWidth="90px"
:formObj="searchForm"
:formData="searchFormData"
>
<span slot="footer" class="search-btns">
<el-button :size="size" type="primary" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleReset">重置</el-button>
</span>
</glsx-combi-form>
<!-- 表格区域 开始 -->
<GLTable ref="table" :tableData="tableData" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<GLTable
ref="table"
:getListApi="getListApi"
:searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" :disabled="scope.scope.isRemind == 1" @click="btnClick('edit', scope.scope)">提醒发送</el-button>
<el-button
type="text"
:disabled="scope.scope.isRemind == 1"
@click="remind(scope.scope)"
>提醒发送</el-button>
</div>
</GLTable>
</div>
......@@ -22,12 +37,13 @@
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="handleNext">确定</el-button>
<!-- <el-button type="primary" @click="handleNext">确定</el-button> -->
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import Vue from 'vue'
import BasicInof from './components/basicInfo.vue'
export default {
components: {
......@@ -36,53 +52,61 @@ export default {
data() {
return {
searchForm: {},
eventBus: new Vue(),
searchFormData: [
{
label: '群聊名称',
name: 'zoneName',
name: 'keyWord',
type: 'input',
maxlength: 20
},
{
label: '群主',
name: 'createDate',
name: 'staffId',
type: 'select',
isClear: true,
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: 12,
value: 12
}
]
optionLabel: 'staffName',
optionId: 'staffId',
optionList: []
},
{
label: '送达状态',
name: 'createDate',
name: 'status',
type: 'select',
isClear: true,
optionLabel: 'label',
optionId: 'value',
optionList: [
{
label: 12,
value: 12
label: '全部',
value: ''
},
{
label: '未发送',
value: '0'
},
{
label: '已发送',
value: '1'
},
{
label: '发送失败',
value: '2'
}
]
}
],
tableParams: {
listName: 'list',
listName: '',
tableOption: false,
tableColumns: [
{
label: '群聊名称',
prop: 'zoneName'
prop: 'groupName'
},
{
label: '群主',
prop: 'zoneName'
prop: 'staffName'
},
{
label: '群主所在部门',
......@@ -90,18 +114,25 @@ export default {
},
{
label: '群客户人数',
prop: 'zoneName'
prop: 'departmentName'
},
{
label: '消息送达状态',
prop: 'zoneName'
prop: 'status',
formatter: cellValue => {
return {
0: '未发送',
1: '已发送',
2: '发送失败'
}[cellValue.status]
}
},
{
label: '确认发送时间',
prop: 'createdDate',
formatter: cellValue => {
return new Date(cellValue.createdDate).toLocaleDateString().replace(/\//g, '-')
}
prop: 'senderTime'
// formatter: cellValue => {
// return new Date(cellValue.createdDate).toLocaleDateString().replace(/\//g, '-')
// }
},
{
label: '操作',
......@@ -113,21 +144,41 @@ export default {
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableData: [
{
zoneName: 'fasd',
isRemind: 1
},
{
zoneName: 'fasd',
isRemind: 2
}
]
getListApi: this.$apis.customerTransform.groupDetailList
}
},
mounted() {
const id = this.$route.params.id
this.getCustomerDetail(id)
this.searchForm.massId = id
},
methods: {
handleCancel() {
this.$router.go(-1)
},
remind(data) {
this.$apis.customerTransform
.listRemindOperate({
id: data.id,
type: 2
})
.then(res => {
console.log(res)
// this.$set(this.employeelist[index], 'isRemind', true)
})
},
handleSearch() {
this.$refs.table.refreshTable()
},
handleReset() {
this.searchForm = {
massId: this.$route.params.id
}
},
getCustomerDetail(id) {
this.$apis.customerTransform.customerDetail({ id }).then(res => {
this.searchFormData[1].optionList = res.userList
})
}
}
}
......
<template>
<div>
<BasicInof></BasicInof>
<BasicInof :eventBus="eventBus" :id="$route.params.id" :form="'customer'"></BasicInof>
<div class="detail-container">
<div class="detail-modular">
<div class="title">员工详情</div>
<div class="detail-info">
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
<el-menu-item index="1">全部</el-menu-item>
<el-menu-item index="2">已发送员工</el-menu-item>
<el-menu-item index="3">未发送员工</el-menu-item>
<el-menu-item index="4">员工发送失败</el-menu-item>
<el-menu
:default-active="activeIndex"
class="el-menu-demo"
mode="horizontal"
@select="handleSelect"
>
<el-menu-item index="0">全部</el-menu-item>
<el-menu-item index="1">已发送员工</el-menu-item>
<el-menu-item index="2">未发送员工</el-menu-item>
<el-menu-item index="3">员工发送失败</el-menu-item>
</el-menu>
<div class="detail-total">共 {{ employeelist.length || 0 }} 人</div>
<div class="info-list">
<div class="info-item" v-for="item in employeelist" :key="item.id">
<img class="info-avatar" src="../../assets/logo.png" alt="" />
<div v-if="employeelist.length != 0" class="info-list">
<div class="info-item" v-for="(item, index) in employeelist" :key="item.id">
<img class="info-avatar" :src="item.avatar" alt />
<div class="info-content">
<div class="info-text">
<div class="info-name">
{{ item.name }}
<span :class="[item.status == 1 ? 'unsend' : 'send']">{{ item.status == 1 ? '未' : '已' }}发送</span>
{{ item.staffName }}
<span
:class="[item.status == 1 ? 'unsend' : 'send']"
>{{ item.status == 1 ? '未' : '已' }}发送</span>
</div>
<div class="info-num">共{{ item.num }}个客户</div>
<div class="info-num">共{{ item.customerCount }}个客户</div>
</div>
<div class="info-right">
<div v-if="item.status == 1">已提醒</div>
<el-button size="mini" type="primary">提醒</el-button>
<div v-if="item.isRemind">已提醒</div>
<el-button size="mini" type="primary" @click="remind(item, index)">提醒</el-button>
</div>
</div>
</div>
</div>
<el-empty v-else image-size="200"></el-empty>
</div>
</div>
<div class="detail-modular">
<div class="title">客户详情</div>
<div class="detail-info">
<el-menu :default-active="customIndex" class="el-menu-demo" mode="horizontal" @select="handleCustomSelect">
<el-menu-item index="1">全部</el-menu-item>
<el-menu-item index="2">已发送员工</el-menu-item>
<el-menu-item index="3">未发送员工</el-menu-item>
<el-menu-item index="4">员工发送失败</el-menu-item>
<el-menu
:default-active="customIndex"
class="el-menu-demo"
mode="horizontal"
@select="handleCustomSelect"
>
<el-menu-item index="0">全部</el-menu-item>
<el-menu-item index="1">已发送客户</el-menu-item>
<el-menu-item index="2">未发送客户</el-menu-item>
<el-menu-item index="3">客户接受失败</el-menu-item>
</el-menu>
<div class="detail-total">共 {{ employeelist.length || 0 }} 人</div>
<div class="info-list">
<div class="info-item" v-for="item in employeelist" :key="item.id">
<img class="info-avatar" src="../../assets/logo.png" alt="" />
<div class="detail-total">共 {{ customerlist.length || 0 }} 人</div>
<div v-if="customerlist.length != 0" class="info-list">
<div class="info-item" v-for="item in customerlist" :key="item.id">
<img class="info-avatar" :src="item.avatar" alt />
<div class="info-content info-custom">
<div class="info-text">
<div class="info-name">
{{ item.name }}
<div :class="[item.status == 1 ? 'unsend' : 'send']">{{ item.status == 1 ? '未' : '已' }}发送</div>
{{ item.customerName }}
<div
:class="[item.status == 0 ? 'unsend' : 'send']"
>{{ item.status == 0 ? '未' : '已' }}发送</div>
</div>
</div>
<div class="info-right">
<div>通过 胡悦发送</div>
<div>通过 {{item.staffName}}发送</div>
</div>
</div>
</div>
</div>
<el-empty v-else image-size="200"></el-empty>
</div>
</div>
</div>
......@@ -68,12 +84,14 @@
width: footerWidth + 'px'
}"
>
<el-button type="primary" @click="handleNext">确定</el-button>
<!-- <el-button type="primary" @click="handle
Next">确定</el-button>-->
<el-button type="primary" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import Vue from 'vue'
import BasicInof from './components/basicInfo.vue'
export default {
components: {
......@@ -81,8 +99,8 @@ export default {
},
data() {
return {
activeIndex: '1',
customIndex: '1',
activeIndex: '0',
customIndex: '0',
employeelist: [
{
id: 1,
......@@ -126,19 +144,65 @@ export default {
num: 1,
url: 'dfsa'
}
]
],
customerlist: [],
basicInfo: {},
eventBus: new Vue()
}
},
mounted() {
this.getStaffList()
this.getCustomerList()
},
methods: {
handleSelect(val) {
console.log(val)
this.activeIndex = val
this.getStaffList(val)
},
handleCustomSelect(val) {
this.customIndex = val
this.getCustomerList(val)
},
handleCancel() {
this.$router.go(-1)
},
remind(data, index) {
if (!data.isRemind) {
this.$apis.customerTransform
.listRemindOperate({
id: data.id,
type: 1
})
.then(res => {
this.$set(this.employeelist[index], 'isRemind', true)
})
}
},
getCustomerDetail(id) {
this.$apis.customerTransform.customerDetail({ id }).then(res => {
console.log(res)
this.basicInfo = res
})
},
getStaffList(status = 0) {
const id = this.$route.params.id
this.$apis.customerTransform.staffList({ id, status }).then(res => {
console.log(res)
this.employeelist = res
})
},
getCustomerList(status = 0) {
const id = this.$route.params.id
this.$apis.customerTransform.customerDetailList({ id, status }).then(res => {
console.log(res)
this.customerlist = res
})
},
remindUserGroup() {
const id = this.$route.params.id
this.$apis.customerTransform.remindUserGroup({ id, type: 1 }).then(res => {
console.log(res)
})
}
}
}
......
<template>
<div class="send-assistant">
<div class="menu-sub">
<div class="menu-sub-item" :class="[activeIndex == '1' ? 'active' : '']" @click="switchMenu(1)">客户群发</div>
<div class="menu-sub-item" :class="[activeIndex == '2' ? 'active' : '']" @click="switchMenu(2)">客户群群发</div>
<div
class="menu-sub-item"
:class="[activeIndex == '1' ? 'active' : '']"
@click="switchMenu(1)"
>客户群发</div>
<div
class="menu-sub-item"
:class="[activeIndex == '2' ? 'active' : '']"
@click="switchMenu(2)"
>客户群群发</div>
</div>
<div v-show="activeIndex == 1" class="container">
<div class="container-header">
......@@ -10,13 +18,27 @@
<el-button type="primary" icon="el-icon-plus" @click="btnClick('create', 1)">新建群发</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="gueast" :getListApi="customerList" :tableParams="gueastTableParams" :pageConf="gueastPageConf">
<!-- <div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span>
</div> -->
<GLTable
ref="customer"
:getListApi="customerList"
:tableParams="gueastTableParams"
:pageConf="gueastPageConf"
>
<div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.attachmentList" :key="index">
[共{{scope.scope.attachmentList.length}}条]
<span v-show="i.attType == 1">{{i.attContent}}</span>
<span v-show="i.attType == 2 || i.attType == 3">[{{ATT_TYPE[i.attType]}}]</span>
<span v-show="i.attType == 4 || i.attType == 5">[{{ATT_TYPE[i.attType]}}]</span>
</span>
</div>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" :disabled="scope.scope.isRemind == 1" @click="btnClick('edit', 1, scope.scope)">提醒发送</el-button>
<el-button type="text" @click="btnClick('detail', 2, scope.scope)">详情</el-button>
<el-button
type="text"
:disabled="scope.scope.isRemind == 0"
@click="btnClick('remind', 1, scope.scope)"
>提醒发送</el-button>
<el-button type="text" @click="btnClick('detail', 1, scope.scope)">详情</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
......@@ -27,12 +49,26 @@
<el-button type="primary" icon="el-icon-plus" @click="btnClick('create', 2)">新建群发</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="gueast" :getListApi="customerGroupList" :tableParams="gueastGroupTableParams" :pageConf="gueastPageConf">
<!-- <div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.userList" :key="index">{{ i.name }}({{ i.tips }});</span>
</div> -->
<GLTable
ref="customerGroup"
:getListApi="customerGroupList"
:tableParams="gueastGroupTableParams"
:pageConf="gueastPageConf"
>
<div slot="entmicro-name" class="entmicro" slot-scope="scope">
<span v-for="(i, index) in scope.scope.attachmentList" :key="index">
[共{{scope.scope.attachmentList.length}}条]
<span v-show="i.attType == 1">{{i.attContent}}</span>
<span v-show="i.attType == 2 || i.attType == 3">[{{ATT_TYPE[i.attType]}}]</span>
<span v-show="i.attType == 4 || i.attType == 5">[{{ATT_TYPE[i.attType]}}]</span>
</span>
</div>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" :disabled="scope.scope.isRemind == 1" @click="btnClick('edit', 2, scope.scope)">提醒发送</el-button>
<el-button
type="text"
:disabled="scope.scope.isRemind == 0"
@click="btnClick('remind', 2, scope.scope)"
>提醒发送</el-button>
<el-button type="text" @click="btnClick('detail', 2, scope.scope)">详情</el-button>
</div>
</GLTable>
......@@ -44,7 +80,14 @@
export default {
name: 'SendAssistant',
data() {
const ATT_TYPE = {
2: '图文消息',
3: '图文消息',
4: '链接',
5: '链接'
}
return {
ATT_TYPE,
activeIndex: '1',
gueastTableParams: {
listName: 'data',
......@@ -64,8 +107,8 @@ export default {
label: '群发内容',
prop: 'massName',
line: 2,
minWidth: '100px'
// addHtml: 'entmicro-name'
minWidth: '100px',
addHtml: 'entmicro-name'
},
{
label: '发送时间',
......@@ -96,8 +139,7 @@ export default {
label: '操作',
prop: 'optionBtns',
width: '140px',
addHtml: 'optionBtns',
fixed: 'right'
addHtml: 'optionBtns'
}
]
},
......@@ -110,14 +152,14 @@ export default {
tableColumns: [
{
label: '群发名称',
prop: 'name'
prop: 'massName'
},
{
label: '群发内容',
prop: 'massName',
line: 2,
minWidth: '100px'
// addHtml: 'entmicro-name'
minWidth: '100px',
addHtml: 'entmicro-name'
},
{
label: '发送时间',
......@@ -148,13 +190,21 @@ export default {
label: '操作',
prop: 'optionBtns',
width: '140px',
addHtml: 'optionBtns',
fixed: 'right'
addHtml: 'optionBtns'
}
]
}
}
},
watch: {
$route(val) {
console.log(val)
if (val.path == '/customerTransform/index') {
this.$refs.customer.refreshTable()
this.$refs.customerGroup.refreshTable()
}
}
},
methods: {
switchMenu(val) {
this.activeIndex = val
......@@ -175,11 +225,28 @@ export default {
break
case 'detail':
if (type == 1) {
this.$router.push('/customerTransform/detailCustomer')
this.$router.push('/customerTransform/detailCustomer/' + rowData.id)
} else {
this.$router.push('/customerTransform/detaiCustomeGroup')
this.$router.push('/customerTransform/detaiCustomeGroup/' + rowData.id)
}
break
case 'remind':
var params = {
id: rowData.id,
type
}
// if (type == 1) {
this.$apis.customerTransform.listRemindOperate(params).then(res => {
console.log(res)
if (type == 1) {
this.$refs.customer.refreshTable()
} else {
this.$refs.customerGroup.refreshTable()
}
})
// } else {
// }
break
default:
console.log(11)
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!