李旭东
2023-11-03 10686c5e51ef98ca459ab000462c0701e0bb17ea
sz_app/pages/spotCheck/index.vue
@@ -19,11 +19,10 @@
         <view 
            class="spot_item"
            v-for="item in spotList"
            :key="item.id"
            @click="navgetToDetail(item)">
            :key="item.id">
            <view class="spot_item_title">
               <span>设备编号:{{item.bigNumber}}</span>
               <span>详情</span>
               <span @click="navgetToDetail(item)">详情</span>
            </view>
            <view class="spot_item_content">
               <view class="">
@@ -36,7 +35,7 @@
               </view>
               <view class="">
                  <span class="label">设备类型:</span>
                  <span>{{item.bigTypeStr}}</span>
                  <span>{{item.bigType == 1 ? '特殊设备' : '一般设备'}}</span>
               </view>
               <view class="">
                  <span class="label">点检时间:</span>
@@ -84,11 +83,15 @@
            pageNum: 1,
            pageSize: 10,
            loadPage: '',
            spotList: [{id: 1}, {id: 2}, {id: 3}],
            spotList: [],
         }
      },
      onShow() {
         this.searchData();
      },
      onUnload() {
         // 移除监听事件
         uni.$off('scancodedate');
      },
      methods: {
         // 查询模具质检列表
@@ -97,6 +100,7 @@
               pageNum: this.pageNum,
               pageSize: this.pageSize
            })
            console.log(data);
            return data;
         },
         // 查询信息
@@ -146,21 +150,22 @@
            uni.$on('scancodedate', function(data) {
               console.log(data.code);
               if(data.code) {
                  uni.navigateTo({
                     url: './deviceSpot'
                  const list = data.code ? data.code.split('bigDeviceId=') : [];
                  const codeStr = list.length > 0 ? list[list.length - 1] : '';
                  that.$api.spot.getDeviceDetails({
                     bigDeviceId: codeStr
                  }).then((res) => {
                     if(res.success) {
                        uni.$u.toast('扫描完成!');
                        uni.navigateTo({
                           url: './deviceSpot?deviceId=' + codeStr
                        })
                     } else {
                        uni.$u.toast(res.statusMsg);
                     }
                  })
                  uni.$off('scancodedate');
               }
               // that.$api.spot.scanCheckMould({
               //    mouldNum: data.code
               // }).then((res) => {
               //    if(res.success) {
               //       uni.$u.toast('扫描完成!');
               //       console.log(res,'===');
               //    } else {
               //       uni.$u.toast(res.statusMsg);
               //    }
               // })
               uni.$off('scancodedate');
            })
         },
         // 跳转详情
@@ -169,7 +174,7 @@
               url: './spotDetail?id=' + item.id
            })
         }
      }
      },
   }
</script>