Commit 9d7aae1e by 李伟康

提交

1 parent 57270929
......@@ -2,30 +2,67 @@
<div class="journey">
<div class="container">
<div class="sticky">
<GLCombiForm ref="showSearch" :rowNumber="2" :formObj="searchForm" :formData="searchFormData" :searchSelectObj="searchSelectObj" @handleOk="handleSearch" @handleRest="handleReset" :key="FormKey"></GLCombiForm>
<GLCombiForm
ref="showSearch"
:rowNumber="2"
:formObj="searchForm"
:formData="searchFormData"
:searchSelectObj="searchSelectObj"
@handleOk="handleSearch"
@handleRest="handleReset"
:key="FormKey"
></GLCombiForm>
<div :class="['sticky-btns', { hiddenExport: viewType == 1 }]">
<div class="btns">
<el-button type="default" @click="handleRefresh" plain>状态刷新</el-button>
<el-button type="default" @click="changeViewType">切换为看板视图</el-button>
<el-button type="default" @click="handleExport">导出</el-button>
<el-button
type="default"
@click="handleRefresh"
plain
>状态刷新</el-button>
<el-button
type="default"
@click="changeViewType"
>切换为看板视图</el-button>
<el-button
type="default"
@click="handleExport"
>导出</el-button>
</div>
</div>
</div>
<template v-if="viewType == 1">
<div class="journey-data-view">
<data-view :params="tableSearchForm" ref="dataView" :stageList="stageList"></data-view>
<data-view
:params="tableSearchForm"
ref="dataView"
:stageList="stageList"
></data-view>
</div>
</template>
<template v-else>
<div class="flex">
<div class="flex-default tabs">
<el-tabs v-model="searchForm.requestSource" @tab-click="handleSearch">
<el-tab-pane :label="i" :name="index" :key="index" v-for="(i, index) in requestSourceList"></el-tab-pane>
</el-tabs>
<template v-if="stageList && stageList.length">
<div class="flex">
<div class="flex-default tabs">
<template v-for="(i,index) in stageList">
<template>
<div
:class="['tab',{'active':searchForm.sopJourneyStage == i.value}]"
:key="index"
@click="changeTab(i.value)"
>
{{ i.label }}
</div>
</template>
</template>
</div>
</div>
</div>
</template>
<div class="journey-table">
<journey-table ref="table" :params="tableSearchForm" :stageList="stageList"></journey-table>
<journey-table
ref="table"
:params="tableSearchForm"
:stageList="stageList"
></journey-table>
</div>
</template>
</div>
......@@ -45,7 +82,6 @@ export default {
name: '',
data () {
return {
requestSourceList: ['全部', '进行中', '高意向', '成功续保', '战败'],
viewType: 11,
journeyList: [],
FormKey: Date.now()
......@@ -56,12 +92,16 @@ export default {
this.getCustomersList();
},
methods: {
getList() {
getList () {
this.$apis.journeyConfig.byGroupIdSop({ groupId: 'M153312087', pageNumber: 1 }).then(res => {
this.journeyList = res.list || []
this.journeyList.forEach(item => {
this.journeyList = res.list || []
this.journeyList.forEach(item => {
const stages = JSON.parse(item.instParam).stages
item.journeyItem = []
item.journeyItem = [{
label: '全部',
value: ''
}]
for (let k in stages) {
item.journeyItem.push({
label: stages[k].value,
......@@ -75,6 +115,10 @@ export default {
this.handleSearch()
})
},
changeTab(val){
this.searchForm.sopJourneyStage = val
this.handleSearch()
},
handleSearch () {
const { viewType, $refs } = this,
el = viewType == 1 ? $refs.dataView : $refs.table,
......@@ -89,15 +133,14 @@ export default {
})
},
handleReset () {
let { requestSource } = this.searchForm
this.searchForm = Object.assign(this.$options.data.call(this).searchForm, { requestSource })
// this.searchForm = this.$options.data.call(this).searchForm
this.searchSelectObj = this.$options.data.call(this).searchSelectObj
this.searchFormData = this.$options.data.call(this).searchFormData
// this.searchFormData = this.$options.data.call(this).searchFormData
this.FormKey = Date.now()
this.handleSearch()
},
handleExport () {
this.$apis.journey.exportExcel({...this.searchForm, pageSize: 10000,pageNumber: 1}).then(res=>{
this.$apis.journey.exportExcel({ ...this.searchForm, pageSize: 10000, pageNumber: 1 }).then(res => {
console.log(res)
})
},
......@@ -114,12 +157,9 @@ export default {
background-color: #fff;
.flex-default.tabs {
border-bottom: none;
/deep/.el-tabs__nav-wrap {
&::after {
display: none;
}
}
/deep/.el-tabs__item {
display: flex;
gap: 2px;
.tab {
background: #fafafa;
border: 1px solid #e5e5e5 !important;
border-radius: 4px 4px 0 0;
......@@ -129,10 +169,12 @@ export default {
width: fit-content;
min-width: 86px;
padding: 0 20px !important;
text-align: center;
cursor: pointer;
}
/deep/.is-active {
border-bottom: none;
font-weight: 500;
.active,.tab:hover {
background-color: #fff;
color: #5850ff;
}
}
&-table-box {
......
let _this = null
const defaultFormData = {
requestSource: '0'
sopJourneyStage: ''
}
import * as dayjs from 'dayjs'
export default {
created() {
created () {
_this = this
},
data() {
data () {
return {
searchForm: {
...defaultFormData
......@@ -61,7 +61,7 @@ export default {
name: 'wechatNickname'
}
],
handleSelectChange(value) {
handleSelectChange (value) {
_this.searchSelectObj.keyword.value = ''
}
},
......@@ -81,7 +81,7 @@ export default {
labelWidth: 72,
isClear: true,
customPickerOptions: {
disabledDate(val) {
disabledDate (val) {
let disabled = true,
startTime = dayjs().subtract(1, 'year'),
endTime = dayjs(),
......@@ -106,7 +106,7 @@ export default {
// console.log(newval)
// }
// },
'searchForm.a'(newval) {
'searchForm.a' (newval) {
//清空旅程阶段并调用旅程阶段接口
console.log(newval, 'a')
}
......@@ -117,12 +117,13 @@ export default {
// }
// },
methods: {
getStage(e) {
getStage (e) {
const step = _this.searchFormData.find(i => i.name === 'sopJourneyStage')
step.optionList = _this.journeyList.find(i => i.instId == e).journeyItem
let optionList = _this.journeyList.find(i => i.instId == e).journeyItem
step.optionList = optionList
this.stageList = step.optionList
},
getSelectInputParams() {
getSelectInputParams () {
const list = Object.keys(this.searchSelectObj)
var params = {}
list.forEach(i => {
......
......@@ -2,27 +2,47 @@
<div class="data-view">
<div class="title">旅程看板</div>
<div class="carousel-box">
<el-carousel ref="carousel" :autoplay="false" :loop="false" height="100%" arrow="never" class="carousel" @change="viewIndex = $event">
<el-carousel
ref="carousel"
:autoplay="false"
:loop="false"
height="100%"
arrow="never"
class="carousel"
@change="viewIndex = $event"
>
<template v-for="(i, index) in viewList">
<template>
<el-carousel-item :key="index" class="carousel-item">
<el-carousel-item
:key="index"
class="carousel-item"
>
<template v-for="(c, cindex) in i">
<template>
<div :key="cindex" class="group">
<div
:key="cindex"
class="group"
>
<div class="title">
<div class="text flex">
<div class="icon"></div>
{{ c.title }}
</div>
<div class="line-box">
<div class="line" :style="[{ width: (100 * (cindex + 1)) / i.length + '%' }]"></div>
<div
class="line"
:style="[{ width: (100 * (cindex + 1)) / i.length + '%' }]"
></div>
</div>
</div>
<el-scrollbar class="content">
<template v-if="c.list.length">
<template v-for="(item, ind) in c.list">
<template>
<div :key="ind" class="item">
<div
:key="ind"
class="item"
>
<div class="top flex">
<div class="icon">
<template v-if="item.icon">
......@@ -58,10 +78,16 @@
</template>
</template>
</el-carousel>
<div class="arrow left" @click="$refs.carousel.prev()">
<div
class="arrow left"
@click="$refs.carousel.prev()"
>
<img :src="viewIndex == 0 ? leftIcon : leftActiveIcon" />
</div>
<div class="arrow right" @click="$refs.carousel.next()">
<div
class="arrow right"
@click="$refs.carousel.next()"
>
<img :src="viewIndex < viewList.length - 1 ? rightActiveIcon : rightIcon" />
</div>
</div>
......@@ -79,7 +105,7 @@ export default {
},
stageList: {
type: Array,
default: () => { }
default: () => { }
},
},
data () {
......@@ -91,7 +117,7 @@ export default {
leftActiveIcon: require('@/assets/icon/left-active.png'),
rightIcon: require('@/assets/icon/right.png'),
rightActiveIcon: require('@/assets/icon/right-active.png'),
pageNumber:1
pageNumber: 1
}
},
mounted () {
......@@ -99,16 +125,36 @@ export default {
},
methods: {
async refreshTable () {
function splitArrayIntoChunks (arr, chunkSize) {
const weight = 1 / arr.length
return arr.reduce((result, item, index) => {
const chunkIndex = Math.floor(index / chunkSize)
item.width = `${(weight * index + weight) * 100}%`
result[chunkIndex] = result[chunkIndex] || []
result[chunkIndex].push(item)
return result
}, [])
}
const params = {
...JSON.parse(JSON.stringify(this.params)),
pageSize: 10,
pageSize: 9999,
pageNumber: this.pageNumber
}
const stageList = this.stageList
for(let k of stageList) {
const list = await this.$apis.journey.getCustomersList(params)
this.viewList.push(list.list)
const stageList = this.stageList,
arr = []
for (let k of stageList) {
if (k.value) {
params.sopJourneyStage = k.value
const { list } = await this.$apis.journey.getCustomersList(params)
arr.push({
title: k.label,
list
})
}
}
this.viewList = splitArrayIntoChunks(arr, 4)
this.dataViewLoading = false
},
}
}
......
......@@ -182,6 +182,7 @@ export default {
}
},
mounted () {
this.refreshTable()
},
methods: {
// beforeSearchFn () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!