Commit 6b5ffc2c authored by wangdanlei's avatar wangdanlei

三期出库

parent 07eccc7c
/**
* @Description:
* @author cxg
* @date 2022/03/29
*/
<template>
<div class="-page">
<dee-as-com
ref="materielSearch"
:lay-config="{ typeName: 'Inventory', layKey: 'search_sanqichukuwuliaomingxi'}"
:basic-data="defaultData"
@searchEvent="searchEvent"
/>
<dee-as-com
ref="materielTable"
:lay-config="{ typeName: 'Inventory', layKey: 'table_sanqichukuwuliaomingxi'}"
@selectionChange="selectionChange"
/>
<div class="foot-btn-box">
<el-button type="primary" @click="submitEvent">确认</el-button>
<el-button @click="cancelEvent">取消</el-button>
</div>
</div>
</template>
<script>
export default {
componentName: '添加三期出库物料明细弹框',
name: 'AddOutStorageMaterialDetailDialog',
components: {},
data() {
return {
selection: [],
defaultData: {}
}
},
computed: {},
mounted() {
},
methods: {
searchEvent(val) {
// const materialType = this.findByNameVnode(this, 'DeeAsForm').form.materialType
val.items.push({ fieldName: 'subTypeName', operator: 'EQ', value: 'Inventory' }/*, { fieldName: 'inventory.materialType', operator: 'EQ', value: materialType }*/)
const el = this.$refs['materielTable']
el.$refs.asCom.getData(val.items, val.items)
},
findByNameVnode(obj, targetName) {
if (obj && obj.$vnode && obj.$vnode.tag && obj.$vnode.tag.includes(targetName)) {
return obj
} else {
return this.findByNameVnode(obj.$parent, targetName)
}
},
selectionChange(val) {
this.selection = val
},
submitEvent() {
console.log(this.selection)
if (this.selection.length) {
this.$emit('submitEvent', { formData: this.selection })
}
},
cancelEvent() {
this.$emit('cancel')
}
}
}
</script>
<style lang='scss'>
.foot-btn-box{
display: flex;
justify-content: center;
align-content: center;
}
</style>
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
<script> <script>
export default { export default {
componentName: '物料明细列表', componentName: '添加三期入库物料明细弹框',
name: 'Materiel', name: 'AddPutStorageMaterialDetailDialog',
components: {}, components: {},
data() { data() {
return { return {
...@@ -67,4 +67,9 @@ export default { ...@@ -67,4 +67,9 @@ export default {
} }
</script> </script>
<style lang='scss'> <style lang='scss'>
.foot-btn-box{
display: flex;
justify-content: center;
align-content: center;
}
</style> </style>
<template>
<div>
<el-select v-model="form.warehouse">
<el-option
v-for="(item,i) in warehouseOptions"
:key="i"
:label="item.typeName"
:value="item.id"
/>
</el-select>
</div>
</template>
<script>
export default {
componentName: '库房',
name: 'Warehouse',
components: {},
props: {
form: {}
},
data() {
return {
warehouseOptions: [],
areaList: []
}
},
computed: {},
watch: {
async 'form.warehouse'() {
if (this.areaList.length) {
//
} else {
await this.searchApi()
}
}
},
// 生命周期 - 创建完成(可以访问当前this 实例)
created() {
},
// 生命周期 - 挂载之前
beforeMount() {
},
// 生命周期 - 挂载完成(可以访问 DOM 元素)
mounted() {
},
methods: {
async searchApi() {
const params = { 'openProps': [{ 'name': 'extDxProductWorkCenters' }] }
await this.$utils.searchApi('ExtDxProductArea', params).then(res => {
this.areaList = res.items.content
})
}
}
}
</script>
<style lang='scss' scoped>
</style>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
v-for="(item,i) in materialTypeOptions" v-for="(item,i) in materialTypeOptions"
:key="i" :key="i"
:label="item.typeName" :label="item.typeName"
:value="item.typeCode" :value="item.id"
/> />
</el-select> </el-select>
</div> </div>
...@@ -24,13 +24,17 @@ export default { ...@@ -24,13 +24,17 @@ export default {
}, },
data() { data() {
return { return {
materialTypeOptions: [] materialTypeOptions: [],
isFirst: true
} }
}, },
computed: {}, computed: {},
watch: { watch: {
'form.billType'(val) { 'form.billType'(val) {
if (val) { if (val) {
if (!this.isFirst) {
this.$set(this.form, 'materialType', '')
}
this.getMaterialType(val) this.getMaterialType(val)
} }
} }
...@@ -46,6 +50,7 @@ export default { ...@@ -46,6 +50,7 @@ export default {
}, },
methods: { methods: {
getMaterialType(val) { getMaterialType(val) {
this.isFirst = false
getParentData({ billTypeCode: val }).then(res => { getParentData({ billTypeCode: val }).then(res => {
this.materialTypeOptions = res.items.content || [] this.materialTypeOptions = res.items.content || []
}) })
......
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