jiangping
2025-06-06 a2299a6d4a6f99e9c11132138f5d3e9ec68f03ea
h5/pages/polling/task.vue
@@ -44,13 +44,17 @@
                  <view class="line" @click="itemClick(item)">执行时间:{{ item.startDate.slice(11, 16) }} 至 {{ item.endDate.slice(11, 16) }}</view>
                  <view class="line">
                     <view @click="itemClick(item)">完成情况:{{item.finishNum || 0}}/{{item.patrolNum}}</view>
                     <view v-if="param.queryStatus == '0,1'" class="btn" @click="openSc(item)">
                     <view v-if="param.queryStatus == '0,1' && item.flag && (item.status == 0 || item.status == 1 || item.status == 2)" class="btn" @click="openSc(item)">
                        <image src="@/static/side/ic_saoma@2x.png" class="saoma" mode=""></image>
                        <view>扫码巡检</view>
                     </view>
                  </view>
               </view>
            </view>
            <view v-if="list.length == 0" class="empty_wrap">
               <image src="@/static/empty.png" mode=""></image>
               <view class="">暂无数据</view>
            </view>
         </view>
      </scroll-view>
@@ -93,7 +97,9 @@
            // activeItem: {}
         };
      },
      onLoad() {
      onShow() {
         this.page = 1
         this.list = []
         this.getList()
      },
      methods: {
@@ -111,10 +117,12 @@
                     },
                     (decodeText, decodeResult) => {
                        if (decodeText) { //这里decodeText就是通过扫描二维码得到的内容
                           const index = decodeText.indexOf('ywid')
                           let pointCode = decodeText.slice(index + 5)
                           this.stopScan(); //关闭扫码功能
                           getPointRecordByCode({
                              taskId: item.id,
                              pointCode: decodeText
                              pointCode
                           }).then(ress=> {
                              if(ress.data){
                                 uni.navigateTo({
@@ -184,7 +192,12 @@
               page,
               capacity: 10
            }).then(res => {
               this.list = [...this.list, ...res.data.records]
               this.list = [...this.list, ...res.data.records]
               this.list.forEach(item => {
               let time = new Date(item.startDate).getTime()
               let userInfo = uni.getStorageSync('userInfo') || {}
               item.flag = new Date().getTime() > time && item.userIds.indexOf(userInfo.id) > -1
               })
               this.total = res.data.total
            })
         }
@@ -272,10 +285,11 @@
   }
   .scroll_Y {
      height: calc(100vh - 230rpx);
      height: calc(100vh - 130rpx);
   }
   .list {
   .list {
      .item {
         display: flex;
         // height: 290rpx;