Commit 3e83e9f9 authored by xioln's avatar xioln

供外出库架次联动修改

parent a9dcdea0
export default {
props: {},
layoutConfigData: [
{
title: '高级组件配置',
data: [
{
key: 'linkageAttr',
title: '架次联动属性',
component: {
defaultValue: 'aircraftType',
name: 'el-input',
placeholder: '机型Key'
}
}
]
}
],
data() {
return {
}
},
created() {
},
computed: {
},
methods: {
}
}
...@@ -17,10 +17,14 @@ ...@@ -17,10 +17,14 @@
</div> </div>
</template> </template>
<script> <script>
import config from './config'
import _get from 'lodash.get'
export default { export default {
componentName: '供外出库架次', componentName: '供外出库架次',
name: 'GetSortiesSelect', // name写在组件的最前方,自定义组件为必填 name: 'GetSortiesSelect', // name写在组件的最前方,自定义组件为必填
components: {}, components: {},
mixins: [config],
props: { props: {
itemObj: { itemObj: {
type: Object, type: Object,
...@@ -43,31 +47,26 @@ export default { ...@@ -43,31 +47,26 @@ export default {
return { return {
options: [], options: [],
selVal: '', selVal: '',
disabledVal: false disabledVal: false,
linkageValue: null
} }
}, },
computed: {}, computed: {},
watch: { watch: {
'form.aircraftType': { form: {
immediate: true, immediate: true,
deep: true, deep: true,
handler(val, oldVal) { handler(val) {
if (val !== oldVal) { if (val) {
const params = { if (!this.itemObj.linkageAttr) {
searchItems: { return
items: [{ 'fieldName': 'aircraftTypeId', operator: 'EQ', value: val.split('+')[0] }],
operator: 'AND'
} }
const _val = _get(this.form, this.itemObj.linkageAttr)
console.log('watch', _val)
if (_val !== this.linkageValue) {
this.linkageValue = _val
this.getData(_val)
} }
this.$api.searchApi('AircraftSorties', params).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.id + '+' + row.defName,
label: row.defName
}
})
})
} }
} }
}, },
...@@ -94,6 +93,22 @@ export default { ...@@ -94,6 +93,22 @@ export default {
// 初始化数据 // 初始化数据
}, },
methods: { methods: {
getData(val) {
const params = {
searchItems: {
items: [{ 'fieldName': 'aircraftTypeId', operator: 'EQ', value: val.split('+')[0] }],
operator: 'AND'
}
}
this.$api.searchApi('AircraftSorties', params).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.id + '+' + row.defName,
label: row.defName
}
})
})
},
changeVal() { changeVal() {
this.$emit('input', this.selVal) this.$emit('input', this.selVal)
} }
......
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