#
whycq
2024-03-25 aca46a03226d908a96b074010633e15ce4df1a4d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<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>