yangan
2025-02-25 5d46360410a48fa6038e46e0d769f88207be9d75
pages/sampling-page/index.vue
@@ -12,10 +12,12 @@
                  iconSize="1000"
                  v-if="CoalNameList.length == 0"></u-empty>
            </view> -->
                <view class="title"><u-icon  size='26' color="#" name="order"></u-icon><i>待检区</i></view>
            <view class="body">
               <!-- <selectTarget ref='selectTarget'></selectTarget> -->
                    <view class="collection-form">
                  <u-tabs :list="tabList" :activeStyle="{fontSize:'26rpx'} " @click="tabClick"></u-tabs>
                        <view style="position: relative;">
               <u-empty mode="data"
                  icon="http://cdn.uviewui.com/uview/empty/data.png"
@@ -73,7 +75,7 @@
                  <view class="third-line">
                     <view class="time-icon">
                        <view
                           style="width: 24rpx;height: 24rpx;li ne-height: 24rpx;background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/clock.png') no-repeat;background-size: cover">
                           style="width: 24rpx;height: 24rpx;line-height: 24rpx;background: url('https://mr1.res.jzeg.cn:9096/appimg/image/banner/clock.png') no-repeat;background-size: cover">
                        </view>
                     </view>
                     <view class="send-date">{{ item.sendDate }}</view>
@@ -87,6 +89,7 @@
                     </view>
                  </view>
               </view>
               <view class="bottom"></view>
                    
            </view>
            </view>
@@ -121,9 +124,20 @@
      data() {
         return {
                orderPlanData:[],
            tagName:'外销',
                activeObj:{},
            timer:null,
                showFlag:false,
            tabList:[{
               name:'外销'
                  },
                  {
                     name:'外购'
                  },
                  {
                     name:'内购'
                  }
               ]
         };
      },
      onLoad() {
@@ -132,7 +146,16 @@
      methods: {
         init() {
            this.$nextTick(() => {
               this.getListData();
               if(this.tagName == '外购'){
                  this.getWaiData();
               }else if(this.tagName == '内购'){
                  this.getNeiData();
               } else{
                  this.getListData();
               }
            })
         },
            getListData(){
@@ -140,7 +163,7 @@
                    console.log(res,'result');
                    if(res.code == 0){
                  if(res.data.records.length){
                     this.orderPlanData  = [res.data.records[0]]
                     this.orderPlanData  = res.data.records
                  }else{
                     this.orderPlanData = [];
                  }
@@ -174,13 +197,59 @@
         timerFun(){
         this.timer = window.setInterval(() => {
               setTimeout(() => {
                  this.getListData() //调用接口的方法
                  if(this.tagName == '外购'){
                     this.getWaiData()
                  }else if(this.tagName == '内购'){
                     this.getNeiData();
                  }
                  else{
                     this.getListData() //调用接口的方法
                  }
                  console.log(1111111111)
               }, 0)
            }, 10000);
            }, 60000);
         },
         clearTime(){
            window.clearInterval(this.timer)
         },
         tabClick(val){
            console.log(val,'valll')
               this.tagName = val.name;
               if(val.name == '外购'){
                  this.getWaiData();
               }else if(val.name === '内购'){
                  this.getNeiData();
               }
               else{
                  this.getListData();
               }
         },
         getWaiData(){
            this.$reqGet('inspectedTaskPage',{inspectionStatus:1,orderType:'外购'}).then(res=>{
                     if(res.code == 0){
                  if(res.data.records.length){
                     this.orderPlanData  = res.data.records;
                  }else{
                     this.orderPlanData = [];
                  }
                    }
                  })
         },
         //内购
         getNeiData(){
            this.$reqGet('inspectedTaskPage',{inspectionStatus:1,orderType:'内购'}).then(res=>{
                     if(res.code == 0){
                  if(res.data.records.length){
                     this.orderPlanData  = res.data.records;
                  }else{
                     this.orderPlanData = [];
                  }
                    }
                  })
         }
      },  
   }
@@ -237,15 +306,18 @@
   }
    .body{
        position: absolute;
        height: 500rpx;
        top: 38%;
        width: 97%;
        left: 50%;
        margin-left: -47%;
        // box-shadow: 0 2px 18px 0 rgba(0, 0, 0, .2);
        // background: #fff;
        border-radius: 20rpx;
    }
   .bottom{
      height: 200rpx;
   }
    .title{
        position: absolute;
        top: 34%;