Commit eff56cec by 前端

短信营销

1 parent 29ee6bdc
import { http } from '@/main'
const url = '/rop-scrm-entmicro/router'
// 查询短信营销列
const getMessageList = params => {
params.method = 'entmicro.api.message.findAllByPage'
return http({
url,
method: 'POST',
data: params,
sign: true
})
}
// 保存短信营销配置
const createMessageInfo= params => {
params.method = 'entmicro.api.message.createMessageInfo'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 查询短信营销客户列表
const findAllCustomerByPage = params => {
params.method = 'entmicro.api.message.findAllCustomerByPage'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 查询短信营销
const findDetailById = params => {
params.method = 'entmicro.api.message.findDetailById'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 查询短信营销客户列表
const getMessageInfoStatus = params => {
params.method = 'entmicro.api.message.updateMessageInfoStatus'
return http({
url,
method: 'POST',
data: params,
sign: true
})
}
export default { createMessageInfo,getMessageInfoStatus,getMessageList, findDetailById, findAllCustomerByPage}
...@@ -18,18 +18,26 @@ html { ...@@ -18,18 +18,26 @@ html {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.outbound .container { .flex-bet {
display: flex;
justify-content: space-between;
}
.flex-top {
display: flex;
align-items: flex-start;
}
.container {
background: #ffffff; background: #ffffff;
padding: 20px; padding: 20px;
} }
.outbound .m-b-20 { .m-b-20 {
margin-bottom: 20px; margin-bottom: 20px;
} }
.word{ .word {
word-wrap: break-all; word-wrap: break-all;
} }
.fwt-4{ .fwt-4 {
font-weight: 400; font-weight: 400;
} }
.font-12 { .font-12 {
...@@ -44,8 +52,8 @@ html { ...@@ -44,8 +52,8 @@ html {
.color3 { .color3 {
color: #333333; color: #333333;
} }
.color58{ .color58 {
color:#5850FF color: #5850ff;
} }
.m-r-4 { .m-r-4 {
margin-right: 4px; margin-right: 4px;
...@@ -61,7 +69,7 @@ html { ...@@ -61,7 +69,7 @@ html {
.outbound.p-t-20 { .outbound.p-t-20 {
padding-top: 20px; padding-top: 20px;
} }
.line-20{ .line-20 {
line-height: 20px; line-height: 20px;
} }
.el-tooltip__popper { .el-tooltip__popper {
...@@ -69,7 +77,7 @@ html { ...@@ -69,7 +77,7 @@ html {
background: #fff; background: #fff;
min-width: 150px; min-width: 150px;
border-radius: 4px; border-radius: 4px;
border: 1px solid #ebeef5!important; border: 1px solid #ebeef5 !important;
padding: 12px; padding: 12px;
z-index: 2000; z-index: 2000;
color: #606266; color: #606266;
...@@ -83,10 +91,18 @@ html { ...@@ -83,10 +91,18 @@ html {
.el-tooltip__popper { .el-tooltip__popper {
max-width: 380px; max-width: 380px;
} }
.el-tooltip__popper[x-placement^="top"] .popper__arrow { .el-tooltip__popper[x-placement^='top'] .popper__arrow {
border-top-color: #ffffff !important; border-top-color: #ffffff !important;
} }
.el-tooltip__popper[x-placement^="top"] .popper__arrow:after { .el-tooltip__popper[x-placement^='top'] .popper__arrow:after {
border-top-color: #ffffff !important; border-top-color: #ffffff !important;
}
\ No newline at end of file \ No newline at end of file
}
.preview {
width: 412px;
height: 64px;
margin: 0 auto;
}
.pd20 {
padding: 20px;
}
<!-- 搜索 --> <!-- 搜索 -->
<template> <template>
<div class="glsx-combi-form gl-form-page gl-form-min"> <div class="glsx-combi-form gl-form-page gl-form-min">
<el-form :ref="formRef" :inline="true" :model="formObj" :label-width="labelWidth" :rules="formRules" size="mini" class="glsx-combi-form-block"> <el-form :ref="formRef" :inline="inline" :model="formObj" :label-width="labelWidth" :rules="formRules" size="mini" class="glsx-combi-form-block">
<template v-for="(item, index) in formData"> <template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :class="{ 'no-label': !item.label, tips: item.tips }" :label="item.label ? item.label + ':' : ''" :prop="item.name"> <el-form-item v-if="!item.isHide" :key="index" :class="{ 'no-label': !item.label, tips: item.tips }" :label="item.label ? item.label + ':' : ''" :prop="item.name">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
import { rangePickerOptions, rangetimePickerOptions } from './common' import { rangePickerOptions, rangetimePickerOptions } from './common'
export default { export default {
name: 'glsx-combi-form', name: 'glsx-combi-form',
data() { data() {
return { return {
pickerOption: { pickerOption: {
...@@ -97,6 +98,10 @@ export default { ...@@ -97,6 +98,10 @@ export default {
searchSelectObj: { searchSelectObj: {
type: Object, type: Object,
default: () => {} default: () => {}
},
inline: {
type: Boolean,
default: true
} }
}, },
......
...@@ -18,8 +18,8 @@ export const fetchConfig = function (isEnv = true) { ...@@ -18,8 +18,8 @@ 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().get('https://oss-config.dev.glsx.com.cn/mock/62ecda0909756a6f4f85cf9a/outbound/config') return new Http().get('https://oss-config.dev.glsx.com.cn/mock/62ecda0909756a6f4f85cf9a/outbound/config')
return new Http({ request: { timeout: 100000 } }).get('https://oss-config.test.glsx.com.cn/mock/62fe2a36abac6ff6ac239d3c/outbound/config') // return new Http({ request: { timeout: 100000 } }).get('https://oss-config.test.glsx.com.cn/mock/62fe2a36abac6ff6ac239d3c/outbound/config')
} }
export const config = { export const config = {
install(vue, cfg) { install(vue, cfg) {
......
<template>
<div class="add-wrap">
<div class="container">
<div class="title">营销配置</div>
<div class="flex">
<div class="gl-form-page">
<el-form ref="configForm" label-width="154px" :model="addForm" :rules="addRules">
<el-form-item label="营销名称:" prop="imName">
<el-input type="text" size="small" placeholder="请输入营销名称" v-model.trim="addForm.imName" maxlength="30"></el-input>
</el-form-item>
<!-- <div class="flex"> -->
<el-form-item label="营销时间:" class="sendTime">
<el-col :span="11">
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.date1" style="width: 100%"></el-date-picker>
</el-col>
<el-col class="line" :span="1">-</el-col>
<el-col :span="11">
<el-time-picker placeholder="选择时间" v-model="addForm.date2" style="width: 100%"></el-time-picker>
</el-col>
</el-form-item>
<el-form-item label="导入客户:" prop="exportUrl">
<div class="upload-box">
<div class="upload-file-panel flex">
<div>
<div class="upload-btn">
<i class="el-icon-plus"></i>
上传文件
</div>
<!-- <input type="file" style="opacity: 0" ref="file" accept="*" @change="uploadFile" /> -->
</div>
<el-popover placement="bottom" width="452" trigger="hover">
<img src="@/images/table.png" class="preview" />
<span slot="reference" class="download-url">模板预览</span>
</el-popover>
<a class="download-url" href="https://img01.glsx.com.cn/weapp/resource/saas/scrm/xlsx/客户信息导入模板.xlsx">下载模版</a>
</div>
<div class="upload-result" v-if="importName">
<div class="upload-result-input">{{ importName }}</div>
<i class="el-icon-delete" @click="clearFile"></i>
</div>
</div>
</el-form-item>
<el-form-item label="短信内容:" prop="messageContext">
<el-input type="textarea" v-model="addForm.messageContext" rows="5" maxlength="280" show-word-limit></el-input>
<div class="select-panel">
<div @click="handleSelectMessage" class="flex">
<img src="@/images/link.png" class="link" />
<span class="">短链</span>
</div>
</div>
<div class="form-tips">70字內(含70字)计一条,超过70字,按70字/条计费。</div>
<div class="form-tips">提示:当前短信已有0字,按0条短信发送且计费。</div>
</el-form-item>
</el-form>
</div>
<div class="form-image">
<img src="@/images/phone.png" />
<div class="preview-content">
<div class="preview-info">
<div class="preview-text text" v-for="(item, index) in content" :key="index">{{ item }}</div>
</div>
</div>
</div>
</div>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleSave">提交</el-button>
</GLFooter>
</div>
</template>
<script>
export default {
data() {
return {
addForm: {
imName: '',
sendTime: '',
exportUrl: '',
messageContext: '',
date: '',
time: ''
},
addRules: {
imName: [{ required: true, message: '请输入营销名称', trigger: 'blur' }],
exportUrl: [{ required: true, message: '请上传客户', trigger: 'change' }],
sendTime: [
// { required: true, message: '请选择营销时间' }
// { validator: validateTime, trigger: 'change' }
],
messageContext: [
{ required: true, message: '请输入营销内容', trigger: 'change' }
// { validator: validateContent, trigger: 'blur' }
]
}
}
},
methods: {
handleSave() {},
handleCancel() {},
uploadFile(e) {
const file = e.srcElement.files[0]
let AllImgExt = '.xls|.xlsx'
let extName = file.name.substring(file.name.lastIndexOf('.')).toLowerCase()
console.log(extName)
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return false
}
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const fileUrl = file.name.split('.')[1] + '@' + arrBase64[1]
this.$apis.common.pictureUpload({ file: fileUrl }).then(res => {
this.importName = file.name
this.exportUrl = res
this.$refs.file.value = ''
this.handleSaveImport()
})
}
}
}
}
</script>
<style lang="scss" scoped>
.container {
background: #ffffff;
margin-bottom:16px;
.title {
height: 56px;
line-height: 56px;
border-bottom: 1px solid #e5e5e5;
padding-left: 20px;
box-sizing: border-box;
}
.gl-form-page {
flex: 1;
padding: 20px;
/deep/.el-form-item__content {
width: 460px;
}
.line {
color: #fff;
}
.download-url {
margin-left: 11px;
font-size: 12px;
font-weight: 400;
color: #5850ff;
line-height: 17px;
}
.link {
width: 18px;
height: 18px;
margin-right: 4px;
}
.upload-box {
margin-bottom: 10px;
.upload-btn {
background: #ffffff;
border: 1px solid #e5e5e5;
border-radius: 3px;
text-align: center;
font-weight: 400;
font-size: 14px;
color: #666666;
box-sizing: border-box;
padding: 6px 17px;
line-height: 20px;
}
.upload-result {
display: flex;
align-items: center;
&-input {
width: 320px;
height: 26px;
background: #f5f7fa;
border-radius: 4px;
font-size: 14px;
padding-left: 12px;
color: #333333;
line-height: 26px;
}
> i {
cursor: pointer;
color: #c6c6c6;
font-size: 14px;
margin-left: 10px;
}
}
.upload-tips {
margin-top: 6px;
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 20px;
}
}
.select-panel {
padding-left: 20px;
background: #fafbfe;
display: flex;
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 40px;
border: 1px solid #e5e5e5;
width: 580px !important;
border-top: 0px;
box-sizing: border-box;
border-radius: 0 0 4px 4px;
cursor: pointer;
}
.form-tips {
font-size: 12px;
color: #999999;
line-height: 20px;
margin-top: 5px;
white-space: nowrap;
}
}
.form-image {
width: 280px;
height: 546px;
margin: 20px 10px;
position: relative;
.preview-content {
position: absolute;
width: 250px;
height: 320px;
overflow-y: auto;
top: 125px;
left: 50px;
.preview-text {
padding: 10px;
position: relative;
width: 160px;
color: #333;
background-color: #f4f4f4;
border-radius: 4px;
word-wrap: break-word;
margin-bottom: 10px;
}
}
img {
width: 100%;
height: auto;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="client">
<div class="container">
<GLCombiForm :rowNumber="1" ref="formSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 -->
<GLTable ref="clientRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleContent(scope.scope)">短信内容</el-button>
</div>
</GLTable>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
data() {
return {
url: url,
searchForm: {
phone: '',
imStatus: '',
merchantName: ''
},
// 搜索
searchFormData: [
{
label: '手机号',
name: 'phone ',
type: 'input'
},
{
label: '状态',
name: 'imStatus',
type: 'select',
optionList: [
{ text: '待发送', id: 1 },
{ text: '已处理', id: 2 },
{ text: '删除', id: 3 }
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '所属门店',
name: 'merchantName',
type: 'input'
}
],
getListApi: this.$apis.outbound.getTaskList,
tableParams: {
listName: 'data',
tableOption: true,
tableColumns: [
{
label: '手机号',
prop: 'phone'
},
{
label: '客户姓名',
prop: 'customerCount '
},
{
label: '所属门店',
prop: 'merchantName '
},
{
label: '发送状态',
prop: 'createdTime'
},
{
label: '发送时间',
prop: 'createdName'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
}
},
methods: {
handleContent() {
this.$router.push({
path: '/client/add'
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.clientRef.data.length ? (this.$refs.clientRef.tableHeightValues = '') : this.$refs.clientRef.setTableHeightFun()
},
handleSearch() {
console.log(111)
this.$refs.clientRef.refreshTable()
},
handleReset() {
this.searchForm = {
phone: '',
imStatus: '',
merchantName: ''
}
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
.client {
margin-top: 16px;
.head-info {
font-weight: 400;
font-size: 14px;
color: #666666;
p {
margin: 0 4px 0 12px;
line-height: 16px;
}
.count-item-question {
width: 14px;
height: 14px;
display: inline-block;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="detail-wrap">
<GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs>
<div class="container" v-if="activeName == 'first'">
<div class="title">营销配置</div>
<div class="flex-bet pd20">
<div class="detail-content">
<template v-for="(item, index) in configList">
<div class="flex-top line-text" :key="index">
<div class="type-text">{{ item.text }}</div>
<div class="type-value">【嘀加智慧车生活】尊敬的顾客,赠送您一张专属权益卡。加油8折起,更有星巴克、喜茶、麦当劳等惊喜折扣优惠。请添加门店顾问企微领取 https://t.hk.uy/bscB</div>
</div>
</template>
</div>
<div class="form-image">
<img src="@/images/phone.png" />
<div class="preview-content">
<div class="preview-info">
<div class="preview-text text" v-for="(item, index) in content" :key="index">{{ item }}</div>
</div>
</div>
</div>
</div>
</div>
<template v-else>
<client></client>
</template>
<GLFooter>
<el-button @click="handleCancel" type="primary">返回</el-button>
</GLFooter>
</div>
</template>
<script>
import client from './client.vue'
export default {
components: {
client
},
data() {
return {
activeName: 'first',
tabPaneList: [
{
label: '短信配置',
name: 'first'
},
{
label: '客户列表',
name: 'second'
}
],
content: [],
configList: [
{
text: '营销名称:',
key: 'imName'
},
{
text: '营销时间:',
key: 'sendTime'
},
{
text: '导入客户:',
key: 'exportUrl'
},
{
text: '有效数据:',
key: 'imName'
},
{
text: '营销内容:',
key: 'messageContext'
}
]
}
},
methods: {
handleCancel() {},
handleClick() {
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
.container {
background: #ffffff;
margin: 16px 0;
.title {
height: 56px;
line-height: 56px;
border-bottom: 1px solid #e5e5e5;
padding-left: 20px;
box-sizing: border-box;
}
.detail-content {
flex: 1;
.line-text {
margin-left: 84px;
margin-bottom: 22px;
height: 20px;
font-weight: 400;
font-size: 14px;
color: #333333;
}
.type-text {
width: 70px;
text-align: right;
}
.type-value {
max-width: 576px;
}
}
.form-image {
width: 280px;
height: 546px;
margin-right: 80px;
position: relative;
.preview-content {
position: absolute;
width: 250px;
height: 320px;
overflow-y: auto;
top: 125px;
left: 50px;
.preview-text {
padding: 10px;
position: relative;
width: 160px;
color: #333;
background-color: #f4f4f4;
border-radius: 4px;
word-wrap: break-word;
margin-bottom: 10px;
}
}
img {
width: 100%;
height: auto;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="marketing">
<div class="flex head">
<el-button type="primary" size="small" icon="el-icon-plus" @click="handleAdd">新增营销</el-button>
<div class="head-info flex">
<p>结合门店营销活动,指定客户创建智能营销,提高活动转化率</p>
<el-popover placement="top" width="560" trigger="hover" content="通过导入的客户,门店可通过智能外呼及智能短信,结合营销活动的需要向离店用户进行智能营销,可实现标准、高效的营销同时实现用户线上化。">
<img src="@/images/question.png" slot="reference" class="count-item-question" />
</el-popover>
</div>
</div>
<div class="container">
<GLCombiForm :rowNumber="1" ref="formSearch" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 -->
<GLTable ref="marketingRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetails(scope.scope)">详情</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
</div>
</GLTable>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
data() {
return {
url: url,
tableSearchForm: {
imName: '',
imStatus: '',
createDate: []
},
searchForm: {},
// 搜索
searchFormData: [
{
label: '创建时间:',
name: 'createDate',
type: 'datePicker',
isClear: true
},
{
label: '状态:',
name: 'imStatus',
type: 'select',
optionList: [
{ text: '待发送', id: 1 },
{ text: '已处理', id: 2 },
{ text: '删除', id: 3 }
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '营销名称:',
name: 'imName',
type: 'input'
}
],
getListApi: this.$apis.outbound.getTaskList,
tableParams: {
listName: 'data',
tableOption: true,
tableColumns: [
{
label: '营销名称',
prop: 'imName'
},
{
label: '营销客户数',
prop: 'customerCount '
},
{
label: '状态',
prop: 'imStatus '
},
{
label: '创建时间',
prop: 'createdTime'
},
{
label: '创建人',
prop: 'createdName'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
}
},
methods: {
handleAdd() {
this.$router.push({
path: '/marketing/add'
})
},
handleDetails(data) {
this.$router.push({
path: '/marketing/details',
query: {
id: data.id
}
})
},
handleDelete() {
this.$confirm('删除后数据将无法恢复,是否确认删除??', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
// this.$apis.channel.deleteChannelCode({ id: scope.id }).then(res => {
// if (res) {
// this.$message({
// type: 'success',
// message: '删除成功!'
// })
// }
// this.handleSearch()
// })
})
.catch(() => {})
},
getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm))
if (this.tableSearchForm.createDate.length) {
params.startTime = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
params.taskStatus = this.currentIndex
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = this.getParams()
delete this.searchForm.createDate
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.marketingRef.data.length ? (this.$refs.marketingRef.tableHeightValues = '') : this.$refs.marketingRef.setTableHeightFun()
},
handleSearch() {
this.$refs.marketingRef.refreshTable()
},
handleReset() {
this.tableSearchForm = {
imName: '',
imStatus: '',
createDate: []
}
this.searchForm = {
imName: '',
imStatus: '',
startTime: '',
endTime: ''
}
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
.marketing {
.head-info {
font-weight: 400;
font-size: 14px;
color: #666666;
p {
margin: 0 4px 0 12px;
line-height: 16px;
}
.count-item-question {
width: 14px;
height: 14px;
display: inline-block;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!