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