#
whycq
2023-05-06 3fbc75322d31f461431870253dfedfc534e1100c
#
3个文件已修改
90 ■■■■ 已修改文件
pages/mat/matList.vue 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/print/print.vue 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/stock/changePallet.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/mat/matList.vue
@@ -15,7 +15,7 @@
            </view>
        </scroll-view>
        <view>
            <view class="tag-list" v-for="(item,i) in matList" :key="i" @click="findBySelect(item.matnr)">
            <view class="tag-list" v-for="(item,i) in matList" :key="i" @click="toPrint(item)">
                <view class="tag">
                    <view style="display: flex;">
                        <view class="wms-tag" :style="baColor" >商品</view>
@@ -91,7 +91,6 @@
                        'token':uni.getStorageSync('token'),
                    },
                    success(result) {
                        console.log(result);
                        that.tagList = null
                        that.matList = []
                        var res = result.data
@@ -101,6 +100,7 @@
                            } else {
                                that.showMat(parentId)
                            }
                            that.baColor = "background-color: #0081ff;"
                        } else if (res.code === 403 ) {
                            uni.showToast({title: res.msg, icon: "none", position: 'top'})
                            setTimeout(() => {
@@ -143,7 +143,6 @@
                        'token':uni.getStorageSync('token'),
                    },
                    success(result) {
                        console.log(result);
                        that.tagList = null
                        var res = result.data
                        if (res.code === 200) {
@@ -170,12 +169,27 @@
                    }
                });
            },
            findBySelect(matnr) {
                this.getOpenerEventChannel().emit('acceptDataFromOpenedPage', {data: matnr});
                uni.navigateBack({
                })
            toPrint(item) {
                console.log(item);
                let that = this
                uni.navigateTo({
                    url: "../print/print",
                    success: function(res) {
                        // 通过eventChannel向被打开页面传送数据   向另外一个页面传递值的
                        res.eventChannel.emit('data', {
                            data: item
                        })
                    },
                    events: {
                        // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据  另外一个页面传过来的
                        acceptDataFromOpenedPage: function(data) {
                            that.matnr = data.data
                            that.findMat(that.matnr)
                        },
                    },
                
                });
            }
        }
    }
pages/print/print.vue
@@ -15,11 +15,11 @@
                    </tr>
                    <tr>
                        <td>商品</td>
                        <td colspan="1">{{mat.matkx}}</td>
                        <td colspan="1">{{mat.maktx}}</td>
                    </tr>
                    <tr>
                        <td>日期</td>
                        <td colspan="2">2023-04-24 15:25:32</td>
                        <td colspan="2">{{time}}</td>
                    </tr>
                </table>
            </view>
@@ -37,24 +37,35 @@
                },
                mat: {
                    matnr: '1200128-10055',
                    matkx: 'X5S-4-M03/333'
                    maktx: 'X5S-4-M03/333'
                },
                qrShow: false
                qrShow: false,
                time: ''
            }
        },
        onShow() {
            let getWindowInfo = uni.getWindowInfo()
            console.log(getWindowInfo.screenHeight); //屏幕高度
            console.log(getWindowInfo.screenWidth); //屏幕宽度
            console.log(getWindowInfo.windowHeight); //可操作页面高度
            console.log(getWindowInfo.windowWidth); //可操作页面宽度
            console.log(getWindowInfo);
            console.log('获取窗口信息');
            // console.log(getWindowInfo.screenHeight); //屏幕高度
            // console.log(getWindowInfo.screenWidth); //屏幕宽度
            // console.log(getWindowInfo.windowHeight); //可操作页面高度
            // console.log(getWindowInfo.windowWidth); //可操作页面宽度
            // console.log(getWindowInfo);
            // console.log('获取窗口信息');
            let height = (getWindowInfo.screenWidth + 10) * 48 / 74
            console.log(height);
            // console.log(height);
            this.style.height = height + 'px'
            this.qrFun("1200128-10055")
            this.getDate()
        },
        onLoad(opt) {
            let that = this
            const eventChannel = this.getOpenerEventChannel();
            eventChannel.on('data', function(data) {
                console.log(data.data);
                that.mat = data.data
                that.qrFun(that.mat.matnr)
            })
        },
        methods: {
            //**生成二维码**//
@@ -72,7 +83,29 @@
                    errorCorrectLevel: uQRCode.errorCorrectLevel.H,
                    success: res => {}
                })
            }
            },
            // 日历
            getDate() {
                var dt = new Date();
                var year,month,day,hours,minutes,seconds,weeks
                year = dt.getFullYear();
                month = (dt.getMonth()+1) < 10 ? '0'+ (dt.getMonth()+1) : (dt.getMonth()+1);
                day = dt.getDate() < 10 ? '0'+dt.getDate() : dt.getDate();
                hours = dt.getHours() < 10 ? '0' + dt.getHours() : dt.getHours();
                minutes = dt.getMinutes() < 10 ? '0' + dt.getMinutes() : dt.getMinutes();
                seconds = dt.getSeconds() < 10 ? '0' + dt.getSeconds() : dt.getSeconds();
                weeks = dt.getDay();
                switch (weeks) {
                    case 0: weeks = "星期日"; break;
                    case 1: weeks = "星期一"; break;
                    case 2: weeks = "星期二"; break;
                    case 3: weeks = "星期三"; break;
                    case 4: weeks = "星期四"; break;
                    case 5: weeks = "星期五"; break;
                    default : weeks = "星期六";
                }
                this.time = year + "年" + month + "月" + day + "日 " + hours + ":" + minutes + ":" + seconds + " "
            },
        }
    }
</script>
pages/stock/changePallet.vue
@@ -135,7 +135,6 @@
                        },
                        data: {barcode:that.barcode},
                        success(res) {
                            console.log(res);
                            res = res.data
                            if(res.code===200) {
                                that.dataList = res.data