Commit a96411a2 by 杨明

fixed

1 parent 12cb5fac
...@@ -17,6 +17,107 @@ const findAllByPage = params => { ...@@ -17,6 +17,107 @@ const findAllByPage = params => {
sign: true 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 { 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) { ...@@ -17,7 +17,7 @@ export const fetchConfig = function(isEnv = true) {
Object.assign(request, { timeout }) Object.assign(request, { timeout })
return Promise.resolve(cfg) 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') // return new Http({ request: { timeout: 100000 } }).get('https://oss-config.dev.glsx.com.cn/mock/618a32851072f92988f05a17/drainage/config')
} }
export const 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([ ...@@ -2,7 +2,9 @@ const staticRoutes = Object.freeze([
{ {
name: 'activity', name: 'activity',
path: '/', path: '/',
meta: {}, meta: {
title: '活动管理'
},
component: resolve => require([`@/views/activity/index.vue`], resolve) component: resolve => require([`@/views/activity/index.vue`], resolve)
}, },
{ {
...@@ -20,7 +22,7 @@ const staticRoutes = Object.freeze([ ...@@ -20,7 +22,7 @@ const staticRoutes = Object.freeze([
{ {
name: 'config', name: 'config',
path: '/', path: '/',
meta: {}, meta: { title: '活动配置' },
component: resolve => require([`@/views/activityConfig/index.vue`], resolve) component: resolve => require([`@/views/activityConfig/index.vue`], resolve)
} }
]) ])
......
...@@ -3,12 +3,14 @@ import Vue from 'vue' ...@@ -3,12 +3,14 @@ import Vue from 'vue'
import { fetchConfig } from '@/config' import { fetchConfig } from '@/config'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import { GLTable, GLButton, GLFooter, GLCombiForm } from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLTable, GLButton, GLFooter, GLCombiForm } from 'glsx-components' //权限按钮 (根据权限动态创建)
import collectButton from '@/components/collect-button'
import { getRoutes } from '@/router' import { getRoutes } from '@/router'
import render from './render' import render from './render'
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
Vue.use(GLFooter) Vue.use(GLFooter)
Vue.use(GLCombiForm) Vue.use(GLCombiForm)
Vue.component(collectButton.name, collectButton)
import 'glsx-components/dist/glsx-components.css' import 'glsx-components/dist/glsx-components.css'
import '@/assets/css/common.scss' import '@/assets/css/common.scss'
let routes = [] let routes = []
......
import { Message } from 'element-ui'
let util = {} 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 export default util
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<slot name="title">{{ title }}</slot> <slot name="title">{{ title }}</slot>
</div> </div>
<div class="market-title">营销内容</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> <WelcomeWords ref="welcome" :form="'customer'" :btnList="btnList" :eventBus="eventBus"></WelcomeWords>
</div> </div>
</div> </div>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<el-button @click="drawer = false"> <el-button @click="drawer = false">
取消 取消
</el-button> </el-button>
<el-button type="primary" @click="handleSure">提交</el-button> <el-button type="primary" @click="handleSaveConfig">提交</el-button>
</div> </div>
</el-drawer> </el-drawer>
</div> </div>
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<script> <script>
import WelcomeWords from './welcomeWords.vue' import WelcomeWords from './welcomeWords.vue'
import Vue from 'vue'
export default { export default {
name: 'marketConfig', name: 'marketConfig',
components: { components: {
...@@ -39,7 +40,9 @@ export default { ...@@ -39,7 +40,9 @@ export default {
}, },
data() { data() {
return { return {
eventBus: new Vue(),
drawer: false, drawer: false,
welcomeStatus: false,
btnList: [ btnList: [
{ {
id: 1, id: 1,
...@@ -77,8 +80,15 @@ export default { ...@@ -77,8 +80,15 @@ export default {
} }
}, },
methods: { methods: {
init() { init(previewList) {
this.drawer = true 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 @@ ...@@ -3,15 +3,15 @@
<el-dialog title="选择模板" :visible.sync="dialogVisible" width="1142px" :before-close="handleClose" :close-on-click-modal="false"> <el-dialog title="选择模板" :visible.sync="dialogVisible" width="1142px" :before-close="handleClose" :close-on-click-modal="false">
<div class="model-panel"> <div class="model-panel">
<el-form :inline="true" class="message-form" :model="searchForm" ref="searchForm"> <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-input v-model="searchForm.title" :size="size" placeholder="请输入模板名称搜索"></el-input>
</el-form-item> </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-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-option v-for="item in createdList" :key="item.id" :label="item.createdName" :value="item.createdBy"></el-option>
</el-select> </el-select>
</el-form-item> </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-button type="primary" :size="size" @click="search">查询</el-button>
</el-form-item> </el-form-item>
<el-form-item style="float: right;margin-right: 0;"> <el-form-item style="float: right;margin-right: 0;">
......
...@@ -3,20 +3,20 @@ ...@@ -3,20 +3,20 @@
<el-dialog title="分配任务" :visible.sync="dialogVisible" width="60%"> <el-dialog title="分配任务" :visible.sync="dialogVisible" width="60%">
<div class="member-item"> <div class="member-item">
<label>任务提醒:</label> <label>任务提醒:</label>
<el-radio-group v-model="type"> <el-radio-group v-model="immExecutionFlag">
<el-radio :label="1">立即提醒</el-radio> <el-radio :label="true">立即提醒</el-radio>
<el-radio :label="2">指定日期</el-radio> <el-radio :label="false">指定日期</el-radio>
<el-date-picker v-if="type == 2" v-model="value1" type="date" placeholder="选择日期" size="small"></el-date-picker> <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> </el-radio-group>
</div> </div>
<div class="member-item"> <div class="member-item">
<label>跟进员工:</label> <label>跟进员工:</label>
<el-radio-group v-model="staffType"> <el-radio-group v-model="flowFirstFlag">
<el-radio :label="1">上一次跟进员</el-radio> <el-radio :label="true">上一次跟进员</el-radio>
<el-radio :label="2">指定员工</el-radio> <el-radio :label="false">指定员工</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div class="member-wrapper"> <div class="member-wrapper" v-if="!flowFirstFlag">
<div class="member-left"> <div class="member-left">
<div class="member-content"> <div class="member-content">
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent> <el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<el-button type="primary" :size="size" @click="search">查询</el-button> <el-button type="primary" :size="size" @click="search">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </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"> <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"> <div slot="staffName" slot-scope="scope">
<span>{{ scope.scope.staffName }}</span> <span>{{ scope.scope.staffName }}</span>
...@@ -76,11 +76,12 @@ ...@@ -76,11 +76,12 @@
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
export default { export default {
name: 'SelectMember', name: 'SelectMember',
props: ['selectData'], props: ['customerIds'],
data() { data() {
return { return {
type: 1, immExecutionFlag: true,
staffType: 1, flowFirstFlag: true,
sendDate: '',
dialogVisible: false, dialogVisible: false,
url: url, url: url,
searchForm: {}, searchForm: {},
...@@ -124,21 +125,49 @@ export default { ...@@ -124,21 +125,49 @@ export default {
tableEmpData: [], tableEmpData: [],
allTreeData: [], allTreeData: [],
currentTreeData: [], currentTreeData: [],
innerTags: [] innerTags: [],
boxHeight: 200
} }
}, },
mounted() { mounted() {
this.boxHeight = document.documentElement.clientHeight - 550
this.listDepartmentTree(false) this.listDepartmentTree(false)
}, },
methods: { methods: {
selectionTable(val) { selectionTable(val) {
console.log(val)
this.innerTags = val this.innerTags = val
// this.$emit('selectTable', val) // this.$emit('selectTable', val)
}, },
init() { init() {
this.immExecutionFlag = true
this.flowFirstFlag = true
this.sendDate = ''
this.innerTags = []
this.dialogVisible = true 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() { resetSearch() {
this.searchForm = {} this.searchForm = {}
...@@ -157,7 +186,7 @@ export default { ...@@ -157,7 +186,7 @@ export default {
this.loading = true this.loading = true
params.isHavCustomer = true params.isHavCustomer = true
params.isFollowerStaff = isFollowerStaff params.isFollowerStaff = isFollowerStaff
this.$apis.customerTransform.listDepartmentTree(params).then(res => { this.$apis.custom.listDepartmentTree(params).then(res => {
console.log(res) console.log(res)
this.loading = false this.loading = false
if (res) { if (res) {
...@@ -165,7 +194,10 @@ export default { ...@@ -165,7 +194,10 @@ export default {
this.allTreeData = this.getEmployee(res) this.allTreeData = this.getEmployee(res)
this.currentTreeData = this.getEmployee(res) this.currentTreeData = this.getEmployee(res)
this.treeData = 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) { if (this.selectData && this.selectData.length) {
this.selectData.forEach(item => { this.selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item) this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
...@@ -271,7 +303,7 @@ export default { ...@@ -271,7 +303,7 @@ export default {
transform: rotate(-180deg); transform: rotate(-180deg);
} }
.select-tree { .select-tree {
max-height: 400px; max-height: 300px;
overflow-y: scroll; overflow-y: scroll;
} }
.staff-title { .staff-title {
...@@ -363,10 +395,9 @@ export default { ...@@ -363,10 +395,9 @@ export default {
line-height: 32px; line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1); transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%; width: 100%;
height: calc(100% - 86px); height: calc(100% - 186px);
display: flex; display: flex;
align-items: center; align-items: center;
max-height: 500px;
overflow: auto; overflow: auto;
// margin-bottom: 10px; // margin-bottom: 10px;
i { i {
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</template> </template>
<template v-else-if="itm.attType == 7"> <template v-else-if="itm.attType == 7">
<img src="@/assets/img/guestCustom/icon-applet.png" alt /> <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>
<template v-else-if="itm.attType == 5"> <template v-else-if="itm.attType == 5">
<img src="@/assets/img/guestCustom/icon-applet.png" alt /> <img src="@/assets/img/guestCustom/icon-applet.png" alt />
...@@ -126,7 +126,8 @@ export default { ...@@ -126,7 +126,8 @@ export default {
sendTime: '', sendTime: '',
sendDate: '', sendDate: '',
editor: {}, editor: {},
textValue: '' textValue: '',
text: ''
} }
}, },
mounted() { mounted() {
...@@ -144,7 +145,8 @@ export default { ...@@ -144,7 +145,8 @@ export default {
// } // }
// this.editor.config.onchangeTimeout = 500 // this.editor.config.onchangeTimeout = 500
// this.editor.create() // this.editor.create()
this.eventBus.$emit('update', this.previewList) console.log(this.previewList)
// this.eventBus.$emit('update', this.previewList)
}, },
methods: { methods: {
selectEmotion() { selectEmotion() {
...@@ -240,22 +242,21 @@ export default { ...@@ -240,22 +242,21 @@ export default {
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
}, },
textInput(val) { textInput(val) {
console.log(val)
const hasText = this.previewList.some(item => item.attType == 1) const hasText = this.previewList.some(item => item.attType == 1)
if (val) { console.log(hasText)
if (hasText) { if (hasText) {
this.$set(this.previewList, 0, { this.$set(this.previewList, 0, {
attContent: val, attContent: val,
attType: ATT_TYPE.TEXT attType: ATT_TYPE.TEXT
}) })
} else {
this.previewList.unshift({
attContent: val,
attType: ATT_TYPE.TEXT
})
}
} else { } else {
this.previewList.shift(0) this.previewList.unshift({
attContent: val,
attType: ATT_TYPE.TEXT
})
} }
console.log(this.previewList)
}, },
selectActivity(val) { selectActivity(val) {
let idx let idx
...@@ -268,16 +269,17 @@ export default { ...@@ -268,16 +269,17 @@ export default {
if (val) { if (val) {
if (hasActivity) { if (hasActivity) {
this.$set(this.previewList, idx, { this.$set(this.previewList, idx, {
attContent: val, attContent: JSON.stringify(val),
attType: ATT_TYPE.ACTIVITY attType: ATT_TYPE.ACTIVITY
}) })
} else { } else {
this.previewList.push({ this.previewList.push({
attContent: val, attContent: JSON.stringify(val),
attType: ATT_TYPE.ACTIVITY attType: ATT_TYPE.ACTIVITY
}) })
} }
} }
console.log(this.previewList)
}, },
selectMessage(val) { selectMessage(val) {
console.log(val) console.log(val)
...@@ -330,26 +332,28 @@ export default { ...@@ -330,26 +332,28 @@ export default {
this.textInput(str) this.textInput(str)
}, 300), }, 300),
updateList(val) { updateList(val) {
console.log(val)
this.previewList = val this.previewList = val
this.eventBus.$emit('update', this.previewList) // this.eventBus.$emit('update', this.previewList)
const obj = val.find(item => item.attType == 1) const obj = val.find(item => item.attType == 1)
let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>') if (obj) {
const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) { let attContent = obj.attContent.replaceAll('[@昵称]', '<wise id="1">@昵称</wise>')
let word = res.replace(/\[|\]/gi, '') const htm = attContent.replace(/\[[\u4E00-\u9FA56]{1,4}]/gi, function(res) {
const list = emoji.flat(Infinity) let word = res.replace(/\[|\]/gi, '')
let index = parseInt(list.indexOf(word)) + 1 const list = emoji.flat(Infinity)
if (index < 10) { let index = parseInt(list.indexOf(word)) + 1
index = '00' + index if (index < 10) {
} else if (index >= 10 && index < 100) { index = '00' + index
index = '0' + 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">` }
}) return `<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
document.querySelector('.w-textarea_input').focus() })
setTimeout(() => { setTimeout(() => {
document.querySelector('.w-textarea_input').innerHTML = htm document.querySelector('.w-textarea_input').innerHTML = htm
}, 100) }, 100)
} else {
this.textValue = ''
}
} }
} }
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <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"> <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"> <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> --> <!-- <GLButton :disabled="scope.scope.imStatus!=1" type="text" @click="handleStatistics(scope.scope)" fn="营销统计">营销统计</GLButton> -->
</div> </div>
</GLTable> </GLTable>
...@@ -20,46 +20,31 @@ ...@@ -20,46 +20,31 @@
<script> <script>
import url from '@/assets/img/empty.png' import url from '@/assets/img/empty.png'
import crowd from '@/mixins/crowd'
export default { export default {
name: 'activity', name: 'activity',
mixins: [crowd],
data() { data() {
return { return {
url: url, url: url,
tableSearchForm: { tableSearchForm: {
imName: '', groupTypeId: '',
imStatus: '', activityName: '',
createTime: '' createTime: ''
}, },
searchFormData: [ searchFormData: [
{ {
label: '人群类型', label: '人群类型',
name: 'imStatus', name: 'groupTypeId',
type: 'select', type: 'select',
placeholder: '请选择', placeholder: '请选择',
optionId: 'value', optionId: 'crowdGroupId',
optionLabel: 'label', optionLabel: 'crowdGroupName',
optionList: [ optionList: []
{
value: '',
label: '全部'
},
{
value: '1',
label: '定保'
},
{
value: '2',
label: '首保'
},
{
value: '3',
label: '流失'
}
]
}, },
{ {
label: '活动名称', label: '活动名称',
name: 'imName', name: 'activityName',
type: 'input', type: 'input',
placeholder: '输入关键字搜索' placeholder: '输入关键字搜索'
}, },
...@@ -83,48 +68,43 @@ export default { ...@@ -83,48 +68,43 @@ export default {
}, },
createTime: '', createTime: '',
dialogVisible: true, dialogVisible: true,
getListApi: this.$apis.activity.findAllByPage, getListApi: this.$apis.activity.activityPageList,
tableParams: { tableParams: {
listName: 'data',
tableOption: false, tableOption: false,
checkSelectKey: 'id',
checkSelectVal: [],
hasNum: false,
listName: 'data',
tableColumns: [ tableColumns: [
{ {
label: '门店编号',
prop: 'imName'
},
{
label: '活动名称', label: '活动名称',
prop: 'customerCount', prop: 'activityName'
width: '120px'
}, },
{ {
label: '人群类型', label: '人群类型',
prop: 'imStatusName' prop: 'groupTypeIdName'
}, },
{ {
label: '客户总数', label: '客户总数',
prop: 'createdTime', prop: 'customerCount'
width: '180px'
}, },
{ {
label: '已跟进', label: '已跟进',
prop: 'createdName', prop: 'followCustomerCount'
width: '220px'
}, },
{ {
label: '已返厂', label: '已到店',
prop: 'createdName', prop: 'retCustomerCount'
width: '220px'
}, },
{ {
label: '创建日期', label: '创建日期',
prop: 'createdName', prop: 'createdTime',
width: '220px' width: '220px'
}, },
{ {
label: '操作', label: '操作',
prop: 'optionBtns', prop: 'optionBtns',
width: '180px', width: '90px',
addHtml: 'optionBtns', addHtml: 'optionBtns',
fixed: 'right' fixed: 'right'
} }
...@@ -138,24 +118,16 @@ export default { ...@@ -138,24 +118,16 @@ export default {
} }
} }
}, },
watch: { async mounted() {
// createTime(value) { this.searchFormData.find(item => (item.name = 'groupTypeId')).optionList = await this.queryCrowdGroupTree()
// if (value) {
// this.tableSearchForm.beginTime = value[0]
// this.tableSearchForm.endTime = value[1]
// } else {
// delete this.tableSearchForm.beginTime
// delete this.tableSearchForm.endTime
// }
// }
}, },
methods: { methods: {
handleSearch() { handleSearch() {
this.$refs.employeeRef.refreshTable() this.$refs.taskForm.refreshTable()
}, },
handleReset() { handleReset() {
this.tableSearchForm = {} this.tableSearchForm = {}
this.$refs.employeeRef.refreshTable() this.$refs.taskForm.refreshTable()
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
...@@ -163,22 +135,15 @@ export default { ...@@ -163,22 +135,15 @@ export default {
this.tableSearchForm.beginTime = new Date(this.tableSearchForm.createTime[0]).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, '/') this.tableSearchForm.endTime = new Date(this.tableSearchForm.createTime[1]).toLocaleDateString().replace(/-/g, '/')
} }
// delete this.tableSearchForm.createTime delete this.tableSearchForm.createTime
resolve() resolve()
}) })
}, },
setTableFinishFun() { setTableFinishFun() {
this.$refs.taskForm.data.length ? (this.$refs.taskForm.tableHeightValues = '') : this.$refs.taskForm.setTableHeightFun() this.$refs.taskForm.data.length ? (this.$refs.taskForm.tableHeightValues = '') : this.$refs.taskForm.setTableHeightFun()
}, },
handleImport() {}, handleDistribution(scope) {
addConfig() { this.$router.push('/activity/distribution?id=' + scope.id)
this.$router.push('/market/config')
},
handleDetail(scope) {
this.$router.push('/market/configDetail/' + scope.id)
},
handleStatistics(scope) {
this.$router.push('/market/effect/' + scope.id)
} }
} }
} }
......
<template> <template>
<div class="activity-main"> <div class="activity-main">
<div class="activity-main-header"> <div class="activity-main-header">
<el-button data-title="新增营销" type="primary" size="small" @click="handleAdd" fn="新增营销"> <collect-button>
<i class="el-icon-plus"></i> <el-button data-title="新增营销" type="primary" size="small" @click="handleAdd()" fn="新增营销">
创建活动 <i class="el-icon-plus"></i>
</el-button> 创建活动
<label>配置门店轻改专家,形成业务活码,客户可通过「精品升级」订单扫码来添加该员工。</label> </el-button>
</collect-button>
<collect-button dataAnalyics="{page:1}">
<label>配置门店轻改专家,形成业务活码,客户可通过「精品升级」订单扫码来添加该员工。</label>
</collect-button>
</div> </div>
<div class="activity-tabel scrm-box-f"> <div class="activity-tabel scrm-box-f">
<div class="activity-tabel-form"> <div class="activity-tabel-form">
<GLCombiForm ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <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"> <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"> <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> --> <!-- <GLButton :disabled="scope.scope.imStatus!=1" type="text" @click="handleStatistics(scope.scope)" fn="营销统计">营销统计</GLButton> -->
</div> </div>
</GLTable> </GLTable>
<div v-show="false"> <div v-show="false">
<div class="nodata-panel"> <div class="nodata-panel">
尚未创建活动, 尚未创建活动,
<a @click="handleAdd">前往创建</a> <a @click="handleAdd()">前往创建</a>
</div> </div>
</div> </div>
</div> </div>
...@@ -29,46 +37,31 @@ ...@@ -29,46 +37,31 @@
<script> <script>
import url from '@/assets/img/empty.png' import url from '@/assets/img/empty.png'
import crowd from '@/mixins/crowd'
export default { export default {
name: 'config', name: 'activityConfig',
mixins: [crowd],
data() { data() {
return { return {
url: url, url: url,
tableSearchForm: { tableSearchForm: {
imName: '', custGroupId: '',
imStatus: '', configName: '',
createTime: '' createTime: ''
}, },
searchFormData: [ searchFormData: [
{ {
label: '人群类型', label: '人群类型',
name: 'imStatus', name: 'custGroupId',
type: 'select', type: 'select',
placeholder: '请选择', placeholder: '请选择',
optionId: 'value', optionId: 'crowdGroupId',
optionLabel: 'label', optionLabel: 'crowdGroupName',
optionList: [ optionList: []
{
value: '',
label: '全部'
},
{
value: '1',
label: '待定保客户'
},
{
value: '2',
label: '待首保客户'
},
{
value: '3',
label: '流失客户'
}
]
}, },
{ {
label: '活动名称', label: '活动名称',
name: 'imName', name: 'configName',
type: 'input', type: 'input',
placeholder: '输入关键字搜索' placeholder: '输入关键字搜索'
}, },
...@@ -92,44 +85,42 @@ export default { ...@@ -92,44 +85,42 @@ export default {
}, },
createTime: '', createTime: '',
dialogVisible: true, dialogVisible: true,
getListApi: this.$apis.activity.findAllByPage, getListApi: this.$apis.activity.activityPage,
tableParams: { tableParams: {
listName: 'data', listName: 'data',
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: '活动名称', label: '活动名称',
prop: 'customerCount', prop: 'configName'
width: '120px'
}, },
{ {
label: '人群类型', label: '人群类型',
prop: 'imStatusName' prop: 'custTypeName'
}, },
{ {
label: '推送日期', label: '推送日期',
prop: 'createdTime', prop: 'sendDate',
width: '180px' width: '180px'
}, },
{ {
label: '创建人', label: '创建人',
prop: 'createdName', prop: 'createdByName'
width: '220px'
}, },
{ {
label: '创建日期', label: '创建日期',
prop: 'createdName', prop: 'createdTime',
width: '220px' width: '220px'
}, },
{ {
label: '状态', label: '状态',
prop: 'createdName', prop: 'status',
width: '220px' addHtml: 'status'
}, },
{ {
label: '操作', label: '操作',
prop: 'optionBtns', prop: 'optionBtns',
width: '180px', width: '100px',
addHtml: 'optionBtns', addHtml: 'optionBtns',
fixed: 'right' fixed: 'right'
} }
...@@ -143,16 +134,8 @@ export default { ...@@ -143,16 +134,8 @@ export default {
} }
} }
}, },
watch: { async mounted() {
// createTime(value) { this.searchFormData.find(item => (item.name = 'custGroupId')).optionList = await this.queryCrowdGroupTree()
// if (value) {
// this.tableSearchForm.beginTime = value[0]
// this.tableSearchForm.endTime = value[1]
// } else {
// delete this.tableSearchForm.beginTime
// delete this.tableSearchForm.endTime
// }
// }
}, },
methods: { methods: {
handleSearch() { handleSearch() {
...@@ -165,16 +148,28 @@ export default { ...@@ -165,16 +148,28 @@ export default {
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
if (this.tableSearchForm.createTime) { if (this.tableSearchForm.createTime) {
this.tableSearchForm.beginTime = new Date(this.tableSearchForm.createTime[0]).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, '/') this.tableSearchForm.endTime = new Date(this.tableSearchForm.createTime[1]).toLocaleDateString().replace(/\//g, '-')
} }
// delete this.tableSearchForm.createTime delete this.tableSearchForm.createTime
resolve() resolve()
}) })
}, },
handleImport() {}, handleAdd(scope) {
handleAdd() { let editParams = scope ? '?id=' + scope.id : ''
// this.$router.push('/activity/addActivity') 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() { setTableFinishFun() {
if (this.$refs.taskForm.data.length) { if (this.$refs.taskForm.data.length) {
...@@ -198,12 +193,6 @@ export default { ...@@ -198,12 +193,6 @@ export default {
document.querySelector('.noDataText').append(cloneNode) document.querySelector('.noDataText').append(cloneNode)
this.$refs.taskForm.setTableHeightFun() 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!