Commit fa89afd9 by 杨明

Merge branch 'v3.19.0' of http://192.168.3.233:8090/saas/scrm-micro-scene into v3.19.0

2 parents 4775861d 46118e97
......@@ -53,7 +53,7 @@ const refreshInst = params => {
return http_sop({
url: `process/sop/api/inst/refresh/${params.instId}`,
method: 'get',
data: params,
// data: params,
sign: false
})
}
......
......@@ -22,3 +22,4 @@ export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params)
export const http_common = params => Vue.prototype.$http_common(params)
export const http_sop = params => Vue.prototype.$http_sop(params)
export const http_merchant = params => Vue.prototype.$http_merchant(params)
<template>
<div class="journey" v-loading="loading">
<div
class="journey"
v-loading="loading"
>
<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="refreshInst" plain>状态刷新</el-button>
<el-button type="default" @click="changeViewType">切换为{{viewType == 1?'列表':'看板'}}视图</el-button>
<el-button type="default" @click="handleExport">导出</el-button>
<el-button
type="default"
@click="refreshInst"
plain
>状态刷新</el-button>
<el-button
type="default"
@click="changeViewType"
>切换为{{viewType == 1?'列表':'看板'}}视图</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>
<template v-if="stageList && stageList.length">
<div class="flex">
<div class="flex-default tabs">
<div class="flex">
<div class="flex-default tabs">
<template v-if="stageList && stageList.length">
<template v-for="(i, index) in stageList">
<template>
<div :class="['tab', { active: searchForm.sopJourneyStage == i.label }]" :key="index" @click="changeTab(i.label)">
<div
:class="['tab', { active: searchForm.sopJourneyStage == i.value }]"
:key="index"
@click="changeTab(i.value)"
>
{{ i.label }}
</div>
</template>
</template>
</div>
</template>
</div>
</template>
</div>
<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>
......@@ -56,7 +90,7 @@ export default {
viewType: 1,
journeyList: [],
FormKey: Date.now(),
loading:false
loading: false
}
},
mounted () {
......@@ -81,7 +115,7 @@ export default {
})
},
getList () {
this.$apis.journeyConfig.byGroupIdSop({ groupId:this.$globalState.session.merchantId, pageNumber: 1 }).then(res => {
this.$apis.journeyConfig.byGroupIdSop({ groupId: this.$globalState.session.merchantId, pageNumber: 1 }).then(res => {
this.journeyList = res.list || []
this.journeyList.forEach(item => {
const stages = JSON.parse(item.instParam).stages
......@@ -122,22 +156,24 @@ export default {
...searchForm,
...tempParams
}
if(!searchForm.sopJourneyId) return
this.$nextTick(() => {
el.refreshTable()
})
},
handleReset () {
const { journeyList } = this
if (!journeyList.length) return
this.searchForm = {
sopJourneyStage: '',
sopJourneyId: journeyList[0].instId
}
this.searchSelectObj = this.$options.data.call(this).searchSelectObj
// this.searchFormData = this.$options.data.call(this).searchFormData
this.FormKey = Date.now()
this.handleSearch()
},
handleExport () {
if(!this.searchForm.sopJourneyId) return
this.$apis.journey.exportExcel({ ...this.searchForm, pageSize: 10000, pageNumber: 1 }).then(res => {
if (res.secureUrl) exportFn(res.secureUrl)
})
......@@ -149,14 +185,19 @@ export default {
async refreshInst () {
const { sopJourneyId } = this.tableSearchForm,
{ refreshTime } = this
if(!sopJourneyId) return
if (refreshTime && Date.now() - refreshTime < 1e4) return this.$message('数据正在刷新中,请勿频繁提交')
this.loading = true
const res = await this.$apis.journey.refreshInst({
instId: sopJourneyId
})
this.loading = false
this.refreshTime = Date.now()
this.handleSearch()
try {
this.loading = true
const res = await this.$apis.journey.refreshInst({
instId: sopJourneyId
})
this.loading = false
this.refreshTime = Date.now()
this.handleSearch()
} catch (error) {
this.loading = false
}
}
}
}
......@@ -169,19 +210,22 @@ export default {
.flex-default.tabs {
border-bottom: none;
display: flex;
gap: 2px;
gap: 1px;
height: 40px;
.tab {
background: #fafafa;
border: 1px solid #e5e5e5 !important;
border: 1px solid #e5e5e5;
border-radius: 4px 4px 0 0;
border-bottom: 0;
height: 40px !important;
line-height: 40px !important;
border-bottom: none;
height: 40px;
line-height: 40px;
width: fit-content;
min-width: 86px;
padding: 0 20px !important;
padding: 0 20px;
text-align: center;
cursor: pointer;
box-sizing: border-box;
color: #666;
}
.active,
.tab:hover {
......
......@@ -2,103 +2,112 @@
<div class="data-view">
<div class="title">旅程看板</div>
<div class="carousel-box">
<el-carousel
ref="carousel"
:autoplay="false"
:loop="false"
indicator-position="none"
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">
<img :src="`https://img01.glsx.com.cn/weapp/resource/saas/scrm/data-view-sop-${cindex}.png`">
<template v-if="viewList.length">
<el-carousel
ref="carousel"
:autoplay="false"
:loop="false"
indicator-position="none"
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">
<img :src="`https://img01.glsx.com.cn/weapp/resource/saas/scrm/data-view-sop-${cindex}.png`">
</div>
{{ c.title }}
</div>
<div class="line-box">
<div
class="line"
:style="[{ width: c.width }]"
></div>
</div>
{{ c.title }}
</div>
<div class="line-box">
<div
class="line"
:style="[{ width: c.width }]"
></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 class="top flex">
<div class="icon">
<template v-if="item.wechatAvatarUrl">
<img :src="item.wechatAvatarUrl" />
</template>
<template v-else>
<img src="@/assets/icon/default-avatar.png" />
</template>
<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 class="top flex">
<div class="icon">
<template v-if="item.wechatAvatarUrl">
<img :src="item.wechatAvatarUrl" />
</template>
<template v-else>
<img src="@/assets/icon/default-avatar.png" />
</template>
</div>
<div class="text">
<div class="name">{{ item.wechatNickname}}</div>
{{ item.customerPhone }}
</div>
</div>
<div class="text">
<div class="name">{{ item.wechatNickname}}</div>
{{ item.customerPhone }}
<div class="bottom flex">
<div class="left text-hide">进入该阶段:第{{ item.day }}天</div>
<div class="right text-hide">跟进人:{{ item.sopFollowUpPersonName }}</div>
</div>
</div>
<div class="bottom flex">
<div class="left text-hide">进入该阶段:第{{ item.day }}天</div>
<div class="right text-hide">跟进人:{{ item.sopFollowUpPersonName }}</div>
</div>
</div>
</template>
</template>
</template>
</template>
<template v-else>
<div class="nothing">
<img src="@/assets/icon/nodata.png" />
</div>
</template>
</el-scrollbar>
</div>
<template v-else>
<div class="nothing">
<img src="@/assets/icon/nodata.png" />
</div>
</template>
</el-scrollbar>
</div>
</template>
</template>
</template>
</el-carousel-item>
</el-carousel-item>
</template>
</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>
</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>
</template>
<template v-else>
<div class="nothing">
<img :src="nothing">
暂无数据
</div>
</template>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import * as dayjs from 'dayjs'
import nothing from '@/assets/icon/data-view-nothing.png'
export default {
name: '',
props: {
......@@ -120,7 +129,8 @@ 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,
nothing
}
},
mounted () {
......@@ -128,7 +138,6 @@ export default {
},
methods: {
async refreshTable () {
console.log(dayjs)
function splitArrayIntoChunks (arr, chunkSize) {
const weight = 1 / arr.length
return arr.reduce((result, item, index) => {
......@@ -319,6 +328,20 @@ export default {
transform: translateY(-50%) scale(1);
}
}
.nothing {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
font-size: 16px;
color: #999999;
img {
width: 268px;
height: 88px;
}
}
}
}
</style>
......@@ -230,17 +230,9 @@ export default {
this.refreshTable()
},
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.$nextTick(() => {
console.log(this.$refs)
if (!this.params.sopJourneyId) return
const params = {
...JSON.parse(JSON.stringify(this.params)),
pageSize: this.$refs.tableRef.page.pageSize,
......@@ -291,6 +283,9 @@ export default {
align-items: center;
}
.journey-table {
padding: 20px;
border: 1px solid #e5e5e5;
border-radius: 0 4px 4px 4px;
/deep/.el-drawer__header {
margin-bottom: 0;
padding-top: 0;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!