#
zwl
昨天 b5390b1f1254d1a286a78c3d22da0366b3a27096
pages/AGV/AGVYBPakin.vue
@@ -1,28 +1,29 @@
<template>
   <view>
      <view class="code">
         <view class="item">
            <view class="code-decs">站点号:</view>
            <input type="text" placeholder=" 扫码 / 输入" v-model="rsta" :focus="rstaFocus" @input="rstaInput()">
         </view>
         <view class="item">
            <view class="code-decs">托盘码:</view>
            <input type="text" placeholder=" 扫码 / 输入" v-model="barcode" :focus="barcodeFocus"
               @input="barcodeInput()">
         </view>
         <view class="item">
            <view class="code-decs">站点号:</view>
            <input type="text" placeholder=" 扫码 / 输入" v-model="rsta" :focus="rstaFocus" @input="rstaInput()">
         </view>
         <view class="item">
            <view class="code-decs">验布码:</view>
            <input type="text" placeholder=" 扫码 / 输入" v-model="batchCode" :focus="batchFocus" @input="findMat()">
            <input type="text" placeholder=" 扫码 / 输入" v-model="ybm" :focus="ybmFocus" @input="findMat()">
            <!-- <view class="item-right">
               <button></button>
               <text style="text-align: right;color: #409EFF;" @click="selectMat()">提取+</text>
               <uni-icons type="right" color="#c1c1c1"></uni-icons>
            </view> -->
         </view>
         <view class="item">
         <!-- <view class="item">
            <view class="code-decs">仓库:</view>
            <uni-combox :candidates="floorList" placeholder="请选择仓库" v-model="floor"></uni-combox>
         </view>
         </view> -->
         <view class="item">
            <view class="code-decs" style="width: 25vw;">大小托盘:</view>
            <radio-group @change="isFullPlt">
@@ -43,28 +44,26 @@
            <view class="list-left">
               <view class="list-left-item">
                  <view class="desc">No:</view>
                  <view class="left-item">{{i + 1}}</view>
                  <view class="left-item">{{dataList.length-i}}</view>
               </view>
               <view class="list-left-item">
                  <view class="desc">料号:</view>
                  <view class="left-item">
                     <uni-tag :text="item.matnr" type="primary"></uni-tag>
                     <uni-tag :text="item.matnr" type="primary" style="color: black; font-weight: 600; font-size: 20px;"></uni-tag>
                  </view>
               </view>
               <view class="list-left-item">
               <!-- <view class="list-left-item">
                  <view class="desc">品名:</view>
                  <view class="left-item">{{item.maktx}}</view>
               </view>
               <view class="list-left-item">
               </view> -->
               <!-- <view class="list-left-item">
                  <view class="desc">规格:</view>
                  <view class="left-item">{{item.specs}}</view>
               </view>
               </view>-->
               <view class="list-left-item">
                  <view class="desc">批号:</view>
                  <view class="left-item">
                     <uni-tag :text="item.batch" type="warning"></uni-tag>
                  </view>
               </view>
                  <view class="left-item">{{item.batch}}</view>
               </view>
               <!-- <view class="list-left-item">
                  <view class="desc">重量:</view>
                  <view class="left-item">
@@ -72,7 +71,7 @@
                  </view>
               </view> -->
               <view class="list-left-item">
                  <view class="desc">数量:</view>
                  <view class="desc">净长:</view>
                  <view class="left-item">{{item.anfme}}</view>
               </view>
            </view>
@@ -193,6 +192,8 @@
            ck: '',
            floorList: [],
            floor: '',
            ybm:'',
            ybmFocus:false,
         }
      },
      onLoad() {
@@ -275,25 +276,27 @@
         // 托盘码有误重置
         barcodeFocuss() {
            let that = this;
            that.barcodeFocus = false;
            that.rstaFocus = false;
            setTimeout(() => {
               that.barcode = '';
               that.barcodeFocus = true;
               that.ybm = '';
               that.ybmFocus = true;
            }, 100);
         },
         // 商品光标清空重置
         focuss() {
            this.focus = false;
            this.barcodeFocus =false;
            this.rstaFocus =false;
            setTimeout(() => {
               this.matnr = '';
               this.matFocus = true;
               this.rsta = '';
               this.rstaFocus = true;
            }, 100);
         },
         // 搜索物料
         findMat() {
            let that = this
            uni.request({
               url: that.baseUrl + '/mobile/mat/tiaoma/auth?barcode=' + that.batchCode,
               url: that.baseUrl + '/mobile/mat/tiaoma/auth?barcode=' + that.ybm,
               header: {
                  'token': uni.getStorageSync('token')
@@ -301,8 +304,23 @@
               success(result) {
                  result = result.data
                  if (result.code === 200 && result.data) {
                     // 检查批号是否重复
                             const newBatchNumber = result.data.batch; // 请替换为实际的批号属性名
                             // 在dataList中查找是否已存在相同批号
                             const isDuplicate = that.dataList.some(item => item.batch === newBatchNumber); // 请替换为实际的批号属性名
                             if (isDuplicate) {
                              that.ybm = '';
                                 uni.showToast({
                                     title: '批号重复,无法添加',
                                     icon: "none",
                                     position: 'top'
                                 })
                                 return; // 停止执行,不添加数据
                             }
                     that.dataList.unshift(result.data)
                     that.focuss()
                     that.ybm = '';
                  } else if (result.code == 403) {
                     uni.showToast({
                        title: result.msg,
@@ -456,11 +474,6 @@
               this.messageToggle('error')
               return;
            }
            if (that.floor === '') {
               this.messageText = "仓库不能为空"
               this.messageToggle('error')
               return;
            }
            for (var i = 0; i < that.dataList.length; i++) {
               if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') {
                  this.messageText = that.dataList[i].matnr + '组托数量不能为0'
@@ -474,10 +487,11 @@
                  beBatch: 0,
                  barcodeSize: '0',
                  rsta: that.rsta,
                  type: true,
                  barcode: that.barcode,
                  combMats: that.dataList,
                  ck: that.floor,
                  type: true,
               }),
               method: 'POST',
               header: {
@@ -648,4 +662,20 @@
      text-align: center;
      box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.5);
   }
</style>
   .list {
      font-size: 20px;
      font-weight: 600;
   }
   .list-left-item .desc,
   .list-left-item .left-item {
      font-size: 20px;
      font-weight: 600;
   }
   .list-left-item uni-tag {
      font-size: 20px;
      font-weight: 600;
   }
</style>