From deead4b32ba93172b99920aebf29008b672a21bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Thu, 28 Oct 2021 00:15:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E6=8D=AE=E4=B8=AD=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=95=86=E5=93=81=E7=9A=84=E6=97=B6=E5=80=99=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=9B=9E=E8=BD=A6=E5=BF=AB=E6=8D=B7=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeecgbiz/modal/JSelectMaterialModal.vue | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) 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 {