Commit bb615942 by 胡悦

Merge branch 'dev_v1.0.0' of http://192.168.3.233:8090/gh/data-view into dev_v1.0.0

2 parents 05727da9 c1c3e601
......@@ -12,6 +12,7 @@ body .app {
--themeColor: #3975C6;
}
img {
width: 100%;
height: 100%;
......@@ -69,6 +70,7 @@ img {
.pointer {
cursor: pointer;
}
.box{
.box {
background: #1D1C1C;
}
\ No newline at end of file
......@@ -3,23 +3,32 @@
<div class="left flex user-select pointer">
<template v-for="(i,index) in tab">
<div
:class="['item flex',index == 0?'text-center':'brand',{'active':i.active}]"
:class="['item flex',index == 0?'text-center':'brand',{'active':tabIndex == index}]"
:key="index"
@click="chooseBrand(index)"
@click="change(index)"
>
{{i.text}}
{{i}}
</div>
</template>
<div
class="options-box"
v-show="showBrand"
></div>
:key="brandsKey"
ref="brands"
>
<template v-for="(i,index) in brands">
<div
:class="['options-item flex',{'active':i.active}]"
:key="index"
@click="chooseBrand({i,index})"
>{{i.name}}</div>
</template>
</div>
</div>
<div class="right y-center flex user-select pointer">
<template v-for="(i,index) in options">
<div
:key="index"
@click="choose(index)"
@click="reportChange(index)"
:class="['item text-center',{'active':reportIndex == index}]"
>
{{i}}
......@@ -31,31 +40,73 @@
</template>
<script type='text/ecmascript-6'>
let test = [{ name: '东风本田' },
{ name: '别克' },
{ name: '凯迪拉克' },
{ name: 'MINI' },
{ name: '荣威' },
{ name: '上海大众' },
{ name: '沃尔沃' },
{ name: '一汽丰田' },
{ name: '平行进口' },
{ name: '奥迪' },
{ name: '广汽本田' },
{ name: '比亚迪' },
{ name: '奔驰' },]
export default {
name: 'ViewControl',
data () {
return {
tab: [{ text: '广汇集团', active: true }, { text: '品牌概览' }],
tab: ['广汇集团', '品牌概览'],
tabIndex: 0,
options: ['日表', '月表'],
reportIndex: 1,
showBrand: false
brands: [],
brandsKey: Date.now()
}
},
mounted () {
test.map(e => e.active = false)
this.brands = test
console.log(this.$store)
},
methods: {
chooseBrand (index) {
let { tab } = this
tab.map(e => e.active = false)
tab[index].active = true
this.showBrand = index == 1
change (index, item) {
let { tabIndex } = this
if (index == 0) {
if (tabIndex == index) return
this.tab = ['广汇集团', '品牌概览']
} else {
if (!item) return
this.tab[1] = item.name
}
this.tabIndex = index
this.emit()
},
choose (index) {
reportChange (index) {
let { reportIndex } = this
if (reportIndex == index) return
this.reportIndex = index
}
this.emit()
},
emit () {
let { reportIndex, tabIndex, brands } = this
let params = {
reportType: reportIndex
}
if (tabIndex == 1) brands.map(e => {
if (e.active) params.brand = e
})
this.$store.state.app.reportParams = params
},
chooseBrand ({ i, index }) {
let { brands } = this
brands.map(e => e.active = false)
brands[index].active = true
this.brandsKey = Date.now()
this.$refs.brands.style.display = 'none'
this.change(1, i)
},
}
}
</script>
......@@ -78,14 +129,18 @@ export default {
.brand {
padding-left: 16px;
border-radius: 0 4px 4px 0;
&:hover ~ .options-box {
display: block;
}
}
.active {
color: #fff;
background: #eb6001;
}
.options-box {
display: none;
position: absolute;
top: 32px;
top: 4.1vh;
right: 0;
width: 50%;
height: 30vh;
......@@ -95,6 +150,40 @@ export default {
border-radius: 4px;
box-sizing: border-box;
z-index: 2;
overflow-y: scroll;
&:hover {
display: block;
}
.options-item {
height: 2.9vh;
font-size: 12px;
color: #ffffff;
padding-left: 19px;
position: relative;
}
.active,
.options-item:hover {
background: #1e1e1e;
color: #eb6001;
&::after {
position: absolute;
left: 0;
top: 0;
width: 4px;
height: 100%;
content: '';
background-color: #eb6001;
}
}
}
::-webkit-scrollbar {
background-color: #383737;
width: 6px;
position: absolute;
}
::-webkit-scrollbar-thumb {
background: #464646;
border-radius: 3px;
}
}
.right {
......
......@@ -25,7 +25,6 @@ export default {
// height: 24px;
height: 2.9vh;
font-size: 14px;
line-height: 20px;
margin-bottom: .5vh;
.logo{
width: 14px;
......
......@@ -11,8 +11,10 @@
</template>
<script type='text/ecmascript-6'>
import { changeMixin } from '@/mixins'
export default {
name: 'ViewTabs',
mixins: [changeMixin],
data () {
return {
}
......
export default {
watch: {
watchReportParams: {
immediate: true,
handler (newval) {
this.init()
}
}
},
computed: {
watchReportParams () {
return this.$store.state.app.reportParams
}
}
}
import indexMixin from './indexMixin'
import shareMixin from './shareMixin'
import changeMixin from './changeMixin'
export {
indexMixin,
shareMixin
changeMixin
}
\ No newline at end of file
import { Notify, Dialog } from 'vant'
import { wwbenchApi, ssoApi, sopApi } from '@/api'
const { subsystemInfo, text } = window.$fetchConfig
export default {
data () {
return {
statusEnum: {
0: '去处理',
1: '处理中',
2: '已完成'
},
taskTypeEnum: {
// 1: '批量添加客户好友',
2: '直播群发任务',
3: '客户群发',
4: '客户群群发',
5: '客户资料完善',
6: '营销sop-任务',
8: '线索跟进-任务',
},
userInfo: {},
accountList: [],
tasksList: [],
taskCountData: {},
showCalendar: false,
taskType: '',
status: '',
statusOption: [
{ text: '全部', value: '' },
{ text: '待处理', value: 0 },
{ text: '处理中', value: 1 },
{ text: '已处理', value: 2 }
],
taskTypeOption: [
{ text: '全部', value: '' },
// { text: '批量添加客户好友', value: 1 },
// { text: '直播群发任务', value: 2 },
{ text: '客户群发', value: 3 },
{ text: '客户群群发', value: 4 },
{ text: '客户资料完善', value: 5 },
{ text: '营销sop', value: 6 },
{ text: '线索跟进', value: 8 }
],
list: [
{
text: '未完成任务',
key: 'unFinishTaskCount'
},
{
text: '已完成任务',
key: 'finishTaskCount'
},
{
text: '完成率',
isCanvas: true
}
],
dateRange: '',
minDate: new Date(),
maxDate: new Date(),
default_Date: null,
dateRangeFormat: 'yyyy.MM.dd',
startDate: '',
endDate: '',
tasksFlag: false
}
},
mounted () {
this.init()
},
methods: {
init () {
this.userInfo = this.getLocalStorage('dj_scrm_userInfo')
let accountList = this.getLocalStorage('dj_scrm_accountList')
if (accountList) {
accountList.map(e => {
e.text = e.merchantName
e.value = e.merchantId
})
console.log(accountList)
this.accountList = accountList
}
this.getTaskData()
this.initDate()
},
getTaskData () {
wwbenchApi.getTaskData().then(data => {
let sum = Number(data.finishTaskCount + data.unFinishTaskCount) || 0
let num = Math.round(Number((Number(data.finishTaskCount) / sum) * 100)) || 0
data.num = num
data.sum = sum
this.taskCountData = data
})
},
initDate () {
let { dateRangeFormat } = this
let now = new Date()
let minDate = new Date(new Date().setDate(now.getDate() - 30))
this.minDate = minDate
this.default_Date = [minDate, now]
let startDate = minDate.format(dateRangeFormat)
let endDate = now.format(dateRangeFormat)
this.dateRange = `${startDate}-${endDate}`
this.getTasksList({
startDate,
endDate
})
},
onConfirmCalendar (e) {
let { dateRangeFormat } = this
let [start, end] = e
let startDate = start.format(dateRangeFormat)
let endDate = end.format(dateRangeFormat)
this.dateRange = `${startDate}-${endDate}`
this.showCalendar = false
this.tasksFlag = false
this.getTasksList({
startDate,
endDate
})
},
changeType (e, target) {
let { dateRange } = this
let [startDate, endDate] = dateRange.split('-')
this[target] = e
this.tasksFlag = false
this.getTasksList({
startDate,
endDate
})
},
getTasksList ({ startDate = '', endDate = '' }) {
this.showLoading()
let { status, taskType } = this
if (startDate) startDate = `${startDate.replace(/\./g, '-')} 00:00:00`
if (endDate) endDate = `${endDate.replace(/\./g, '-')} 23:59:59`
let obj = {
status,
taskType,
startDate,
endDate
}
console.log(obj)
wwbenchApi.getTasksList(obj).then(({ code, data, message }) => {
this.hideLoading()
if (code == 0) {
this.tasksList = data
} else {
Notify(message)
}
this.tasksFlag = true
})
},
changeAccount (id) {
console.log(id)
let { accountList } = this
try {
accountList.map(e => {
if (e.value == id) throw e
})
} catch (e) {
this.showLoading('切换中...')
ssoApi
.changeLoginAccount({
loginAccount: e.accountName,
merchantId: id
})
.then(({ code, data, message }) => {
this.hideLoading()
if (code == '0') {
this.setLocalStorage('dj_scrm_userInfo', data)
console.log(data)
this.init()
} else {
Notify(message)
}
})
}
},
click (e) {
let { status, id, taskType } = e
if (status == 2 && (taskType != 6 || taskType != 8)) return
if (taskType == 6 || taskType == 8) {
this.jump(e)
} else {
wwbenchApi.updateTasks({ id }).then(res => {
if (taskType == 3 || taskType == 4) {
Dialog.alert({
message: `请去企业微信“消息”列表-“${text}”中进行转发`,
theme: 'round-button',
confirmButtonText: '我知道了',
confirmButtonColor: '#3975C6'
})
} else {
this.jump(e)
}
})
}
},
jump (e) {
let { taskId, taskType } = e
let sessionId = this.getSessionId()
let { corpId } = this.getLocalStorage('dj_scrm_corpId')
let link = {
1: 'customerDetails',
2: 'customerGroup/mass',
5: 'customer/information',
6: 'home',
8: 'clew/detail'
}[taskType]
let { path } = subsystemInfo[{
5: 'customer',
6: 'sop',
8: 'clew'
}[taskType]]
if (link) {
if (!['prod', 'production'].includes(process.env.NODE_ENV)) path = '/dj-scrm-wx-work-main-lwk/#/'
let url = `${path}${link}?sessionId=${sessionId}&corpId=${corpId}`
if (taskId) url = `${url}&taskId=${taskId}`
window.location.href = url
}
}
}
}
import { wxConfig, marketingApi } from '@/api'
export default {
data () {
return {
entry: 'normal'
}
},
mounted () {
this.wxInit()
},
methods: {
wxInit () {
let _this = this
wxConfig.init(['getContext', 'shareAppMessage', 'shareToExternalMoments'])
},
shareToExternalMoments (i) {
this.sendMessage(i, true)
},
sendMessage (i, isPyq) {
const { shopmall_appid, envVersion } = window.$fetchConfig
const path = 'pages/psdView/psdView'
const { merchantId, uuid, sapCode } = this.getLocalStorage('dj_scrm_userInfo')
const { entry } = this
const { materialName, id, titleUrl, materialTitle, description } = i
const imgUrl = 'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/test/test.jpg'
let query = `merchantId=${merchantId}&id=${id}&staffUuid=${uuid}&shareTime=${Date.now()}`
if (sapCode) query = `${query}&storeCode=${sapCode}`
wxConfig.createMiniprogramUrlLink({
path,
query,
appId: shopmall_appid,
envVersion
})
.then(link => {
this.showLoading()
if (isPyq) {
console.log('朋友圈')
wxConfig.shareToExternalMoments({
attachments: [
{
msgtype: 'link', // 消息类型,必填
link: {
title: materialTitle || materialName, // H5消息标题
imgUrl: titleUrl || imgUrl, // H5消息封面图片URL
url: link // H5消息页面url 必填
},
}
]
}).then(() => {
this.sendReadBuriedPoint({ id, merchantId, uuid })
this.hideLoading()
})
.catch(err => {
this.hideLoading()
})
} else {
let params = {
link,
title: materialTitle || materialName,
desc: description || '',
imgUrl: titleUrl || imgUrl
}
this.shareAppMessage(params, { id, merchantId, uuid })
}
})
},
sendReadBuriedPoint ({ id, merchantId, uuid }) {
marketingApi.sendReadBuriedPoint({
materialId: id,
type: 1,
merchantId,
staffUuid: uuid
})
},
shareAppMessage (params, sendParams) {
wxConfig
.shareAppMessage(params)
.then(() => {
this.sendReadBuriedPoint(sendParams)
this.hideLoading()
})
.catch(() => {
this.hideLoading()
})
}
}
}
......@@ -7,9 +7,7 @@
* @LastEditTime: 2021-07-06 12:02:21
*/
const state = {
pageMeta: '',
keepAlives: [],
lastPath: ''
reportParams: {}
}
const mutations = {
SET_PAGE_META (state, meta) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!