#
whycq
2022-08-25 b72346cb72abb2c5a5376a6a8f0363f42a46b73c
pages/basics/notificationFile.vue
@@ -5,7 +5,7 @@
         <view class="search-area">
            <view class="search-icon"><uni-icons type="search" size="25" color="#a5a5a5"></uni-icons></view>
            <input type="text" v-model="zpallet" placeholder=" 托盘条码"/>
            <view class="close-icon" @click="reset()"><uni-icons type="closeempty" size="25" color="#a5a5a5"></uni-icons></view>
            <view class="close-icon" v-show="zpallet" @click="remove(zpallet)"><uni-icons type="closeempty" size="25" color="#a5a5a5"></uni-icons></view>
         </view>
         <view class="search-btn"><button @click="getList(zpallet)" class="cu-btn bg-blue">搜索</button></view>
      </view>
@@ -71,8 +71,15 @@
         getUrl() {
            this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
         },
         remove(e) {
            this[e] = ''
         },
         getList(barcode) {
            let that = this
            if (barcode == '') {
               uni.showToast({title: '请输入托盘码', icon: "none",position: 'center'})
               return
            }
            uni.request({
               url: that.commonUrl + '/waitPakin/list/auth',
               data:{
@@ -86,9 +93,18 @@
                  console.log(result);
                  let res = result.data
                  if (res.code === 200) {
                     if (res.data.records) {
                     console.log(res.data.records.length);
                     if (res.data.records.length>0) {
                        that.listData = res.data.records
                     } else {
                        console.log('-----------');
                        uni.showToast({title: '托盘码:' + barcode + ' 无数据!', icon: "none",position: 'center'})
                     }
                  } else if(res.code === 403) {
                     uni.showToast({title: res.msg, icon: "none", position: 'center'})
                     that.returnIndex();
                  } else {
                     uni.showToast({title: res.msg, icon: "none",position: 'center'})
                  }
               }
            })
@@ -97,6 +113,7 @@
         resst() {
            this.listData = []
            this.zpallet = ''
            // 80049089
         },
         // 删除
         deleteData() {
@@ -105,13 +122,33 @@
            uni.request({
               url: that.commonUrl + "/waitPakin/delete/auth",
               data: {param:JSON.stringify(that.listData)},
               header: {'token':uni.getStorageSync('token')},
               header: {
                  'token':uni.getStorageSync('token'),
                  'content-type' : 'application/x-www-form-urlencoded'
                  },
               method:'POST',
               success(result) {
                  console.log(result);
                  let res = result.data
                  if (res.code === 200) {
                     uni.showToast({title: res.msg, icon: "none",position: 'center'})
                     that.resst();
                  } else if(res.code === 403) {
                     uni.showToast({title: res.msg, icon: "none", position: 'center'})
                     that.returnIndex();
                  } else {
                     uni.showToast({title: res.msg, icon: "none",position: 'center'})
                  }
               }
            })
         },
         // 403跳转登录页
         returnIndex() {
            setTimeout(() => {
               uni.reLaunch({
                  url: '../login/login'
               });
            }, 1000);
         },
      }
      
   }