| | |
| | | <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"> |
| | |
| | | specs: '10-z' |
| | | }, |
| | | { |
| | | orderNo: 'cg0931242', |
| | | matnr: 'cg0931242', |
| | | orderNo: 'cg0931243', |
| | | matnr: 'cg0931243', |
| | | maktx: '哈哈', |
| | | anfme: 10, |
| | | specs: '10-z' |
| | | }, |
| | | { |
| | | orderNo: 'cg0931244', |
| | | matnr: 'cg0931244', |
| | | maktx: '辣椒', |
| | | 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() { |
| | |
| | | }, |
| | | 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, |
| | |
| | | }, |
| | | clear() { |
| | | this.matnr = '' |
| | | |
| | | this.dataList = [...this.oldDataList] |
| | | } |
| | | } |
| | | } |