Commit d537d259 authored by 季圣华's avatar 季圣华
Browse files

优化商品选择的仓库传值逻辑

parent 56d8218a
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓库"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="仓库">
<a-select placeholder="选择仓库" v-model="queryParam.depotId" <a-select placeholder="选择仓库" v-model="queryParam.depotId" @change="onDepotChange"
:dropdownMatchSelectWidth="false" showSearch optionFilterProp="children" allow-clear> :dropdownMatchSelectWidth="false" showSearch optionFilterProp="children" allow-clear>
<a-select-option v-for="(item,index) in depotList" :key="index" :value="item.id"> <a-select-option v-for="(item,index) in depotList" :key="index" :value="item.id">
{{ item.depotName }} {{ item.depotName }}
...@@ -166,7 +166,6 @@ ...@@ -166,7 +166,6 @@
this.resetScreenSize() this.resetScreenSize()
this.loadTreeData() this.loadTreeData()
this.getDepotList() this.getDepotList()
this.loadData()
}, },
methods: { methods: {
initBarCode() { initBarCode() {
...@@ -226,6 +225,7 @@ ...@@ -226,6 +225,7 @@
this.title = '选择商品' this.title = '选择商品'
this.queryParam.q = barCode this.queryParam.q = barCode
this.$nextTick(() => this.$refs.material.focus()); this.$nextTick(() => this.$refs.material.focus());
this.initDepotSelect()
this.loadData(); this.loadData();
this.form.resetFields(); this.form.resetFields();
}, },
...@@ -289,7 +289,6 @@ ...@@ -289,7 +289,6 @@
getAction('/depot/findDepotByCurrentUser').then((res) => { getAction('/depot/findDepotByCurrentUser').then((res) => {
if(res.code === 200){ if(res.code === 200){
that.depotList = res.data that.depotList = res.data
this.initDepotSelect()
} }
}) })
}, },
...@@ -300,6 +299,9 @@ ...@@ -300,6 +299,9 @@
} }
} }
}, },
onDepotChange(value) {
this.queryParam.depotId = value
},
onSelectChange(selectedRowKeys, selectionRows) { onSelectChange(selectedRowKeys, selectionRows) {
this.selectedRowKeys = selectedRowKeys; this.selectedRowKeys = selectedRowKeys;
this.selectionRows = selectionRows; this.selectionRows = selectionRows;
......
Supports Markdown
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