From cea197ee03add9a3279bc65d005f4f56fdab43e0 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期三, 20 三月 2024 09:37:33 +0800 Subject: [PATCH] # --- pages/tzsk/AGV/orderList.vue | 64 ++++++++++++++++++++++++------- 1 files changed, 49 insertions(+), 15 deletions(-) diff --git a/pages/tzsk/AGV/orderList.vue b/pages/tzsk/AGV/orderList.vue index 09c75e4..01d53c0 100644 --- a/pages/tzsk/AGV/orderList.vue +++ b/pages/tzsk/AGV/orderList.vue @@ -1,8 +1,8 @@ <template> <view> <view class="code"> - <uni-search-bar :focus="matFocus" v-model="matnr" @input="matInput()" - @cancel="cancel" @clear="clear" placeholder="杈撳叆 / 鎵弿鍟嗗搧"> + <uni-search-bar :focus="matFocus" v-model="matnr" @input="matInput()" ma + maxlength="500" ancel="cancel" @clear="clear" placeholder="杈撳叆 / 鎵弿鍟嗗搧"> </uni-search-bar> </view> <view class="list" v-for="(item,i) in dataList"> @@ -45,14 +45,36 @@ specs: '10-z' }, { - orderNo: 'cg0931242', - matnr: 'cg0931242', + orderNo: 'cg0931243', + matnr: 'cg0931243', maktx: '鍝堝搱', + anfme: 10, + specs: '10-z' + }, + { + orderNo: 'cg0931244', + matnr: 'cg0931244', + maktx: '杈f', + anfme: 10, + specs: '10-z' + }, + { + orderNo: 'cg0931245', + matnr: 'cg0931245', + maktx: '44', + anfme: 10, + specs: '10-z' + }, + { + orderNo: 'cg0931246', + matnr: 'cg0931246', + maktx: '41', anfme: 10, specs: '10-z' } ], - oldDataList: [] + oldDataList: [], + newDataList: [] } }, onShow() { @@ -60,26 +82,38 @@ }, methods: { matInput() { - let _this = this - this.dataList = [...this.oldDataList] let count = 0 + let sign = 0 + this.dataList = [...this.oldDataList] + this.newDataList = [] + this.searchEnd() for (let k in this.dataList) { if (!this.dataList[k].matnr.includes(this.matnr)) { - this.dataList.splice(k,1) - } else { count++; + } else { + this.newDataList.push(this.dataList[k]) } } - if (count == 0) { - this.dataList = [...this.oldDataList] + if (this.matnr != '') { for (let j in this.dataList) { if (!this.dataList[j].maktx.includes(this.matnr)) { - this.dataList.splice(j,1) } else { - // this.dataList = [...this.oldDataList] + for (let i in this.newDataList) { + if (this.newDataList[i].matnr == this.dataList[j].matnr) { + sign++ + } + } + if (sign == 0) { + this.newDataList.push(this.dataList[j]) + } } } } + this.dataList = this.newDataList + }, + searchEnd() { + + }, checkboxChange(e) { let items = this.dataList, @@ -92,7 +126,7 @@ }, clear() { this.matnr = '' - + this.dataList = [...this.oldDataList] } } } @@ -136,4 +170,4 @@ align-items: center; justify-content: center; } -</style> +</style> \ No newline at end of file -- Gitblit v1.9.1