From 386ea12405fbc2a17f15d4b57bdf36b37dae75ea Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Thu, 27 Apr 2023 18:47:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/ProductManage/EmptyPipeInStore.vue | 38 +++++++++++++------ .../uni-data-select/uni-data-select.vue | 23 +++++++++-- 2 files changed, 47 insertions(+), 14 deletions(-) diff --git a/pages/ProductManage/EmptyPipeInStore.vue b/pages/ProductManage/EmptyPipeInStore.vue index 581b783..63ece4f 100644 --- a/pages/ProductManage/EmptyPipeInStore.vue +++ b/pages/ProductManage/EmptyPipeInStore.vue @@ -18,7 +18,7 @@ 物料 - + @@ -30,7 +30,7 @@ - + @@ -54,7 +54,9 @@ options3: [], index3: '', qty: '', - disabled: false + disabled: false, + val1: '', + newoptions3: [] }; }, created () { @@ -75,6 +77,27 @@ selectChange3(e) { this.index3 = e }, + /** 模糊匹配 */ + selectMatchItem (lists, keyWord) { + let resArr = [] + lists.filter((item) => { + if (item.text.indexOf(keyWord) > -1) { + resArr.push(item) + } + }) + return resArr + }, + handleChange (e) { + if (e){ + this.index3 = '' + this.newoptions3 = this.selectMatchItem(this.options3, e) + } else { + this.newoptions3 = this.options3 + } + }, + showSelector () { + this.newoptions3 = this.options3 + }, /** 生产区域下拉框查询 */ async _queryProductArea () { let res = await queryProductArea() @@ -89,6 +112,7 @@ async _queryPaperMaterial (code) { let res = await queryPaperMaterial(code) this.options3 = [...res.rows] + this.newoptions3 = [...res.rows] res.rows.map(el => { if (el.value === code) { this.index3 = res.material_code @@ -127,14 +151,6 @@ this.disabled = false return } - if (!this.qty) { - uni.showToast({ - title: '数量不能为空', - icon: 'none' - }) - this.disabled = false - return - } try { let res = await emptyConfirm(this.qty, this.index3, this.index2, '1') this.disabled = false diff --git a/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue b/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue index 85877ca..82241c3 100644 --- a/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue +++ b/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue @@ -12,7 +12,8 @@ - + + {{emptyTips}} @@ -60,6 +61,14 @@ default () { return [] } + }, + searchInput: { + type: Boolean, + default: false + }, + svalue: { + type: [String, Number], + default: '' }, value: { type: [String, Number], @@ -138,7 +147,11 @@ } } }, - methods: { + methods: { + handleInput($event) { + this.$emit('input', $event.target.value) + this.$emit('handleChange', $event.target.value) + }, initDefVal() { let defValue = '' if ((this.value || this.value === 0) && !this.isDisabled(this.value)) { @@ -181,7 +194,7 @@ return isDisabled; }, - clearVal() { + clearVal() { this.emit('') if (this.collection) { uni.removeStorageSync(this.last) @@ -423,5 +436,9 @@ bottom: 0; right: 0; left: 0; + } + .filter_input_s { + width: calc(100% - 30rpx); + margin: 0 20rpx 0 10rpx; }