lty
2025-04-08 79c97902cc5bae4f8202bebf7c1d4f25b6e59da8
pages/basics/stockCheck.vue
@@ -1,7 +1,7 @@
<template>
   <view>
      <scroll-view scroll-y>
         <view class="pak-seach-box">
<!--          <view class="pak-seach-box">
            <view class="box-top">
               <view class="color-block-blue"></view>
               <text class="title">选择站台</text>
@@ -12,7 +12,7 @@
                  <uni-combox @input="getCheckDetl" emptyTips="暂无数据" :candidates="staNoList" v-model="staNo" placeholder="请选择"></uni-combox>
               </view>
            </view>
         </view>
         </view> -->
         
         <view class="square-2">
            <view class="square-title">
@@ -57,7 +57,7 @@
               <button class="cu-btn lg" @click="resst()">重置</button>
            </view>
            <view>
               <button class="cu-btn lg pakin-btn bg-blue" @click="adjust()">确认</button>
               <button class="cu-btn lg pakin-btn bg-blue" @click="confirm()">确认</button>
            </view>
         </view>
      </scroll-view>
@@ -196,9 +196,9 @@
         findMat() {
            let that = this
            uni.request({
                url: that.commonUrl + '/mat/auth',
                url: that.commonUrl + '/plate/out/startFree',
                data: {
                  matnr:that.matnr
                  barcode:that.barcode
                },
                header: {
                  'token':uni.getStorageSync('token')
@@ -253,9 +253,73 @@
            
         },
         confirm() {
            this.matList[this.rowNum].anfme = this.count
            this.$refs.revise.close()
            let that = this;
            console.log("当前条码是:", that.barcode);
            if (!that.barcode) {
               uni.showToast({
                  title: '请先输入或扫码托盘条码',
                  icon: 'none'
               });
               return;
            }
            uni.request({
               url: that.commonUrl + '/plate/out/startFree',
               method: 'POST',
               data: JSON.stringify(that.barcode), // 注意这里直接传字符串
               header: {
                  'token': uni.getStorageSync('token'),
                  'Content-Type': 'application/json' // 重要,告诉后端你发的是 JSON 字符串
               },
               success(result) {
                  uni.vibrateShort();
                  let res = result.data;
                  if (res.code === 200) {
                     uni.showToast({
                        title: res.msg || '出库启动成功',
                        icon: 'success'
                     });
                     // 清空托盘条码
                     that.barcode = '';
                     // 如果有 matData 再跳转
                     if (res.data) {
                        that.matData = res.data;
                        uni.navigateTo({
                           url: "matQuery",
                           events: {
                              matList: function(data) {
                                 that.matList.push(data.data);
                              },
                           },
                           success: function(res) {
                              res.eventChannel.emit('matData', {
                                 data: that.matData
                              });
                           }
                        });
                     }
                  } else {
                     uni.showToast({
                        title: res.msg || '出库启动失败',
                        icon: 'none'
                     });
                  }
               },
               fail(err) {
                  uni.showToast({
                     title: '网络请求失败',
                     icon: 'none'
                  });
                  console.error('请求失败:', err);
               }
            });
         },
         resst() {
            this.matList = []
            this.staNo = ''