Commit d7397b32 authored by xioln's avatar xioln

供外出库

parent 1b445974
/**
* @Description: 作业令号根据机型架次选择
* @author xioln
* @date 2023-08-14
* @FilePath: applications/dee-mes/src/privateComponents/components/JobNumberSelect/index.vue
*/
<template>
<div class="jobNumber-select">
<el-select v-model="selVal" placeholder="请选择" size="mini" @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: 'JobNumberSelect', // name写在组件的最前方,自定义组件为必填
components: {},
props: {
itemObj: {
type: Object,
default: null
},
form: {
type: Object,
default: () => {}
},
value: {
type: [Number, String, Object],
default: () => ''
}
},
data() {
return {
options: [],
selVal: ''
}
},
computed: {},
watch: {
form: {
immediate: true,
deep: true,
handler(val) {
if (val.aircraftType && val.sorties) {
const params = {
searchItems: {
items: [
{ 'fieldName': 'aircraftTypeId', operator: 'EQ', value: val.aircraftType },
{ 'fieldName': 'aircraftSortiesId', operator: 'EQ', value: val.sorties }
],
operator: 'AND'
}
}
this.$api.searchApi('ORProduction', params).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.id,
label: row.jobNo
}
})
})
}
}
}
},
created() {
// 初始化数据
},
methods: {
changeVal() {
this.$emit('input', this.selVal)
}
}
}
</script>
<style lang='scss'>
</style>
......@@ -43,11 +43,12 @@ export default {
{ title: '牌号/型号/件号', key: 'extMaterial.modelNo', align: 'center', minWidth: '120' },
{ title: '规格', key: 'extMaterial.spec', align: 'center' },
{ title: '单位名称', key: 'extMaterial.extUnit.unitName', align: 'center' },
{ title: '申领数量', key: 'reqAmount', align: 'center', minWidth: '120',
{
title: '申领数量', key: 'reqAmount', align: 'center', minWidth: '120',
component: {
show: true,
render: (h, data, column, index) => {
return (<el-input-number size='small'v-model={data.reqAmount}
return (<el-input-number size='small' v-model={data.reqAmount}
on-change={(e) => {
this.tableData = this.tableData.map(item => {
if (item.extMaterialId === data.extMaterialId) {
......@@ -55,7 +56,7 @@ export default {
}
return item
})
}}/>)
}} />)
}
}
},
......@@ -113,6 +114,11 @@ export default {
created() {
// 初始化数据
},
mounted() {
if (this.$route.query.id) {
this.getEditData(this.$route.query.id)
}
},
methods: {
addData(data) {
console.log('data', data)
......@@ -173,6 +179,46 @@ export default {
})
})
},
getEditData(id) {
const param = {
'searchItems': {
'items': [
{ 'fieldName': 'subTypeName', 'operator': 'EQ', 'value': 'OutStorageOut' },
{ 'fieldName': 'id', 'operator': 'EQ', 'value': id }
]
},
openProps: [{
'name': 'inStorageRequestItems',
'openProps': [{
'name': 'extMaterial',
'openProps': [{
'name': 'resType2'
}, {
'name': 'extUnit'
}]
}, {
'name': 'extDxSipplier'
}, {
'name': 'creator'
}, {
'name': 'storageZone'
},
{
'name': 'inventoryJobResponses'
}]
}]
}
post('OutStorageRequest/search', param).then(res => {
console.log('res', res)
const data = res.items.content[0].inStorageRequestItems
data.forEach(item => {
item.allocatedAmount = this.sumArray(item.inventoryJobResponses, 'allocatedAmount')
})
this.tableData = data
}).catch((err) => {
console.log(err)
})
},
sumArray(array, key) {
let sum = 0
for (let i = 0; i < array.length; i++) {
......
/**
* @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" @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: 'GetSortiesSelect', // name写在组件的最前方,自定义组件为必填
components: {},
props: {
itemObj: {
type: Object,
default: null
},
form: {
type: Object,
default: () => {}
},
value: {
type: [Number, String, Object],
default: () => ''
}
},
data() {
return {
options: [],
selVal: ''
}
},
computed: {},
watch: {
form: {
immediate: true,
deep: true,
handler(val) {
if (val.aircraftType) {
const params = {
searchItems: {
items: [{ 'fieldName': 'aircraftTypeId', operator: 'EQ', value: val.aircraftType }],
operator: 'AND'
}
}
this.$api.searchApi('AircraftSorties', params).then(res => {
this.options = res.items.content.map(row => {
return {
value: row.id,
label: row.defName
}
})
})
}
}
}
},
created() {
// 初始化数据
},
methods: {
changeVal() {
this.$emit('input', this.selVal)
}
}
}
</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