Commit 0ebedc34 by 李伟康

修复BUG

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