Commit a96411a2 by 杨明

fixed

1 parent 12cb5fac
......@@ -17,6 +17,107 @@ const findAllByPage = params => {
sign: true
})
}
//活动配置详情
const activityDetail = params => {
params.method = 'marketing.api.activity.config.detail'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//活动配置列表
const activityPage = params => {
params.method = 'marketing.api.activity.config.page'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//活动配置创建
const activityInsert = params => {
params.method = 'marketing.api.activity.config.insert'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//活动配置创建
const activityGroupList = params => {
params.method = 'marketing.api.activity.config.group.list'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//活动配置编辑
const activityUpdate = params => {
params.method = 'marketing.api.activity.config.update'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//查询活动列表
const activityPageList = params => {
params.method = 'marketing.api.activity.activityPage'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//查询活动客户列表
const activityCustomerPage = params => {
params.method = 'marketing.api.activity.activityCustomerPage'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//分配客户
const assignmentCustomer = params => {
params.method = 'marketing.api.activity.assignmentCustomer'
return http({
url: '/rop-scrm-marketing/router',
method: 'POST',
data: params,
sign: true
})
}
//活动配置编辑
const queryCrowdGroupTree = params => {
params.method = 'scrm.api.datahub.crowdgroup.queryCrowdGroupTree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
findAllByPage
findAllByPage,
activityDetail,
activityPage,
activityPageList,
activityCustomerPage,
assignmentCustomer,
activityInsert,
activityUpdate,
queryCrowdGroupTree,
activityGroupList
}
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http_common } from '@/main'
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
export default {
pictureUpload
}
/**
* 新增参数sign 判断接口是否需要sign签名
*/
/**
* 用法 : this.$apis.demo.GETLISTDEVICEFILEUNSTOCK(...)
* @param {*} params
* @returns
*/
import { http } from '@/main'
const getStaffList = params => {
params.method = 'entmicro.api.staff.findStaffByMerchantId'
return http({
url: '/rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
const listDepartmentTree = params => {
params.method = 'entmicro.api.department.listDepartmentTree'
return http({
url: '/rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
const queryCrowdTree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
export default {
getStaffList,
listDepartmentTree,
queryCrowdTree
}
<template>
<div class="button-panel" v-stat="dataAnalyics">
<slot></slot>
</div>
</template>
<script>
export default {
name: 'collect-button',
data() {
return {}
},
props: { dataAnalyics: Object },
directives: {
stat: function(el, binding, vnode) {
el.addEventListener('click', function() {
console.log(binding.value)
})
}
}
}
</script>
<style scoped lang="scss"></style>
......@@ -17,7 +17,7 @@ export const fetchConfig = function(isEnv = true) {
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
return new Http({ request: { timeout: 100000 } }).get('https://oss-config.test.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
return new Http({ request: { timeout: 100000 } }).get('https://oss-config.dev.glsx.com.cn/mock/62947bd8304f1311a3b76a01/activity/config')
// return new Http({ request: { timeout: 100000 } }).get('https://oss-config.dev.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
}
export const config = {
......
export default {
data() {
return {
crowdGroupUnitList: []
}
},
mounted() {},
methods: {
async queryCrowdGroupTree() {
let params = {
req: {
pageSize: 1000,
pageNum: 1,
merchantId: this.$globalState.session.merchantId,
keyword: ''
}
}
const crowdGroupUnitList = await this.$apis.activity.queryCrowdGroupTree(params)
return crowdGroupUnitList.crowdGroupUnitList
},
async queryCrowdTree() {
const commonParam = { pageSize: 1000, pageNum: 1, merchantId: this.$globalState.session.merchantId }
const params1 = {
req: {
crowdType: 1,
...commonParam
}
}
const params2 = {
req: {
...commonParam,
crowdType: 2
}
}
const crowdUnitList1 = this.$apis.activity.queryCrowdTree(params1)
const crowdUnitList2 = this.$apis.activity.queryCrowdTree(params2)
const crowdUnitList = await Promise.all([crowdUnitList1, crowdUnitList2])
/*
groupArr: 勾选的人群
checked: 是否展开
isIndeterminateGroup:树节点选中
gruopCheckAll: 全选
selectGroup:右边树的选中数据
*/
this.crowdUnitList = [
{ crowdName: '推荐人群', children: crowdUnitList[0] },
{ crowdName: '自定义人群', children: crowdUnitList[1] }
]
return this.crowdUnitList
}
}
}
......@@ -2,7 +2,9 @@ const staticRoutes = Object.freeze([
{
name: 'activity',
path: '/',
meta: {},
meta: {
title: '活动管理'
},
component: resolve => require([`@/views/activity/index.vue`], resolve)
},
{
......@@ -20,7 +22,7 @@ const staticRoutes = Object.freeze([
{
name: 'config',
path: '/',
meta: {},
meta: { title: '活动配置' },
component: resolve => require([`@/views/activityConfig/index.vue`], resolve)
}
])
......
......@@ -3,12 +3,14 @@ import Vue from 'vue'
import { fetchConfig } from '@/config'
import ElementUI from 'element-ui'
import { GLTable, GLButton, GLFooter, GLCombiForm } from 'glsx-components' //权限按钮 (根据权限动态创建)
import collectButton from '@/components/collect-button'
import { getRoutes } from '@/router'
import render from './render'
Vue.use(ElementUI)
Vue.use(GLTable)
Vue.use(GLFooter)
Vue.use(GLCombiForm)
Vue.component(collectButton.name, collectButton)
import 'glsx-components/dist/glsx-components.css'
import '@/assets/css/common.scss'
let routes = []
......
import { Message } from 'element-ui'
let util = {}
util.cloneText = function(message) {
let input = document.createElement('input')
input.value = message
document.body.appendChild(input)
input.select()
input.setSelectionRange(0, input.value.length), document.execCommand('Copy')
document.body.removeChild(input)
Message.success('复制成功')
}
util.getBeforeDate = function(sign = '-') {
let day = new Date()
let month = day.getMonth() + 1
let date = day.getDate()
if (month < 10) month = '0' + month
if (date < 10) date = '0' + date
var s = day.getFullYear() + sign + month + sign + date
return s
}
util.getBeforeMonth = function(days) {
let month = new Date().getMonth() + 1
let year = new Date().getFullYear()
let arr = new Array()
for (let i = 0; i < days; i++) {
if (month <= 0) {
year = year - 1
month = month + 12
}
if (month < 10) month = '0' + month
arr[i] = year + '年' + month + '月'
month--
}
return arr
}
/**
* 格式化时间
* @param {Array} time
*/
util.formatTime = function(time) {
return {
startTime: time ? time[0] + ' ' + '00:00:00' : '',
endTime: time ? time[1] + ' ' + '23:59:59' : ''
}
}
util.tringToDate = function(dateStr, separator) {
if (!separator) {
separator = '-'
}
var dateArr = dateStr.split(separator)
var year = parseInt(dateArr[0])
var month
//处理月份为04这样的情况
if (dateArr[1].indexOf('0') == 0) {
month = parseInt(dateArr[1].substring(1))
} else {
month = parseInt(dateArr[1])
}
var day = parseInt(dateArr[2])
var date = new Date(year, month - 1, day)
return date
}
util.getDay = function(num, str = '-') {
var today = new Date()
var nowTime = today.getTime()
var ms = 24 * 3600 * 1000 * num
today.setTime(parseInt(nowTime + ms))
var oYear = today.getFullYear()
var oMoth = (today.getMonth() + 1).toString()
if (oMoth.length <= 1) oMoth = '0' + oMoth
var oDay = today.getDate().toString()
if (oDay.length <= 1) oDay = '0' + oDay
return oYear + str + oMoth + str + oDay
}
util.openUrl = function(url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
util.downloadUrl = function(url) {
const link = document.createElement('a')
link.href = url
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
}
util.getArrayIsSubset = (arr2, arr1) => {
return arr1.every(item => {
return arr2.includes(item)
})
}
util.downloadIamge = function(imgsrc, name = new Date().getTime()) {
//下载图片地址和图片名
var image = new Image()
// 解决跨域 Canvas 污染问题
image.setAttribute('crossOrigin', 'anonymous')
image.onload = function() {
var canvas = document.createElement('canvas')
canvas.width = image.width
canvas.height = image.height
var context = canvas.getContext('2d')
context.drawImage(image, 0, 0, image.width, image.height)
var url = canvas.toDataURL('image/png') //得到图片的base64编码数据
var a = document.createElement('a') // 生成一个a元素
var event = new MouseEvent('click') // 创建一个单击事件
a.download = name || 'photo' // 设置图片名称
a.href = url // 将生成的URL设置为a.href属性
a.dispatchEvent(event) // 触发a的单击事件
}
image.src = imgsrc
}
export default util
<template>
<div class="activity-main">
<div class="activity-box-f" :style="{ 'min-height': boxHeight + 'px' }">
<div class="activity-box-title">创建活动</div>
<div class="activity-box-f" :style="{ 'min-height': boxHeight + 'px' }" v-loading="addLoading">
<div class="activity-box-title">{{ activityId ? '编辑活动' : '创建活动' }}</div>
<div class="activity-box-form">
<el-form ref="addForm" :model="addForm" class="code-body-form" label-width="120px" :rules="addRules">
<el-form-item label="活动名称" prop="name" size="small">
<el-input size="small" v-model.trim="addForm.name" placeholder="请输入活动名称" maxlength="30"></el-input>
<el-form-item label="活动名称" prop="configName" size="small">
<el-input size="small" v-model.trim="addForm.configName" placeholder="请输入活动名称" maxlength="20"></el-input>
<div class="activity-name-tips">例:输入“定保客户”,系统推送任务时将自动追加月份信息“5月招揽-定保客户”</div>
</el-form-item>
<el-form-item label="推送日期" prop="date" size="small">
<el-form-item label="推送日期" prop="sendDate" size="small">
<div class="activity-date">
每月
<el-input-number v-model="addForm.date" controls-position="right" :min="1" :max="28"></el-input-number>
<el-input-number v-model="addForm.sendDate" controls-position="right" :min="1" :max="28"></el-input-number>
号
</div>
</el-form-item>
<el-form-item label="推送月份" prop="month" size="small">
<el-radio-group v-model="addForm.month">
<el-form-item label="推送月份" prop="sendMonth" size="small">
<el-radio-group v-model="addForm.sendMonth">
<el-radio :label="1">次月</el-radio>
<el-radio :label="2">当月</el-radio>
<el-radio :label="0">当月</el-radio>
</el-radio-group>
<div class="activity-name-tips">例:选择“次月”,系统将在设定的推送日期推送次月的待定保客户</div>
</el-form-item>
<el-form-item label="状态" size="small">
<el-switch v-model="addForm.value"></el-switch>
{{ addForm.value ? '启用' : '停用' }}
<el-switch v-model="activityStatus"></el-switch>
{{ activityStatus ? '启用' : '停用' }}
<el-popover placement="top" width="300" trigger="hover" content="停用活动仅会影响下个周期的营销推送,不影响已经生成的招揽活动。">
<img src="@/assets/img/question.png" slot="reference" class="count-item-question" />
</el-popover>
</el-form-item>
<el-form-item label="客群" prop="name" size="small">
<el-form-item label="客群" prop="custGroupId" size="small">
<div class="group-item">
<el-select v-model="addForm.value" placeholder="请选择">
<el-option v-for="item in optionsGroup" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-select v-model="addForm.custGroupId" placeholder="请选择" @change="selectCrowd(addForm.custGroupId)">
<el-option v-for="item in crowdGroupUnitList" :key="item.crowdGroupId" :label="item.crowdGroupName" :value="item.crowdGroupId"></el-option>
</el-select>
<div class="edit-group">编辑客群</div>
<div class="edit-group" @click="jumpCrowd">编辑客群</div>
</div>
</el-form-item>
<el-form-item label="配置营销" prop="name" size="small">
<el-form-item label="配置营销" prop="name" size="small" v-if="addForm.custGroupId">
<GLTable :hasPage="false" ref="config" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="handleConfig(scope.scope)">配置</el-button>
......@@ -61,7 +61,7 @@
<el-button size="small" @click="dialogVisible = false">
否
</el-button>
<el-button size="small" type="primary" @click="handleSure">是</el-button>
<el-button size="small" type="primary" @click="handleSureConfig">是</el-button>
</div>
</el-dialog>
<GLFooter>
......@@ -71,13 +71,14 @@
<el-button type="primary" @click="handleSure">提交</el-button>
</GLFooter>
<el-image class="preview-panel" style="width: 100px; height: 0px" ref="imageForm" :src="url" :preview-src-list="srcList"></el-image>
<component title="345" :is="'market-config'" ref="configForm" :boxHeight="boxHeight"></component>
<component @handleConfigChecked="handleConfigChecked" :is="'market-config'" ref="configForm" :boxHeight="boxHeight"></component>
</div>
</template>
<script>
import url from '@/assets/img/activity/config.png'
import marketConfig from './components/marketConfig.vue'
import crowd from '@/mixins/crowd'
const optionsGroup = [
{
value: '1',
......@@ -93,6 +94,7 @@ const optionsGroup = [
}
]
export default {
mixins: [crowd],
name: 'addActivity',
components: {
marketConfig
......@@ -100,25 +102,34 @@ export default {
data() {
return {
url,
activityStatus: true,
boxHeight: '',
srcList: [url],
dialogVisible: false,
addLoading: false,
drawer: false,
addForm: {},
addForm: {
sendMonth: 1,
status: 0
},
activityId: '',
optionsGroup,
tableData: [{}],
tableData: [],
tableIndex: 0,
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '人群',
prop: 'codeRemark'
prop: 'crowdName'
},
{
label: '状态',
prop: 'yesterdayNum',
addHtml: 'yesterdayNum'
prop: 'welcomeConfigDTOS',
formatter: cellValue => {
return cellValue.welcomeDTOS && cellValue.welcomeDTOS.length ? '已配置' : '未配置'
}
},
{
label: '操作',
......@@ -128,30 +139,138 @@ export default {
]
},
addRules: {
name: [{ required: true, message: '请输入活动名称', trigger: 'blur' }],
date: [{ required: true, message: '请输入推送日期', trigger: 'change' }],
month: [{ required: true, message: '请选择推送月份', trigger: 'change' }]
configName: [{ required: true, message: '请输入活动名称', trigger: 'blur' }],
sendDate: [{ required: true, message: '请输入推送日期', trigger: 'change' }],
sendMonth: [{ required: true, message: '请选择推送月份', trigger: 'change' }],
custGroupId: [{ required: true, message: '请选择客群', trigger: 'change' }]
}
}
},
watch: {
addForm: {
handler() {
if (this.addForm.sendDate < new Date().getDate() && this.addForm.sendMonth == 0) {
this.addForm.sendDate = new Date().getDate()
}
},
deep: true
},
// 'addForm.sendMonth'(val) {
// if (val < new Date().getDate() && this.addForm.sendMonth == 0) {
// this.addForm.sendDate = new Date().getDate()
// }
// },
activityStatus(val) {
this.addForm.status = val ? 0 : -1
}
},
methods: {
handleReset(scope) {
this.tableIndex = this.tableData.findIndex(item => item.crowdId == scope.crowdId)
this.dialogVisible = true
},
//配置
handleConfig(scope) {
this.$refs.configForm.init()
this.tableIndex = this.tableData.findIndex(item => item.groupId == scope.groupId)
let params = {
groupIdList: [scope.crowdId],
custGroupId: this.addForm.custGroupId
}
this.$apis.activity.activityGroupList(params).then(res => {
console.log(res)
})
console.log(this.tableData[this.tableIndex])
this.$refs.configForm.init(this.tableData[this.tableIndex].welcomeDTOS)
},
handleConfigChecked(dtos) {
let welcome = dtos.filter(item => item.attContent)
this.tableData[this.tableIndex].welcomeDTOS = welcome
},
handleSureConfig() {
this.dialogVisible = false
this.tableData[this.tableIndex].welcomeDTOS = []
},
handleSure() {
this.$refs['addForm'].validate(valid => {
if (valid) {
console.log(valid)
let params = this.addForm
params.configDetailRpcRequests = this.tableData
let activityParams
if (this.activityId) {
activityParams = 'activityUpdate'
} else {
activityParams = 'activityInsert'
}
this.$apis.activity[activityParams](params).then(res => {
if (res) {
this.$router.push('/activityConfig/index')
}
})
}
})
},
//编辑客群
jumpCrowd() {
this.$history.push('/custom/clientDataOverview/grouping')
},
//选择客群
selectCrowd(val) {
let tableData
this.crowdGroupUnitList.forEach(item => {
if (item.crowdGroupId == val) {
tableData = item.crowdUnitList
}
})
this.tableData = tableData.map(item => {
return {
groupId: item.crowdId,
configId: item.crowdId,
crowdName: item.crowdName,
welcomeDTOS: []
}
})
},
activityDetail(id) {
let params = { id }
this.addLoading = true
this.$apis.activity.activityDetail(params).then(res => {
this.addForm = res
const configDetailRpcRequests = res.configDetailRpcResponses
let tableData
this.crowdGroupUnitList.forEach(item => {
if (item.crowdGroupId == res.custGroupId) {
tableData = item.crowdUnitList
}
})
console.log(configDetailRpcRequests)
this.tableData = tableData.map((item, index) => {
return {
groupId: item.crowdId,
configId: item.crowdId,
crowdName: item.crowdName,
welcomeDTOS: configDetailRpcRequests[index] && configDetailRpcRequests[index].welcomeConfigDTOList ? configDetailRpcRequests[index].welcomeConfigDTOList : []
}
})
console.log(this.tableData)
this.activityStatus = this.addForm.status == -1 ? false : true
this.$nextTick(() => {
this.addLoading = false
})
delete this.addForm.configDetailRpcResponses
})
},
goBack() {
this.$router.push('/activityConfig/index')
}
},
async created() {
this.activityId = this.$route.query.id
this.crowdGroupUnitList = await this.queryCrowdGroupTree()
if (this.activityId) {
this.activityDetail(this.activityId)
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.boxHeight = clientHeight - 160
......
......@@ -6,7 +6,7 @@
<slot name="title">{{ title }}</slot>
</div>
<div class="market-title">营销内容</div>
<div class="market-content">
<div class="market-content" v-if="drawer">
<WelcomeWords ref="welcome" :form="'customer'" :btnList="btnList" :eventBus="eventBus"></WelcomeWords>
</div>
</div>
......@@ -14,7 +14,7 @@
<el-button @click="drawer = false">
取消
</el-button>
<el-button type="primary" @click="handleSure">提交</el-button>
<el-button type="primary" @click="handleSaveConfig">提交</el-button>
</div>
</el-drawer>
</div>
......@@ -22,6 +22,7 @@
<script>
import WelcomeWords from './welcomeWords.vue'
import Vue from 'vue'
export default {
name: 'marketConfig',
components: {
......@@ -39,7 +40,9 @@ export default {
},
data() {
return {
eventBus: new Vue(),
drawer: false,
welcomeStatus: false,
btnList: [
{
id: 1,
......@@ -77,8 +80,15 @@ export default {
}
},
methods: {
init() {
init(previewList) {
this.drawer = true
this.$nextTick(() => {
this.$refs.welcome.updateList(previewList)
})
},
handleSaveConfig() {
this.$emit('handleConfigChecked', this.$refs.welcome.previewList)
this.drawer = false
}
}
}
......
......@@ -3,15 +3,15 @@
<el-dialog title="选择模板" :visible.sync="dialogVisible" width="1142px" :before-close="handleClose" :close-on-click-modal="false">
<div class="model-panel">
<el-form :inline="true" class="message-form" :model="searchForm" ref="searchForm">
<el-form-item label="模板标题">
<el-form-item label="模板标题" size="small">
<el-input v-model="searchForm.title" :size="size" placeholder="请输入模板名称搜索"></el-input>
</el-form-item>
<el-form-item label="创建者">
<el-form-item label="创建者" size="small" style="margin-left: 10px">
<el-select v-model="searchForm.createdBy" :size="size" placeholder="全部">
<el-option v-for="item in createdList" :key="item.id" :label="item.createdName" :value="item.createdBy"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-form-item size="small" style="margin-left: 10px">
<el-button type="primary" :size="size" @click="search">查询</el-button>
</el-form-item>
<el-form-item style="float: right;margin-right: 0;">
......
......@@ -3,20 +3,20 @@
<el-dialog title="分配任务" :visible.sync="dialogVisible" width="60%">
<div class="member-item">
<label>任务提醒:</label>
<el-radio-group v-model="type">
<el-radio :label="1">立即提醒</el-radio>
<el-radio :label="2">指定日期</el-radio>
<el-date-picker v-if="type == 2" v-model="value1" type="date" placeholder="选择日期" size="small"></el-date-picker>
<el-radio-group v-model="immExecutionFlag">
<el-radio :label="true">立即提醒</el-radio>
<el-radio :label="false">指定日期</el-radio>
<el-date-picker v-if="!immExecutionFlag" value-format="yyyy-MM-dd" v-model="sendDate" type="date" placeholder="选择日期" size="small"></el-date-picker>
</el-radio-group>
</div>
<div class="member-item">
<label>跟进员工:</label>
<el-radio-group v-model="staffType">
<el-radio :label="1">上一次跟进员</el-radio>
<el-radio :label="2">指定员工</el-radio>
<el-radio-group v-model="flowFirstFlag">
<el-radio :label="true">上一次跟进员</el-radio>
<el-radio :label="false">指定员工</el-radio>
</el-radio-group>
</div>
<div class="member-wrapper">
<div class="member-wrapper" v-if="!flowFirstFlag">
<div class="member-left">
<div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
......@@ -36,7 +36,7 @@
<el-button type="primary" :size="size" @click="search">查询</el-button>
</el-form-item>
</el-form>
<div class="table-content" style="max-height: 456px;">
<div class="table-content" :style="{ 'max-height': boxHeight + 'px' }">
<GLTable v-loading="loading" ref="empTable" :tableData="tableEmpData" :tableParams="tableParams" :hasNum="false" :hasPage="false" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick">
<div slot="staffName" slot-scope="scope">
<span>{{ scope.scope.staffName }}</span>
......@@ -76,11 +76,12 @@
import url from '@/assets/empty.png'
export default {
name: 'SelectMember',
props: ['selectData'],
props: ['customerIds'],
data() {
return {
type: 1,
staffType: 1,
immExecutionFlag: true,
flowFirstFlag: true,
sendDate: '',
dialogVisible: false,
url: url,
searchForm: {},
......@@ -124,21 +125,49 @@ export default {
tableEmpData: [],
allTreeData: [],
currentTreeData: [],
innerTags: []
innerTags: [],
boxHeight: 200
}
},
mounted() {
this.boxHeight = document.documentElement.clientHeight - 550
this.listDepartmentTree(false)
},
methods: {
selectionTable(val) {
console.log(val)
this.innerTags = val
// this.$emit('selectTable', val)
},
init() {
this.immExecutionFlag = true
this.flowFirstFlag = true
this.sendDate = ''
this.innerTags = []
this.dialogVisible = true
},
handleSure() {
const { flowFirstFlag, immExecutionFlag, sendDate, customerIds, innerTags } = this
const staffIds = innerTags.map(item => item.staffId)
const activityId = this.$route.query.id
let params = {
flowFirstFlag,
immExecutionFlag,
sendDate,
activityId,
customerIds,
staffIds
}
this.$apis.activity.assignmentCustomer(params).then(res => {
if (res) {
this.$message({
message: '分配成功',
type: 'success'
})
this.$emit('taskFinish')
this.dialogVisible = false
}
})
},
// 清空搜索条件
resetSearch() {
this.searchForm = {}
......@@ -157,7 +186,7 @@ export default {
this.loading = true
params.isHavCustomer = true
params.isFollowerStaff = isFollowerStaff
this.$apis.customerTransform.listDepartmentTree(params).then(res => {
this.$apis.custom.listDepartmentTree(params).then(res => {
console.log(res)
this.loading = false
if (res) {
......@@ -165,7 +194,10 @@ export default {
this.allTreeData = this.getEmployee(res)
this.currentTreeData = this.getEmployee(res)
this.treeData = res
this.$refs.empTable.tableHeightValues = this.tableEmpData.length ? '' : '230px'
this.$nextTick(() => {
this.$refs.empTable.tableHeightValues = this.tableEmpData.length ? '' : '230px'
})
if (this.selectData && this.selectData.length) {
this.selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
......@@ -271,7 +303,7 @@ export default {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
max-height: 300px;
overflow-y: scroll;
}
.staff-title {
......@@ -363,10 +395,9 @@ export default {
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
height: calc(100% - 186px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
......
......@@ -33,7 +33,7 @@
</template>
<template v-else-if="itm.attType == 7">
<img src="@/assets/img/guestCustom/icon-applet.png" alt />
<span :title="itm.attContent.marketingName">{{ itm.attContent.marketingName }}</span>
<span :title="JSON.parse(itm.attContent).marketingName">{{ JSON.parse(itm.attContent).marketingName }}</span>
</template>
<template v-else-if="itm.attType == 5">
<img src="@/assets/img/guestCustom/icon-applet.png" alt />
......@@ -126,7 +126,8 @@ export default {
sendTime: '',
sendDate: '',
editor: {},
textValue: ''
textValue: '',
text: ''
}
},
mounted() {
......@@ -144,7 +145,8 @@ export default {
// }
// this.editor.config.onchangeTimeout = 500
// this.editor.create()
this.eventBus.$emit('update', this.previewList)
console.log(this.previewList)
// this.eventBus.$emit('update', this.previewList)
},
methods: {
selectEmotion() {
......@@ -240,22 +242,21 @@ export default {
this.eventBus.$emit('update', this.previewList)
},
textInput(val) {
console.log(val)
const hasText = this.previewList.some(item => item.attType == 1)
if (val) {
if (hasText) {
this.$set(this.previewList, 0, {
attContent: val,
attType: ATT_TYPE.TEXT
})
} else {
this.previewList.unshift({
attContent: val,
attType: ATT_TYPE.TEXT
})
}
console.log(hasText)
if (hasText) {
this.$set(this.previewList, 0, {
attContent: val,
attType: ATT_TYPE.TEXT
})
} else {
this.previewList.shift(0)
this.previewList.unshift({
attContent: val,
attType: ATT_TYPE.TEXT
})
}
console.log(this.previewList)
},
selectActivity(val) {
let idx
......@@ -268,16 +269,17 @@ export default {
if (val) {
if (hasActivity) {
this.$set(this.previewList, idx, {
attContent: val,
attContent: JSON.stringify(val),
attType: ATT_TYPE.ACTIVITY
})
} else {
this.previewList.push({
attContent: val,
attContent: JSON.stringify(val),
attType: ATT_TYPE.ACTIVITY
})
}
}
console.log(this.previewList)
},
selectMessage(val) {
console.log(val)
......@@ -330,26 +332,28 @@ export default {
this.textInput(str)
}, 300),
updateList(val) {
console.log(val)
this.previewList = val
this.eventBus.$emit('update', this.previewList)
// this.eventBus.$emit('update', this.previewList)
const obj = val.find(item => item.attType == 1)
let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>')
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
document.querySelector('.w-textarea_input').focus()
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML = htm
}, 100)
if (obj) {
let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>')
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML = htm
}, 100)
} else {
this.textValue = ''
}
}
}
}
......
......@@ -13,16 +13,16 @@
</div>
<el-button size="small" @click="handleDistribution">分配任务</el-button>
</div>
<GLTable @setTableFinishFun="setTableFinishFun" ref="clientManage" :hasNum="true" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :pageConf="pageConf" :tableParams="tableParams">
<GLTable @selectionTable="selectionTable" @setTableFinishFun="setTableFinishFun" ref="customForm" :hasNum="true" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchFormTable" :pageConf="pageConf" :tableParams="tableParams" :pageSizes="[10, 100, 1000, 2000]">
<span slot="customerName" slot-scope="scope">
<GLFull :labelWidth="70" :identification="`node_${scope.scope.id}`">{{ scope.scope.customerName }}</GLFull>
</span>
<span slot="customerSex" slot-scope="scope">
<span>{{ scope.scope.customerSex == 0 ? '未知' : scope.scope.customerSex == 1 ? '男' : scope.scope.customerSex == 2 ? '女' : '' }}</span>
</span>
<div slot="followStaff" class="entmicro" slot-scope="scope">
<div v-if="!followList(scope.scope.followStaff).length">--</div>
<div class="entmicro-tag" style="padding-right:3px" v-for="(tag, idx) in followList(scope.scope.followStaff)" :key="idx">
<div slot="followName" class="entmicro" slot-scope="scope">
<div v-if="!followList(scope.scope.followName).length">--</div>
<div class="entmicro-tag" style="padding-right:3px" v-for="(tag, idx) in followList(scope.scope.followName)" :key="idx">
<el-tooltip effect="dark" :content="tag" placement="top">
<el-tag type="info" class="ellipsis-1" v-if="idx < 2" :disable-transitions="false">
<i class="el-icon-user-solid"></i>
......@@ -30,11 +30,11 @@
</el-tag>
</el-tooltip>
<el-tag type="info" v-if="followList(scope.scope.followStaff).length > 2 && idx == 2">
<el-tag type="info" v-if="followList(scope.scope.followName).length > 2 && idx == 2">
<el-popover placement="top" width="600" trigger="hover">
<div slot="reference">...({{ followList(scope.scope.followStaff).length }})</div>
<div slot="reference">...({{ followList(scope.scope.followName).length }})</div>
<div class="entmicro-hover">
<el-tag style="margin-left:4px" type="info" v-for="(i, index) in followList(scope.scope.followStaff)" :key="index" :disable-transitions="false">
<el-tag style="margin-left:4px" type="info" v-for="(i, index) in followList(scope.scope.followName)" :key="index" :disable-transitions="false">
<i class="el-icon-user-solid" style="color: #75acff"></i>
{{ i }}
</el-tag>
......@@ -45,7 +45,7 @@
</div>
<!-- 企微名称 -->
<div slot="nickNameList" slot-scope="scope" class="expandImg">
<div v-if="!scope.scope.nickNameList.length">--</div>
<div v-if="!scope.scope.nickNameList || !scope.scope.nickNameList.length">--</div>
<div v-for="(list, idx) in scope.scope.nickNameList" :key="idx">
<div v-if="idx == 0">
<span>{{ list.nickName }}</span>
......@@ -64,63 +64,58 @@
<span slot="customerPhone" slot-scope="scope">
<span>{{ scope.scope.customerPhone == null ? '--' : scope.scope.customerPhone }}</span>
</span>
<span slot="addWay" slot-scope="scope">
<el-tooltip effect="dark" :content="toLabel(scope.scope.addWay)" placement="top">
<span style="display: inline-block; max-width: 120px; text-align: left">{{ toLabel(scope.scope.addWay) }}</span>
</el-tooltip>
</span>
<span slot="isJoin" slot-scope="scope">
<span>{{ scope.scope.isJoin ? '是' : '否' }}</span>
</span>
<span slot="status" slot-scope="scope">
<span class="statusText">
<span :class="{ circleStatusGray: scope.scope.status === -1, circleStatusGreen: scope.scope.status == 0 }"></span>
<span>{{ statusText(scope.scope.status) }}</span>
</span>
</span>
<div slot="followFlag" slot-scope="scope">
<div class="statusText">
<span :class="{ circleStatusGray: scope.scope.followFlag === 0, circleStatusGreen: scope.scope.followFlag == 1 }"></span>
<span>{{ statusText(scope.scope.followFlag) }}</span>
</div>
</div>
<!-- <template slot="auth-button" slot-scope="scope" :data="scope.scope">
<auth-button :data="scope.scope"></auth-button>
<span @click="goDetail(scope.scope.oneId)" class="blue-text">详情</span>
</template> -->
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<el-button type="text" @click="goDetail(scope.scope.oneId)">详情</el-button>
<el-button type="text" @click="goDetail(scope.scope)">详情</el-button>
<!-- <GLButton @click="goDetail(scope.scope.oneId)" fn="客户详情" type="text">详情</GLButton> -->
</div>
</GLTable>
</div>
</div>
<select-member ref="memberForm"></select-member>
<select-member ref="memberForm" @taskFinish="taskFinish" :customerIds="customerIds"></select-member>
</div>
</template>
<script>
import selectMember from './components/selectMember.vue'
import crowd from '@/mixins/crowd'
export default {
components: { selectMember },
mixins: [crowd],
name: 'clientManage',
data() {
return {
isReload: true,
sloading: false,
searchForm: {
addWay: '',
isJoin: null
},
searchForm: {},
customerIds: [],
searchFormTable: {},
clientManageFormList: [
{
type: 'input',
inputType: 'text',
// prop: 'customerPhone',
name: 'customerPhone',
name: 'keyword',
label: '姓名电话',
placeholder: '输入关键字搜索'
},
{
type: 'select',
// prop: 'isJoin',
name: 'isJoin',
name: 'distributeFlag',
label: '是否分配',
placeholder: '请选择',
optionLabel: 'label',
......@@ -154,8 +149,8 @@ export default {
},
{
type: 'select',
name: 'followStaff',
// prop: 'followStaff',
name: 'staffId',
// prop: 'staffId',
noFilter: false,
optionLabel: 'label',
optionId: 'value',
......@@ -166,7 +161,7 @@ export default {
{
type: 'select',
// prop: 'status',
name: 'status',
name: 'followFlag',
label: '跟进状态',
placeholder: '请选择当前状态',
optionLabel: 'optionLabel',
......@@ -178,43 +173,34 @@ export default {
},
{
optionLabel: '已跟进',
optionId: 0
optionId: 1
},
{
optionLabel: '未跟进',
optionId: -1
optionId: 0
}
]
},
{
type: 'select',
// prop: 'status',
name: 'status',
label: '人群分组',
placeholder: '请选择当前状态',
optionLabel: 'optionLabel',
optionId: 'optionId',
optionList: [
{
optionLabel: '全部',
optionId: null
},
{
optionLabel: '正常',
optionId: 0
},
{
optionLabel: '删除好友',
optionId: -1
}
]
name: 'groupId',
type: 'select',
optionLabel: 'crowdName',
optionId: 'crowdId',
optionList: []
}
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
tableParams: {
listName: 'data',
tableOption: false,
listName: 'data',
// 行数据的key
mutiSelectUniqueKey: 'customerId',
checkSelectKey: 'customerId',
// 多选ref的名称
mutiSelectName: 'activityList',
checkSelectVal: [],
tableColumns: [
{
label: '客户姓名',
......@@ -232,29 +218,35 @@ export default {
label: '联系电话',
prop: 'customerPhone',
addHtml: 'customerPhone',
minWidth: 130
width: 130
},
{
label: '人群分组',
prop: 'customerSex',
addHtml: 'customerSex'
prop: 'groupName'
},
{
label: '是否分配', //1. 加入,0.未加入
prop: 'isJoin',
addHtml: 'isJoin',
prop: 'distributeFlag',
formatter: cellValue => {
return cellValue.distributeFlag ? '是' : '否'
},
width: 120
},
{
label: '分配日期',
prop: 'distributeDate',
width: 180
},
{
label: '跟进员工',
prop: 'followStaff',
addHtml: 'followStaff'
prop: 'followName',
addHtml: 'followName'
},
{
label: '跟进状态',
prop: 'status',
addHtml: 'status',
prop: 'followFlag',
addHtml: 'followFlag',
minWidth: 130
},
{
......@@ -266,10 +258,10 @@ export default {
}
]
},
getListApi: this.$apis.activity.findAllByPage,
getListApi: this.$apis.activity.activityCustomerPage,
merchantModel: 1,
sourceList: [],
followstaffList: [],
staffIdList: [],
queryFlag: 0,
accountLevel: 0, //1,2,3,4工厂,省代,市代,门店
flushTime: false
......@@ -278,19 +270,24 @@ export default {
// activated() {
// this.searchTable()
// },
created() {},
beforeDestroy() {
this.$message.closeAll()
},
methods: {
selectionTable(val) {
this.customerIds = val.map(item => item.customerId)
},
//分配任务
handleDistribution() {
if (this.customerIds.length == 0) {
this.$message({
showClose: true,
duration: 3000,
message: '请勾选需要被分配的客户后,再进行分配任务。'
})
return
}
this.$refs.memberForm.init()
this.$message({
showClose: true,
duration: 3000,
message: '请勾选需要被分配的客户后,再进行分配任务。'
})
},
followList(str) {
if (!str) {
......@@ -299,19 +296,32 @@ export default {
return str.split(',')
},
statusText(text) {
return text === -1 ? '删除好友' : text === 0 ? '正常' : ''
return text === 1 ? '已跟进' : text === 0 ? '未跟进' : '--'
},
setTableHeightEvent() {
this.$refs.clientManage.setTableHeightFun()
this.$refs.customForm.setTableHeightFun()
},
setTableFinishFun(content) {
this.$refs.clientManage.data.length ? (this.$refs.clientManage.tableHeightValues = '') : this.$refs.clientManage.setTableHeightFun()
if (content && content.length) {
content.forEach(item => {
item.distributeFlag && this.tableParams.checkSelectVal.push(item.customerId)
})
this.$refs.customForm.tableHeightValues = ''
} else {
this.$refs.customForm.setTableHeightFun()
}
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (/^1[3456789]\d{9}$/.test(params.keyword)) {
params.customerPhone = params.keyword
} else {
params.customerName = params.keyword
}
params.id = this.$route.query.id
if (params.daterange) {
params.beginTime = this.searchForm.daterange[0]
params.endTime = this.searchForm.daterange[1]
params.beginTime = this.searchForm.daterange[0].replace(/-/g, '/')
params.endTime = this.searchForm.daterange[1].replace(/-/g, '/')
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
}
......@@ -319,35 +329,7 @@ export default {
return params
},
beforeSearchFn() {
// return new Promise((resolve, reject) => {
// this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
// if (this.searchFormTable.daterange) {
// this.searchFormTable.beginTime = this.searchForm.daterange[0]
// this.searchFormTable.endTime = this.searchForm.daterange[1]
// delete this.searchFormTable.daterange
// } else {
// if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
// }
// resolve()
// })
return new Promise(async (resolve, reject) => {
if (Object.keys(this.$route.query).length && this.queryFlag == 0) {
const res = JSON.parse(window.localStorage.getItem('sourceList'))
let add_way = this.$route.query.addWay || ''
let isJoinVal = this.$route.query.isJoin || null
let addWayObj = res.find(i => i.label === add_way)
let addWayVal = addWayObj.value
this.searchForm.addWay = addWayVal
this.searchForm.isJoin = isJoinVal === null ? null : Number(isJoinVal)
window.history.pushState(null, null, location.origin + location.pathname)
setTimeout(() => {
this.$refs.combiForm.expandFn()
}, 100)
// document.querySelector('.operate').lastElementChild.click()
this.queryFlag = 1
}
this.searchFormTable = this.getParams()
resolve()
})
......@@ -363,34 +345,86 @@ export default {
return curElement.label
},
taskFinish() {
this.searchTable()
},
//搜索表格
searchTable() {
this.$refs.clientManage.refreshTable()
this.$refs.customForm.refreshTable()
},
//重置表格
resetTable() {
this.searchForm = {}
this.$refs.clientManage.refreshTable()
this.$refs.customForm.refreshTable()
// 点击之后强制页面刷新
// this.reload()
// this.$forceUpdate() // 没用
// this.$router.go(0)//没有预期效果,会出现一段空白页,用户体验不好
// location.reload() //没有预期效果,会出现一段空白页,用户体验不好
},
goDetail(id) {
this.$router.push({
path: '/clientManage/clientDetail',
query: {
id: id
goDetail(scope) {
this.$history.push('/custom/clientManage/clientDetail?id=' + scope.nickNameList[0].oneId)
},
//获取跟进员工
getStaffList() {
this.$apis.custom.getStaffList({}).then(res => {
if (res.length == 0) {
return ''
}
const index = this.clientManageFormList.findIndex(item => {
return item.name == 'staffId'
})
const staff = res.map(item => {
return {
label: item.staffName,
value: item.id
}
})
staff.unshift({ label: '全部', value: '' })
this.clientManageFormList.find(item => item.name == 'staffId').optionList = staff
console.log(this.tagsPartFormList[index])
})
},
queryCrowdTree() {
const params = {
req: {
pageSize: 1000,
pageNum: 1,
merchantId: this.$globalState.session.merchantId,
crowdType: 3
}
}
this.$apis.custom.queryCrowdTree(params).then(res => {
this.clientManageFormList.find(item => item.name == 'groupId').optionList = res.crowdUnitList
})
}
},
mounted() {}
async mounted() {
this.getStaffList()
this.queryCrowdTree()
this.clientManageFormList.find(item => item.name == 'custGroupId').optionList = await this.queryCrowdGroupTree()
}
}
</script>
<style lang="scss" scoped>
.statusText {
> span:first-child {
width: 6px;
height: 6px;
border-radius: 50%;
display: inline-block;
vertical-align: middle;
margin-right: 8px;
&.circleStatusGreen {
background: #2cca74;
}
&.circleStatusGray {
background: #c6c6c6;
}
}
}
.expandImg {
display: flex;
// justify-content: center;
......
......@@ -9,7 +9,7 @@
<GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable @setTableFinishFun="setTableFinishFun" :noDataImg="url" ref="taskForm" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<GLButton type="text" @click="handleDetail(scope.scope)" fn="智能营销配置">查看配置</GLButton>
<el-button type="text" @click="handleDistribution(scope.scope)">任务分配</el-button>
<!-- <GLButton :disabled="scope.scope.imStatus!=1" type="text" @click="handleStatistics(scope.scope)" fn="营销统计">营销统计</GLButton> -->
</div>
</GLTable>
......@@ -20,46 +20,31 @@
<script>
import url from '@/assets/img/empty.png'
import crowd from '@/mixins/crowd'
export default {
name: 'activity',
mixins: [crowd],
data() {
return {
url: url,
tableSearchForm: {
imName: '',
imStatus: '',
groupTypeId: '',
activityName: '',
createTime: ''
},
searchFormData: [
{
label: '人群类型',
name: 'imStatus',
name: 'groupTypeId',
type: 'select',
placeholder: '请选择',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
value: '',
label: '全部'
},
{
value: '1',
label: '定保'
},
{
value: '2',
label: '首保'
},
{
value: '3',
label: '流失'
}
]
optionId: 'crowdGroupId',
optionLabel: 'crowdGroupName',
optionList: []
},
{
label: '活动名称',
name: 'imName',
name: 'activityName',
type: 'input',
placeholder: '输入关键字搜索'
},
......@@ -83,48 +68,43 @@ export default {
},
createTime: '',
dialogVisible: true,
getListApi: this.$apis.activity.findAllByPage,
getListApi: this.$apis.activity.activityPageList,
tableParams: {
listName: 'data',
tableOption: false,
checkSelectKey: 'id',
checkSelectVal: [],
hasNum: false,
listName: 'data',
tableColumns: [
{
label: '门店编号',
prop: 'imName'
},
{
label: '活动名称',
prop: 'customerCount',
width: '120px'
prop: 'activityName'
},
{
label: '人群类型',
prop: 'imStatusName'
prop: 'groupTypeIdName'
},
{
label: '客户总数',
prop: 'createdTime',
width: '180px'
prop: 'customerCount'
},
{
label: '已跟进',
prop: 'createdName',
width: '220px'
prop: 'followCustomerCount'
},
{
label: '已返厂',
prop: 'createdName',
width: '220px'
label: '已到店',
prop: 'retCustomerCount'
},
{
label: '创建日期',
prop: 'createdName',
prop: 'createdTime',
width: '220px'
},
{
label: '操作',
prop: 'optionBtns',
width: '180px',
width: '90px',
addHtml: 'optionBtns',
fixed: 'right'
}
......@@ -138,24 +118,16 @@ export default {
}
}
},
watch: {
// createTime(value) {
// if (value) {
// this.tableSearchForm.beginTime = value[0]
// this.tableSearchForm.endTime = value[1]
// } else {
// delete this.tableSearchForm.beginTime
// delete this.tableSearchForm.endTime
// }
// }
async mounted() {
this.searchFormData.find(item => (item.name = 'groupTypeId')).optionList = await this.queryCrowdGroupTree()
},
methods: {
handleSearch() {
this.$refs.employeeRef.refreshTable()
this.$refs.taskForm.refreshTable()
},
handleReset() {
this.tableSearchForm = {}
this.$refs.employeeRef.refreshTable()
this.$refs.taskForm.refreshTable()
},
beforeSearchFn() {
return new Promise(resolve => {
......@@ -163,22 +135,15 @@ export default {
this.tableSearchForm.beginTime = new Date(this.tableSearchForm.createTime[0]).toLocaleDateString().replace(/-/g, '/')
this.tableSearchForm.endTime = new Date(this.tableSearchForm.createTime[1]).toLocaleDateString().replace(/-/g, '/')
}
// delete this.tableSearchForm.createTime
delete this.tableSearchForm.createTime
resolve()
})
},
setTableFinishFun() {
this.$refs.taskForm.data.length ? (this.$refs.taskForm.tableHeightValues = '') : this.$refs.taskForm.setTableHeightFun()
},
handleImport() {},
addConfig() {
this.$router.push('/market/config')
},
handleDetail(scope) {
this.$router.push('/market/configDetail/' + scope.id)
},
handleStatistics(scope) {
this.$router.push('/market/effect/' + scope.id)
handleDistribution(scope) {
this.$router.push('/activity/distribution?id=' + scope.id)
}
}
}
......
<template>
<div class="activity-main">
<div class="activity-main-header">
<el-button data-title="新增营销" type="primary" size="small" @click="handleAdd" fn="新增营销">
<i class="el-icon-plus"></i>
创建活动
</el-button>
<label>配置门店轻改专家,形成业务活码,客户可通过「精品升级」订单扫码来添加该员工。</label>
<collect-button>
<el-button data-title="新增营销" type="primary" size="small" @click="handleAdd()" fn="新增营销">
<i class="el-icon-plus"></i>
创建活动
</el-button>
</collect-button>
<collect-button dataAnalyics="{page:1}">
<label>配置门店轻改专家,形成业务活码,客户可通过「精品升级」订单扫码来添加该员工。</label>
</collect-button>
</div>
<div class="activity-tabel scrm-box-f">
<div class="activity-tabel-form">
<GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable @setTableFinishFun="setTableFinishFun" ref="taskForm" :noDataImg="url" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div class="table-btns" slot="status" slot-scope="scope">
<el-switch v-model="scope.scope.status" :active-value="0" :inactive-value="-1" @change="changeSwitch(scope.scope)"></el-switch>
{{ scope.scope.status == 0 ? '启用' : '停用' }}
</div>
<div class="table-btns" slot="optionBtns" slot-scope="scope">
<GLButton type="text" @click="handleDetail(scope.scope)" fn="智能营销配置">查看配置</GLButton>
<el-button type="text" @click="handleAdd(scope.scope)" fn="智能营销配置">编辑</el-button>
<!-- <GLButton :disabled="scope.scope.imStatus!=1" type="text" @click="handleStatistics(scope.scope)" fn="营销统计">营销统计</GLButton> -->
</div>
</GLTable>
<div v-show="false">
<div class="nodata-panel">
尚未创建活动,
<a @click="handleAdd">前往创建</a>
<a @click="handleAdd()">前往创建</a>
</div>
</div>
</div>
......@@ -29,46 +37,31 @@
<script>
import url from '@/assets/img/empty.png'
import crowd from '@/mixins/crowd'
export default {
name: 'config',
name: 'activityConfig',
mixins: [crowd],
data() {
return {
url: url,
tableSearchForm: {
imName: '',
imStatus: '',
custGroupId: '',
configName: '',
createTime: ''
},
searchFormData: [
{
label: '人群类型',
name: 'imStatus',
name: 'custGroupId',
type: 'select',
placeholder: '请选择',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
value: '',
label: '全部'
},
{
value: '1',
label: '待定保客户'
},
{
value: '2',
label: '待首保客户'
},
{
value: '3',
label: '流失客户'
}
]
optionId: 'crowdGroupId',
optionLabel: 'crowdGroupName',
optionList: []
},
{
label: '活动名称',
name: 'imName',
name: 'configName',
type: 'input',
placeholder: '输入关键字搜索'
},
......@@ -92,44 +85,42 @@ export default {
},
createTime: '',
dialogVisible: true,
getListApi: this.$apis.activity.findAllByPage,
getListApi: this.$apis.activity.activityPage,
tableParams: {
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '活动名称',
prop: 'customerCount',
width: '120px'
prop: 'configName'
},
{
label: '人群类型',
prop: 'imStatusName'
prop: 'custTypeName'
},
{
label: '推送日期',
prop: 'createdTime',
prop: 'sendDate',
width: '180px'
},
{
label: '创建人',
prop: 'createdName',
width: '220px'
prop: 'createdByName'
},
{
label: '创建日期',
prop: 'createdName',
prop: 'createdTime',
width: '220px'
},
{
label: '状态',
prop: 'createdName',
width: '220px'
prop: 'status',
addHtml: 'status'
},
{
label: '操作',
prop: 'optionBtns',
width: '180px',
width: '100px',
addHtml: 'optionBtns',
fixed: 'right'
}
......@@ -143,16 +134,8 @@ export default {
}
}
},
watch: {
// createTime(value) {
// if (value) {
// this.tableSearchForm.beginTime = value[0]
// this.tableSearchForm.endTime = value[1]
// } else {
// delete this.tableSearchForm.beginTime
// delete this.tableSearchForm.endTime
// }
// }
async mounted() {
this.searchFormData.find(item => (item.name = 'custGroupId')).optionList = await this.queryCrowdGroupTree()
},
methods: {
handleSearch() {
......@@ -165,16 +148,28 @@ export default {
beforeSearchFn() {
return new Promise(resolve => {
if (this.tableSearchForm.createTime) {
this.tableSearchForm.beginTime = new Date(this.tableSearchForm.createTime[0]).toLocaleDateString().replace(/-/g, '/')
this.tableSearchForm.endTime = new Date(this.tableSearchForm.createTime[1]).toLocaleDateString().replace(/-/g, '/')
this.tableSearchForm.beginTime = new Date(this.tableSearchForm.createTime[0]).toLocaleDateString().replace(/\//g, '-')
this.tableSearchForm.endTime = new Date(this.tableSearchForm.createTime[1]).toLocaleDateString().replace(/\//g, '-')
}
// delete this.tableSearchForm.createTime
delete this.tableSearchForm.createTime
resolve()
})
},
handleImport() {},
handleAdd() {
// this.$router.push('/activity/addActivity')
handleAdd(scope) {
let editParams = scope ? '?id=' + scope.id : ''
this.$router.push('/activity/addActivity' + editParams)
},
changeSwitch(scope) {
this.$apis.activity
.activityUpdate({
id: scope.id,
status: scope.status
})
.then(res => {
if (res) {
this.handleSearch()
}
})
},
setTableFinishFun() {
if (this.$refs.taskForm.data.length) {
......@@ -198,12 +193,6 @@ export default {
document.querySelector('.noDataText').append(cloneNode)
this.$refs.taskForm.setTableHeightFun()
}
},
handleDetail(scope) {
this.$router.push('/market/configDetail/' + scope.id)
},
handleStatistics(scope) {
this.$router.push('/market/effect/' + scope.id)
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!