#
whycq
2023-04-02 7af9529188258a1d118609f86b19b558e80c2664
#
3个文件已修改
75 ■■■■ 已修改文件
pages/mat/matQuery.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/mat/matSelected.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/pakin/pakin.vue 66 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/mat/matQuery.vue
@@ -76,7 +76,6 @@
                        'token':uni.getStorageSync('token'),
                    },
                    success(result) {
                        console.log(result)
                        that.tagList = null
                        that.matList = null
                        var res = result.data
@@ -96,7 +95,6 @@
                        } else {
                            uni.showToast({title: res.msg, icon: "none",position: 'top'})
                        }
                        uni.hideLoading();
                    }
                });
            },
@@ -115,15 +113,12 @@
                        'token':uni.getStorageSync('token'),
                    },
                    success(result) {
                        console.log(result)
                        that.tagList = null
                        var res = result.data
                        if (res.code === 200) {
                            if (res.data != null && res.data.length > 0) {
                                that.matList = res.data
                                that.baColor = "background-color: #1cbbb4;"
                            } else {
                                // that.tagId = parentId
                            }
                        } else if (res.code === 403 ) {
                            uni.showToast({title: res.msg, icon: "none", position: 'top'})
pages/mat/matSelected.vue
@@ -44,7 +44,7 @@
                    maktx: null,
                    specs: null,
                    batch: null,
                    anfme: null,
                    anfme: 0,
                },
                baseIP:'',
                basePORT:'',
@@ -78,13 +78,11 @@
                this.mat.anfme = value
            },
            back() {
                console.log(this.mat.anfme);
                if (this.mat.anfme === 0) {
                    uni.showToast({title: '请输入数量', icon: "none", position: 'top'});
                    return;
                }
                this.getOpenerEventChannel().emit('matList', {data: this.mat});
                uni.vibrateShort();
                uni.navigateBack({
                    
                })
pages/pakin/pakin.vue
@@ -43,7 +43,7 @@
                    </view>
                    <view class="list-left-item">
                        <view class="desc">数量:</view>
                        <view class="left-item"><uni-tag :text="item.anfme"></uni-tag></view>
                        <view class="left-item">{{item.anfme}}</view>
                    </view>
                </view>
                <view class="list-right">
@@ -211,9 +211,8 @@
                                },
                                // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                                events: {
                                    dataList: function(data) {
                                    matList: function(data) {
                                        that.checkMat(data.data)
                                        // that.matList.push(data.data)
                                    },
                                },
                            });
@@ -225,7 +224,6 @@
                                });
                            }, 1000);
                        } else {
                            console.log(res);
                            uni.showToast({title: res.msg, icon: "none",position: 'top'})
                        }
                        
@@ -259,6 +257,7 @@
                var add = true
                for (var i = 0; i < len; i++) {
                    if (mat.matnr == this.dataList[i].matnr) {
                        console.log(typeof mat.anfme);
                        this.dataList[i].anfme += mat.anfme
                        this.$forceUpdate() // 强制刷新
                        add = false
@@ -320,8 +319,55 @@
                this.$refs.combConfirm.close()
            },
            comb() {
                this.messageText = "组托成功"
                this.messageToggle('success')
                uni.vibrateShort();
                let that = this;
                if (that.barcode === '') {
                    this.messageText = "请扫描托盘条码"
                    this.messageToggle('error')
                    return;
                }
                if (that.dataList.length === 0) {
                    this.messageText = "请添加商品列表"
                    this.messageToggle('error')
                    return;
                }
                for (var i = 0; i < that.dataList.length; i++) {
                    if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') {
                        this.messageText = that.dataList[i].matnr + '组托数量不能为0'
                        this.messageToggle('error')
                        return;
                    }
                }
                uni.request({
                    url: that.baseUrl + '/mobile/comb/auth',
                    data: JSON.stringify({
                        barcode: that.barcode,
                        combMats: that.dataList
                    }),
                    method: 'POST',
                    header: {
                        'token':uni.getStorageSync('token')
                    },
                    success(result) {
                        var res = result.data
                        if (res.code === 200) {
                            that.resst();
                            that.messageText = "组托成功"
                            that.messageToggle('success')
                        } else if (res.code == 403) {
                            that.messageText = res.msg
                            that.messageToggle('error')
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            that.messageText = res.msg
                            that.messageToggle('error')
                        }
                    }
                });
            },
            reset(type) {
                this.msgType = type
@@ -338,7 +384,13 @@
            // 取消重置
            resetClose() {
                
            }
            },
            // 清空
            resst() {
                this.dataList = []
                this.barcode = ''
                this.barcodeFocuss()
            },
        }
    }
</script>