<template> 
 | 
    <view> 
 | 
        <view class="code"> 
 | 
            <uni-search-bar :focus="searchValueFocus" v-model="searchValue"  @input="searchValueInput()" 
 | 
                maxlength="500" ancel="cancel" @clear="clear" placeholder="输入 / 扫描 料想码"> 
 | 
            </uni-search-bar> 
 | 
            <view class="code-title"> 
 | 
                <view></view> 
 | 
                <view>入库通知档</view> 
 | 
                <view></view> 
 | 
                <!-- <view @click="allChecked">{{allCheckBtnTitle}}</view> --> 
 | 
            </view> 
 | 
        </view> 
 | 
        <view class="list" v-for="(item,i) in dataList"> 
 | 
            <view class="list-left"> 
 | 
                <view>料箱码:{{item.suppCode}}</view> 
 | 
                <view>商品编码:{{item.matnr}}</view> 
 | 
                <view>商品名称:{{item.maktx}}</view> 
 | 
                <view>单据编号:{{item.orderNo}}</view> 
 | 
                <view>数量:{{item.anfme}}</view> 
 | 
                <!-- <view class="card-id">{{i + 1}}</view> --> 
 | 
                <view class="card-status-1" v-if="item.ioStatus == 'N'">待入库</view> 
 | 
                <view class="card-status-2" v-if="item.ioStatus == 'Y'">入库中</view> 
 | 
            </view> 
 | 
            <!-- <view class="list-right" @click="checkboxChange(item)"> 
 | 
                <label > 
 | 
                    <checkbox :value="item.orderNo" :checked="item.checked" color="#FFCC33" style="transform:scale(0.7)" /><text></text> 
 | 
                </label> 
 | 
            </view> --> 
 | 
            <view class="list-right" @click="deleteItem(item)"> 
 | 
                <uni-icons type="trash" color="#c1c1c1"></uni-icons> 
 | 
            </view> 
 | 
        </view> 
 | 
        <view style="height: 50rpx;"></view> 
 | 
    </view> 
 | 
</template> 
 | 
  
 | 
<script> 
 | 
    export default { 
 | 
        data() { 
 | 
            return { 
 | 
                baseUrl: '', 
 | 
                token: '', 
 | 
                searchValueFocus: true, 
 | 
                searchValue: '', 
 | 
                checck: true, 
 | 
                dataList: [], 
 | 
            } 
 | 
        }, 
 | 
        onShow() { 
 | 
            this.baseUrl = uni.getStorageSync('baseUrl'); 
 | 
            this.token = uni.getStorageSync('token'); 
 | 
            this.oldDataList = [...this.dataList] 
 | 
            this.getWaitPakinList() 
 | 
        }, 
 | 
        methods: { 
 | 
            searchValueInput() { 
 | 
                let count = 0 
 | 
                let sign = 0 
 | 
                this.dataList = [...this.oldDataList] 
 | 
                this.newDataList = [] 
 | 
                for (let k in this.dataList) { 
 | 
                    if (!this.dataList[k].matnr.includes(this.matnr)) { 
 | 
                        count++; 
 | 
                    } else { 
 | 
                        this.newDataList.push(this.dataList[k]) 
 | 
                    } 
 | 
                } 
 | 
                if (this.matnr != '') { 
 | 
                    for (let j in this.dataList) { 
 | 
                        if (!this.dataList[j].maktx.includes(this.matnr)) { 
 | 
                        } else { 
 | 
                            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 
 | 
            }, 
 | 
            // 获取订单列表 
 | 
            getWaitPakinList() { 
 | 
                let _this = this 
 | 
                uni.request({ 
 | 
                    url: `${_this.baseUrl}/agv/waitPakin/list/auth`, 
 | 
                    header: {'token': uni.getStorageSync('token')}, 
 | 
                    data: { 
 | 
                        curr: 1, 
 | 
                        limit: 1000, 
 | 
                    }, 
 | 
                    method: 'GET', 
 | 
                    success(res) { 
 | 
                        res = res.data 
 | 
                        if (res.code === 200) { 
 | 
                            _this.dataList = res.data.records 
 | 
                        }  
 | 
                    } 
 | 
                }) 
 | 
            }, 
 | 
            deleteItem(item) { 
 | 
                let _this = this 
 | 
                let param = [] 
 | 
                param.push(item) 
 | 
                uni.request({ 
 | 
                    url: `${_this.baseUrl}/agv/waitPakin/delete/auth`, 
 | 
                    header: { 
 | 
                        'token': uni.getStorageSync('token'), 
 | 
                        'content-type': 'application/x-www-form-urlencoded; charset=UTF-8' 
 | 
                        }, 
 | 
                    data: {param: JSON.stringify(param)}, 
 | 
                    method: 'POST', 
 | 
                    success(res) { 
 | 
                        res = res.data 
 | 
                        if (res.code === 200) { 
 | 
                            _this.getWaitPakinList() 
 | 
                        } else { 
 | 
                            uni.showToast({ title: res.msg, icon: "none", position: 'top' }) 
 | 
                        } 
 | 
                    } 
 | 
                }) 
 | 
            } 
 | 
        } 
 | 
    } 
 | 
</script> 
 | 
  
 | 
<style> 
 | 
    @import url('../../../static/css/common/order.css'); 
 | 
</style> 
 |