Commit d7d34681 authored by wangdanlei's avatar wangdanlei

入库申请

parent 571ff13f
import { get } from '../utils/http'
export function getParentData(params) {
return get(`/ExtDxProcessResourceType/findByBillTypeCode`, params)
}
<template>
<div>
<el-select v-model="form.materialType">
<el-option
v-for="(item,i) in materialTypeOptions"
:key="i"
:label="item.typeName"
:value="item.typeCode"
/>
</el-select>
</div>
</template>
<script>
import { getParentData } from '../../../api/storeroom'
export default {
componentName: '器材类别',
name: 'MaterialType',
components: {},
props: {
form: {}
},
data() {
return {
materialTypeOptions: []
}
},
computed: {},
watch: {
'form.billType'(val) {
if (val) {
this.getMaterialType(val)
}
}
},
// 生命周期 - 创建完成(可以访问当前this 实例)
created() {
},
// 生命周期 - 挂载之前
beforeMount() {
},
// 生命周期 - 挂载完成(可以访问 DOM 元素)
mounted() {
},
methods: {
getMaterialType(val) {
getParentData({ billTypeCode: val }).then(res => {
this.materialTypeOptions = res.items.content || []
})
}
}
}
</script>
<style lang='scss' scoped>
</style>
/**
* @Description:
* @author cxg
* @date 2022/03/29
*/
<template>
<div class="-page">
<dee-as-com
ref="materielSearch"
:lay-config="{ typeName: 'JobResponseOutStorageExpire', layKey: 'defaultQuery'}"
:basic-data="defaultData"
@searchEvent="searchEvent"
/>
<dee-as-com
ref="materielTable"
:lay-config="{ typeName: 'JobResponseOutStorageExpire', layKey: 'table'}"
@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: 'Materiel',
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: 'JobResponseOutStorageExpire' }/*, { 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.map(item => item.inventory))
this.$emit('submitEvent', { formData: this.selection.map(item => item.inventory) })
},
cancelEvent() {
this.$emit('cancel')
}
}
}
</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