#
whycq
2022-10-26 3d07921edd3cb3d2773c9d8148ef9748f10856b1
pages/basics/paking.vue
@@ -22,7 +22,7 @@
            <button class="cu-btn" @click="resst()">重置</button>
         </label>
         <label class="label-btn">
            <button class="cu-btn bg-blue " @click="startPakin()">入库</button>
            <button class="cu-btn bg-blue " @click="startPaking()">入库</button>
         </label>
      </view>
   </view>
@@ -40,11 +40,49 @@
            siteId: '',
         }
      },
      mounted(){
         const UIP = uni.getStorageSync('UIP');
         this.baseIP = UIP;
         const UPORT = uni.getStorageSync('UPORT');
         this.basePORT = UPORT
         const PROJ = uni.getStorageSync('UPROJ');
         this.baseUrl = PROJ
         this.getUrl()
      },
      methods: {
         // 获取url
         getUrl() {
            this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
         },
         startPaking() {
            uni.showLoading({})
            let that = this
            uni.request({
               url: that.commonUrl + "/open/asrs/wrk/pickback",
               data: {barcode:that.barcode},
               method: 'GET',
               header: {
                  'token':uni.getStorageSync('token')
               },
               success(result) {
                  console.log(result);
                  var res = result.data
                  if (res.code === 200) {
                     uni.showToast({title: res.msg, icon: "none", position: 'top'})
                     uni.hideLoading()
                  } else if (res.code == 403) {
                     uni.showToast({title: res.msg, icon: "none", position: 'top'})
                     setTimeout(() => {
                        uni.reLaunch({
                           url: '../login/login'
                        });
                     }, 1000);
                  } else {
                     uni.showToast({title: res.msg, icon: "none",position: 'top'})
                  }
               }
            })
         }
      }
   }
</script>