Commit d28c7d86 by 杨明

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

2 parents 92776448 0ebedc34
<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>
......@@ -22,7 +48,11 @@
<template v-if="stageList && stageList.length">
<template v-for="(i, index) in stageList">
<template>
<div :class="['tab', { active: searchForm.sopJourneyStage == i.value }]" :key="index" @click="changeTab(i.value)">
<div
:class="['tab', { active: searchForm.sopJourneyStage == i.value }]"
:key="index"
@click="changeTab(i.value)"
>
{{ i.label }}
</div>
</template>
......@@ -31,7 +61,11 @@
</div>
</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>
......@@ -94,11 +128,12 @@ export default {
item.journeyItem.push({
label: stages[k].value,
value: stages[k].value, // 后台要求改成label值 20230927
disabled: !stages[k].editable
})
}
})
this.searchFormData[0].optionList = this.journeyList
const {instId} = this.$route.query
const { instId } = this.$route.query
this.searchForm.sopJourneyId = instId?instId:this.journeyList[0].instId
this.getStage(this.searchForm.sopJourneyId)
this.handleSearch()
......@@ -109,10 +144,8 @@ export default {
this.searchForm.sopJourneyStage = val
this.handleSearch()
},
handleSearch () {
const { viewType, $refs } = this,
el = viewType == 1 ? $refs.dataView : $refs.table,
tempParams = this.getSelectInputParams(),
getParams () {
const tempParams = this.getSelectInputParams(),
searchForm = JSON.parse(JSON.stringify(this.searchForm))
if (searchForm.time) {
let sopJourneyEnterTimeBegin = dayjs(searchForm.time[0]).format('YYYY-MM-DD')
......@@ -125,7 +158,13 @@ export default {
...searchForm,
...tempParams
}
if(!searchForm.sopJourneyId) return
},
handleSearch () {
this.getParams()
const { viewType, $refs } = this,
el = viewType == 1 ? $refs.dataView : $refs.table,
{ sopJourneyId } = this.tableSearchForm
if (!sopJourneyId) return
this.$nextTick(() => {
el.refreshTable()
})
......@@ -142,8 +181,10 @@ export default {
this.handleSearch()
},
handleExport () {
if(!this.searchForm.sopJourneyId) return
this.$apis.journey.exportExcel({ ...this.searchForm, pageSize: 10000, pageNumber: 1 }).then(res => {
const { sopJourneyId } = this.tableSearchForm
if (!sopJourneyId) return
this.getParams()
this.$apis.journey.exportExcel({ ...this.tableSearchForm, pageSize: 10000, pageNumber: 1 }).then(res => {
if (res.secureUrl) exportFn(res.secureUrl)
})
},
......@@ -154,7 +195,7 @@ export default {
async refreshInst () {
const { sopJourneyId } = this.tableSearchForm,
{ refreshTime } = this
if(!sopJourneyId) return
if (!sopJourneyId) return
if (refreshTime && Date.now() - refreshTime < 1e4) return this.$message('数据正在刷新中,请勿频繁提交')
try {
this.loading = true
......
......@@ -170,7 +170,7 @@ export default {
}
list.length &&
list.forEach((e) => {
e.day = dayjs().diff(dayjs(e.sopJourneyStageEnterTime), 'day')
e.day = dayjs().diff(dayjs(e.sopJourneyStageEnterTime).format('YYYY/MM/DD'), 'day')
})
arr.push({
title: k.label,
......
......@@ -52,8 +52,8 @@
class="tags-item flex"
>
<el-button
:class="['text', { active: index == stageIndex }]"
:disabled="index < stageIndex"
:class="['text',{disabled:i.disabled}, { active: index == stageIndex }]"
:disabled="i.disabled"
@click="editStage(index)"
>{{ i.label }}</el-button>
<div class="arrow"></div>
......@@ -156,16 +156,13 @@ export default {
{
label: '进入旅程时间',
prop: 'sopJourneyEnterTime',
minWidth: '160px',
formatter: cell => {
return `${dayjs(cell.sopJourneyEnterTime).format('YYYY/MM/DD')}`
}
minWidth: '160px'
},
{
label: '所处旅程天数',
minWidth: '160px',
formatter: cell => {
return `${dayjs().diff(dayjs(cell.sopJourneyEnterTime), 'day')}天`
return `${dayjs().diff(cell.sopJourneyEnterTime, 'day')}天`
}
},
{
......@@ -177,7 +174,7 @@ export default {
label: '所处旅程阶段天数',
minWidth: '160px',
formatter: cell => {
return `${dayjs().diff(dayjs(cell.sopJourneyStageEnterTime), 'day')}天`
return `${dayjs().diff(cell.sopJourneyStageEnterTime, 'day')}天`
}
}
]
......@@ -232,6 +229,7 @@ export default {
},
mounted () {
this.refreshTable()
console.log(this.stageList)
},
methods: {
refreshTable () {
......@@ -246,6 +244,11 @@ export default {
this.$apis.journey.getCustomersList(params).then(res => {
this.loading = false
if (res) {
res?.list?.map(e =>{
e.sopJourneyEnterTime = dayjs(e.sopJourneyEnterTime).format('YYYY/MM/DD')
e.sopJourneyStageEnterTime = dayjs(e.sopJourneyStageEnterTime).format('YYYY/MM/DD')
})
console.log(res.list)
this.tableData = res.list
this.tableTotal = res.total || 0
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!