#
whycq
2024-03-20 cea197ee03add9a3279bc65d005f4f56fdab43e0
#
1个文件已修改
62 ■■■■ 已修改文件
pages/tzsk/AGV/orderList.vue 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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: '辣椒',
                        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]
            }
        }
    }