Commit 61e8ac83 by 李伟康

提交旅程列表

1 parent 7511992e
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.'
const getListApi = params => {
params.method = `${defaultPath}order.page`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default {
getListApi
}
\ No newline at end of file
......@@ -20,6 +20,7 @@ html {
.live-room.p-t-20 {
padding-top: 20px;
}
.live-room .table-circle {
display: inline-block;
width: 6px;
......@@ -47,10 +48,59 @@ html {
.live-room .back-red {
background-color: #eb4e4e;
}
.live-room .m-r-8 {
margin-right: 8px;
}
.message-Z-zinde,
.live-room .message-Z-zinde {
z-index: 9999 !important;
}
.journey {
.el-tabs__item {
height: 20px !important;
line-height: 10px !important;
}
.el-tabs__item {
box-sizing: border-box;
width: 120px;
height: 48px !important;
line-height: 48px !important;
font-size: 14px;
text-align: center;
border: 0 !important;
color: #666666;
background: #fafafa;
border-radius: 4px 4px 0px 0px;
border: 1px solid #eeedff;
padding: 0;
margin-right: 1px;
}
.el-tabs__active-bar {
display: none;
}
.el-tabs__header {
margin: 0 !important;
}
.el-tabs__item.is-active {
color: #5850ff;
background: #ffffff !important;
border-radius: 4px 4px 0px 0px;
}
}
.text-hide{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
img{
width: 100%;
height: 100%;
vertical-align: top;
}
\ No newline at end of file
<!--
* @Author: yangming yangming@didihu.com.cn
* @Date: 2023-09-05 17:23:03
* @LastEditors: yangming yangming@didihu.com.cn
* @LastEditTime: 2023-09-05 17:23:24
* @FilePath: \scrm-micro-journey\src\views\journey\index.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div>
555
<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>
<div :class="['sticky-btns',{'hiddenExport':viewType == 1}]">
<div class="btns">
<el-button
type="default"
@click="handleExport"
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"
></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>
</div>
</div>
<div class="journey-table">
<journey-table
ref="table"
:params="tableSearchForm"
></journey-table>
</div>
</template>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { combiFormConfig } from './index/config'
import journeyTable from './index/table.vue'
import dataView from './index/dataView.vue'
export default {
mixins: [combiFormConfig],
components: {
journeyTable,
dataView
},
name: '',
data () {
return {
requestSourceList: ['全部', '进行中', '高意向', '成功续保', '战败'],
viewType: 11,
FormKey: Date.now()
}
},
mounted () {
},
methods: {
handleSearch () {
const { viewType, $refs } = this,
el = viewType == 1 ? $refs.dataView : $refs.table,
tempParams = this.getSelectInputParams(),
searchForm = JSON.parse(JSON.stringify(this.searchForm))
this.tableSearchForm = {
...searchForm,
...tempParams
}
this.$nextTick(() => {
el.refreshTable()
})
},
handleReset () {
let { requestSource } = this.searchForm
this.searchForm = Object.assign(this.$options.data.call(this).searchForm, { requestSource })
this.searchSelectObj = this.$options.data.call(this).searchSelectObj
this.searchFormData = this.$options.data.call(this).searchFormData
this.FormKey = Date.now()
this.handleSearch()
},
handleExport () {
},
changeViewType () {
this.viewType = this.viewType == 1 ? 0 : 1
}
}
}
</script>
<style scoped lang='scss'>
.journey {
padding: 20px;
background-color: #fff;
.flex-default.tabs {
border-bottom: none;
/deep/.el-tabs__nav-wrap {
&::after {
display: none;
}
}
/deep/.el-tabs__item {
background: #fafafa;
border: 1px solid #e5e5e5 !important;
border-radius: 4px 4px 0 0;
border-bottom: 0;
height: 40px !important;
line-height: 40px !important;
width: fit-content;
min-width: 86px;
padding: 0 20px !important;
}
/deep/.is-active {
border-bottom: none;
font-weight: 500;
}
}
&-table {
padding: 20px;
border: 1px solid #e5e5e5;
}
&-data-view {
height: calc(100vh - 224px);
}
.sticky {
position: relative;
z-index: 2;
&-btns {
position: absolute;
right: 0;
bottom: -33px;
overflow: hidden;
.el-button + .el-button {
margin-left: 8px;
}
.btns {
transition: all 0.25s;
}
}
.hiddenExport {
.btns {
transform: translateX(68px);
}
}
}
}
</style>
let _this = null
const defaultFormData = {
a: '',
b: '',
c: '',
d: '',
requestSource: '0'
}
export default {
created () {
_this = this
},
data () {
return {
searchForm: {
...defaultFormData
},
searchSelectObj: {
keyword: {
attr: 'customerPhone',
value: ''
}
},
searchFormData: [
{
label: '旅程',
name: 'a',
type: 'select',
labelWidth: 56,
optionList: [
{
confId: '',
confName: '全部'
},
{
confId: '0',
confName: '未支付'
},
],
optionId: 'confId',
optionLabel: 'confName',
changeAttr: e => {
_this.searchFormData.find(i => i.name === 'b').isDisabled = !e
}
},
{
label: '旅程阶段',
name: 'b',
type: 'select',
labelWidth: 56,
isDisabled: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
},
{
type: 'selectInput',
selectName: 'keyword',
isClear: true,
inputWidth: '320px',
selectWidth: '110px',
selectOption: [
{
label: '客户电话',
name: 'customerPhone'
},
{
label: '客户姓名',
name: 'customerName'
},
{
label: '微信昵称',
name: 'nickName'
}
],
handleSelectChange (value) {
_this.searchSelectObj.keyword.value = ''
}
},
{
label: '跟进人',
name: 'c',
type: 'select',
labelWidth: 56,
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
},
{
label: '进入旅程时间',
name: 'd',
type: 'datePicker',
labelWidth: 72,
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
],
tableSearchForm: {
...defaultFormData
}
}
},
methods: {
getSelectInputParams () {
const list = Object.keys(this.searchSelectObj)
var params = {}
list.forEach(i => {
const item = this.searchSelectObj[i]
item.value && (params[item.attr] = item.value)
})
return params
},
},
}
\ No newline at end of file
import combiFormConfig from './combiFormConfig'
export {
combiFormConfig
}
\ No newline at end of file
<template>
<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"
>
<template v-for="(i,index) in viewList">
<template>
<el-carousel-item
:key="index"
class="carousel-item"
>
<template v-for="(c,cindex) in i">
<template>
<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':c.width}]"
></div>
</div>
</div>
<div class="content">
<template v-for="(item,ind) in c.list">
<template>
<div
:key="ind"
class="item"
>
<div class="top flex">
<div class="icon">
<template v-if="item.icon">
<img :src="item.icon">
</template>
<template v-else>
<img src="@/assets/icon/default-avatar.png">
</template>
</div>
<div class="text">
<div class="name">微信昵称</div>
18888888888
</div>
</div>
<div class="bottom flex">
<div class="left text-hide">进入该阶段:第1天</div>
<div class="right text-hide">跟进人:姓名啊</div>
</div>
</div>
</template>
</template>
</div>
</div>
</template>
</template>
</el-carousel-item>
</template>
</template>
</el-carousel>
<div
class="arrow left"
@click="$refs.carousel.prev()"
>
<img :src="viewIndex == 0 ? leftIcon:leftActiveIcon" />
</div>
<div
class="arrow right"
@click="$refs.carousel.next()"
>
<img :src="viewIndex < viewList.length - 1 ?rightActiveIcon:rightIcon" />
</div>
</div>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: '',
props: {
params: {
type: Object,
default: () => { }
}
},
data () {
return {
viewList: [
[
{
title: '待跟进',
list: new Array(8).fill({}),
width: '12.5%'
},
{
title: '已成交',
list: new Array(15).fill({}),
width: '25%'
},
{
title: '有意向',
list: new Array(4).fill({}),
width: '37.5%'
},
{
title: '已报价',
list: new Array(5).fill({}),
width: '50%'
},
],
[
{
title: '小熊猫',
list: new Array(115).fill({}),
width: '62.5%'
},
{
title: '啊啊啊',
list: new Array(11).fill({}),
width: '75%'
},
{
title: '恒河猴',
list: new Array(16).fill({}),
width: '87.5%'
},
{
title: '嘻嘻嘻',
list: new Array(3).fill({}),
width: '100%'
}
]
],
viewIndex: 0,
leftIcon: require('@/assets/icon/left.png'),
leftActiveIcon: require('@/assets/icon/left-active.png'),
rightIcon: require('@/assets/icon/right.png'),
rightActiveIcon: require('@/assets/icon/right-active.png')
}
},
mounted () {
this.refreshTable()
},
methods: {
refreshTable () {
const params = JSON.parse(JSON.stringify(this.params))
params.requestSource = ''
console.log(JSON.parse(JSON.stringify(params)))
},
}
}
</script>
<style scoped lang="scss">
.flex {
display: flex;
align-items: center;
}
.data-view {
height: 100%;
.title {
font-weight: 500;
font-size: 16px;
color: #333333;
padding: 8px 0 16px;
}
.carousel-box {
height: calc(100% - 40px);
position: relative;
.carousel {
height: 100%;
&-item {
display: flex;
gap: 8px;
.group {
flex: 1;
max-width: 280px;
height: 100%;
background: #f9f9fe;
border-radius: 4px;
.title {
height: 60px;
background: #f0efff;
border-radius: 4px 4px 0 0;
box-sizing: border-box;
padding: 10px 16px;
.text {
font-weight: 500;
font-size: 16px;
color: #5850ff;
.icon {
width: 30px;
height: 30px;
margin-right: 8px;
}
}
.line-box {
height: 2px;
background: #d6d4f8;
border-radius: 1px;
margin-top: 8px;
.line {
height: 100%;
background-color: #5850ff;
border-radius: 1px;
transition: all 0.25s;
}
}
}
.content {
height: calc(100% - 60px);
overflow-y: scroll;
box-sizing: border-box;
padding: 16px 16px 8px;
&::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.item {
height: 91px;
background: #ffffff;
border-radius: 4px;
margin-bottom: 8px;
.top {
border-bottom: 1px solid #f0efff;
padding: 8px;
.icon {
width: 40px;
height: 40px;
margin-right: 8px;
overflow: hidden;
border-radius: 100%;
}
.text {
font-size: 12px;
color: #666666;
.name {
font-weight: 500;
font-size: 14px;
color: #333333;
margin-bottom: 4px;
}
}
}
.bottom {
height: 33px;
justify-content: space-between;
padding: 0 8px;
font-size: 12px;
color: #666666;
.text-hide {
flex: 1;
}
.right {
text-align: right;
}
}
}
}
}
}
}
&:hover {
.arrow {
display: block;
}
}
.arrow {
display: none;
position: absolute;
width: 36px;
height: 36px;
top: 50%;
transform: translateY(-50%) scale(1.15);
z-index: 2;
cursor: pointer;
opacity: 0;
animation: show-arrow 0.25s forwards;
}
.left {
left: -18px;
}
.right {
right: -18px;
}
@keyframes show-arrow {
to {
opacity: 1;
transform: translateY(-50%) scale(1);
}
}
}
}
</style>
<template>
<div class="journey-table">
<GLTable
ref="tableRef"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
>
<div
class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
></GLTableButton>
</div>
</GLTable>
<el-drawer
:visible.sync="showDrawer"
direction="rtl"
size="720px"
>
<template #title>
<div class="drawer-title">编辑客户旅程</div>
</template>
<div class="customer-detail">
<div class="info flex">
<div class="icon">
<template v-if="currentItem.icon">
<img :src="currentItem.icon">
</template>
<template v-else>
<img src="@/assets/icon/default-avatar.png">
</template>
</div>
<div class="text">
<div class="name">恒河猴</div>
18888888888
</div>
</div>
<div class="tags">
<div class="label">旅程阶段:</div>
<template v-for="(i,index) in currentItem.mainOrderCode">
<template>
<div
:key="index"
class="tags-item flex"
>
<el-button
:class="['text',{'disabled':i.disabled || i == 2},{'active':i.active || i == 1}]"
:disabled="i.disabled"
>{{ i }}恒河猴</el-button>
<div class="arrow"></div>
</div>
</template>
</template>
</div>
<div class="file">
<div class="title flex">
<div class="icon">
<img src="@/assets/icon/file.png">
</div>
智能档案
</div>
<template v-for="(i,index) in fileObject">
<template>
<div
:key="index"
class="file-item flex"
>
<div class="label">{{ i.label }}:</div>
<div class="value">恒河猴{{ i.key }}</div>
</div>
</template>
</template>
</div>
</div>
<div class="footer flex">
<el-button
type="default"
@click="showDrawer = false"
>取消</el-button>
<el-button
type="primary"
@click="handleConfirm"
>确定</el-button>
</div>
</el-drawer>
</div>
</template>
<script type='text/ecmascript-6'>
import url from '@/assets/empty.png'
export default {
name: '',
props: {
params: {
type: Object,
default: () => { }
}
},
data () {
return {
currentItem: {},
tableSearchForm: {},
url,
// 表格
getListApi: this.$apis.a.getListApi,
tableParams: {
listName: 'list',
tableOption: {
width: '62px'
},
tableColumns: [
{
label: '客户姓名',
prop: 'orderCode',
minWidth: '100px'
},
{
label: '客户电话',
prop: 'orderCode',
minWidth: '100px'
},
{
label: '微信昵称',
prop: 'orderCode',
minWidth: '100px'
},
{
label: '旅程',
prop: 'orderCode',
minWidth: '100px'
},
{
label: '进入旅程时间',
prop: 'orderCode',
minWidth: '160px'
},
{
label: '所处旅程天数',
prop: 'orderCode',
minWidth: '160px'
},
{
label: '旅程阶段',
prop: 'orderCode',
minWidth: '100px'
},
{
label: '所处旅程阶段天数',
prop: 'orderCode',
minWidth: '160px'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 表格按钮
tableButtonList: [
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text'
},
condition: row => true,
listeners: {
click: row => {
this.currentItem = row
this.showDrawer = true
}
}
},
],
showDrawer: true,
fileObject: [
{
label: '车牌号',
key: ''
},
{
label: '车架号',
key: ''
},
{
label: '品牌车型',
key: ''
},
{
label: '购车日期',
key: ''
},
{
label: '近期保养',
key: ''
},
{
label: '保险到期日期',
key: ''
}
]
}
},
mounted () {
},
methods: {
beforeSearchFn () {
return new Promise(resolve => {
console.log(JSON.parse(JSON.stringify(this.params)))
this.tableSearchForm = this.params
// delete this.tableSearchForm.createDate
resolve()
})
},
refreshTable () {
this.$refs.tableRef.refreshTable()
},
handleConfirm () {
this.showDrawer = false
}
}
}
</script>
<style scoped lang='scss'>
.flex {
display: flex;
align-items: center;
}
.journey-table {
/deep/.el-drawer__header {
margin-bottom: 0;
padding-top: 0;
}
.drawer-title {
font-weight: 500;
font-size: 20px;
color: #333333;
padding: 16px 0;
}
.customer-detail {
height: calc(100% - 63px);
box-sizing: border-box;
border: 1px solid #e5e5e5;
border-right: none;
border-left: none;
padding: 20px;
.info {
.icon {
width: 40px;
height: 40px;
margin-right: 8px;
border-radius: 100%;
overflow: hidden;
}
.text {
font-size: 12px;
color: #666666;
.name {
font-weight: 500;
font-size: 14px;
color: #333333;
margin-bottom: 4px;
}
}
}
.tags {
font-size: 14px;
color: #333333;
display: flex;
flex-wrap: wrap;
margin-top: 20px;
.label {
line-height: 24px;
}
&-item {
margin-bottom: 8px;
.text {
height: 24px;
border-radius: 2px;
padding: 0 8px;
background: #eeedff;
color: #5850ff;
line-height: 24px;
border: none;
&:hover {
opacity: 0.75;
}
}
.disabled {
background: #f3f3f3 !important;
color: #666666 !important;
}
.active {
background: #5850ff !important;
color: #fff !important;
}
.arrow {
margin: 0 4px;
width: 32px;
height: 4px;
position: relative;
&::before {
position: absolute;
width: 100%;
height: 1px;
content: '';
left: 0;
bottom: 0;
background: #5850ff;
}
&::after {
position: absolute;
right: 0;
-webkit-clip-path: polygon(0 0, 0% 100%, 100% 100%);
clip-path: polygon(0 0, 0% 100%, 100% 100%);
bottom: 0;
width: 4px;
height: 4px;
content: '';
background: #5850ff;
}
}
&:last-of-type {
.arrow {
display: none;
}
}
}
}
.file {
margin-top: 12px;
background: #f9f9fe;
padding: 0 20px 20px;
.title {
border-bottom: 1px solid #ebebf9;
height: 46px;
padding-left: 20px;
font-weight: 500;
font-size: 16px;
color: #333333;
width: calc(100% + 40px);
transform: translateX(-20px);
.icon {
width: 20px;
height: 20px;
margin-right: 4px;
}
}
&-item {
margin-top: 16px;
.label {
color: #666666;
margin-left: auto;
}
.value {
width: calc(100% - 100px);
line-height: 20px;
}
}
}
}
.footer {
height: 63px;
padding-right: 20px;
box-shadow: none;
justify-content: flex-end;
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!