Commit 530fe975 authored by arvin's avatar arvin

站位计划维护

parent a5e889de
<template>
<div class="show-page-com stationPlan-maintenance-page">
<searchBar @showStation="showStation" @search="search" />
<station v-show="headerShow" :sorties-id="sortiesId" />
<searchBar :state-options="stateOptions" @showStation="showStation" @search="search" />
<station v-show="headerShow" :state-options="stateOptions" :sorties-id="sortiesId" :form="form" @change="change" />
<gantt :form="form" :state-options="stateOptions" :class="[headerShow?'gantt-bar':'gantt-bar no-header']" />
</div>
</template>
<script>
import searchBar from './searchBar.vue'
import station from './station.vue'
import gantt from './gantt.vue'
export default {
name: 'StationPlanMaintenance',
components: { searchBar, station },
components: { searchBar, station, gantt },
data() {
return {
sortiesId: '',
positionNumber: '',
form: {},
stateOptions: [],
headerShow: true
}
},
mounted() {
this.getStateOptions()
},
methods: {
getStateOptions() {
this.$utils.getDicListByCode('PlanState').then(res => {
this.stateOptions = res
})
},
search(form) {
this.form = form
this.form = { ...form }
this.form.positionNumber = this.positionNumber
this.sortiesId = form.sorties
},
change(positionNumber) {
this.positionNumber = positionNumber
this.form.positionNumber = this.positionNumber
},
showStation(flag) {
this.headerShow = flag
}
......@@ -73,6 +86,15 @@ export default {
background-color: #666;
}
}
.gantt-bar{
height: calc(100% - 208px);
.gantt{
height: 100%;
}
&.no-header{
height: calc(100% - 50px);
}
}
.search-bar{
height: 40px;
.legnd {
......
......@@ -72,13 +72,17 @@
<script>
export default {
name: 'TfMomWebSearchBar',
props: {
stateOptions: {
type: Array,
default: () => []
}
},
data() {
return {
headerShow: true,
modelData: [],
sortiesData: [],
stateOptions: [],
curColorStatus: '',
timeoutId: null,
form: {}
......@@ -97,7 +101,10 @@ export default {
},
'form.sorties': {
immediate: true,
handler() {
handler(val) {
const sorties = this.sortiesData.find(r => r.id === val)
this.$set(this.form, 'positionNumber', '')
this.$set(this.form, 'sortiesName', sorties && sorties.defName || '')
this.search()
}
},
......@@ -116,17 +123,11 @@ export default {
},
created() {
this.getModelData()
this.getStateOptions()
},
mounted() {
},
methods: {
getStateOptions() {
this.$utils.getDicListByCode('PlanState').then(res => {
this.stateOptions = res
})
},
getSortiesList() {
this.sortiesData = []
const params = { 'searchItems': { 'items': [{ 'fieldName': 'id', 'operator': 'NEQ', 'value': 0 }] }, 'sortItem': [{ 'fieldName': 'modifyTime', 'sortOrder': 'asc' }] }
......@@ -161,8 +162,9 @@ export default {
this.$emit('showStation', this.headerShow)
},
search() {
this.timeoutId && clearTimeout(this.timeoutId)
this.timeoutId = setTimeout(() => {
this.$emit('search', this.form)
this.$emit('search', { ...this.form })
}, 500)
},
goto() {
......
......@@ -5,7 +5,7 @@
v-for="item in postionList"
:key="item.id"
:class="{ cur: item.id === platformId }"
@click="triggerGetGantt(item.id)"
@click="triggerGetGantt(item.id,item.serialNumber)"
>
<div :title="item.serialNumber">
{{ item.serialNumber }}
......@@ -70,6 +70,10 @@ export default {
sortiesId: {
type: [Number, String],
default: () => ''
},
form: {
type: Object,
default: () => {}
}
},
data() {
......@@ -105,6 +109,7 @@ export default {
post('ExtPosition/positionSearch', params).then(res => {
if (res.items) {
this.postionList = res.items
this.triggerGetGantt(this.postionList[0].id, this.postionList[0].serialNumber)
} else {
this.postionList = []
}
......@@ -114,8 +119,9 @@ export default {
this.standLoading = false
})
},
triggerGetGantt(id) {
triggerGetGantt(id, name) {
this.platformId = id
this.$emit('change', name)
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment