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