#
Junjie
2025-07-30 12966b4ef9d35b25760fcd4fcdd569bef9aa8547
pages/basics/pakin.vue
@@ -9,7 +9,7 @@
            <view class="square-content">
               <view class="content-input">
                  <input v-model="barcode" type="text" placeholder="扫码 / 输入" 
                  :focus="barcodeFocus" @input="barcodeInput()" placeholder-style="line-height:  85rpx;">
                  :focus="barcodeFocus" @confirm="barcodeInput()" placeholder-style="line-height:  85rpx;">
                  <uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
               </view>
            </view>
@@ -22,14 +22,14 @@
               <view class="title-text"><text>检索商品</text></view>
            </view>
            <view class="square-content">
               <view class="content-input-btn">
               <view class="content-input">
                  <input v-model="matnr" type="text" placeholder="扫码 / 输入" @input="findMat()"
                  :focus="focus" placeholder-style="line-height:  85rpx;">
                  <uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></uni-icons>
               </view>
               <view class="content-btn">
               <!-- <view class="content-btn">
                  <button class="cu-btn bg-blue pda-btn" @click="selectMat()">+提取</button>
               </view>
               </view> -->
            </view>
         </view>
         
@@ -52,11 +52,20 @@
                  <!-- <view>
                     <checkbox :value="item.id+''" :checked="item.checked" style="display: block;" />
                  </view> -->
                  <view ><text style="width: 400rpx;">单据:{{item.orderNo}}</text></view>
                  <view class="matnr"><text style="width: 400rpx;">编码:{{item.matnr}}</text></view>
                  <view><text style="width: 400rpx;">品名:{{item.maktx}}</text></view>
                  <view><text style="width: 400rpx;">批号:{{item.batch}}</text></view>
                  <view><text style="width: 400rpx;">规格:{{item.specs}}</text></view>
               <!--    <view><text style="width: 400rpx;">型号:{{item.model}}</text></view> -->
                  <view><text style="width: 400rpx;">批次:{{item.batch}}</text></view>
                  <view style="width: 500rpx;"><text>型号:{{item.model}}</text></view>
                  <view><text style="width: 400rpx;">库存状态:{{item.cstateid$}}</text></view>
                  <!-- <view><text style="width: 400rpx;">备注:{{item.memo}}</text></view> -->
                  <view>
                     <text style="width: 400rpx;">数量:{{item.anfme}}</text>
                     <text style="width: 400rpx;">主数量:{{item.anfme}}</text>
                  </view>
                  <view>
                     <text style="width: 400rpx;">辅数量:{{item.weight}}</text>
                  </view>
               </view>
               <view class="data-list-right">
@@ -80,6 +89,9 @@
         <label class="label-btn" style="width: 150rpx;">
            <button class="cu-btn" @click="resst()">重置</button>
         </label>
         <label>
            总计辅数量:{{ countWeight }}
         </label>
         <label class="label-btn">
            <button class="cu-btn bg-blue " @click="comb()">组托</button>
         </label>
@@ -87,15 +99,20 @@
      
      <!-- 弹窗 -->
      <!-- 修改数量 -->
      <uni-popup ref="revise" background-color="#fff" @change="change">
         <view class="revise-box">
      <uni-popup ref="revise" background-color="#fff">
         <view class="revise-box ">
            <view class="revise-box-top">
               <view class="color-block-blue"></view>
               <text class="title">修改数量</text>
            </view>
         <!--    <view class="" style="position: relative;left: 50px;margin-bottom: 20px;">
               <text style="display: inline-block;float: left;width: 60px;">批次:</text>
               <input type="text" style="width: 100px;border-bottom: 1px solid #9e9e9e;" v-model="batch">
            </view> -->
            <view class="changeBox">
               <view class="num-box">
                  <uni-number-box :value="count" :max="9999" color="#747474"  @change="changeValue"/>
                  <text style="display: inline-block;float: left;width: 60px;">主数量:</text>
                  <uni-number-box :value="count" :max="99999999" color="#747474"  @change="changeValue"/>
               </view> 
            </view>
            <view class="revise-box-buttom">
@@ -131,6 +148,8 @@
            check:false,
            checkText:'全选',
            checkedData:[],
            batch:'',
            countWeight: 0
         }
      },
      onShow() {
@@ -163,10 +182,8 @@
                  this.barcodeFocuss()
                  return;
               }
               if (len == 8) {
                  this.focuss()
               }
            },100)
               this.focuss()
            },200)
         },
         // 托盘码有误重置
         barcodeFocuss() {
@@ -234,7 +251,7 @@
            }
            uni.showLoading();
            uni.request({
                url: that.commonUrl + '/mobile/comb/auth',
                url: that.commonUrl + '/mobile/comb2/auth',
                data: JSON.stringify({
                  barcode: that.barcode,
                  combMats: that.matList
@@ -280,7 +297,7 @@
               },
               success: function(res) {
                   // 通过eventChannel向被打开页面传送数据   向另外一个页面传递值的
                   res.eventChannel.emit('acceptDataFromOpenerPage', {commonUrl:that.commonUrl })
                   res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
               },
               
            });
@@ -289,7 +306,7 @@
         findMat() {
            let that = this
            uni.request({
                url: that.commonUrl + '/mat/auth',
                url: that.commonUrl + '/mobile/mat/auth',
                data: {
                  matnr:that.matnr
                },
@@ -301,13 +318,17 @@
                  let res = result.data
                  if (res.code === 200 && res.data) {
                     that.matData = res.data
                     let tiaoma = that.matnr;
                     that.matnr = ''
                     uni.navigateTo({
                        url: "matQuery",
                        events: {
                            // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                            matList: function(data) {
                              that.checkMat(data.data)
                              let resultData = data.data;
                              resultData.tiaoma = tiaoma;
                              that.checkMat(resultData)
                              // that.matList.push(data.data)
                           },
                        },
@@ -340,7 +361,11 @@
            var len = this.matList.length
            var add = true
            for (var i = 0; i < len; i++) {
               if (mat.matnr == this.matList[i].matnr) {
               if (mat.tiaoma == this.matList[i].tiaoma){
                  uni.showToast({title: "条码重复扫了", icon: "none", position: 'top'})
                  add = false
               }
               if (mat.matnr == this.matList[i].matnr && mat.batch == this.matList[i].batch) {
                  this.matList[i].anfme += mat.anfme 
                  this.$forceUpdate() // 强制刷新
                  add = false
@@ -348,6 +373,12 @@
            }
            if (add) {
               this.matList.unshift(mat)
               let count = 0;
               this.matList.forEach((item) => {
                  count += item.weight;
               })
               this.countWeight = count;
            }
         },
         change(e) {
@@ -400,8 +431,8 @@
            this.count = value
         },
         confirm() {
            console.log(this.count)
            this.matList[this.rowNum].anfme = this.count
            this.matList[this.rowNum].batch = this.batch
            this.$refs.revise.close()
            this.$forceUpdate() // 强制刷新
         },
@@ -456,8 +487,9 @@
   /* @import "../../colorui/main.css";
   @import "../../colorui/icon.css"; */
   .revise-box {
      width: 400rpx;
      height: 300rpx;
      position: relative;
      width: 500rpx;
      height: 400rpx;
      border-radius: 25px;
   }
   .revise-box-top {
@@ -473,7 +505,7 @@
      margin-left: 100rpx;
   }
   .revise-box-buttom{
      margin-left: 130rpx;
      margin-left: 190rpx;
   }
   .pak-seach-box {
      background-color: #FFFFFF;
@@ -571,7 +603,7 @@
   }
   .data-list {
      border-bottom: 1px solid #d8d8d8;
      height: 180rpx;
      height: 450rpx;
      margin: 15rpx;
      border-radius: 20rpx;
   }