Commit cc8bc5f0 authored by wangdanlei's avatar wangdanlei

三期出库仓库自定义组件

parent 355b5860
<template>
<div>
<el-select v-model="form.warehouse">
<el-select v-model="form.extWorkCenterId">
<el-option
v-for="(item,i) in warehouseOptions"
:key="i"
:label="item.typeName"
:label="item.extname"
:value="item.id"
/>
</el-select>
......@@ -23,14 +23,19 @@ export default {
data() {
return {
warehouseOptions: [],
areaList: []
areaList: [],
isFirst: true
}
},
computed: {},
watch: {
async 'form.warehouse'() {
async 'form.extProductArea.id'() {
this.$set(this.form, 'extWorkCenterId', this.form.extWorkCenterId || '')
if (!this.isFirst) {
this.$set(this.form, 'extWorkCenterId', '')
}
if (this.areaList.length) {
//
this.findWarehouse()
} else {
await this.searchApi()
}
......@@ -47,10 +52,16 @@ export default {
},
methods: {
async searchApi() {
this.isFirst = false
const params = { 'openProps': [{ 'name': 'extDxProductWorkCenters' }] }
await this.$utils.searchApi('ExtDxProductArea', params).then(res => {
await this.$api.searchApi('ExtDxProductArea', params).then(res => {
this.areaList = res.items.content
this.findWarehouse()
})
},
findWarehouse() {
const warehouse = this.areaList.find(item => item.id === this.form.extProductArea.id)
this.warehouseOptions = warehouse.extDxProductWorkCenters
}
}
}
......
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