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
......@@ -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 = ''
}
}
}
}
......
......@@ -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!