Commit e54783c7 by 前端

Merge branch 'v3.2.0' into 'master'

V3.2.0

See merge request !5
2 parents 29ee6bdc 3c768ce3
...@@ -2246,6 +2246,11 @@ ...@@ -2246,6 +2246,11 @@
"integrity": "sha512-tNEZYz5G/zYunxFm7sfhAxkXEuLj3K6BKwv6ZURlsF6yiUQ65z0Q2wZW9L5cPUl9ocofGvXOdFYbFHp0+6MOig==", "integrity": "sha512-tNEZYz5G/zYunxFm7sfhAxkXEuLj3K6BKwv6ZURlsF6yiUQ65z0Q2wZW9L5cPUl9ocofGvXOdFYbFHp0+6MOig==",
"dev": true "dev": true
}, },
"adler-32": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz",
"integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A=="
},
"ajv": { "ajv": {
"version": "6.12.6", "version": "6.12.6",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
...@@ -3282,6 +3287,15 @@ ...@@ -3282,6 +3287,15 @@
"integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==",
"dev": true "dev": true
}, },
"cfb": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz",
"integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==",
"requires": {
"adler-32": "~1.3.0",
"crc-32": "~1.2.0"
}
},
"chalk": { "chalk": {
"version": "2.4.2", "version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
...@@ -3635,6 +3649,11 @@ ...@@ -3635,6 +3649,11 @@
"integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==",
"dev": true "dev": true
}, },
"codepage": {
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz",
"integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA=="
},
"collection-visit": { "collection-visit": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
...@@ -4067,6 +4086,11 @@ ...@@ -4067,6 +4086,11 @@
"parse-json": "^4.0.0" "parse-json": "^4.0.0"
} }
}, },
"crc-32": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",
"integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="
},
"create-ecdh": { "create-ecdh": {
"version": "4.0.4", "version": "4.0.4",
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
...@@ -5981,6 +6005,11 @@ ...@@ -5981,6 +6005,11 @@
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
"dev": true "dev": true
}, },
"frac": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
"integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA=="
},
"fragment-cache": { "fragment-cache": {
"version": "0.2.1", "version": "0.2.1",
"resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
...@@ -11343,6 +11372,14 @@ ...@@ -11343,6 +11372,14 @@
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
"dev": true "dev": true
}, },
"ssf": {
"version": "0.11.2",
"resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz",
"integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==",
"requires": {
"frac": "~1.1.2"
}
},
"sshpk": { "sshpk": {
"version": "1.17.0", "version": "1.17.0",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz",
...@@ -13421,6 +13458,16 @@ ...@@ -13421,6 +13458,16 @@
"dayjs": "^1.8.25" "dayjs": "^1.8.25"
} }
}, },
"wmf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
"integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw=="
},
"word": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz",
"integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA=="
},
"word-wrap": { "word-wrap": {
"version": "1.2.3", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
...@@ -13497,6 +13544,20 @@ ...@@ -13497,6 +13544,20 @@
"async-limiter": "~1.0.0" "async-limiter": "~1.0.0"
} }
}, },
"xlsx": {
"version": "0.18.5",
"resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz",
"integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==",
"requires": {
"adler-32": "~1.3.0",
"cfb": "~1.2.1",
"codepage": "~1.15.0",
"crc-32": "~1.2.1",
"ssf": "~0.11.2",
"wmf": "~1.0.1",
"word": "~0.3.0"
}
},
"xtend": { "xtend": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
"glsx-components": "^1.5.2", "glsx-components": "^1.5.2",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.1.2" "vuex": "^3.1.2",
"xlsx": "^0.18.5"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.1.0", "@vue/cli-plugin-babel": "^4.1.0",
......
...@@ -26,9 +26,7 @@ ...@@ -26,9 +26,7 @@
</div> </div>
<img src="./assets/logo.png" alt="" srcset="" /> <img src="./assets/logo.png" alt="" srcset="" />
</div>--> </div>-->
<keep-alive exclude="details">
<router-view /> <router-view />
</keep-alive>
</div> </div>
</template> </template>
......
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
})
}
// 查询短信营销
const findDetailById = params => {
params.method = 'entmicro.api.message.findDetailById'
return http({
url,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 删除
const updateMessageInfoStatus = params => {
params.method = 'entmicro.api.message.updateMessageInfoStatus'
return http({
url,
method: 'POST',
data: params,
sign: true
})
}
export default { createMessageInfo,updateMessageInfoStatus,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) {
......
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.getTimeFomat = function(time, sign = '-') {
let day = new Date(time)
let month = day.getMonth() + 1
let date = day.getDate()
let hour = day.getHours()
let mm = day.getMinutes()
if (month < 10) month = '0' + month
if (date < 10) date = '0' + date
if (hour < 10) hour = '0' + hour
if (mm < 10) mm = '0' + mm
var s = day.getFullYear() + sign + month + sign + date + ' ' + hour + ':' + mm
return s
}
util.getBetweenDate = function(day, num, str = '-') {
var today = new Date(day)
var nowTime = today.getTime()
var ms = 24 * 3600 * 1000 * (num - 1)
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.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
}
util.getPrevMonth = function() {
let month = new Date().getMonth()
let year = new Date().getFullYear()
if (month == 0) {
year = year - 1
month = 12
}
return year + '年' + month + '月'
}
util.getCurrentMonthLast = function(date) {
var endDate = new Date(date)
var month = endDate.getMonth()
var nextMonth = ++month
var nextMonthFirstDay = new Date(endDate.getFullYear(), nextMonth, 1)
var oneDay = 1000 * 60 * 60 * 24
var dateString = new Date(nextMonthFirstDay - oneDay)
return dateString.toLocaleDateString().replace(new RegExp('/', 'g'), '-') //toLocaleDateString() 返回 如:2018/8/31
}
util.openUrl = function(url) {
const link = document.createElement('a')
link.href = url
link.click()
}
util.openTab = function(url) {
const link = document.createElement('a')
link.href = url
link.target = '_blank'
link.rel = 'opener'
link.click()
}
util.isShowBtn = function(value, permissions) {
let isShowStatus = false
const menu = JSON.parse(sessionStorage['SCRM_BASE_MENULIST'])
menuLevel(menu)
function menuLevel(item) {
item.forEach(itm => {
if (value && itm.path == value) {
isShowStatus = true
}
if (
!value &&
itm.path ==
'/' +
location.pathname
.split('/')
.slice(-2)
.join('/') &&
itm.meta &&
itm.meta.permissions.includes(permissions)
) {
isShowStatus = true
}
if (itm.children) {
menuLevel(itm.children)
}
})
}
return isShowStatus
}
util.getArrayIsSubset = (arr2, arr1) => {
return arr2.every(item => {
console.log(arr1.includes(item))
return arr1.includes(item)
})
}
export default util
<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" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="delFlag" slot-scope="scope">
<div :class="['task_icon', scope.scope.delFlag == 0 ? 'task_icon1' : 'task_icon2']">{{ scope.scope.delFlag == 0 ? '待发送' : '已发送' }}</div>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleContent(scope.scope)">短信内容</el-button>
</div>
</GLTable>
</div>
<!-- 外呼短信 -->
<GLDialog mode="small" title="短信内容" :visible.sync="messageVisible" cancelText="取消" okText="确定" @onCancel="messageVisible = false" @onOk="handleMessageConfirm" >
<div class="market-note">{{ messageContext }}</div>
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
data() {
return {
messageVisible: false,
messageContext: '',
url: url,
searchForm: {
phone: '',
delFlag: '',
merchantName: '',
imId: ''
},
// 搜索
searchFormData: [
{
label: '手机号',
name: 'phone ',
type: 'input'
},
{
label: '状态',
name: 'delFlag',
type: 'select',
optionList: [
{ text: '待发送', id: 0 },
{ text: '已发送', id: 1 }
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '所属门店',
name: 'merchantName',
type: 'input'
}
],
getListApi: this.$apis.marketing.findAllCustomerByPage,
tableParams: {
listName: 'data',
tableOption: true,
tableColumns: [
{
label: '手机号',
prop: 'phone'
},
{
label: '客户姓名',
prop: 'customerName'
},
{
label: '所属门店',
prop: 'merchantName'
},
{
label: '状态',
prop: 'delFlag',
addHtml: 'delFlag'
},
{
label: '发送时间',
prop: 'sendTime'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
}
},
props: {
imId: {
type: String,
default: ''
}
},
methods: {
handleContent(data) {
this.messageContext = data.messageContext
this.messageVisible = true
},
handleMessageConfirm() {
this.messageVisible = false
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
params.imId = this.imId
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = this.getParams()
resolve()
})
},
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: '',
delFlag: '',
merchantName: '',
imId: ''
}
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped>
.client {
margin: 16px 0;
.task_icon {
position: relative;
&::after {
content: '';
position: absolute;
top: 4px;
left: -10px;
width: 6px;
height: 6px;
border-radius: 4px;
}
&.task_icon1 {
&::after {
background: #fdb757;
}
}
&.task_icon2 {
&::after {
background: #2cca74;
}
}
}
.market-note {
font-weight: 400;
font-size: 16px;
color: #333333;
line-height: 24px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
// text-align: center;
width: 448px;
white-space: wrap;
}
}
</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>
<tempalte v-if="item.key == 'exportName'">
<a class="type-value exportName" @click="download(detailData)">{{ detailData[item.key] }}</a>
</tempalte>
<div v-else class="type-value">{{ detailData[item.key] ? detailData[item.key] : '--' }}</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" :key="index">{{ detailData.messageContext }}</div>
</div>
</div>
</div>
</div>
</div>
<template v-else>
<client :imId="id"></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 {
id: this.$route.query.id ? this.$route.query.id : 0,
activeName: 'first',
tabPaneList: [
{
label: '短信配置',
name: 'first'
},
{
label: '客户列表',
name: 'second'
}
],
detailData: '',
content: [],
configList: [
{
text: '营销名称:',
key: 'imName'
},
{
text: '营销时间:',
key: 'sendTime'
},
{
text: '导入客户:',
key: 'exportName'
},
{
text: '有效数据:',
key: 'customerCount'
},
{
text: '营销内容:',
key: 'messageContext'
}
]
}
},
created() {
this.congifDetails()
},
methods: {
download(data) {
this.getBlob(data.exportUrl).then(blob => {
this.saveAs(blob, data.exportName)
})
},
getBlob(url) {
return new Promise(resolve => {
const xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.responseType = 'blob'
xhr.onload = () => {
if (xhr.status === 200) {
resolve(xhr.response)
}
}
xhr.send()
})
},
saveAs(blob, filename) {
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob, filename)
} else {
const link = document.createElement('a')
const body = document.querySelector('body')
let binaryData = []
binaryData.push(blob)
link.href = window.URL.createObjectURL(new Blob(binaryData))
link.download = filename
// fix Firefox
link.style.display = 'none'
body.appendChild(link)
link.click()
body.removeChild(link)
window.URL.revokeObjectURL(link.href)
}
},
congifDetails() {
let params = {
id: this.id
}
this.$apis.marketing.findDetailById(params).then(res => {
if (res.code == 0) this.detailData = res.data
})
},
handleCancel() {
this.$router.go(-1)
},
handleClick() {
console.log(this.activeName)
}
}
}
</script>
<style lang="scss" scoped>
.container {
background: #ffffff;
margin: 16px 0;
padding: 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;
line-height: 20px;
}
.type-value {
max-width: 576px;
line-height: 20px;
}
.exportName {
text-decoration: underline;
color: #5850ff;
cursor: pointer;
}
}
.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">
<template slot="imStatus" slot-scope="scope">
<div :class="['task_icon', scope.scope.imStatus == 1 ? 'task_icon1' : 'task_icon2']">{{ scope.scope.imStatus == 1 ? '待处理' : scope.scope.imStatus == 2 ? '已完成' : '删除' }}</div>
</template>
<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: '' },
{ text: '待处理', id: 1 },
{ text: '已完成', id: 2 }
],
optionId: 'id',
optionLabel: 'text'
},
{
label: '营销名称',
name: 'imName',
type: 'input'
}
],
getListApi: this.$apis.marketing.getMessageList,
tableParams: {
listName: 'data',
tableOption: true,
tableColumns: [
{
label: '营销名称',
prop: 'imName',
line:1,
width:350
},
{
label: '营销客户数',
prop: 'customerCount'
},
{
label: '状态',
prop: 'imStatus',
addHtml: 'imStatus'
},
{
label: '创建时间',
prop: 'sendTime'
},
{
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(data) {
this.$confirm('删除后数据将无法恢复,是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$apis.marketing.updateMessageInfoStatus({ id: data.id, imStatus: 3 }).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 {
margin-bottom: 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;
}
}
.task_icon {
position: relative;
&::after {
content: '';
position: absolute;
top: 4px;
left: -10px;
width: 6px;
height: 6px;
border-radius: 4px;
}
&.task_icon1 {
&::after {
background: #fdb757;
}
}
&.task_icon2 {
&::after {
background: #2cca74;
}
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -9,7 +9,7 @@ const cdn = { ...@@ -9,7 +9,7 @@ const cdn = {
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`] js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`]
} }
module.exports = { module.exports = {
outputDir: `../dist/${packageName}`, outputDir: `dist`,
publicPath, publicPath,
assetsDir: 'static', assetsDir: 'static',
productionSourceMap: false, productionSourceMap: false,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!