#
Junjie
昨天 0d3ecfe8b2dc6b707b60d1e64b6f9f9c7c33bbd3
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<template>
    <scroll-view scroll-y>
        <view>
            <view class="container">
                <view class="text-box">
                    <view class="text-title"><text>订单</text></view>
                    <view class="text-title">{{checkOrder}}</view>
                </view>
                <view class="text-box">
                    <view class="text-title"><text>品名</text></view>
                    <view class="text-title">{{matData.maktx}}</view>
                </view>
                <view class="text-box">
                    <view class="text-title"><text>规格</text></view>
                    <view class="text-title">{{matData.specs}}</view>
                </view>
                <!-- <view class="text-box">
                    <view class="text-title"><text>工序</text></view>
                    <view class="text-title">{{matData.sku}}</view>
                </view> -->
                <view class="text-box">
                    <view class="text-title"><text>批次</text></view>
                    <view class="text-title"><input type="text" v-model="matData.batch"></view>
                </view>
                <!-- <view class="text-box">
                    <view class="text-title"><text>备注</text></view>
                    <view class="text-title"><input type="text" v-model="matData.memo"></view>
                </view> -->
                
                <view class="text-box">
                    <view class="text-title"><text>主数量</text></view>
                    <view class="text-title">
                        <view>
                            <uni-number-box v-model="matData.anfme" :value="matData.anfme" :max="99999999" color="#747474" @change="changeValue"/>
                        </view>
                    </view>
                </view>
                <view class="text-box">
                    <view class="text-title"><text>辅数量</text></view>
                    <view class="text-title">
                        <view>
                            <uni-number-box v-model="matData.weight" :value="matData.weight" :max="99999999" color="#747474" @change="changeValue2"/>
                        </view>
                    </view>
                </view>
            </view>
        </view>
        <view class="foot flex justify-center">
            <label>
                <button class="cu-btn bg-blue" @click="back()">提取</button>
            </label>
        </view>
    </scroll-view>
</template>
 
<script>
    export default {
        data() {
            return {
                matData: {
                    matnr: null,
                    maktx: null,
                    batch: null,
                    anfme: null,
                    anfme2: null,
                    origin: null,
                    checkOrder: null,
                },
                baseIP:'',
                basePORT:'',
                checkOrder: null,
            }
        },
        onLoad(option) {
            let that = this
            // #ifdef APP-NVUE
            const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
            // #endif
            // #ifndef APP-NVUE
            const eventChannel = this.getOpenerEventChannel();
            // #endif
            
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('matData', function(data) {
                let item = data.data;
                that.matData = item.matData
                that.matData.checkOrder = item.orderNo
                that.checkOrder = item.orderNo
            })
            
            
        },
        methods: {
            blur() {
                
            },
            focus() {
                
            },
            changeValue(value) {
                // this.matData.anfme = value
            },
            changeValue2(value) {
                let arr = this.matData.origin.split("/")
                let mainAnfme = value * parseFloat(arr[1]) * parseFloat(arr[0])
                let flooredNum = Math.floor(mainAnfme * 10000) / 10000; // 截断到小数点后4位
                this.matData.weight = value
                this.matData.anfme = flooredNum
            },
            back() {
                if (this.matData.anfme === 0) {
                    uni.showToast({title: '请输入数量', icon: "none", position: 'top'});
                    return;
                }
                
                this.getOpenerEventChannel().emit('matList', {data: this.matData});
                uni.vibrateShort();
                uni.navigateBack({
                    
                })
            }
        }
    }
</script>
 
<style>
    .container {
        width: 100%;
        height: 100%;
        background-color: #ffffff;
    }
    .text-box {
        height: 100rpx;
        line-height: 100rpx;
        margin-top: 20rpx;
        margin-left: 10%;
        width: 80%;
        font-size: 32rpx;
        font-weight: 400;
        color: #434343;
        border-bottom: 1rpx solid #e8e8e8;
    }
    .text-box:last-child {
        border-bottom: none;
    }
    .text-box .text-title {
        width: 30%;
        height: 100rpx;
        float: left;
        display: inline-block;
    }
    .text-box .text-title:last-child {
        display: inline-block;
        margin-left: 5%;
        width: 65%;
        font-size: 30rpx;
        font-weight: 400;
        color: #747474;
        display: flex;
        align-items: center;
    }
    .text-box .text-title:last-child input {
        border-bottom: 1rpx solid #e8e8e8 ;
        width: 100%;
    }
    
    
    .foot {
        width: 100%;
        height: 100rpx;
        line-height: 100rpx;
        background-color: rgba(255,255,255,1);
        position: fixed;
        bottom: 0%;
        border-top: 1px solid #d8d8d8;
        z-index: 1;
    }
</style>