diff --git a/jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue b/jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue index 1f788238..e8967a89 100644 --- a/jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue +++ b/jshERP-web/src/components/jeecgbiz/modal/JSelectMaterialModal.vue @@ -18,7 +18,7 @@ - + @@ -187,6 +187,12 @@ if (res) { this.dataSource = res.rows this.ipagination.total = res.total + if(res.total ===1) { + this.title = '选择商品【再次回车可以直接选中】' + this.$nextTick(() => this.$refs.material.focus()); + } else { + this.title = '选择商品' + } } }).finally(() => { this.loading = false @@ -217,7 +223,9 @@ }, showModal(barCode) { this.visible = true; + this.title = '选择商品' this.queryParam.q = barCode + this.$nextTick(() => this.$refs.material.focus()); this.loadData(); this.form.resetFields(); }, @@ -297,10 +305,21 @@ this.selectionRows = selectionRows; }, onSearch() { - this.loadData(1); + if(this.dataSource && this.dataSource.length===1) { + if(this.queryParam.q === this.dataSource[0].mBarCode) { + let arr = [] + arr.push(this.dataSource[0].id) + this.selectedRowKeys = arr + this.handleSubmit() + } else { + this.loadData(1) + } + } else { + this.loadData(1) + } }, modalFormOk() { - this.loadData(); + this.loadData() }, rowAction(record, index) { return {