Commit 0ebedc34 by 李伟康

修复BUG

1 parent 0dd7363e
<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>
...@@ -99,7 +133,7 @@ export default { ...@@ -99,7 +133,7 @@ export default {
} }
}) })
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()
...@@ -110,10 +144,8 @@ export default { ...@@ -110,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')
...@@ -126,7 +158,13 @@ export default { ...@@ -126,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()
}) })
...@@ -143,8 +181,10 @@ export default { ...@@ -143,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)
}) })
}, },
...@@ -155,7 +195,7 @@ export default { ...@@ -155,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
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!