#
zhou zhou
7 天以前 bccdb8f81c07c8a9cdcd6838173dfd1c73c98d90
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<template>
    <view class="page-container">
        <!-- 头部导航 -->
        <u-navbar
            title="商品信息"
            :fixed="true"
            :placeholder="true"
            bgColor="#ffffff"
            titleStyle="font-weight: 600; color: #303133; font-size: 32rpx;"
            autoBack
        ></u-navbar>
 
        <!-- 表单区域 -->
        <view class="panel-section">
            <view class="panel">
                <view class="panel-header">
                    <u-icon
                        name="grid-fill"
                        size="24"
                        color="#409eff"
                    ></u-icon>
                    <text class="panel-title">物料详情</text>
                </view>
 
                <u--form
                    labelPosition="left"
                    labelWidth="80"
                >
                    <u-form-item
                        label="商品编码"
                        borderBottom
                    >
                        <text class="value-text code">{{ mat.matnr }}</text>
                    </u-form-item>
 
                    <u-form-item
                        label="商品名称"
                        borderBottom
                    >
                        <text class="value-text name">{{ mat.maktx }}</text>
                    </u-form-item>
 
                    <u-form-item
                        label="规格"
                        borderBottom
                    >
                        <text class="value-text">{{ mat.specs || '-' }}</text>
                    </u-form-item>
 
                    <u-form-item
                        label="批号"
                        borderBottom
                    >
                        <u--input
                            v-model="mat.batch"
                            placeholder="请输入批号"
                            border="none"
                            clearable
                        ></u--input>
                    </u-form-item>
 
                    <u-form-item label="数量">
                        <u-number-box
                            v-model="mat.anfme"
                            :max="99999999"
                            :step="1"
                            @change="changeValue"
                        ></u-number-box>
                    </u-form-item>
                </u--form>
            </view>
        </view>
 
        <!-- 底部操作按钮 -->
        <view class="bottom-bar">
            <u-button
                type="primary"
                text="确认提取"
                icon="checkbox-mark"
                @click="back"
                customStyle="width: 100%; border-radius: 40rpx;"
            ></u-button>
        </view>
        <u-toast ref="uToast"></u-toast>
    </view>
</template>
 
<script>
export default {
    data() {
        return {
            mat: {
                matnr: null,
                maktx: null,
                specs: null,
                batch: null,
                anfme: 0
            }
        }
    },
    onLoad() {
        let that = this
        // #ifdef APP-NVUE
        const eventChannel = this.$scope.eventChannel
        // #endif
        // #ifndef APP-NVUE
        const eventChannel = this.getOpenerEventChannel()
        // #endif
 
        // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
        eventChannel.on('mat', function (data) {
            that.mat = data.data
            that.mat.anfme = 0
        })
    },
    methods: {
        changeValue(e) {
            this.mat.anfme = e.value
        },
        back() {
            if (this.mat.anfme === 0) {
                this.$showToast({ type: 'error', message: '请输入数量' })
                return
            }
            this.getOpenerEventChannel().emit('matList', { data: this.mat })
            uni.navigateBack()
        }
    }
}
</script>
 
<style lang="scss" scoped>
page {
    background-color: #f0f2f5;
}
 
.page-container {
    min-height: 100vh;
    background-color: #f0f2f5;
    padding-bottom: 140rpx; /* 给底部悬浮按钮留出空间 */
}
 
/* 面板区域 */
.panel-section {
    padding: 24rpx;
}
 
.panel {
    background-color: #ffffff;
    border-radius: 12rpx;
    padding: 0 24rpx 24rpx;
    box-shadow: 0 2rpx 12rpx 0 rgba(0, 0, 0, 0.05);
}
 
.panel-header {
    display: flex;
    align-items: center;
    padding: 24rpx 0;
    border-bottom: 1px solid #ebeef5;
    margin-bottom: 10rpx;
}
 
.panel-title {
    font-size: 30rpx;
    color: #303133;
    font-weight: 600;
    margin-left: 12rpx;
}
 
.value-text {
    font-size: 28rpx;
    color: #303133;
    word-break: break-all;
    line-height: 1.5;
}
 
.value-text.code {
    color: #409eff;
    font-weight: 600;
}
 
.value-text.name {
    font-weight: 500;
}
 
/* 底部操作栏 */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
    display: flex;
    padding: 20rpx 40rpx;
    padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
    z-index: 99;
}
</style>