Commit 2c6a163f authored by caolaoban's avatar caolaoban

单架次指令标识

parent 4fe8989a
<template>
<div class="search-sorties">
<el-form :inline="true" :model="form" class="demo-form-inline search-bar">
<el-form-item label="架次:">
<el-select v-model="form.sorties" placeholder="架次">
<el-option
v-for="(item, i) in sortiesData"
:key="item.value + i"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="站位:">
<el-select v-model="form.postion" placeholder="站位">
<el-option
v-for="(item, i) in postionList"
:key="item.value + i"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
</div>
</template>
<script>
import { post } from '@/utils/http'
export default {
componentName: 'AO架次站位搜索',
name: 'SearchSorties',
components: {},
props: {},
data() {
return {
sortiesData: [],
SoriteTypeOptions: [],
form: {},
postionList: []
}
},
computed: {},
watch: {
'form.sorties': {
immediate: true,
handler(val) {
this.$utils.getDicListByCode('SoriteType').then(res => {
this.SoriteTypeOptions = res
this.getStation(val)
})
}
}
},
created() {
this.getModelData()
this.getSortiesList()
},
mounted() {},
// 组件方法
methods: {
getStation(val) {
this.postionList = []
this.$set(this.form, 'postion', '')
if (val) {
const sortiesId = val.split(':')[0]
const sortiesTypeId = val.split(':').slice(-1)[0]
const params = {
'searchItems': { 'items': [{ 'fieldName': 'aircraftSortiesId', 'operator': 'EQ', 'value': sortiesId }, { 'fieldName': 'soritesTypeId', 'operator': 'EQ', 'value': sortiesTypeId }] },
'openProps': [{ name: 'aircraftSorties' }],
'sortItem': [{ 'fieldName': 'serialNumber', 'sortOrder': 'asc' }]
}
post('ExtPosition/search', params).then(res => {
if (res.items && res.items.content) {
this.postionList = res.items.content.map(row => {
return {
value: `${row.id}`,
label: row.serialNumber
}
})
this.$set(this.form, 'postion', this.postionList[0].value)
}
})
}
},
getSortiesList() {
this.sortiesData = []
const params = { 'searchItems': { 'items': [] }, 'sortItem': [{ 'fieldName': 'modifyTime', 'sortOrder': 'asc' }] }
params.openProps = [{ name: 'target' }, { name: 'source' }]
this.$api.searchApi('SoritesLink', params).then(res => {
if (res.items && res.items.content) {
this.sortiesData = res.items.content.map(row => {
return {
value: `${row.sourceId}:${row.targetId}`,
label: this.getSoritesLabel(row)
}
})
this.$set(this.form, 'sorties', this.sortiesData[0].value)
}
})
},
getSoritesLabel(row) {
const type = (row.target && row.target.type) ? this.SoriteTypeOptions.find(r => r.value === row.target.type) : ''
return `${row.source.defName} ${type && type.label || ''}`
},
getModelData() {
this.modelData = []
const params = { 'searchItems': { 'items': [{ 'fieldName': 'id', 'operator': 'NEQ', 'value': 0 }] }, 'sortItem': [{ 'fieldName': 'modifyTime', 'sortOrder': 'asc' }] }
this.$api.searchApi('AircraftType', params).then(res => {
if (res.items && res.items.content) {
this.modelData = res.items.content
this.$set(this.form, 'model', this.modelData[0].id)
}
})
}
}
}
</script>
<style lang='scss'>
</style>
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