skyouc
2024-12-21 0d2024eabd0f07bc4ab3341dddc10464d31938f8
#新增订单筛选物料界面
1个文件已添加
163 ■■■■■ 已修改文件
pages/pakin/pakinSelector.vue 163 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/pakin/pakinSelector.vue
New file
@@ -0,0 +1,163 @@
<template>
    <view>
        <scroll-view>
            <view class="tag-list" v-for="(item,i) in matData" :key="i" @click="showTag(item)">
    <!--             <view class="tag">
                    <view style="display: flex;">
                        <view class="wms-tag" :style="baColor" >分类</view>
                    </view>
                </view> -->
                <view class="tag-item">名称:{{item.maktx}}</view>
                <view class="tag-item">编码:{{item.matnr}}</view>
                <view class="tag-item">型号:{{item.model}}</view>
                <view class="tag-item">规格:{{item.specs}}</view>
                <view style="display: flex;">
                    <view class="tag-item">数量:{{item.anfme}}</view>
                    <view class="tag-item" style="display: flex;">
                        <view >
                            已完成:
                        </view>
                        <view style="color: green;">
                            {{item.qty}}
                        </view>
                    </view>
                    <view class="tag-item" style="display: flex;">
                        <view>
                            执行中:
                        </view>
                        <view style="color: red;">
                            {{item.workQty}}
                        </view>
                    </view>
                    <view class="tag-item" style="display: flex;">
                        <view>
                            可组拖:
                        </view>
                        <view style="color: blue;">
                            {{item.mergeNum}}
                        </view>
                        </view>
                </view>
            </view>
        </scroll-view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                matData: [],
                barcode: '',
            }
        },
        onLoad(option) {
            this.barcode = option.barcode
        },
        onShow() {
            this.getMats(this.barcode)
        },
        methods: {
            showTag(pars) {
                uni.navigateTo({
                    url: "../mat/matSelected",
                    // 通过eventChannel向被打开页面传送数据
                    success: function(res) {
                        res.eventChannel.emit('mat', {
                            data: pars
                        })
                    },
                    // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                    events: {
                        matList: function(data) {
                            // that.checkMat(data.data)
                            // that.focuss()
                        },
                    },
                });
            },
            /**
             * 获取当前订单下所有物料明细
             * @param {Object} barcode
             */
            getMats(barcode) {
                let that = this
                uni.request({
                    // url: that.baseUrl + '/mat/auth',
                    url: uni.getStorageSync('baseUrl') + '/pda/mat/auth',
                    method:'POST',
                    data: JSON.stringify({
                        barcode: barcode,
                    }),
                    header: {
                        'token': uni.getStorageSync('token')
                    },
                    success(result) {
                        result = result.data
                        if (result.code === 200 && result.data) {
                            that.matData = result.data
                            that.matData['batch'] = ''
                        } else if (result.code == 403) {
                            uni.showToast({
                                title: result.msg,
                                icon: "none",
                                position: 'top'
                            })
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({
                                title: result.msg,
                                icon: "none",
                                position: 'top'
                            })
                        }
                    }
                });
            }
        }
    }
</script>
<style>
    @import url('../../static/css/wms.css/wms.css');
    .tag-list {
        width: 94%;
        min-height: 160rpx;
        margin: 15rpx;
        padding: 15rpx;
        background-color: #FFF;
        border-radius: 5px;
        box-shadow: 0 5upx 20upx rgba(0, 0, 0, 0.2);
    }
    .tag {
        display: flex;
        flex-direction: column;
        min-height: 80rpx;
        border-bottom: 1px solid #e2e2e2;
    }
    .wms-tag {
        min-width: 60rpx;
        margin-left: 50rpx;
        margin-top: 30rpx;
        color: #FFF;
        font-size: 14px;
        padding: 4rpx 12rpx;
    }
    .tag-item {
        width: 100%;
        min-height: 60rpx;
        line-height: 2;
        /* padding: 20rpx auto; */
        color: #606266;
        font-size: 14px;
    }
</style>