dengjunjie
2025-10-24 ea79f0278f9b17b6d17e054028d5e7175ec168dd
н¨Îļþ¼Ð/PDA/pages/stash/raworderboxing.vue
@@ -37,7 +37,8 @@
                     <view style="display: flex;justify-content: space-around;margin-top: 2%;">
                        <!-- <button @click="reset" type="default" size="default"
                           style="width: 160rpx;border: 1rpx solid #007aff;color: #007aff;">重置</button> -->
                        <button @click="submit" type="primary" size="default" style="width: 200rpx;">确认入库</button>
                        <button @click="submit" type="primary" size="default"
                           style="width: 200rpx;">确认入库</button>
                     </view>
                  </uni-forms-item>
               </uni-forms>
@@ -135,13 +136,14 @@
            matTotal: [],
            matInfos: [],
            orderNo: "",
            batchNo:"",
            orderqty:"",
            Inqty:"",
            goods_no:"",
            batch_num:"",
            order_qty:"",
            order_Inqty:"",
            batchNo: "",
            materielCode:"",
            orderqty: 0,
            Inqty: 0,
            goods_no: "",
            batch_num: "",
            order_qty: "",
            order_Inqty: "",
            label: "",
            orderInfo: [],
            focus: false,
@@ -174,15 +176,16 @@
         this.focus = false;
         this.addressFocus = false;
         this.orderNo = res.orderNo;
         this.Inqty=res.order_Inqty;
         this.orderqty=res.order_qty;
         this.batchNo=res.batchNo;
         this.Inqty = res.order_Inqty;
         this.orderqty = res.order_qty;
         this.batchNo = res.batchNo;
         this.materielCode=res.goods_no;
         this.warehouseId = res.warehouseId;
         this.label = "单据编号:" + this.orderNo;
         this.batch_num="批次号:"+res.batchNo;
         this.order_qty="单据数量:"+res.order_qty;
         this.order_Inqty="已入库数量:"+this.Inqty;
         this.goods_no="物料编号:"+res.goods_no;
         this.batch_num = "批次号:" + res.batchNo;
         this.order_qty = "单据数量:" + res.order_qty;
         this.order_Inqty = "已入库数量:" + this.Inqty;
         this.goods_no = "物料编号:" + res.goods_no;
         this.getData();
      },
      methods: {
@@ -254,12 +257,12 @@
                     matSn = matSn.replace(/,SC.*/, '');
                  }
                  //查询matSn是否存在字符
                  if(matSn.indexOf("POHA")>0){
                  if (matSn.indexOf("POHA") > 0) {
                     this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
                        this.Testcheck = false;
                        if (res.status) {
                           this.sns.push(res.data.serialNumber);
                           this.matInfos.push(res.data);
                           if (res.message) {
                              this.$refs.uToast.show({
@@ -294,10 +297,10 @@
         pksnInput() {
            this.$nextTick(() => {
               if (this.pkmaterSn != "") {
                  var matSn = this.pkmaterSn;
                  if(matSn.indexOf("POHA")>0){
                  if (matSn.indexOf("POHA") > 0) {
                     this.$u.post('/api/MaterielInfo/CodeAnalysis?serNum=' + matSn, {}).then((res) => {
                        if (res.status) {
                           this.pksns.push(res.data.serialNumber);
@@ -451,33 +454,88 @@
               })
               return;
            }
            uni.showLoading({
               title: '提交中...'
            });
            this.$u.post('/api/CabinOrder/FeedbackIn', {
               MainData: {
                  "LocationCode": this.barcode,
                  "warehouseCode": this.warehouseId,
                  "orderNo": this.orderNo,
                  "materielCode":this.materielCode,
                  "Inqty": this.materSn,
                  "batchNo": this.batchNo,
               },
               DelKeys: this.sns
            }).then(res => {
               uni.hideLoading();
               this.Testcheck = false;
               if (res.status) {
                  this.$refs.uToast.show({
                     title: "入库成功",
                     type: "success"
                  })
                  this.Inqty=res.message;
                  this.order_Inqty="已入库数量:"+this.Inqty;
                  this.barcode="";
                  this.materSn="";
                  this.Inqty = parseInt(res.message);
                  this.order_Inqty = "已入库数量:" + this.Inqty;
                  this.barcode = "";
                  this.materSn = "";
                  if (this.Inqty == this.orderqty) {
                     uni.setStorageSync('isLoaded', true);
                     this.handleInboundComplete();
                  }
               } else {
                  this.$refs.uToast.show({
                     title: res.message,
                     type: "error"
                  })
               }
            }).catch(err => {
               uni.hideLoading();
               this.$refs.uToast.show({
                  title: "网络错误,请重试",
                  type: "error"
               })
            })
         },
         // æ–°å¢žæ–¹æ³•处理入库完成逻辑
         handleInboundComplete() {
            // æ˜¾ç¤ºå®Œæˆæç¤º
            // uni.showModal({
            //    title: '提示',
            //    content: '入库已完成,是否返回首页?',
            //    success: (res) => {
            //       if (res.confirm) {
            //          // ç”¨æˆ·ç‚¹å‡»ç¡®å®š
            //          setTimeout(() => {
            //             // uni.redirectTo({
            //             //    url: '/pages/stash/inboundorder?warehouseId='+this.warehouseId // æ›¿æ¢ä¸ºä½ çš„目标页面路径
            //             // });
            //             uni.navigateBack({
            //                delta: 2
            //             });
            //          }, 500);
            //       } else {
            //          // ç”¨æˆ·ç‚¹å‡»å–消,可以停留在当前页面
            //          // æˆ–者执行其他操作
            //       }
            //    }
            // });
            // æˆ–者直接跳转(不询问用户)
            setTimeout(() => {
            // æ–¹å¼2:跳转到指定页面
            // uni.redirectTo({
            //     url: '/pages/order/list' // æ›¿æ¢ä¸ºä½ çš„目标页面路径
            // });
            // æ–¹å¼3:跳转到首页
            // uni.switchTab({
            //     url: '/pages/index/index'
            // });
            // æ–¹å¼1:使用uni.navigateBack返回上一页
                uni.navigateBack({
                    delta: 2
                });
            }, 600);
         }
      }
   }