skyouc
2025-05-08 b6c44345b43433a9e28aab4fc33dedfb5ab16efe
pages/listing/itemSelect.vue
@@ -2,7 +2,7 @@
   <view>
      <!-- 搜索框 -->
      <view class="search-bar">
         <uni-search-bar v-model="condition" placeholder=" 输入批次" bgColor="#EEEEEE"  />
         <uni-search-bar v-model="condition" placeholder=" 输入批次" bgColor="#EEEEEE"  @confirm="search()"/>
      </view>
      
       
@@ -33,14 +33,7 @@
                        <text class="text-grey ">{{item.asnCode}}</text>
                     </view>
                  </view>
                  <view class="cu-item">
                     <view class="content">
                        <text class="text-black">物料条码:</text>
                     </view>
                     <view class="action">
                        <text class="text-grey ">{{item.trackCode}}</text>
                     </view>
                  </view>
                  <view class="cu-item">
                     <view class="content">
                        <text class="text-black">供应商批次:</text>
@@ -49,23 +42,6 @@
                        <text class="text-grey ">{{item.splrBatch}}</text>
                     </view>
                  </view>
                  <!-- <view class="cu-item">
                     <view class="content">
                        <text class="text-black">库存批次:</text>
                     </view>
                     <view class="action">
                        <text class="text-grey ">{{item.batch}}</text>
                     </view>
                  </view> -->
                  <!-- <view class="cu-item">
                     <view class="content">
                        <text class="text-black">平台行号: <text class="text-grey ">{{item.platformId}}</text></text>
                     </view>
                     <view class="content">
                        <text class="text-black">质检结果: <text class="text-grey ">{{item.inspect}}</text></text>
                     </view>
                  </view> -->
                  <view class="cu-item">
                     <view class="content">
                        <text class="text-black">库存单位: <text class="text-grey ">{{item.stockUnit}}</text></text>
@@ -97,6 +73,9 @@
</template>
<script>
   import {
      request
   } from '../../common/request.js'
   export default {
      data() {
         return {            
@@ -110,7 +89,7 @@
            selectedList:[],
            repeatClick: false,
            matnrCode:'',
            asnCode:''
            asnCode:'',
            
         }
      },
@@ -126,8 +105,7 @@
         
         // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
         eventChannel.on('data', function(data) {
            console.log(data.item)
            that.matList = data.item
            that.getDet(data)
         })
      },
      onShow() {
@@ -136,6 +114,15 @@
         
      },
      methods: {
         search(){
            let req = {
               matnrCode: this.condition,
               asnCode: this.condition,
               code: this.condition,
               batch: this.condition
            }
            this.getDet(req);
         },
         back() {
            for (var i = 0; i < this.matList.length; i++) {
               if(this.matList[i].selected === true){
@@ -155,22 +142,27 @@
               this.matList[index].selected = !this.matList[index].selected
            }            
         },
         async getDet() {
         async getDet(req) {
            let that = this;
            uni.showLoading({
               title:'加载中...'
            })
            const {
               code,
               data,
               msg
            } = await request('/asnOrderItem/trackCode', {
               matnrCode: that.matnrCode,
               asnCode: that.asnCode
               matnrCode: req.matnrCode,
               asnCode: req.asnCode,
               code: req.code,
               batch: req.batch
            }, "post")
            if (code === 200) {
               for (var i = 0; i < data.length; i++) {
                  data[i].receiptQty =0;
                  data[i].selected = false;                     
               }   
               this.list = data
               this.matList = data
            } else {
               uni.showToast({
                  title: msg,
@@ -178,6 +170,7 @@
                  position: 'top'
               })
            }
            uni.hideLoading();
         },
         
      }