Commit 7f6452a9 authored by xioln's avatar xioln

架次、作业令号

parent 049502f0
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
}, },
data() { data() {
return { return {
creatorId: null, creatorId: localStorage.getItem('userId'),
disabledVal: false, disabledVal: false,
option: { option: {
id: localStorage.getItem('userId'), id: localStorage.getItem('userId'),
...@@ -59,13 +59,11 @@ export default { ...@@ -59,13 +59,11 @@ export default {
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
if (!this.form.creatorId) { if (this.form.creatorId) {
this.creatorId = localStorage.getItem('userId') this.creatorId = this.form.creator.id
} else {
this.creatorId = this.form.creator.userName
} }
this.$emit('input', this.creatorId)
}) })
this.$emit('input', this.creatorId)
}, },
methods: { methods: {
} }
......
export default {
props: {},
layoutConfigData: [
{
title: '高级组件配置',
data: [
{
key: 'linkageAttr',
title: '架次联动属性',
component: {
defaultValue: 'sorties',
name: 'el-input',
placeholder: '架次ID'
}
},
{
key: 'linkageAttr1',
title: '机型联动属性',
component: {
defaultValue: 'aircraftType',
name: 'el-input',
placeholder: '机型ID'
}
}
]
}
],
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: 'JobNumberSelect', // name写在组件的最前方,自定义组件为必填 name: 'JobNumberSelect', // name写在组件的最前方,自定义组件为必填
components: {}, components: {},
mixins: [config],
props: { props: {
itemObj: { itemObj: {
type: Object, type: Object,
...@@ -48,28 +52,21 @@ export default { ...@@ -48,28 +52,21 @@ export default {
}, },
computed: {}, computed: {},
watch: { watch: {
'form.sorties': { 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: this.form.aircraftType.split('+')[0] }, const _val = _get(this.form, this.itemObj.linkageAttr)
{ 'fieldName': 'aircraftSortiesId', operator: 'EQ', value: val.split('+')[0] } const _val1 = _get(this.form, this.itemObj.linkageAttr1)
], if (_val !== this.linkageValue || _val1 !== this.linkageValue1) {
operator: 'AND' this.linkageValue = _val
} this.linkageValue1 = _val1
this.getData(_val, _val1)
} }
this.$api.searchApi('ORProduction', params).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.id,
label: row.jobNo
}
})
})
} }
} }
}, },
...@@ -95,6 +92,27 @@ export default { ...@@ -95,6 +92,27 @@ export default {
created() { created() {
}, },
methods: { methods: {
getData(val, val1) {
if (val && val1) {
const params = {
searchItems: {
items: [
{ 'fieldName': 'aircraftTypeId', operator: 'EQ', value: val1 },
{ 'fieldName': 'aircraftSortiesId', operator: 'EQ', value: val }
],
operator: 'AND'
}
}
this.$api.searchApi('ORProduction', params).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.id,
label: row.jobNo
}
})
})
}
},
changeVal() { changeVal() {
this.$emit('input', this.selVal) this.$emit('input', this.selVal)
} }
......
export default {
props: {},
layoutConfigData: [
{
title: '高级组件配置',
data: [
{
key: 'linkageAttr',
title: '联动属性',
component: {
defaultValue: 'extWorkCenterId',
name: 'el-input'
}
}
]
}
],
data() {
return {
}
},
created() {
},
computed: {
},
methods: {
}
}
/**
* @Description: 架次根据机型选择
* @author xioln
* @date 2023-08-14
* @FilePath: applications/dee-mes/src/privateComponents/components/getSortiesSelect/index.vue
*/
<template>
<div class="getSorties-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>
import config from './config'
import _get from 'lodash.get'
export default {
componentName: '架次',
name: 'GetSortiesSelect', // name写在组件的最前方,自定义组件为必填
components: {},
mixins: [config],
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,
linkageValue: ''
}
},
computed: {},
watch: {
form: {
immediate: true,
deep: true,
handler(val) {
if (val) {
if (!this.itemObj.linkageAttr) {
return
}
const _val = _get(this.form, this.itemObj.linkageAttr)
if (_val !== this.linkageValue) {
this.linkageValue = _val
this.getData(_val)
}
}
}
},
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) {
this.selVal = this.value
}
}
}
},
created() {
// 初始化数据
},
methods: {
getData(val) {
if (val) {
const params = {
searchItems: {
items: [{ 'fieldName': 'aircraftTypeId', operator: 'EQ', value: val }],
operator: 'AND'
}
}
this.$api.searchApi('AircraftSorties', params).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.id,
label: row.defName
}
})
})
}
},
changeVal() {
this.$emit('input', this.selVal)
}
}
}
</script>
<style lang='scss'>
</style>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
</template> </template>
<script> <script>
export default { export default {
componentName: '架次', componentName: '供外出库架次',
name: 'GetSortiesSelect', // name写在组件的最前方,自定义组件为必填 name: 'GetSortiesSelect', // name写在组件的最前方,自定义组件为必填
components: {}, components: {},
props: { props: {
......
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