Commit c64dd432 by 前端

Merge branch 'v2.10.1' into 'develop'

V2.10.1上线后,代码合并。

See merge request !356
2 parents 34b650ed 8bcbfa45
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
"lodash": "^4.17.21", "lodash": "^4.17.21",
"node-sass": "^4.0.0", "node-sass": "^4.0.0",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-amap": "^0.5.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuedraggable": "^2.24.3", "vuedraggable": "^2.24.3",
"vuex": "^3.1.2", "vuex": "^3.1.2",
......
...@@ -137,7 +137,7 @@ const staffList = params => { ...@@ -137,7 +137,7 @@ const staffList = params => {
} }
// 客户群发客户列表 // 客户群发客户列表
const customerDetailList = params => { const customerDetailList = params => {
params.method = `${path}customer.list` params.method = `${path}customer.list.page`
return http({ return http({
url: URL, url: URL,
method: 'GET', method: 'GET',
......
...@@ -45,10 +45,34 @@ const getBrowseListApi = params => { ...@@ -45,10 +45,34 @@ const getBrowseListApi = params => {
sign: true sign: true
}) })
} }
//众筹活动访客明细
const getVisitorListApi = params => {
params.method = 'scrm.api.shopmall.customer.visitor.records'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 众筹活动分享明细
const getSharedListApi = params => {
params.method = 'scrm.api.shopmall.customer.shared.records'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 分页浏览-导出 // 分页浏览-导出
const exportBrowseApi = params => { const exportBrowseApi = (params, TYPE = 1) => {
params.method = 'scrm.api.shopmall.customer.browse.records.export' //TYPE 1 浏览 2 访客 3 分享
params.method = {
1: 'scrm.api.shopmall.customer.browse.records.export',
2: 'scrm.api.shopmall.customer.visitor.records.export',
3: 'scrm.api.shopmall.customer.shared.records.export'
}[TYPE]
return http({ return http({
url: 'rop-scrm-shopmall/router', url: 'rop-scrm-shopmall/router',
method: 'POST', method: 'POST',
...@@ -137,5 +161,45 @@ const getCrowdSharedApi = params => { ...@@ -137,5 +161,45 @@ const getCrowdSharedApi = params => {
sign: true sign: true
}) })
} }
/**直播间下拉列表 */
const getLiveListApi = params => {
params.method = 'scrm.api.shopmall.livebroadcast.dropdown.list'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi } /**数据看板员工排名 */
const getRankListApi = params => {
params.method = 'scrm.api.shopmall.activity.ranking.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 数据看板员工-导出
const exportRankListApi = params => {
params.method = 'scrm.api.shopmall.activity.ranking.export'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**数据看板 */
const getDataBoardApi = params => {
params.method = 'scrm.api.shopmall.activity.statdata'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getRankListApi, exportRankListApi, getDataBoardApi, getVisitorListApi, getSharedListApi }
<template> <template>
<div class="map-box" :style="{ height: mapHeight + 'px' }"> <div class="map-box" :style="{ height: mapHeight + 'px', width: mapWidth + 'xp' }">
<div id="container" style="width: 100%; height: 100%"></div> <div id="container">
<div class="map-address">{{ address }}</div> <el-select v-model="input" class="map-input" filterable remote reserve-keyword placeholder="请输入" :remote-method="remoteMethod" @change="handleChangeAdr" :loading="loading">
<div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%"> <el-option v-for="item in adrList" :key="item.id" :label="item.address" :value="item.id"></el-option>
<el-input placeholder="请输入关键字" v-model="input" class="input-with-select"> </el-select>
<el-button slot="append" icon="el-icon-search" @click="searchAddress"></el-button> </div>
</el-input> <div class="map-address">
<img class="icon-map" src="./images/icon-map.png" />
{{ address }}
</div> </div>
</div> </div>
</template> </template>
...@@ -16,23 +18,65 @@ export default { ...@@ -16,23 +18,65 @@ export default {
props: { props: {
mapHeight: { mapHeight: {
type: Number, type: Number,
default: 300 default: 460
},
mapWidth: {
type: Number,
default: 740
} }
}, },
data() { data() {
return { return {
input: '', input: [],
address: '', address: '',
adrList: [],
lnglat: [], lnglat: [],
geocoderAddress: {} geocoderAddress: {}
} }
}, },
mounted() {
this.mapInit()
},
methods: { methods: {
// initMap() {
// console.log(document.getElementsByTagName('head'))
// var script = document.createElement('script')
// script.type = 'text/javascript'
// script.src = 'https://webapi.amap.com/loader.js'
// document.getElementsByTagName('head')[0].appendChild(script)
// },
mapInit() { mapInit() {
/* eslint-disable */
AMapLoader.load({
/* eslint-enable */
key: '44cc16e43ad7ed3358df507bd0618181', // 申请好的Web端开发者Key,首次调用 load 时必填
version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
// 需要使用的的插件列表
plugins: ['AMap.ToolBar', 'AMap.Scale', 'AMap.Geocoder'],
AMapUI: {
// 是否加载 AMapUI,缺省不加载
version: '1.1', // AMapUI 版本
plugins: ['overlay/SimpleMarker'] // 需要加载的 AMapUI ui插件
},
Loca: {
// 是否加载 Loca, 缺省不加载
version: '2.0' // Loca 版本
}
})
.then(AMap => {
map = new AMap.Map('container', { map = new AMap.Map('container', {
zoom: 20,
autoFitView: true,
resizeEnable: true, resizeEnable: true,
zoom: 20 cursor: 'move'
}) })
if (this.lnglat.length) {
this.addMarker(this.lnglat)
}
map.addControl(new AMap.Scale())
map.addControl(new AMap.ToolBar())
this.geocoder = new AMap.Geocoder()
map.setDefaultCursor('pointer')
AMap.plugin(['AMap.PlaceSearch'], function () { AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类 //构造地点查询类
placeSearch = new AMap.PlaceSearch({ placeSearch = new AMap.PlaceSearch({
...@@ -44,15 +88,20 @@ export default { ...@@ -44,15 +88,20 @@ export default {
renderStyle: 'default' renderStyle: 'default'
}) })
}) })
// 添加列表点选监听事件
map.on('click', this.getAddress) map.on('click', this.getAddress)
})
.catch(e => {
console.error(e) //加载错误提示
})
}, },
searchAddress() { remoteMethod(query) {
if (query == '') {
return true
}
let _this = this let _this = this
placeSearch.search(this.input, function (status, result) { placeSearch.search(query, function (status, result) {
if (status === 'complete' && result.poiList.pois.length) { if (status === 'complete' && result.poiList.pois.length) {
let lnglat = result.poiList.pois[0].location _this.adrList = result.poiList.pois
_this.getAddress(lnglat)
} }
}) })
}, },
...@@ -63,63 +112,76 @@ export default { ...@@ -63,63 +112,76 @@ export default {
} else { } else {
position = lnglat position = lnglat
} }
this.lnglat = position
marker = new AMap.Marker({ marker = new AMap.Marker({
map: map,
icon: new AMap.Icon({ icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png', image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小 size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34) imageSize: new AMap.Size(27, 34)
}), }),
// draggable: true,
position: position, position: position,
offset: new AMap.Pixel(-10, -10) offset: new AMap.Pixel(-10, -10)
}) })
map.setCenter(position)
map.add(marker) map.add(marker)
map.setFitView() marker.setMap(map)
// this.map.setFitView()
}, },
getAddress(e) { getAddress(e) {
let self = this let self = this
let lnglat let position
if (e.type == 'click') { if (e.type == 'click') {
lnglat = e.lnglat position = e.lnglat
} else { } else {
let { lng, lat } = e let { lng, lat } = e
lnglat = [lng, lat] position = [lng, lat]
} }
if (marker) { if (marker) {
map.remove(marker)
marker.setMap(null) marker.setMap(null)
marker = null marker = null
} }
self.addMarker(lnglat) self.addMarker(position)
AMap.plugin('AMap.Geocoder', () => { AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder() const geocoder = new AMap.Geocoder()
geocoder.getAddress(lnglat, (status, result) => { geocoder.getAddress(position, (status, result) => {
self.lnglat = lnglat
self.address = result.regeocode.formattedAddress self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => { geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') { if (status === 'complete' && result.info === 'OK') {
this.geocoderAddress = result.geocodes[0] self.geocoderAddress = result.geocodes[0]
} }
}) })
}) })
}) })
}, },
selectAddress(e) { handleChangeAdr(val) {
//这里获得点选地点的经纬度 if (val) {
this.getAddress() var location = this.adrList.find(item => item.id == val)
this.getAddress(location.location)
this.input = ''
this.adrList = []
}
} }
},
mounted() {
this.mapInit()
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.map-box { .map-box {
display: flex;
#container {
position: relative; position: relative;
width: 100%; width: calc(100% - 284px - 16px);
}
#container {
position: absolute;
height: 100%; height: 100%;
}
.map-input {
position: absolute;
top: 32px;
width: 60%;
left: 25%;
z-index: 2;
}
} }
#panel { #panel {
position: absolute; position: absolute;
...@@ -130,8 +192,18 @@ export default { ...@@ -130,8 +192,18 @@ export default {
width: 280px; width: 280px;
} }
.map-address { .map-address {
position: absolute; display: flex;
box-sizing: border-box;
width: 284px;
height: 100%;
background-color: #f9f9f9;
padding: 20px;
margin-left: 16px;
line-height: 20px; line-height: 20px;
bottom: -30px; .icon-map {
width: 16px;
height: 16px;
margin-right: 6px;
}
} }
</style> </style>
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<el-form-item v-for="(item, index) in formList" :key="index" :label="item.label || ''"> <el-form-item v-for="(item, index) in formList" :key="index" :label="item.label || ''">
<template> <template>
<template v-if="item.type === 'input'"> <template v-if="item.type === 'input'">
<el-input v-model="formModel[item.prop]" :type="item.inputType || 'text'" :placeholder="item.placeholder || '请输入'" :clearable="item.clearable || false" :readonly="item.readonly || false" @keyup.enter.native="onInput" ></el-input> <el-input v-model="formModel[item.prop]" :type="item.inputType || 'text'" :placeholder="item.placeholder || '请输入'" :clearable="item.clearable || false" :readonly="item.readonly || false" @keyup.enter.native="onInput"></el-input>
</template> </template>
<template v-else-if="item.type === 'select'"> <template v-else-if="item.type === 'select'">
<el-select size="small" v-model="formModel[item.prop]" :placeholder="item.placeholder || '请选择'" :filterable="!item.noFilter"> <el-select size="small" v-model="formModel[item.prop]" :placeholder="item.placeholder || '请选择'" :filterable="!item.noFilter">
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
isThreeRowShow:{ isThreeRowShow: {
type: Boolean, type: Boolean,
default: false default: false
}, },
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
isNeedThreeBtns:{ isNeedThreeBtns: {
type: Boolean, type: Boolean,
default: true default: true
} }
...@@ -118,11 +118,10 @@ export default { ...@@ -118,11 +118,10 @@ export default {
//调用默认时间(30天) //调用默认时间(30天)
this.getPassMonthFormatDate() this.getPassMonthFormatDate()
} }
this.$nextTick(()=>{ this.$nextTick(() => {
var sf = document.getElementById('searchForm') var sf = document.getElementById('searchForm')
if (sf.clientWidth < 1280 && this.isHasSyncBtn) { if (sf.clientWidth < 1280 && this.isHasSyncBtn) {
document.querySelector('.itemWidth').style.maxWidth = 700 + 'px' document.querySelector('.itemWidth').style.maxWidth = 700 + 'px'
} }
if (sf.clientWidth < 952 && this.isHasSyncBtn) { if (sf.clientWidth < 952 && this.isHasSyncBtn) {
...@@ -131,7 +130,6 @@ export default { ...@@ -131,7 +130,6 @@ export default {
let lineHeight = 75 //75 let lineHeight = 75 //75
if (document.getElementById('searchForm').offsetHeight > lineHeight * 2) { if (document.getElementById('searchForm').offsetHeight > lineHeight * 2) {
this.expande = false this.expande = false
this.needShowExpande = true this.needShowExpande = true
} else { } else {
...@@ -139,13 +137,12 @@ export default { ...@@ -139,13 +137,12 @@ export default {
this.expande = true this.expande = true
} }
if( sf.clientWidth< 840 && this.isThreeRowShow){ if (sf.clientWidth < 840 && this.isThreeRowShow) {
document.querySelector('.itemWidth').style.minHeight= document.querySelector('.itemWidth').offsetHeight + 50 + 'px' document.querySelector('.itemWidth').style.minHeight = document.querySelector('.itemWidth').offsetHeight + 50 + 'px'
// 客户群里面四个表做特殊处理,当为苹果笔记本电脑尺寸时,不是现实展开收起按钮 // 客户群里面四个表做特殊处理,当为苹果笔记本电脑尺寸时,不是现实展开收起按钮
this.needShowExpande = false this.needShowExpande = false
this.expande = true this.expande = true
} }
}) })
//有数据不算表格高度,没数据算高度 //有数据不算表格高度,没数据算高度
...@@ -215,8 +212,8 @@ export default { ...@@ -215,8 +212,8 @@ export default {
syncClick() { syncClick() {
this.$emit('syncClick') this.$emit('syncClick')
}, },
handleExport(){ handleExport() {
this.$emit('handleExport') this.$emit('handleExport')
}, },
expandeClick() { expandeClick() {
...@@ -264,7 +261,7 @@ this.$emit('handleExport') ...@@ -264,7 +261,7 @@ this.$emit('handleExport')
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
@import '@/styles/variables.scss'; @import '@/styles/variables.scss';
.search-form { .search-form {
padding: 18px 0 0 0; padding: 18px 0 0 0;
...@@ -324,7 +321,7 @@ this.$emit('handleExport') ...@@ -324,7 +321,7 @@ this.$emit('handleExport')
.el-select { .el-select {
width: 215px; width: 215px;
} }
.el-select>.el-input{ .el-select > .el-input {
width: 215px; width: 215px;
} }
.el-form-item__content { .el-form-item__content {
......
...@@ -15,14 +15,6 @@ import '@/components' ...@@ -15,14 +15,6 @@ import '@/components'
// import 'glsx-components/dist/glsx-components.css' // import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup' import { start } from '@/setup'
import { setMinHeight } from '@/common/constant' import { setMinHeight } from '@/common/constant'
import VueAMap from 'vue-amap'
Vue.use(VueAMap)
// 初始化vue-amap
VueAMap.initAMapApiLoader({
key: 'bd290dc27d0945959280753215ddda71', // 这里写你申请的高德地图的key
plugin: ['AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.Geolocation'],
v: '1.4.15'
})
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$apis = apis Vue.prototype.$apis = apis
Vue.prototype.size = 'small' Vue.prototype.size = 'small'
......
...@@ -350,6 +350,12 @@ const staticRoutes = Object.freeze([ ...@@ -350,6 +350,12 @@ const staticRoutes = Object.freeze([
path: '/seckillActivity/browseList', path: '/seckillActivity/browseList',
component: resolve => require([`@/views/seckillActivity/browseList.vue`], resolve), component: resolve => require([`@/views/seckillActivity/browseList.vue`], resolve),
meta: {} meta: {}
},
{
name: 'dataBoard',
path: '/seckillActivity/dataBoard',
component: resolve => require([`@/views/seckillActivity/dataBoard.vue`], resolve),
meta: {}
} }
]) ])
export default staticRoutes export default staticRoutes
...@@ -48,14 +48,14 @@ ...@@ -48,14 +48,14 @@
<div class="detail-modular"> <div class="detail-modular">
<div class="title">客户详情</div> <div class="title">客户详情</div>
<div class="detail-info"> <div class="detail-info">
<el-menu :default-active="customIndex" class="el-menu-demo" mode="horizontal" @select="handleCustomSelect"> <el-menu :default-active="customIndex" class="el-menu-demo" mode="horizontal" @select="handleCustomSelect" infinite-scroll-distance="10">
<el-menu-item index>全部</el-menu-item> <el-menu-item index>全部</el-menu-item>
<el-menu-item index="1">已送达客户</el-menu-item> <el-menu-item index="1">已送达客户</el-menu-item>
<el-menu-item index="0">未送达客户</el-menu-item> <el-menu-item index="0">未送达客户</el-menu-item>
<el-menu-item index="2">客户送达失败</el-menu-item> <el-menu-item index="2">客户送达失败</el-menu-item>
</el-menu> </el-menu>
<div class="detail-total">共 {{ customerlist.length || 0 }} 人</div> <div class="detail-total">共 {{ customerCount || 0 }} 人</div>
<div v-if="customerlist.length != 0" class="info-list"> <div v-if="customerCount != 0" class="info-list" v-infinite-scroll="customerDetailLoad" immediate-check="false">
<div class="info-item" v-for="item in customerlist" :key="item.id"> <div class="info-item" v-for="item in customerlist" :key="item.id">
<img class="info-avatar" :src="item.avatar ? item.avatar : require('@/assets/guestCustom/default-avatar.png')" alt /> <img class="info-avatar" :src="item.avatar ? item.avatar : require('@/assets/guestCustom/default-avatar.png')" alt />
<div class="info-content info-custom"> <div class="info-content info-custom">
...@@ -108,7 +108,14 @@ export default { ...@@ -108,7 +108,14 @@ export default {
eventBus: new Vue(), eventBus: new Vue(),
isDisabled: false, isDisabled: false,
footerLeft: 0, footerLeft: 0,
footerWidth: 0 footerWidth: 0,
// 客户详情分页
customerPage: {
pageSize: 10,
pageNum: 1
},
// 客户详情总数
customerCount: 0
} }
}, },
mounted() { mounted() {
...@@ -126,8 +133,19 @@ export default { ...@@ -126,8 +133,19 @@ export default {
this.activeIndex = val this.activeIndex = val
this.getStaffList(val) this.getStaffList(val)
}, },
// 客户详情选择切换
handleCustomSelect(val) { handleCustomSelect(val) {
this.customIndex = val this.customIndex = val
this.customerlist = []
// 获取滑动高度清0,防止tab切换时记录滚动条位置问题
var scrolltopList = document.querySelectorAll('.info-list')
if (scrolltopList) {
scrolltopList[1] ? (scrolltopList[1].scrollTop = 0) : ''
}
this.customerPage = {
pageSize: 10,
pageNum: 1
}
this.getCustomerList(val) this.getCustomerList(val)
}, },
remind(data, index) { remind(data, index) {
...@@ -163,10 +181,28 @@ export default { ...@@ -163,10 +181,28 @@ export default {
this.employeelist = res ? res : [] this.employeelist = res ? res : []
}) })
}, },
// 客户详情下拉加载
customerDetailLoad() {
// 详情列表有数据时才触发
if (this.customerlist.length > 0) {
this.customerPage.pageNum++
// 详情数组数量小于总数才触发,带上切换的tab值
if (this.customerlist.length < this.customerCount) this.getCustomerList(this.customIndex)
}
},
// 获取客户详情列表
getCustomerList(status = null) { getCustomerList(status = null) {
const id = this.$route.params.id const id = this.$route.params.id
this.$apis.customerTransform.customerDetailList({ id, status }).then(res => { var params = JSON.parse(JSON.stringify(this.customerPage))
this.customerlist = res ? res : [] params.status = status
params.id = id
this.$apis.customerTransform.customerDetailList(params).then(res => {
this.customerCount = res.count
if (!res.data.length) {
this.customerlist = []
return
}
this.customerlist.push(...res.data)
}) })
}, },
remindUserGroup() { remindUserGroup() {
...@@ -276,7 +312,7 @@ export default { ...@@ -276,7 +312,7 @@ export default {
margin-top: 0; margin-top: 0;
margin-left: 10px; margin-left: 10px;
&.send { &.send {
width: 70px; width: 80px;
} }
span { span {
vertical-align: middle; vertical-align: middle;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<i class="el-icon-refresh-right"></i> <i class="el-icon-refresh-right"></i>
<span style="margin-right: 8px;">更新数据</span> <span style="margin-right: 8px;">更新数据</span>
</div> </div>
<span style="color: #999;" v-if="time">更新于 {{time}}</span> <span style="color: #999;" v-if="time">更新于 {{ time }}</span>
</div> </div>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
<i class="el-icon-refresh-right"></i> <i class="el-icon-refresh-right"></i>
<span style="margin-right: 8px;">更新数据</span> <span style="margin-right: 8px;">更新数据</span>
</div> </div>
<span style="color: #999;" v-if="times">更新于 {{times}}</span> <span style="color: #999;" v-if="times">更新于 {{ times }}</span>
</div> </div>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
...@@ -97,8 +97,8 @@ export default { ...@@ -97,8 +97,8 @@ export default {
} }
return { return {
timeId: Function, timeId: Function,
time:'', time: '',
times:'', times: '',
ATT_TYPE, ATT_TYPE,
activeIndex: 1, activeIndex: 1,
// 表格按钮 // 表格按钮
...@@ -336,9 +336,10 @@ export default { ...@@ -336,9 +336,10 @@ export default {
}, },
mounted() { mounted() {
// this.wxTips() // this.wxTips()
this.refreshData(this.activeIndex)
}, },
watch: { watch: {
activeIndex (newVal,oldVal) { activeIndex(newVal, oldVal) {
if (newVal == 2) { if (newVal == 2) {
this.times = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss') this.times = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
} else if (newVal == 1) { } else if (newVal == 1) {
...@@ -354,11 +355,11 @@ export default { ...@@ -354,11 +355,11 @@ export default {
clearTimeout(this.timeId) clearTimeout(this.timeId)
this.timeId = setTimeout(() => { this.timeId = setTimeout(() => {
this.$apis.customerTransform.renewDetailList({}).then(res => { this.$apis.customerTransform.renewDetailList({}).then(res => {
if(res.code == '0'){ if (res.code == '0') {
if(type == 1) { if (type == 1) {
this.time = res.data.createdTime this.time = res.data.createdTime
this.$refs.customer.refreshTable() this.$refs.customer.refreshTable()
} else if(type == 2) { } else if (type == 2) {
this.times = res.data.createdTime this.times = res.data.createdTime
this.$refs.customerGroup.refreshTable() this.$refs.customerGroup.refreshTable()
} }
...@@ -495,12 +496,13 @@ export default { ...@@ -495,12 +496,13 @@ export default {
color: #999; color: #999;
margin-left: 20px; margin-left: 20px;
} }
.renew,.renews { .renew,
.renews {
display: flex; display: flex;
position: absolute; position: absolute;
right: 44px; right: 44px;
font-size: 14px; font-size: 14px;
color: #5850FF color: #5850ff;
} }
} }
} }
......
...@@ -66,10 +66,10 @@ ...@@ -66,10 +66,10 @@
<el-radio :label="2">指定车架号后6位</el-radio> <el-radio :label="2">指定车架号后6位</el-radio>
</el-radio-group> </el-radio-group>
<div :style="{ 'margin-left': defaultLabelWidth }"> <div :style="{ 'margin-left': defaultLabelWidth }">
<el-input :style="editForm.receiveRule === 4?'margin-top: -22px;margin-left: 8px;':''" @blur="formatPhone" type="textarea" v-model="phone" :placeholder="placeholder"></el-input> <el-input :style="editForm.receiveRule === 4 ? 'margin-top: -22px;margin-left: 8px;' : ''" @blur="formatPhone" type="textarea" v-model="phone" :placeholder="placeholder"></el-input>
<p v-if="editForm.receiveRule !== 4" class="approval-tip">客户需准确输入该{{ receiveWay == 1 ? '手机号码' : '车架号后6位' }}才能成功领取</p> <p v-if="editForm.receiveRule !== 4" class="approval-tip">客户需准确输入该{{ receiveWay == 1 ? '手机号码' : '车架号后6位' }}才能成功领取</p>
<div :style="editForm.receiveRule === 4 ? 'margin-left: 7px;' : ''"> <div :style="editForm.receiveRule === 4 ? 'margin-left: 7px;' : ''">
<div :class="['tel-item', !item.valid ? 'valid-tel': receiveWay == 1?'realTel':'realNum']" v-for="(item, index) in phoneList" :key="index"> <div :class="['tel-item', !item.valid ? 'valid-tel' : receiveWay == 1 ? 'realTel' : 'realNum']" v-for="(item, index) in phoneList" :key="index">
{{ item.tel }} {{ item.tel }}
<i style="cursor:pointer" class="el-icon-close" @click="delPhone(item.tel)"></i> <i style="cursor:pointer" class="el-icon-close" @click="delPhone(item.tel)"></i>
</div> </div>
...@@ -130,7 +130,18 @@ ...@@ -130,7 +130,18 @@
<el-button type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button> <el-button type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button>
</GLFooter> </GLFooter>
<select-gift-dialog v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedGiftList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog> <select-gift-dialog v-if="isSelectGiftVisible" :isSelectGiftVisible="isSelectGiftVisible" :selectedGiftList="selectedGiftList" @handleGiftConfirm="handleGiftConfirm" @handleGiftClose="handleGiftClose"></select-gift-dialog>
<select-staff-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :searchForm="searchStaffForm" :selectedStaffList="selectedStaffList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose"></select-staff-dialog> <select-staff-dialog ref="staffDialog" :searchForm="tableSearchForm" v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :selectedStaffList="selectedStaffList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose">
<div slot="search">
<el-form class="search-staff" :inline="true" :model="tableSearchForm">
<el-form-item size="small" label="员工">
<el-input clearable v-model.trim="tableSearchForm.staffName" placeholder="请输入员工姓名"></el-input>
</el-form-item>
<el-form-item size="small" class="emp-form-btn">
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
</div>
</select-staff-dialog>
</div> </div>
</template> </template>
<script> <script>
...@@ -144,6 +155,7 @@ export default { ...@@ -144,6 +155,7 @@ export default {
phone: '', phone: '',
isLoaded: true, isLoaded: true,
loading: false, loading: false,
tableSearchForm: { staffName: '' },
phoneList: [], phoneList: [],
size: 'small', size: 'small',
title: '新增礼包', title: '新增礼包',
...@@ -153,7 +165,6 @@ export default { ...@@ -153,7 +165,6 @@ export default {
}, },
// 选择员工弹窗 // 选择员工弹窗
isMutiSelectVisible: false, isMutiSelectVisible: false,
searchStaffForm: {},
selectedStaffList: [], selectedStaffList: [],
// 选择定向礼包弹窗 // 选择定向礼包弹窗
isSelectGiftVisible: false, isSelectGiftVisible: false,
...@@ -290,13 +301,13 @@ export default { ...@@ -290,13 +301,13 @@ export default {
label: '库存数量', label: '库存数量',
name: 'stock', name: 'stock',
addHtml: 'stockNumInput', addHtml: 'stockNumInput',
isHide: false, isHide: false
}, },
{ {
label: '审批要求', label: '审批要求',
name: 'approveFlag', name: 'approveFlag',
addHtml: 'approvalSlot', addHtml: 'approvalSlot',
isHide: false, isHide: false
}, },
{ {
label: '领取规则设置', label: '领取规则设置',
...@@ -328,7 +339,7 @@ export default { ...@@ -328,7 +339,7 @@ export default {
} }
], ],
suffixSlot: 'configSlot', suffixSlot: 'configSlot',
handleRadioChange: (e) => { handleRadioChange: e => {
if (e == 4) { if (e == 4) {
this.receiveWay = 1 this.receiveWay = 1
} }
...@@ -369,7 +380,7 @@ export default { ...@@ -369,7 +380,7 @@ export default {
label: '发放员工', label: '发放员工',
name: 'staffList', name: 'staffList',
addHtml: 'selectStaffBtn', addHtml: 'selectStaffBtn',
isHide: false, isHide: false
}, },
{ {
label: '', label: '',
...@@ -429,7 +440,7 @@ export default { ...@@ -429,7 +440,7 @@ export default {
this.editForm.staffList = [] this.editForm.staffList = []
this.editForm.stock = 1 this.editForm.stock = 1
} }
}, }
}, },
computed: { computed: {
placeholder() { placeholder() {
...@@ -454,6 +465,10 @@ export default { ...@@ -454,6 +465,10 @@ export default {
} }
}, },
methods: { methods: {
//员工查询
handleSearch() {
this.$refs?.staffDialog?.getList({}, true)
},
resetTextArea() { resetTextArea() {
this.phone = '' this.phone = ''
this.phoneList = [] this.phoneList = []
...@@ -616,6 +631,7 @@ export default { ...@@ -616,6 +631,7 @@ export default {
}, },
handleMutiSelectClose() { handleMutiSelectClose() {
this.isMutiSelectVisible = !this.isMutiSelectVisible this.isMutiSelectVisible = !this.isMutiSelectVisible
this.tableSearchForm.staffName = ''
}, },
handleMutiSelectConfirm(selectedData) { handleMutiSelectConfirm(selectedData) {
this.editForm.staffList = [] this.editForm.staffList = []
...@@ -694,7 +710,7 @@ export default { ...@@ -694,7 +710,7 @@ export default {
lock: true, lock: true,
text: '正在Loading···', text: '正在Loading···',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)', background: 'rgba(0, 0, 0, 0.3)',
customClass: 'loadingClass' customClass: 'loadingClass'
}) })
this.$apis.giftBag this.$apis.giftBag
...@@ -728,7 +744,7 @@ export default { ...@@ -728,7 +744,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => { }) .catch(() => {})
} else { } else {
this.cancelJump() this.cancelJump()
} }
...@@ -976,4 +992,9 @@ export default { ...@@ -976,4 +992,9 @@ export default {
} }
} }
} }
.search-staff {
.el-form-item {
margin-right: 20px;
}
}
</style> </style>
<!-- 选择员工弹窗 --> <!-- 选择员工弹窗 -->
<template> <template>
<GLDialog class="muti-pro" bigTitle="选择员工" mode="big" :before-close="handleMutiSelectClose" :visible.sync="isMutiSelectVisible" @onOk="handleMutiSelectConfirm" @onCancel="handleMutiSelectClose" v-loading="loading"> <GLDialog class="muti-pro" :close-on-click-modal="false" bigTitle="选择员工" mode="big" :before-close="handleMutiSelectClose" :visible.sync="isMutiSelectVisible" @onOk="handleMutiSelectConfirm" @onCancel="handleMutiSelectClose" v-loading="loading">
<div class="noproDiv" v-show="!staffList.length && fnCallBack"> <!-- <div class="noproDiv" v-show="!staffList.length && fnCallBack">
<img src="@/assets/noPro.png" /> <img src="@/assets/noPro.png" />
<p class="noproP">系统暂无已创建的员工</p> <p class="noproP">系统暂无已创建的员工</p>
</div> </div> -->
<div v-show="staffList.length"> <div>
<slot name="search"></slot> <slot name="search"></slot>
<GLTable v-loading="loading" ref="mutiProRef" :tableData="staffList" :pageConf="pageConf" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList"></GLTable> <GLTable v-loading="loading" ref="mutiProRef" :tableData="staffList" :pageConf="pageConf" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList"></GLTable>
</div> </div>
...@@ -25,6 +25,9 @@ export default { ...@@ -25,6 +25,9 @@ export default {
fnCallBack: false, fnCallBack: false,
url: url, url: url,
loading: true, loading: true,
tableSearchForm: {
staffName: ''
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数 // 表格参数
tableParams: { tableParams: {
...@@ -58,7 +61,7 @@ export default { ...@@ -58,7 +61,7 @@ export default {
}, },
searchForm: { searchForm: {
type: Object, type: Object,
default: () => { } default: () => {}
}, },
selectedStaffList: { selectedStaffList: {
type: Array, type: Array,
...@@ -69,7 +72,7 @@ export default { ...@@ -69,7 +72,7 @@ export default {
mounted() { mounted() {
this.userInfo = this.$globalState.session this.userInfo = this.$globalState.session
this.selectList = JSON.parse(JSON.stringify(this.selectedStaffList)) this.selectList = JSON.parse(JSON.stringify(this.selectedStaffList))
this.selectList.map(item => item.userOneId = item.staffUUID) this.selectList.map(item => (item.userOneId = item.staffUUID))
this.getList({}, true) this.getList({}, true)
}, },
...@@ -102,7 +105,6 @@ export default { ...@@ -102,7 +105,6 @@ export default {
this.selectedStaffList.forEach(row => { this.selectedStaffList.forEach(row => {
row.userOneId = row.staffUUID row.userOneId = row.staffUUID
this.$nextTick(() => { this.$nextTick(() => {
let idx = this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.userOneId == row.staffUUID) let idx = this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.userOneId == row.staffUUID)
if (idx > -1) { if (idx > -1) {
try { try {
......
...@@ -147,14 +147,12 @@ export default { ...@@ -147,14 +147,12 @@ export default {
} }
}, },
mounted() { mounted() {
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
// this.updateList(this.previewList) // this.updateList(this.previewList)
// obj.init('video') // obj.init('video')
}, },
methods: { methods: {
handleImgChange(e, targetItem) { handleImgChange(e, targetItem) {
var reader = new FileReader() var reader = new FileReader()
var file = e.srcElement.files[0] var file = e.srcElement.files[0]
...@@ -170,12 +168,10 @@ export default { ...@@ -170,12 +168,10 @@ export default {
var image = new Image() var image = new Image()
image.src = e.target.result image.src = e.target.result
image.onload = () => { image.onload = () => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
this.previewList.push({ this.previewList.push({
attType: ATT_TYPE.IMAGE, attType: ATT_TYPE.IMAGE,
attContent: res attContent: res
...@@ -198,10 +194,9 @@ export default { ...@@ -198,10 +194,9 @@ export default {
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = e => { reader.onload = e => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
this.previewList.push({ this.previewList.push({
attType: ATT_TYPE.VEDIO, attType: ATT_TYPE.VEDIO,
attContent: res attContent: res
...@@ -227,11 +222,10 @@ export default { ...@@ -227,11 +222,10 @@ export default {
image.src = e.target.result image.src = e.target.result
image.onload = () => { image.onload = () => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$set(this.appletForm, 'picUrl', 'dfasdfasfa') this.$set(this.appletForm, 'picUrl', 'dfasdfasfa')
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
this.$set(this.appletForm, 'picUrl', res) this.$set(this.appletForm, 'picUrl', res)
} }
}) })
...@@ -239,7 +233,6 @@ export default { ...@@ -239,7 +233,6 @@ export default {
} }
}, },
switchDailog(funName) { switchDailog(funName) {
if (funName == 'link') { if (funName == 'link') {
this.dialogTitle = '添加网页消息' this.dialogTitle = '添加网页消息'
} else if (funName == 'applet') { } else if (funName == 'applet') {
...@@ -253,7 +246,6 @@ export default { ...@@ -253,7 +246,6 @@ export default {
case '添加网页消息': case '添加网页消息':
this.$refs.linkForm.validate(valid => { this.$refs.linkForm.validate(valid => {
if (valid) { if (valid) {
this.previewList.push({ this.previewList.push({
attType: ATT_TYPE.URL, attType: ATT_TYPE.URL,
attContent: this.linkForm attContent: this.linkForm
...@@ -264,16 +256,13 @@ export default { ...@@ -264,16 +256,13 @@ export default {
// this.linkForm = {} // this.linkForm = {}
// this.$refs.linkForm.clearValidate() // this.$refs.linkForm.clearValidate()
} else { } else {
return false return false
} }
}) })
break break
case '添加小程序': case '添加小程序':
this.$refs.appletForm.validate(valid => { this.$refs.appletForm.validate(valid => {
if (valid) { if (valid) {
this.previewList.push({ this.previewList.push({
attType: ATT_TYPE.MINIPROGRAM, attType: ATT_TYPE.MINIPROGRAM,
attContent: this.appletForm attContent: this.appletForm
...@@ -283,23 +272,19 @@ export default { ...@@ -283,23 +272,19 @@ export default {
// this.appletForm = {} // this.appletForm = {}
// this.$refs.appletForm.clearValidate() // this.$refs.appletForm.clearValidate()
} else { } else {
return false return false
} }
}) })
break break
default: default:
} }
}, },
close(index) { close(index) {
// this.previewList // this.previewList
this.previewList.splice(index, 1) this.previewList.splice(index, 1)
this.eventBus.$emit('update', this.previewList) this.eventBus.$emit('update', this.previewList)
}, },
textInput(val) { textInput(val) {
const hasText = this.previewList.some(item => item.attType == 1) const hasText = this.previewList.some(item => item.attType == 1)
if (hasText) { if (hasText) {
...@@ -313,7 +298,6 @@ export default { ...@@ -313,7 +298,6 @@ export default {
attType: ATT_TYPE.TEXT attType: ATT_TYPE.TEXT
}) })
} }
}, },
closeDialog() { closeDialog() {
if (this.dialogVisible) { if (this.dialogVisible) {
......
...@@ -407,7 +407,7 @@ export default { ...@@ -407,7 +407,7 @@ export default {
.border { .border {
padding: 20px; padding: 20px;
background: #ffffff; background: #ffffff;
box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1); // box-shadow: 0px 10px 20px 0px rgba(88, 80, 255, 0.1);
} }
.orange { .orange {
......
...@@ -420,7 +420,8 @@ export default { ...@@ -420,7 +420,8 @@ export default {
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = e => { reader.onload = e => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] // const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
const base64 = file.name.slice(-3) + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
this.pdfUrl = res this.pdfUrl = res
...@@ -448,7 +449,7 @@ export default { ...@@ -448,7 +449,7 @@ export default {
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = e => { reader.onload = e => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
// console.log(res) // console.log(res)
......
...@@ -19,6 +19,10 @@ export default { ...@@ -19,6 +19,10 @@ export default {
excludeMenus: { excludeMenus: {
type: Array, type: Array,
default: () => ['code'] default: () => ['code']
},
boxHeight:{
type: Number,
default: 240
} }
}, },
mounted() { mounted() {
...@@ -31,7 +35,7 @@ export default { ...@@ -31,7 +35,7 @@ export default {
this.editor.config.uploadImgShowBase64 = true this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down' this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = 400 this.editor.config.height = this.boxHeight
this.editor.config.width = 500 this.editor.config.width = 500
this.editor.config.excludeMenus = this.excludeMenus this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = html => { this.editor.config.onchange = html => {
...@@ -43,7 +47,7 @@ export default { ...@@ -43,7 +47,7 @@ export default {
this.$emit('focus') this.$emit('focus')
} }
// 上传图片 // 上传图片
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) { this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
var file = resultFiles[0] var file = resultFiles[0]
var reader = new FileReader() var reader = new FileReader()
// 默认1MB // 默认1MB
...@@ -56,7 +60,7 @@ export default { ...@@ -56,7 +60,7 @@ export default {
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = e => { reader.onload = e => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => { _this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
// console.log(res) // console.log(res)
...@@ -69,7 +73,7 @@ export default { ...@@ -69,7 +73,7 @@ export default {
} }
} }
// 上传视频 // 上传视频
this.editor.config.customUploadVideo = function (resultFiles, insertVideoFn) { this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) {
var file = resultFiles[0] var file = resultFiles[0]
var reader = new FileReader() var reader = new FileReader()
// 默认1MB // 默认1MB
...@@ -82,7 +86,7 @@ export default { ...@@ -82,7 +86,7 @@ export default {
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = e => { reader.onload = e => {
const videoFile = e.target.result const videoFile = e.target.result
const base64 = file.name.split('.')[1] + '@' + videoFile.split(',')[1] const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + videoFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => { _this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
// console.log(res) // console.log(res)
...@@ -112,7 +116,7 @@ export default { ...@@ -112,7 +116,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
#div-demo { #div-demo {
margin: 16px 300px 0 0; // margin: 16px 300px 0 0;
} }
.el-form .editor { .el-form .editor {
margin-top: 20px; margin-top: 20px;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
</span> </span>
<div class="container"> <div class="container">
<div class="search-form"> <div class="search-form">
<GLCombiForm ref="showSearch" :rowNumber="2" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm> <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
</div> </div>
<div class="tabelList"> <div class="tabelList">
<el-row> <el-row>
......
<!-- 浏览明细 --> <!-- 明细 -->
<template> <template>
<div class="edit-share marketing edit-box"> <div class="edit-share marketing edit-box">
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">{{ routeInfo.activityName }}</p> <p class="edit-title">{{ routeInfo.activityName }}</p>
<div class="p-20"> <div class="p-20">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent"> <div class="flex m-b-10 w-100-percent">
<span class="table-title"></span> <div class="table-title">
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button> 已累计<template v-if="routeInfo.type != 2">{{decodeURI(routeInfo.name)}}</template>
<span>{{routeInfo.count || 0}}</span>
{{routeInfo.type == 2?'位访客':'次'}}
</div>
<el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="browserRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable
<div slot="customerName" class="flex-align" slot-scope="scope"> ref="browserRef"
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block"> :getListApi="getListApi"
<img class="table-popover-img" :src="scope.scope.customerAvatar" /> :noDataImg="url"
<img class="img-36 pointer" slot="reference" :src="scope.scope.customerAvatar" /> :searchForm="searchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div
slot="customerName"
class="flex-align"
slot-scope="scope"
>
<template v-if="scope.scope.customerAvatar">
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.customerAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.customerAvatar"
/>
</el-popover> </el-popover>
</template>
<span class="m-l-10">{{ scope.scope.customerName }}</span> <span class="m-l-10">{{ scope.scope.customerName }}</span>
</div> </div>
<div slot="shareName" class="flex-align" slot-scope="scope"> <div
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block"> slot="shareName"
<img class="table-popover-img" :src="scope.scope.shareAvatar" /> class="flex-align"
<img class="img-36 pointer" slot="reference" :src="scope.scope.shareAvatar" /> slot-scope="scope"
>
<template v-if="scope.scope.shareAvatar">
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.shareAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.shareAvatar"
/>
</el-popover> </el-popover>
</template>
<span class="m-l-10">{{ scope.scope.shareName }}</span> <span class="m-l-10">{{ scope.scope.shareName }}</span>
<span class="m-l-10">{{ scope.scope.sharePhone }}</span>
</div>
<div
slot="isBuy"
slot-scope="scope"
>
<span :class="['table-circle', 'm-r-8', scope.scope.isBuy == 'Y' ?'back-green': 'back-grey']"></span>
<span>{{{
'Y':'已付款',
'N':'未付款'
}[scope.scope.isBuy] || '--'}}</span>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
</div> </div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div
<el-button type="default" @click="handleJump">返回</el-button> class="footer"
:style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type="default"
@click="handleJump"
>返回</el-button>
</div> </div>
</div> </div>
</template> </template>
...@@ -44,7 +122,7 @@ import url from '@/assets/empty.png' ...@@ -44,7 +122,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant' import { exportFn } from '@/common/constant'
export default { export default {
name: 'browseList', name: 'browseList',
data() { data () {
return { return {
size: 'small', size: 'small',
url: url, url: url,
...@@ -72,15 +150,21 @@ export default { ...@@ -72,15 +150,21 @@ export default {
name: 'mobile', name: 'mobile',
type: 'input', type: 'input',
maxlength: 11 maxlength: 11
},
{
label: '分享人',
name: 'shareName',
type: 'input',
maxlength: 50
} }
], ],
// 表格 // 表格
getListApi: this.$apis.seckillActivity.getBrowseListApi, getListApi: null,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableColumns: [ tableColumns: [
{ {
label: '微信名称', label: '微信昵称',
prop: 'customerName', prop: 'customerName',
addHtml: 'customerName' addHtml: 'customerName'
}, },
...@@ -89,66 +173,133 @@ export default { ...@@ -89,66 +173,133 @@ export default {
prop: 'mobile' prop: 'mobile'
}, },
{ {
label: '来源', label: '分享人',
prop: 'shareName', prop: 'shareName',
addHtml: 'shareName' addHtml: 'shareName',
width: 230
}, },
]
}
}
},
created () {
const lastTableColumns = [
{ {
label: '浏览次数', label: '浏览时长',
prop: 'browseCount' prop: 'browserTime',
}, },
{ {
label: '浏览时间', label: '进入页面时间',
prop: 'lastBrowseDate', prop: 'operationDate',
width: '180' width: '180'
},
{
label: '离开页面时间',
prop: 'leaveDate',
width: '180'
},
{
label: '订单状态',
prop: 'isBuy',
addHtml: 'isBuy'
} }
] ], {
} query
} } = this.$route,
name = {
1: '浏览',
2: '访客',
3: '分享',
}[query.type],
[url] = window.location.href.split('%24title')
query.name = name
this.routeInfo = query
this.getListApi = this.$apis.seckillActivity[{
1: 'getBrowseListApi',
2: 'getVisitorListApi',
3: 'getSharedListApi'
}[query.type]]
history.replaceState(null, null, `${url}&$title=${name}明细`)
// listName:
//1 浏览 2 访客 3 分享
if (query.type != 2) {
this.searchFormData.push({
label: '订单状态',
name: 'isBuy',
type: 'select',
width: '215px',
optionList: [
{
confId: '',
confName: '全部'
}, },
{
confId: 'Y',
confName: '已付款'
},
{
confId: 'N',
confName: '未付款'
}
],
optionId: 'confId',
optionLabel: 'confName',
})
if (query.type == 3) this.tableParams.tableColumns.push({
label: '分享时间',
prop: 'sharedTime',
})
this.tableParams.tableColumns = [...this.tableParams.tableColumns, ...lastTableColumns]
} else this.tableParams.tableColumns = [...this.tableParams.tableColumns, {
label: '浏览次数',
prop: 'browseCount',
}, {
label: '最后浏览时间',
prop: 'lastBrowseDate',
}]
created() {
this.routeInfo = this.$route.query
}, },
mounted() { mounted () {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
}, },
methods: { methods: {
beforeSearchFn() { beforeSearchFn () {
return new Promise(resolve => { return new Promise(resolve => {
this.searchForm.activityId = this.routeInfo.id this.searchForm.activityId = this.routeInfo.id
resolve() resolve()
}) })
}, },
handleExport () {
handleExport() {
var params = this.$common.utils.deepClone(this.searchForm) var params = this.$common.utils.deepClone(this.searchForm)
let { type } = this.routeInfo
params.pageNum = 1 params.pageNum = 1
params.pageSize = 999999 params.pageSize = 999999
this.$apis.seckillActivity.exportBrowseApi(params).then(res => { this.$apis.seckillActivity.exportBrowseApi(params, type).then(res => {
exportFn(res) exportFn(res)
}) })
}, },
handleJump(path, row = {}) { handleJump (path, row = {}) {
this.$router.push({ this.$router.push({
path: '/seckillActivity/crowdFundList' path: '/seckillActivity/crowdFundList'
}) })
}, },
setTableFinishFun() { setTableFinishFun () {
//接收到的数据为空 //接收到的数据为空
this.$refs.browserRef.data.length ? (this.$refs.browserRef.tableHeightValues = '') : this.$refs.browserRef.setTableHeightFun() this.$refs.browserRef.data.length ? (this.$refs.browserRef.tableHeightValues = '') : this.$refs.browserRef.setTableHeightFun()
}, },
handleSearch() { handleSearch () {
this.$refs.browserRef.refreshTable() this.$refs.browserRef.refreshTable()
}, },
handleReset() { handleReset () {
this.searchForm = { this.searchForm = {
activityId: this.routeInfo.id, activityId: this.routeInfo.id,
customerName: '', customerName: '',
...@@ -160,4 +311,18 @@ export default { ...@@ -160,4 +311,18 @@ export default {
} }
</script> </script>
<style scoped></style> <style scoped lang="scss">
.edit-container {
.table-title {
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 20px;
display: flex;
align-items: center;
span {
color: #5850ff;
}
}
}
</style>
...@@ -2,36 +2,103 @@ ...@@ -2,36 +2,103 @@
<template> <template>
<div class="marketing"> <div class="marketing">
<div class="m-b-20"> <div class="m-b-20">
<GLButton :size="size" class="default-blue-btn el-icon-plus" type="default" @click="handleEdit('add')" fn="新增众筹" mode="el-button">新建众筹</GLButton> <GLButton
<el-button :size="size" type="default" class="default-blue-btn" @click="handleJump">订单管理</el-button> :size="size"
class="default-blue-btn el-icon-plus"
type="default"
@click="handleEdit('add')"
fn="新增众筹"
mode="el-button"
>新建众筹</GLButton>
<el-button
:size="size"
type="default"
class="default-blue-btn"
@click="handleJump"
>订单管理</el-button>
</div> </div>
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent"> <div class="flex m-b-10 w-100-percent">
<span class="table-title"></span> <span class="table-title"></span>
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button> <el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="activity" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable
<div slot="activityImg" class="table-image" slot-scope="scope"> ref="activity"
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block"> :getListApi="getListApi"
<img class="table-popover-img" :src="scope.scope.activityImg" /> :noDataImg="url"
<img class="img-60 pointer" slot="reference" :src="scope.scope.activityImg" /> :searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div
slot="activityImg"
class="table-image"
slot-scope="scope"
>
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.activityImg"
/>
<img
class="img-60 pointer"
slot="reference"
:src="scope.scope.activityImg"
/>
</el-popover> </el-popover>
</div> </div>
<div slot="viewAmount" slot-scope="scope"> <div
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.viewAmount || 0 }}</p> slot="linkText"
slot-scope="scope"
>
<p
class="cursor-pointer"
@click="handleDetail(scope)"
>{{scope.scope[scope.prop] || 0}}</p>
</div> </div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton> class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<!-- 分享 --> <!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog> <share-dialog
:isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"
></share-dialog>
</div> </div>
</template> </template>
...@@ -42,7 +109,7 @@ import url from '@/assets/empty.png' ...@@ -42,7 +109,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant' import { exportFn } from '@/common/constant'
export default { export default {
name: 'crowdFundList', name: 'crowdFundList',
data() { data () {
return { return {
size: 'small', size: 'small',
url: url, url: url,
...@@ -69,7 +136,7 @@ export default { ...@@ -69,7 +136,7 @@ export default {
maxlength: 20 maxlength: 20
}, },
{ {
label: '状态', label: '活动状态',
name: 'activityStatus', name: 'activityStatus',
type: 'select', type: 'select',
width: '215px', width: '215px',
...@@ -162,6 +229,36 @@ export default { ...@@ -162,6 +229,36 @@ export default {
listeners: { listeners: {
click: this.handleShare click: this.handleShare
} }
},
{
type: 'el-button',
name: '复制',
attrs: {
type: 'text'
},
listeners: {
click: row => {
this.handleEdit('copy', row)
}
}
},
{
type: 'GLButton',
name: '数据看板',
attrs: {
type: 'text',
fn: '数据看板'
},
listeners: {
click: row => {
this.$router.push({
path: '/seckillActivity/dataBoard',
query: {
activityId: row.id
}
})
}
}
} }
], ],
// 表格 // 表格
...@@ -183,7 +280,7 @@ export default { ...@@ -183,7 +280,7 @@ export default {
{ {
label: '浏览量(次)', label: '浏览量(次)',
prop: 'viewAmount', prop: 'viewAmount',
addHtml: 'viewAmount', addHtml: 'linkText',
width: 140 width: 140
}, },
{ {
...@@ -208,12 +305,14 @@ export default { ...@@ -208,12 +305,14 @@ export default {
} }
}, },
{ {
label: '粉丝', label: '访客',
prop: 'fansAmount' prop: 'fansAmount',
addHtml: 'linkText'
}, },
{ {
label: '分享', label: '分享',
prop: 'shareAmount' prop: 'shareAmount',
addHtml: 'linkText'
}, },
{ {
label: '销量', label: '销量',
...@@ -274,16 +373,16 @@ export default { ...@@ -274,16 +373,16 @@ export default {
shareDialog shareDialog
}, },
mounted() { mounted () {
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
}, },
methods: { methods: {
getParams() { getParams () {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
return params return params
}, },
beforeSearchFn() { beforeSearchFn () {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate // delete this.tableSearchForm.createDate
...@@ -291,13 +390,13 @@ export default { ...@@ -291,13 +390,13 @@ export default {
}) })
}, },
handleJump(path, row = {}) { handleJump (path, row = {}) {
this.$router.push({ this.$router.push({
path: '/orderManage/index' path: '/orderManage/index'
}) })
}, },
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) { secondConfirm (title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, { this.$confirm(txt, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -320,16 +419,16 @@ export default { ...@@ -320,16 +419,16 @@ export default {
}, },
//开始 //开始
start(item) { start (item) {
this.startOrEndConfirm('开始', item) this.startOrEndConfirm('开始', item)
}, },
//结束 //结束
end(item) { end (item) {
this.startOrEndConfirm('结束', item) this.startOrEndConfirm('结束', item)
}, },
startOrEndConfirm(txt, row) { startOrEndConfirm (txt, row) {
var title = txt var title = txt
var params = {} var params = {}
params.id = row.id params.id = row.id
...@@ -342,24 +441,29 @@ export default { ...@@ -342,24 +441,29 @@ export default {
}, },
//置顶 //置顶
topping(row) { topping (row) {
var params = {} var params = {}
params.id = row.id params.id = row.id
this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params) this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params)
}, },
//删除 //删除
del(row) { del (row) {
var params = {} var params = {}
params.id = row.id params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params) this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEdit(addOrEdit, row) { handleEdit (addOrEdit, row) {
var txtObj = {
add: '新建',
edit: '编辑',
copy: '复制'
}[addOrEdit]
var params = { var params = {
addOrEdit: addOrEdit, addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新建众筹活动' : '编辑众筹活动') $title: encodeURI(txtObj + '众筹活动')
} }
if (addOrEdit != 'add') { if (addOrEdit != 'add') {
params.id = row.id params.id = row.id
...@@ -370,37 +474,56 @@ export default { ...@@ -370,37 +474,56 @@ export default {
query: params query: params
}) })
}, },
test (option) {
console.log(JSON.parse(JSON.stringify(option)))
},
// 明细 // 明细
handleDetail(row) { handleDetail ({ prop, scope }) {
let data = {
viewAmount: {
type: 1,
count: scope.viewAmount
},
fansAmount: {
type: 2,
count: scope.fansAmount
},
shareAmount: {
type: 3,
count: scope.shareAmount
}
}[prop]
this.$router.push({ this.$router.push({
path: '/seckillActivity/browseList', path: '/seckillActivity/browseList',
query: { query: {
id: row.id, id: scope.id,
activityName: row.activityName activityName: scope.activityName,
type: data.type,
count: data.count,
} }
}) })
}, },
handleExport() { handleExport () {
var params = this.getParams() var params = this.getParams()
this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => { this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => {
exportFn(res) exportFn(res)
}) })
}, },
handleShare(row) { handleShare (row) {
this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => { this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => {
this.shareForm = res this.shareForm = res
this.handleShareClose() this.handleShareClose()
}) })
}, },
handleShareClose() { handleShareClose () {
this.isShareVisible = !this.isShareVisible this.isShareVisible = !this.isShareVisible
}, },
getOptionsList(formName, hasAll = true, refreshSigle) { getOptionsList (formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle) var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle) var index = this[formName].findIndex(k => k.name == refreshSigle)
...@@ -426,11 +549,11 @@ export default { ...@@ -426,11 +549,11 @@ export default {
} }
}, },
handleSearch() { handleSearch () {
this.$refs.activity.refreshTable() this.$refs.activity.refreshTable()
}, },
handleReset() { handleReset () {
this.searchForm = { this.searchForm = {
activityName: '', activityName: '',
activityStatus: '' activityStatus: ''
...@@ -438,7 +561,7 @@ export default { ...@@ -438,7 +561,7 @@ export default {
this.handleSearch() this.handleSearch()
}, },
setTableFinishFun() { setTableFinishFun () {
//接收到的数据为空 //接收到的数据为空
this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun() this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun()
} }
......
<template>
<div class="marketing data-board">
<div class="data-board-box">
<p class="edit-title">数据看板</p>
<div class="p-20">
<GLCombiForm
ref="dataRef"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
></GLCombiForm>
<div class="data-view">
<template v-for="(item,index) in dataList">
<div
:key="index"
class="item"
>
<div class="name">
{{item.name}}
<el-popover
class="tips"
placement="top"
width="260"
trigger="hover"
:content="item.tips"
>
<img
slot="reference"
class="tips-icon"
src="@/components/glsx-combi-form/images/icon-tip.png"
/>
</el-popover>
</div>
<div class="value">{{dataBoard[item.key] || 0}}</div>
<template v-if="item.half">
<div class="half">
日环比:
<div :class="['icon',
{'up':dataBoard[item.half]>0},
{'down':dataBoard[item.half]<0}
]"></div>
<span class="num">{{Math.abs(dataBoard[item.half]).toFixed(2) || 0}}%</span>
</div>
</template>
</div>
</template>
</div>
</div>
</div>
<div class="data-board-box">
<p class="edit-title">员工排行榜</p>
<div class="p-20">
<GLCombiForm
ref="rankRef"
:rowNumber="1"
:formObj="searchRankForm"
:formData="searchFormRankData"
@handleOk="handleSearchRank"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
</div>
<GLTable
ref="dataTableRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
:hasNum="false"
>
<div
slot="shareName"
class="flex-align"
slot-scope="scope"
>
<template v-if="scope.scope.shareAvatar">
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.shareAvatar"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.shareAvatar"
/>
</el-popover>
</template>
<span class="m-l-10">{{ scope.scope.shareName }}</span>
<span class="m-l-10">{{ scope.scope.sharePhone || '' }}</span>
</div>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import { exportFn } from '@/common/constant'
import url from '@/assets/empty.png'
const dataList = [
{ name: '新增浏览量', key: 'browseCount', tips: '统计时间内,新增页面被浏览的次数(一人多次访问计为多次)', half: 'browseRingRatio' },
{ name: '新增访客数', key: 'fansCount', tips: '统计时间内访问页面的人数(一人多次访问计为一次)', half: 'fansRingRatio' },
{ name: '新增订单数', key: 'orderCount', tips: '统计时间内,新增订单数(只记录已付款的订单)', half: 'orderRingRatio' },
{ name: '累计浏览量', key: 'totalBrowseCount', tips: '页面被浏览的总次数(一人多次访问计为多次)' },
{ name: '累计访客数', key: 'totalFansCount', tips: '访问页面的总人数(一人多次访问计为一次)' },
{ name: '累计订单数', key: 'totalOrderCount', tips: '累计订单总数(只记录已付款的订单)' }
], optionList = [
{ confId: '1', confName: '转发次数' },
{ confId: '2', confName: '访客总数' },
{ confId: '3', confName: '浏览总数' },
{ confId: '4', confName: '成交单量' },
{ confId: '5', confName: '转化率' }
]
export default {
name: 'ScrmMicroMarketingDataBoard',
data () {
return {
url,
dataList,
searchForm: {
statDate: dayjs().format('YYYY-MM-DD')
},
searchFormData: [
{
label: '统计日期',
name: 'statDate',
type: 'datePicker',
dateType: 'date',
pickerOptions: 'beforeRangePickerOptions'
}
],
searchRankForm: {
statDimension: '1'
},
searchFormRankData: [
{
label: '统计维度',
name: 'statDimension',
type: 'select',
width: '215px',
optionList,
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'statusList'
}
],
getListApi: this.$apis.seckillActivity.getRankListApi,
tableSearchForm: {},
tableParams: {
listName: 'list',
tableColumns: [
{
label: '排名',
prop: 'rankNumber',
},
{
label: '员工',
prop: 'shareName',
addHtml: 'shareName',
width: 220
},
{
label: '转发次数',
prop: 'shareCount',
},
{
label: '访客总数',
prop: 'fansCount',
width: 140
},
{
label: '浏览总数',
prop: 'browseCount',
},
{
label: '成交单量',
prop: 'orderCount',
},
{
label: '转化率',
prop: 'conversionRate',
formatter: cellValue => {
return `${cellValue.conversionRate.toFixed(2)}%`
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
dataBoard: {}
}
},
created () {
this.getDataBoardApi()
},
mounted () {
let [dataResetBtn] = this.$refs.dataRef.$el.getElementsByClassName('el-button--default'),
[rankResetBtn] = this.$refs.rankRef.$el.getElementsByClassName('el-button--default')
if (dataResetBtn) dataResetBtn.style.display = 'none'
if (rankResetBtn) rankResetBtn.style.display = 'none'
},
methods: {
getDataBoardApi () {
let { activityId } = this.$route.query,
{ statDate } = this.searchForm
this.$apis.seckillActivity.getDataBoardApi({ activityId, statDimension: dayjs(statDate).format('YYYY-MM-DD') }).then(res => {
this.dataBoard = res || {}
})
},
getParams () {
let { activityId } = this.$route.query,
params = JSON.parse(JSON.stringify(this.searchRankForm))
params.activityId = activityId
return params
},
handleSearch () {
this.getDataBoardApi()
},
handleSearchRank () {
this.$refs.dataTableRef.refreshTable()
},
handleExport () {
let params = this.getParams()
this.$apis.seckillActivity.exportRankListApi(params).then(res => {
exportFn(res)
})
},
beforeSearchFn () {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
setTableFinishFun () {
//接收到的数据为空
this.$refs.dataTableRef.data.length ? (this.$refs.dataTableRef.tableHeightValues = '') : this.$refs.dataTableRef.setTableHeightFun()
}
},
};
</script>
<style lang="scss" scoped>
.data-board {
&-box {
background: #ffffff;
&:last-of-type {
margin-top: 16px;
}
.data-view {
max-width: 854px;
display: flex;
flex-wrap: wrap;
gap: 16px;
padding-bottom: 12px;
.item {
width: 274px;
height: 128px;
background: #f9fafc;
border-radius: 4px;
box-sizing: border-box;
padding: 10px;
.name {
font-size: 14px;
color: #333333;
display: flex;
align-items: center;
height: 21px;
.tips {
margin-left: 4px;
}
}
.value {
padding: 20px 0;
font-size: 26px;
color: #333333;
line-height: 26px;
font-weight: bold;
}
.half {
font-size: 14px;
color: #666666;
line-height: 21px;
display: flex;
align-items: center;
.icon {
width: 16px;
height: 16px;
background-image: url(../../assets/dataBoard/icon-half-default.png);
background-size: 16px 16px;
}
.up {
background-image: url(../../assets/dataBoard/icon-half-up.png);
}
.down {
background-image: url(../../assets/dataBoard/icon-half-down.png);
}
.num {
margin-left: 4px;
}
}
}
}
}
}
</style>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOptions" :default-time="['00:00:00', '23:59:59']" :disabled="isDisabled" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker> <el-date-picker v-model="editForm.activityTime" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" :picker-options="pickerOptions" :default-time="['00:00:00', '23:59:59']" :disabled="isDisabled" @change="e => handleTimeChange(e, scope.scope)"></el-date-picker>
</template> </template>
<div slot="goodsHtml"> <div slot="goodsHtml">
<el-button type="default" class="default-blue-btn el-icon-plus" v-if="apear != 'see'" @click="handleRelateProClose">选择商品</el-button> <el-button type="default" class="default-blue-btn el-icon-plus" v-if="!isDisabled" :disabled="apear == 'see'" @click="handleRelateProClose">选择商品</el-button>
<div v-if="selectedProInfo.id && !specificationDetailList.length" style="margin-top: 10px"> <div v-if="selectedProInfo.id && !specificationDetailList.length" style="margin-top: 10px">
<p> <p>
<img class="img-60" :src="selectedProInfo.goodsImage" /> <img class="img-60" :src="selectedProInfo.goodsImage" />
...@@ -371,6 +371,9 @@ export default { ...@@ -371,6 +371,9 @@ export default {
}, },
getGoodInfo(id) { getGoodInfo(id) {
if (!id) {
this.isDisabled = false
} else {
this.$apis.proManage.getProInfoApi({ id: id }).then(res => { this.$apis.proManage.getProInfoApi({ id: id }).then(res => {
this.selectedProInfo = this.$common.utils.deepClone(res) this.selectedProInfo = this.$common.utils.deepClone(res)
if (this.selectedProInfo.specificationDetailList.length) { if (this.selectedProInfo.specificationDetailList.length) {
...@@ -383,6 +386,7 @@ export default { ...@@ -383,6 +386,7 @@ export default {
this.specificationDetailList = [] this.specificationDetailList = []
} }
}) })
}
}, },
// 规格值解构 // 规格值解构
......
...@@ -160,7 +160,7 @@ export default { ...@@ -160,7 +160,7 @@ export default {
getBaseInfo() { getBaseInfo() {
this.$apis.sop.getSopBaseInfoApi({ sopId: this.sopId }).then(res => { this.$apis.sop.getSopBaseInfoApi({ sopId: this.sopId }).then(res => {
this.sopInfo = res this.sopInfo = res
this.sopInfo.touchPercent = this.baseData.sopEventList.length ? Math.round((this.selectedEventInfo.eventStatistics.reachCustomerCount / this.sopInfo.customerCount) * 100).toFixed(0) + '%' : '-' this.sopInfo.touchPercent = this.sopInfo.customerCount ? Math.round((this.selectedEventInfo.eventStatistics.reachCustomerCount / this.sopInfo.customerCount) * 100).toFixed(0) + '%' : '-'
this.drawPie() this.drawPie()
}) })
}, },
......
...@@ -6,7 +6,7 @@ const resolve = dir => path.join(__dirname, dir) ...@@ -6,7 +6,7 @@ const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://img02.glsx.com.cn/' const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = { const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`], css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
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`, `${CDN_DOMAIN}ajax/libs/moment/2.24.0/moment.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`, `${CDN_DOMAIN}ajax/libs/moment/2.24.0/moment.js`, 'https://webapi.amap.com/loader.js']
} }
module.exports = { module.exports = {
outputDir: `../dist/${packageName}`, outputDir: `../dist/${packageName}`,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!