#
whycq
2024-01-19 b9e0cd2967f91865ae987707b34fba88dfbc5095
#
2个文件已修改
1个文件已添加
158 ■■■■ 已修改文件
pages.json 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/order/orderDetls.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/order/orderPakin2.vue 81 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json
@@ -216,6 +216,14 @@
                "enablePullDownRefresh": false
            }
            
        },
        {
            "path" : "pages/order/orderDetls",
            "style" :
            {
                "navigationBarTitleText" : "订单明细",
                "enablePullDownRefresh" : false
            }
        }
    ],
    "globalStyle": {
pages/order/orderDetls.vue
New file
@@ -0,0 +1,69 @@
<template>
    <view>
        <view class="data-list" v-for="item in dataList">
            <view class="data-item">
                <view><text>编码:</text><text>{{item.matnr}}</text></view>
                <view><text>品名:</text><text>{{item.maktx}}</text></view>
                <view><text>位置:</text><text>{{item.position}}</text></view>
                <view><text>重量:</text><text>{{item.weight}}</text></view>
                <view><text>批号:</text><text>{{item.batch}}</text></view>
            </view>
            <view class="data-options">
                <uni-icons type="right" color="#FFF" size="50rpx" @click="back(item)"></uni-icons>
            </view>
        </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                dataList:[]
            }
        },
        onLoad(option) {
            let _this = this
            // #ifdef APP-NVUE
            const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
            // #endif
            // #ifndef APP-NVUE
            const eventChannel = this.getOpenerEventChannel();
            // #endif
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('orderDetls', function(data) {
                _this.dataList = data.data
            })
        },
        methods: {
            back(item) {
                this.getOpenerEventChannel().emit('detl', {data: item});
                uni.navigateBack({
                })
            }
        }
    }
</script>
<style>
    .data-list {
        margin: 16rpx;
        background-color: antiquewhite;
        display: flex;
        background-color: #888;
        color: #fff;
        border-radius: 16rpx;
    }
    .data-item {
        flex: 1;
        padding: 16rpx 24rpx;
    }
    .data-options {
        width: 15%;
        border-left: 1px solid #ddd;
        display: flex;
        align-items: center;
        justify-content: center;
    }
</style>
pages/order/orderPakin2.vue
@@ -20,7 +20,9 @@
        <view class="mat-list-title">
            <view class="title-item"></view>
            <view class="title-item">商品列表</view>
            <view class="title-item"><button size="mini" type="primary" @click="addMat()">添加</button></view>
            <view class="title-item">
                <!-- <button size="mini" type="primary" @click="addMat()">添加</button> -->
            </view>
            
        </view>
        <u-empty v-show="dataList.length == 0" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png" style="position:fixed;top: 60%;left: 50%;transform: translate(-50%, -50%);">
@@ -139,11 +141,11 @@
        <!-- 弹窗选择 -->
        <uni-popup ref="inputDialog" type="dialog">
            <view class="pop">
                <view class="pop-btn" @click="select('1')">
                    1号码垛位
                <view class="pop-btn" @click="select('118')">
                    118号码垛位
                </view>
                <view class="pop-btn" @click="select('2')">
                    2号码垛位
                <view class="pop-btn" @click="select('119')">
                    119号码垛位
                </view>
            </view>
        </uni-popup>
@@ -195,14 +197,35 @@
            findOrder() {
                let _this = this 
                uni.request({
                    url: `${_this.baseUrl}/order/search/orderNo/auth/v2`,
                    header: { 'token': uni.getStorageSync('token') },
                    url: `${_this.baseUrl}/mobile/order/search/orderNo/auth/v2`,
                    header: {
                        'token': uni.getStorageSync('token'),
                        'content-type': 'application/x-www-form-urlencoded'
                    },
                    data: { orderNo: _this.orderNo },
                    method: 'POST',
                    success(res) {
                        res = res.data
                        if (res.code === 200 && res.data) {
                            _this.dataList = res.data
                    success(result) {
                        result = result.data
                        if (result.code === 200 && result.data) {
                            // for(let k of result.data[0].combMats) {
                            //     _this.dataList.push(k)
                            // }
                            uni.navigateTo({
                                url: "../order/orderDetls",
                                // 通过eventChannel向被打开页面传送数据
                                success: function(res) {
                                    res.eventChannel.emit('orderDetls', {
                                        data: result.data[0].combMats
                                    })
                                },
                                // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                                events: {
                                    detl: function(data) {
                                        _this.dataList.push(data.data)
                                    },
                                },
                            });
                        } else {
                            uni.showToast({ title: res.msg, icon: "none", position: 'top' })
                        }
@@ -442,15 +465,16 @@
            },
            comb() {
                let that = this;
                that.combCheck(that.palletizingNo,that.boxType,that.createTime);
                that.combCheck(that.palletizingNo2,that.boxType,that.createTime);
                if (that.checkFlag) {
                    return
                }
                uni.request({
                    url: that.baseUrl + '/mobile/truss/auth',
                    url: that.baseUrl + '/mobile/truss/order/auth',
                    data: JSON.stringify({
                        orderNo: that.orderNo,
                        barcode: that.barcode,
                        combMats: that.dataList
                        matList: that.dataList
                    }),
                    method: 'POST',
                    header: {
@@ -462,9 +486,6 @@
                            that.resst();
                            that.messageText = "退库成功"
                            that.messageToggle('success')
                            const innerAudioContext = uni.createInnerAudioContext();
                            innerAudioContext.src = '/static/music/pakinOk.mp3';
                            innerAudioContext.play()
                        } else if (res.code == 403) {
                            that.messageText = res.msg
                            that.messageToggle('error')
@@ -481,8 +502,8 @@
                });
            },
            // 提交校验
            combCheck(palletizingNo,boxType,createTime) {
                if (palletizingNo === '') {
            combCheck(palletizingNo2,boxType,createTime) {
                if (palletizingNo2 === '') {
                    this.messageText = "请添加码垛位"
                    this.messageToggle('error')
                    this.checkFlag = true;
@@ -494,33 +515,11 @@
                    this.checkFlag = true;
                    return
                }
                if (createTime === '') {
                    this.messageText = "请添加创建时间"
                    this.messageToggle('error')
                    this.checkFlag = true;
                    return
                }
                if (this.dataList.length === 0) {
                    this.messageText = "请添加退库商品"
                    this.messageToggle('error')
                    this.checkFlag = true;
                    return
                }
                for (let i = 0; i < this.dataList.length; i++) {
                    if (this.dataList[i].anfme == 0 || this.dataList[i].anfme == '') {
                        this.messageText = this.dataList[i].matnr + '退库数量不能为0'
                        this.messageToggle('error')
                        this.checkFlag = true;
                        return
                    }
                }
                for (let i = 0; i < this.dataList.length; i++) {
                    if (this.dataList[i].anfme == 0 || this.dataList[i].anfme == '') {
                        this.messageText = this.dataList[i].matnr + '退库数量不能为0'
                        this.messageToggle('error')
                        this.checkFlag = true;
                        return
                    }
                }
                this.checkFlag = false;
            },