skyouc
2025-11-04 bb44fbbe5340a86a16f6deec50cc39a8700e80c6
pages/mat/matSelected.vue
@@ -1,6 +1,10 @@
<template>
   <view>
      <view class="form">
      <view class="form" v-for="mat in mats">
         <view class="form-item">
            <view class="form-item-desc"><text>订单号</text></view>
            <view class="form-item-content"><text>{{mat.orderNo}}</text></view>
         </view>
         <view class="form-item">
            <view class="form-item-desc"><text>商品编码</text></view>
            <view class="form-item-content"><text>{{mat.matnr}}</text></view>
@@ -24,7 +28,7 @@
         <view class="form-item">
            <view class="form-item-desc"><text>数量</text></view>
            <view class="form-item-content">
               <uni-number-box :value="mat.anfme" :max="99999999" :step='1' color="#747474" @change="changeValue" />
               <uni-number-box :value="mat.enableQty" :max="99999999" color="#747474" @change="changeValue" />
            </view>
         </view>
      </view>
@@ -46,6 +50,8 @@
               batch: null,
               anfme: 0,
            },
            selectNum: null,
            mats: null,
            baseIP:'',
            basePORT:'',
         }
@@ -61,8 +67,7 @@
         
         // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
         eventChannel.on('mat', function(data) {
            that.mat = data.data
            that.mat.anfme = 0
            that.mats = data.data
         })
         
         
@@ -75,14 +80,22 @@
            
         },
         changeValue(value) {
            this.mat.anfme = value
            this.mats[0].anfme = value
            this.selectNum = value
         },
         back() {
            if (this.mat.anfme === 0) {
            if (this.mats[0].anfme === 0) {
               uni.showToast({title: '请输入数量', icon: "none", position: 'top'});
               return;
            }
            this.getOpenerEventChannel().emit('matList', {data: this.mat});
            console.log("=======>");
            console.log(this.mats[0]);
            if (this.selectNum != null) {
               this.mats[0].anfme = this.selectNum
            } else {
               this.mats[0].anfme = this.mats[0].enableQty
            }
            this.getOpenerEventChannel().emit('matList', {data: this.mats[0]});
            uni.navigateBack({
               
            })