Commit 75cc6a28 authored by xioln's avatar xioln

供外出库作业令号修改

parent fcd53213
/**
* @Description: 供外出库作业令号
* @author xioln
* @date 2023-08-14
* @FilePath: applications/dee-mes/src/privateComponents/components/OfferJobNumberSelect/index.vue
*/
<template>
<div class="jobNumber-select">
<el-select v-model="selVal" placeholder="请选择" size="mini" :disabled="disabledVal" @change="changeVal">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
</template>
<script>
export default {
componentName: '供外出库作业令号',
name: 'OfferJobNumberSelect', // name写在组件的最前方,自定义组件为必填
components: {},
props: {
itemObj: {
type: Object,
default: null
},
form: {
type: Object,
default: () => {}
},
middleForm: {
type: Object,
default: () => {}
},
value: {
type: [Number, String, Object],
default: () => ''
}
},
data() {
return {
options: [],
selVal: '',
disabledVal: false
}
},
computed: {},
watch: {
'form.sorties': {
immediate: true,
deep: true,
handler(val, oldVal) {
if (val !== oldVal) {
const params = {
searchItems: {
items: [
{ 'fieldName': 'aircraftTypeId', operator: 'EQ', value: this.form.aircraftType.split('+')[0] },
{ 'fieldName': 'aircraftSortiesId', operator: 'EQ', value: val.split('+')[0] }
],
operator: 'AND'
}
}
this.$api.searchApi('ORProduction', params).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.id,
label: row.jobNo
}
})
})
}
}
},
itemObj: {
immediate: true,
deep: true,
handler(v) {
if (v.component.hasOwnProperty('disabled')) {
this.disabledVal = v.component.disabled
}
}
},
value: {
immediate: true,
deep: true,
handler(v) {
if (v) {
console.log('this.form', this.form)
const params = {
searchItems: {
items: [
{ 'fieldName': 'aircraftType.defCode', operator: 'EQ', value: this.form.aircraftType },
{ 'fieldName': 'aircraftSorties.defCode', operator: 'EQ', value: this.form.sorties }
],
operator: 'AND'
}
}
this.$api.searchApi('ORProduction', params).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.id,
label: row.jobNo
}
})
this.selVal = v
})
}
}
}
},
created() {
},
methods: {
changeVal() {
this.$emit('input', this.selVal)
}
}
}
</script>
<style lang='scss'>
</style>
...@@ -87,14 +87,17 @@ export default { ...@@ -87,14 +87,17 @@ export default {
'openProps': [{ name: 'target' }] 'openProps': [{ name: 'target' }]
} }
this.$api.searchApi('SoritesLink', params).then(res => { this.$api.searchApi('SoritesLink', params).then(res => {
this.$utils.getDicListByCode('SoriteType').then(codes => {
const options = res.items.content.map(row => { const options = res.items.content.map(row => {
return { return {
value: row.target.id, value: row.target.id,
label: row.target.type // label: row.target.type,
label: codes.find(item => item.value === row.target.type).label
} }
}) })
this.options = options this.options = options
}) })
})
} }
}, },
changeVal() { changeVal() {
......
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