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 @@
"lodash": "^4.17.21",
"node-sass": "^4.0.0",
"vue": "^2.6.10",
"vue-amap": "^0.5.10",
"vue-router": "^3.1.3",
"vuedraggable": "^2.24.3",
"vuex": "^3.1.2",
......
......@@ -137,7 +137,7 @@ const staffList = params => {
}
// 客户群发客户列表
const customerDetailList = params => {
params.method = `${path}customer.list`
params.method = `${path}customer.list.page`
return http({
url: URL,
method: 'GET',
......
......@@ -45,10 +45,34 @@ const getBrowseListApi = params => {
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 => {
params.method = 'scrm.api.shopmall.customer.browse.records.export'
const exportBrowseApi = (params, TYPE = 1) => {
//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({
url: 'rop-scrm-shopmall/router',
method: 'POST',
......@@ -137,5 +161,45 @@ const getCrowdSharedApi = params => {
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>
<div class="map-box" :style="{ height: mapHeight + 'px' }">
<div id="container" style="width: 100%; height: 100%"></div>
<div class="map-address">{{ address }}</div>
<div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%">
<el-input placeholder="请输入关键字" v-model="input" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="searchAddress"></el-button>
</el-input>
<div class="map-box" :style="{ height: mapHeight + 'px', width: mapWidth + 'xp' }">
<div id="container">
<el-select v-model="input" class="map-input" filterable remote reserve-keyword placeholder="请输入" :remote-method="remoteMethod" @change="handleChangeAdr" :loading="loading">
<el-option v-for="item in adrList" :key="item.id" :label="item.address" :value="item.id"></el-option>
</el-select>
</div>
<div class="map-address">
<img class="icon-map" src="./images/icon-map.png" />
{{ address }}
</div>
</div>
</template>
......@@ -16,43 +18,90 @@ export default {
props: {
mapHeight: {
type: Number,
default: 300
default: 460
},
mapWidth: {
type: Number,
default: 740
}
},
data() {
return {
input: '',
input: [],
address: '',
adrList: [],
lnglat: [],
geocoderAddress: {}
}
},
mounted() {
this.mapInit()
},
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() {
map = new AMap.Map('container', {
resizeEnable: true,
zoom: 20
/* 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 版本
}
})
AMap.plugin(['AMap.PlaceSearch'], function () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
.then(AMap => {
map = new AMap.Map('container', {
zoom: 20,
autoFitView: true,
resizeEnable: true,
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 () {
//构造地点查询类
placeSearch = new AMap.PlaceSearch({
pageSize: 8, // 单页显示结果条数
pageIndex: 1, // 页码
citylimit: false, //是否强制限制在设置的城市内搜索
// panel: "panel", // 结果列表将在此容器中进行展示。
autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
renderStyle: 'default'
})
})
map.on('click', this.getAddress)
})
.catch(e => {
console.error(e) //加载错误提示
})
})
// 添加列表点选监听事件
map.on('click', this.getAddress)
},
searchAddress() {
remoteMethod(query) {
if (query == '') {
return true
}
let _this = this
placeSearch.search(this.input, function (status, result) {
placeSearch.search(query, function (status, result) {
if (status === 'complete' && result.poiList.pois.length) {
let lnglat = result.poiList.pois[0].location
_this.getAddress(lnglat)
_this.adrList = result.poiList.pois
}
})
},
......@@ -63,63 +112,76 @@ export default {
} else {
position = lnglat
}
this.lnglat = position
marker = new AMap.Marker({
map: map,
icon: new AMap.Icon({
image: '//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png',
size: new AMap.Size(27, 34), //图标大小
imageSize: new AMap.Size(27, 34)
}),
// draggable: true,
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.setCenter(position)
map.add(marker)
map.setFitView()
marker.setMap(map)
// this.map.setFitView()
},
getAddress(e) {
let self = this
let lnglat
let position
if (e.type == 'click') {
lnglat = e.lnglat
position = e.lnglat
} else {
let { lng, lat } = e
lnglat = [lng, lat]
position = [lng, lat]
}
if (marker) {
map.remove(marker)
marker.setMap(null)
marker = null
}
self.addMarker(lnglat)
self.addMarker(position)
AMap.plugin('AMap.Geocoder', () => {
const geocoder = new AMap.Geocoder()
geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat
geocoder.getAddress(position, (status, result) => {
self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
this.geocoderAddress = result.geocodes[0]
self.geocoderAddress = result.geocodes[0]
}
})
})
})
},
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress()
handleChangeAdr(val) {
if (val) {
var location = this.adrList.find(item => item.id == val)
this.getAddress(location.location)
this.input = ''
this.adrList = []
}
}
},
mounted() {
this.mapInit()
}
}
</script>
<style scoped lang="scss">
.map-box {
position: relative;
width: 100%;
}
#container {
position: absolute;
height: 100%;
display: flex;
#container {
position: relative;
width: calc(100% - 284px - 16px);
height: 100%;
}
.map-input {
position: absolute;
top: 32px;
width: 60%;
left: 25%;
z-index: 2;
}
}
#panel {
position: absolute;
......@@ -130,8 +192,18 @@ export default {
width: 280px;
}
.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;
bottom: -30px;
.icon-map {
width: 16px;
height: 16px;
margin-right: 6px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -28,7 +28,7 @@
<el-form-item v-for="(item, index) in formList" :key="index" :label="item.label || ''">
<template>
<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 v-else-if="item.type === 'select'">
<el-select size="small" v-model="formModel[item.prop]" :placeholder="item.placeholder || '请选择'" :filterable="!item.noFilter">
......@@ -83,7 +83,7 @@ export default {
type: Boolean,
default: false
},
isThreeRowShow:{
isThreeRowShow: {
type: Boolean,
default: false
},
......@@ -99,7 +99,7 @@ export default {
type: Boolean,
default: false
},
isNeedThreeBtns:{
isNeedThreeBtns: {
type: Boolean,
default: true
}
......@@ -118,34 +118,31 @@ export default {
//调用默认时间(30天)
this.getPassMonthFormatDate()
}
this.$nextTick(()=>{
var sf = document.getElementById('searchForm')
if (sf.clientWidth < 1280 && this.isHasSyncBtn) {
document.querySelector('.itemWidth').style.maxWidth = 700 + 'px'
}
if (sf.clientWidth < 952 && this.isHasSyncBtn) {
this.isShowBtns = false
}
this.$nextTick(() => {
var sf = document.getElementById('searchForm')
let lineHeight = 75 //75
if (document.getElementById('searchForm').offsetHeight > lineHeight * 2) {
this.expande = false
this.needShowExpande = true
} else {
this.needShowExpande = false
this.expande = true
}
if (sf.clientWidth < 1280 && this.isHasSyncBtn) {
document.querySelector('.itemWidth').style.maxWidth = 700 + 'px'
}
if (sf.clientWidth < 952 && this.isHasSyncBtn) {
this.isShowBtns = false
}
if( sf.clientWidth< 840 && this.isThreeRowShow){
document.querySelector('.itemWidth').style.minHeight= document.querySelector('.itemWidth').offsetHeight + 50 + 'px'
// 客户群里面四个表做特殊处理,当为苹果笔记本电脑尺寸时,不是现实展开收起按钮
this.needShowExpande = false
this.expande = true
}
let lineHeight = 75 //75
if (document.getElementById('searchForm').offsetHeight > lineHeight * 2) {
this.expande = false
this.needShowExpande = true
} else {
this.needShowExpande = false
this.expande = true
}
if (sf.clientWidth < 840 && this.isThreeRowShow) {
document.querySelector('.itemWidth').style.minHeight = document.querySelector('.itemWidth').offsetHeight + 50 + 'px'
// 客户群里面四个表做特殊处理,当为苹果笔记本电脑尺寸时,不是现实展开收起按钮
this.needShowExpande = false
this.expande = true
}
})
//有数据不算表格高度,没数据算高度
......@@ -160,7 +157,7 @@ export default {
// $(window).bind('resize', function() {
// if (resizeTimer) clearTimeout(resizeTimer)
// resizeTimer = setTimeout(function() {
//
//
// }, 100)
// })
// window.onresize = () => {
......@@ -215,8 +212,8 @@ export default {
syncClick() {
this.$emit('syncClick')
},
handleExport(){
this.$emit('handleExport')
handleExport() {
this.$emit('handleExport')
},
expandeClick() {
......@@ -264,7 +261,7 @@ this.$emit('handleExport')
}
}
</script>
<style lang="scss">
<style lang="scss" scoped>
@import '@/styles/variables.scss';
.search-form {
padding: 18px 0 0 0;
......@@ -324,7 +321,7 @@ this.$emit('handleExport')
.el-select {
width: 215px;
}
.el-select>.el-input{
.el-select > .el-input {
width: 215px;
}
.el-form-item__content {
......
......@@ -15,14 +15,6 @@ import '@/components'
// import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
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.prototype.$apis = apis
Vue.prototype.size = 'small'
......
......@@ -350,6 +350,12 @@ const staticRoutes = Object.freeze([
path: '/seckillActivity/browseList',
component: resolve => require([`@/views/seckillActivity/browseList.vue`], resolve),
meta: {}
},
{
name: 'dataBoard',
path: '/seckillActivity/dataBoard',
component: resolve => require([`@/views/seckillActivity/dataBoard.vue`], resolve),
meta: {}
}
])
export default staticRoutes
......@@ -48,14 +48,14 @@
<div class="detail-modular">
<div class="title">客户详情</div>
<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="1">已送达客户</el-menu-item>
<el-menu-item index="0">未送达客户</el-menu-item>
<el-menu-item index="2">客户送达失败</el-menu-item>
</el-menu>
<div class="detail-total">共 {{ customerlist.length || 0 }} 人</div>
<div v-if="customerlist.length != 0" class="info-list">
<div class="detail-total">共 {{ customerCount || 0 }} 人</div>
<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">
<img class="info-avatar" :src="item.avatar ? item.avatar : require('@/assets/guestCustom/default-avatar.png')" alt />
<div class="info-content info-custom">
......@@ -108,7 +108,14 @@ export default {
eventBus: new Vue(),
isDisabled: false,
footerLeft: 0,
footerWidth: 0
footerWidth: 0,
// 客户详情分页
customerPage: {
pageSize: 10,
pageNum: 1
},
// 客户详情总数
customerCount: 0
}
},
mounted() {
......@@ -126,8 +133,19 @@ export default {
this.activeIndex = val
this.getStaffList(val)
},
// 客户详情选择切换
handleCustomSelect(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)
},
remind(data, index) {
......@@ -163,10 +181,28 @@ export default {
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) {
const id = this.$route.params.id
this.$apis.customerTransform.customerDetailList({ id, status }).then(res => {
this.customerlist = res ? res : []
var params = JSON.parse(JSON.stringify(this.customerPage))
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() {
......@@ -276,7 +312,7 @@ export default {
margin-top: 0;
margin-left: 10px;
&.send {
width: 70px;
width: 80px;
}
span {
vertical-align: middle;
......
......@@ -15,11 +15,11 @@
<GLButton type="primary" :size="size" icon="el-icon-plus" fn="新建客户群发" @click="btnClick('create', 1)">新建群发</GLButton>
<div class="text">企业统一选择要发送的客户,由添加客户的成员确认后发送给客户,消息内容仅管理员和负责人可创建。</div>
<div class="renew">
<div style="cursor:pointer;" @click="refreshData('1')">
<i class="el-icon-refresh-right"></i>
<span style="margin-right: 8px;">更新数据</span>
</div>
<span style="color: #999;" v-if="time">更新于 {{time}}</span>
<div style="cursor:pointer;" @click="refreshData('1')">
<i class="el-icon-refresh-right"></i>
<span style="margin-right: 8px;">更新数据</span>
</div>
<span style="color: #999;" v-if="time">更新于 {{ time }}</span>
</div>
</div>
<!-- 表格区域 开始 -->
......@@ -54,11 +54,11 @@
<GLButton type="primary" :size="size" fn="新建客户群群发" icon="el-icon-plus" @click="btnClick('create', 2)">新建群发</GLButton>
<div class="text">管理员或负责人统一创建内容,群主收到通知后,可选择他管理的客户群并群发。</div>
<div class="renews">
<div style="cursor:pointer;" @click="refreshData('2')">
<i class="el-icon-refresh-right"></i>
<span style="margin-right: 8px;">更新数据</span>
</div>
<span style="color: #999;" v-if="times">更新于 {{times}}</span>
<div style="cursor:pointer;" @click="refreshData('2')">
<i class="el-icon-refresh-right"></i>
<span style="margin-right: 8px;">更新数据</span>
</div>
<span style="color: #999;" v-if="times">更新于 {{ times }}</span>
</div>
</div>
<!-- 表格区域 开始 -->
......@@ -97,8 +97,8 @@ export default {
}
return {
timeId: Function,
time:'',
times:'',
time: '',
times: '',
ATT_TYPE,
activeIndex: 1,
// 表格按钮
......@@ -336,9 +336,10 @@ export default {
},
mounted() {
// this.wxTips()
this.refreshData(this.activeIndex)
},
watch: {
activeIndex (newVal,oldVal) {
activeIndex(newVal, oldVal) {
if (newVal == 2) {
this.times = dayjs(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
} else if (newVal == 1) {
......@@ -354,12 +355,12 @@ export default {
clearTimeout(this.timeId)
this.timeId = setTimeout(() => {
this.$apis.customerTransform.renewDetailList({}).then(res => {
if(res.code == '0'){
if(type == 1) {
this.time = res.data.createdTime
if (res.code == '0') {
if (type == 1) {
this.time = res.data.createdTime
this.$refs.customer.refreshTable()
} else if(type == 2) {
this.times = res.data.createdTime
} else if (type == 2) {
this.times = res.data.createdTime
this.$refs.customerGroup.refreshTable()
}
}
......@@ -495,12 +496,13 @@ export default {
color: #999;
margin-left: 20px;
}
.renew,.renews {
.renew,
.renews {
display: flex;
position: absolute;
right: 44px;
font-size: 14px;
color: #5850FF
color: #5850ff;
}
}
}
......
......@@ -66,10 +66,10 @@
<el-radio :label="2">指定车架号后6位</el-radio>
</el-radio-group>
<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>
<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 }}
<i style="cursor:pointer" class="el-icon-close" @click="delPhone(item.tel)"></i>
</div>
......@@ -130,7 +130,18 @@
<el-button type="primary" @click="handleConfirm" size="medium" :loading="loading">提交</el-button>
</GLFooter>
<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>
</template>
<script>
......@@ -144,6 +155,7 @@ export default {
phone: '',
isLoaded: true,
loading: false,
tableSearchForm: { staffName: '' },
phoneList: [],
size: 'small',
title: '新增礼包',
......@@ -153,7 +165,6 @@ export default {
},
// 选择员工弹窗
isMutiSelectVisible: false,
searchStaffForm: {},
selectedStaffList: [],
// 选择定向礼包弹窗
isSelectGiftVisible: false,
......@@ -290,13 +301,13 @@ export default {
label: '库存数量',
name: 'stock',
addHtml: 'stockNumInput',
isHide: false,
isHide: false
},
{
label: '审批要求',
name: 'approveFlag',
addHtml: 'approvalSlot',
isHide: false,
isHide: false
},
{
label: '领取规则设置',
......@@ -328,7 +339,7 @@ export default {
}
],
suffixSlot: 'configSlot',
handleRadioChange: (e) => {
handleRadioChange: e => {
if (e == 4) {
this.receiveWay = 1
}
......@@ -369,7 +380,7 @@ export default {
label: '发放员工',
name: 'staffList',
addHtml: 'selectStaffBtn',
isHide: false,
isHide: false
},
{
label: '',
......@@ -429,7 +440,7 @@ export default {
this.editForm.staffList = []
this.editForm.stock = 1
}
},
}
},
computed: {
placeholder() {
......@@ -454,6 +465,10 @@ export default {
}
},
methods: {
//员工查询
handleSearch() {
this.$refs?.staffDialog?.getList({}, true)
},
resetTextArea() {
this.phone = ''
this.phoneList = []
......@@ -616,6 +631,7 @@ export default {
},
handleMutiSelectClose() {
this.isMutiSelectVisible = !this.isMutiSelectVisible
this.tableSearchForm.staffName = ''
},
handleMutiSelectConfirm(selectedData) {
this.editForm.staffList = []
......@@ -694,7 +710,7 @@ export default {
lock: true,
text: '正在Loading···',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)',
background: 'rgba(0, 0, 0, 0.3)',
customClass: 'loadingClass'
})
this.$apis.giftBag
......@@ -728,7 +744,7 @@ export default {
.then(() => {
this.cancelJump()
})
.catch(() => { })
.catch(() => {})
} else {
this.cancelJump()
}
......@@ -976,4 +992,9 @@ export default {
}
}
}
</style>
\ No newline at end of file
.search-staff {
.el-form-item {
margin-right: 20px;
}
}
</style>
<!-- 选择员工弹窗 -->
<template>
<GLDialog class="muti-pro" bigTitle="选择员工" mode="big" :before-close="handleMutiSelectClose" :visible.sync="isMutiSelectVisible" @onOk="handleMutiSelectConfirm" @onCancel="handleMutiSelectClose" v-loading="loading">
<div class="noproDiv" v-show="!staffList.length && fnCallBack">
<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">
<img src="@/assets/noPro.png" />
<p class="noproP">系统暂无已创建的员工</p>
</div>
<div v-show="staffList.length">
</div> -->
<div>
<slot name="search"></slot>
<GLTable v-loading="loading" ref="mutiProRef" :tableData="staffList" :pageConf="pageConf" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList"></GLTable>
</div>
......@@ -25,6 +25,9 @@ export default {
fnCallBack: false,
url: url,
loading: true,
tableSearchForm: {
staffName: ''
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
......@@ -58,7 +61,7 @@ export default {
},
searchForm: {
type: Object,
default: () => { }
default: () => {}
},
selectedStaffList: {
type: Array,
......@@ -69,7 +72,7 @@ export default {
mounted() {
this.userInfo = this.$globalState.session
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)
},
......@@ -102,7 +105,6 @@ export default {
this.selectedStaffList.forEach(row => {
row.userOneId = row.staffUUID
this.$nextTick(() => {
let idx = this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.userOneId == row.staffUUID)
if (idx > -1) {
try {
......
......@@ -147,17 +147,15 @@ export default {
}
},
mounted() {
this.eventBus.$emit('update', this.previewList)
// this.updateList(this.previewList)
// obj.init('video')
},
methods: {
handleImgChange(e, targetItem) {
var reader = new FileReader()
var file = e.srcElement.files[0]
// 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize
......@@ -170,12 +168,10 @@ export default {
var image = new Image()
image.src = e.target.result
image.onload = () => {
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 => {
if (res) {
this.previewList.push({
attType: ATT_TYPE.IMAGE,
attContent: res
......@@ -198,10 +194,9 @@ export default {
reader.readAsDataURL(file)
reader.onload = e => {
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 => {
if (res) {
this.previewList.push({
attType: ATT_TYPE.VEDIO,
attContent: res
......@@ -213,7 +208,7 @@ export default {
handleImg(e) {
var reader = new FileReader()
var file = e.srcElement.files[0]
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
......@@ -227,11 +222,10 @@ export default {
image.src = e.target.result
image.onload = () => {
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.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
this.$set(this.appletForm, 'picUrl', res)
}
})
......@@ -239,7 +233,6 @@ export default {
}
},
switchDailog(funName) {
if (funName == 'link') {
this.dialogTitle = '添加网页消息'
} else if (funName == 'applet') {
......@@ -253,7 +246,6 @@ export default {
case '添加网页消息':
this.$refs.linkForm.validate(valid => {
if (valid) {
this.previewList.push({
attType: ATT_TYPE.URL,
attContent: this.linkForm
......@@ -264,16 +256,13 @@ export default {
// this.linkForm = {}
// this.$refs.linkForm.clearValidate()
} else {
return false
}
})
break
case '添加小程序':
this.$refs.appletForm.validate(valid => {
if (valid) {
this.previewList.push({
attType: ATT_TYPE.MINIPROGRAM,
attContent: this.appletForm
......@@ -283,25 +272,21 @@ export default {
// this.appletForm = {}
// this.$refs.appletForm.clearValidate()
} else {
return false
}
})
break
default:
}
},
close(index) {
// this.previewList
this.previewList.splice(index, 1)
this.eventBus.$emit('update', this.previewList)
},
textInput(val) {
const hasText = this.previewList.some(item => item.attType == 1)
if (hasText) {
this.$set(this.previewList, 0, {
attContent: val,
......@@ -313,7 +298,6 @@ export default {
attType: ATT_TYPE.TEXT
})
}
},
closeDialog() {
if (this.dialogVisible) {
......@@ -342,7 +326,7 @@ export default {
<style lang="scss" scoped>
.welcome-box {
display: inline-block !important;
display: inline-block !important;
// padding-top: 20px;
// margin-left: 87px;
}
......
......@@ -407,7 +407,7 @@ export default {
.border {
padding: 20px;
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 {
......
......@@ -420,7 +420,8 @@ export default {
reader.readAsDataURL(file)
reader.onload = e => {
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 => {
if (res) {
this.pdfUrl = res
......@@ -448,7 +449,7 @@ export default {
reader.readAsDataURL(file)
reader.onload = e => {
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 => {
if (res) {
// console.log(res)
......
......@@ -19,6 +19,10 @@ export default {
excludeMenus: {
type: Array,
default: () => ['code']
},
boxHeight:{
type: Number,
default: 240
}
},
mounted() {
......@@ -31,7 +35,7 @@ export default {
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = 400
this.editor.config.height = this.boxHeight
this.editor.config.width = 500
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = html => {
......@@ -43,7 +47,7 @@ export default {
this.$emit('focus')
}
// 上传图片
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
......@@ -56,7 +60,7 @@ export default {
reader.readAsDataURL(file)
reader.onload = e => {
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 => {
if (res) {
// console.log(res)
......@@ -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 reader = new FileReader()
// 默认1MB
......@@ -82,7 +86,7 @@ export default {
reader.readAsDataURL(file)
reader.onload = e => {
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 => {
if (res) {
// console.log(res)
......@@ -112,7 +116,7 @@ export default {
<style lang="scss" scoped>
#div-demo {
margin: 16px 300px 0 0;
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
......
......@@ -13,7 +13,7 @@
</span>
<div class="container">
<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 class="tabelList">
<el-row>
......
<!-- 浏览明细 -->
<!-- 明细 -->
<template>
<div class="edit-share marketing edit-box">
<div class="container edit-container">
<p class="edit-title">{{ routeInfo.activityName }}</p>
<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">
<span class="table-title"></span>
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button>
<div class="table-title">
已累计<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>
<!-- 表格区域 开始 -->
<GLTable ref="browserRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="customerName" class="flex-align" slot-scope="scope">
<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>
<GLTable
ref="browserRef"
:getListApi="getListApi"
:noDataImg="url"
: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>
</template>
<span class="m-l-10">{{ scope.scope.customerName }}</span>
</div>
<div slot="shareName" class="flex-align" slot-scope="scope">
<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>
<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>
<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>
</GLTable>
<!-- 表格区域 end -->
</div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="default" @click="handleJump">返回</el-button>
<div
class="footer"
:style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"
>
<el-button
type="default"
@click="handleJump"
>返回</el-button>
</div>
</div>
</template>
......@@ -44,7 +122,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'browseList',
data() {
data () {
return {
size: 'small',
url: url,
......@@ -72,15 +150,21 @@ export default {
name: 'mobile',
type: 'input',
maxlength: 11
},
{
label: '分享人',
name: 'shareName',
type: 'input',
maxlength: 50
}
],
// 表格
getListApi: this.$apis.seckillActivity.getBrowseListApi,
getListApi: null,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '微信名称',
label: '微信昵称',
prop: 'customerName',
addHtml: 'customerName'
},
......@@ -89,66 +173,133 @@ export default {
prop: 'mobile'
},
{
label: '来源',
label: '分享人',
prop: 'shareName',
addHtml: 'shareName'
},
{
label: '浏览次数',
prop: 'browseCount'
addHtml: 'shareName',
width: 230
},
{
label: '浏览时间',
prop: 'lastBrowseDate',
width: '180'
}
]
}
}
},
created() {
this.routeInfo = this.$route.query
created () {
const lastTableColumns = [
{
label: '浏览时长',
prop: 'browserTime',
},
{
label: '进入页面时间',
prop: 'operationDate',
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',
}]
},
mounted() {
mounted () {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
},
methods: {
beforeSearchFn() {
beforeSearchFn () {
return new Promise(resolve => {
this.searchForm.activityId = this.routeInfo.id
resolve()
})
},
handleExport() {
handleExport () {
var params = this.$common.utils.deepClone(this.searchForm)
let { type } = this.routeInfo
params.pageNum = 1
params.pageSize = 999999
this.$apis.seckillActivity.exportBrowseApi(params).then(res => {
this.$apis.seckillActivity.exportBrowseApi(params, type).then(res => {
exportFn(res)
})
},
handleJump(path, row = {}) {
handleJump (path, row = {}) {
this.$router.push({
path: '/seckillActivity/crowdFundList'
})
},
setTableFinishFun() {
setTableFinishFun () {
//接收到的数据为空
this.$refs.browserRef.data.length ? (this.$refs.browserRef.tableHeightValues = '') : this.$refs.browserRef.setTableHeightFun()
},
handleSearch() {
handleSearch () {
this.$refs.browserRef.refreshTable()
},
handleReset() {
handleReset () {
this.searchForm = {
activityId: this.routeInfo.id,
customerName: '',
......@@ -160,4 +311,18 @@ export default {
}
</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 @@
<template>
<div class="marketing">
<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>
<el-button :size="size" type="default" class="default-blue-btn" @click="handleJump">订单管理</el-button>
<GLButton
: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 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">
<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>
<!-- 表格区域 开始 -->
<GLTable ref="activity" :getListApi="getListApi" :noDataImg="url" :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" />
<GLTable
ref="activity"
:getListApi="getListApi"
:noDataImg="url"
: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>
</div>
<div slot="viewAmount" slot-scope="scope">
<p class="cursor-pointer" @click="handleDetail(scope.scope)">{{ scope.scope.viewAmount || 0 }}</p>
<div
slot="linkText"
slot-scope="scope"
>
<p
class="cursor-pointer"
@click="handleDetail(scope)"
>{{scope.scope[scope.prop] || 0}}</p>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
<div
class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog>
<share-dialog
:isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"
></share-dialog>
</div>
</template>
......@@ -42,7 +109,7 @@ import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'crowdFundList',
data() {
data () {
return {
size: 'small',
url: url,
......@@ -69,7 +136,7 @@ export default {
maxlength: 20
},
{
label: '状态',
label: '活动状态',
name: 'activityStatus',
type: 'select',
width: '215px',
......@@ -162,6 +229,36 @@ export default {
listeners: {
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 {
{
label: '浏览量(次)',
prop: 'viewAmount',
addHtml: 'viewAmount',
addHtml: 'linkText',
width: 140
},
{
......@@ -208,12 +305,14 @@ export default {
}
},
{
label: '粉丝',
prop: 'fansAmount'
label: '访客',
prop: 'fansAmount',
addHtml: 'linkText'
},
{
label: '分享',
prop: 'shareAmount'
prop: 'shareAmount',
addHtml: 'linkText'
},
{
label: '销量',
......@@ -274,16 +373,16 @@ export default {
shareDialog
},
mounted() {
mounted () {
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
getParams () {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
beforeSearchFn() {
beforeSearchFn () {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate
......@@ -291,13 +390,13 @@ export default {
})
},
handleJump(path, row = {}) {
handleJump (path, row = {}) {
this.$router.push({
path: '/orderManage/index'
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
secondConfirm (title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
......@@ -320,16 +419,16 @@ export default {
},
//开始
start(item) {
start (item) {
this.startOrEndConfirm('开始', item)
},
//结束
end(item) {
end (item) {
this.startOrEndConfirm('结束', item)
},
startOrEndConfirm(txt, row) {
startOrEndConfirm (txt, row) {
var title = txt
var params = {}
params.id = row.id
......@@ -342,24 +441,29 @@ export default {
},
//置顶
topping(row) {
topping (row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params)
},
//删除
del(row) {
del (row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
},
// 1-新增;2-编辑
handleEdit(addOrEdit, row) {
handleEdit (addOrEdit, row) {
var txtObj = {
add: '新建',
edit: '编辑',
copy: '复制'
}[addOrEdit]
var params = {
addOrEdit: addOrEdit,
$title: encodeURI(addOrEdit == 'add' ? '新建众筹活动' : '编辑众筹活动')
$title: encodeURI(txtObj + '众筹活动')
}
if (addOrEdit != 'add') {
params.id = row.id
......@@ -370,37 +474,56 @@ export default {
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({
path: '/seckillActivity/browseList',
query: {
id: row.id,
activityName: row.activityName
id: scope.id,
activityName: scope.activityName,
type: data.type,
count: data.count,
}
})
},
handleExport() {
handleExport () {
var params = this.getParams()
this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => {
exportFn(res)
})
},
handleShare(row) {
handleShare (row) {
this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => {
this.shareForm = res
this.handleShareClose()
})
},
handleShareClose() {
handleShareClose () {
this.isShareVisible = !this.isShareVisible
},
getOptionsList(formName, hasAll = true, refreshSigle) {
getOptionsList (formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
......@@ -426,11 +549,11 @@ export default {
}
},
handleSearch() {
handleSearch () {
this.$refs.activity.refreshTable()
},
handleReset() {
handleReset () {
this.searchForm = {
activityName: '',
activityStatus: ''
......@@ -438,7 +561,7 @@ export default {
this.handleSearch()
},
setTableFinishFun() {
setTableFinishFun () {
//接收到的数据为空
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 @@
<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>
<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">
<p>
<img class="img-60" :src="selectedProInfo.goodsImage" />
......@@ -371,18 +371,22 @@ export default {
},
getGoodInfo(id) {
this.$apis.proManage.getProInfoApi({ id: id }).then(res => {
this.selectedProInfo = this.$common.utils.deepClone(res)
if (this.selectedProInfo.specificationDetailList.length) {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
this.specificationDetailList = this.selectedProInfo.specificationList
this.recoverySpec()
} else {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], true)
this.nameToValSpecsList = []
this.specificationDetailList = []
}
})
if (!id) {
this.isDisabled = false
} else {
this.$apis.proManage.getProInfoApi({ id: id }).then(res => {
this.selectedProInfo = this.$common.utils.deepClone(res)
if (this.selectedProInfo.specificationDetailList.length) {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], false)
this.specificationDetailList = this.selectedProInfo.specificationList
this.recoverySpec()
} else {
this.changeFormAttr('editFormData', 'isHide', ['规格明细'], true)
this.nameToValSpecsList = []
this.specificationDetailList = []
}
})
}
},
// 规格值解构
......
......@@ -160,7 +160,7 @@ export default {
getBaseInfo() {
this.$apis.sop.getSopBaseInfoApi({ sopId: this.sopId }).then(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()
})
},
......
......@@ -6,7 +6,7 @@ const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = {
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 = {
outputDir: `../dist/${packageName}`,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!