jiangping
2025-06-06 a2299a6d4a6f99e9c11132138f5d3e9ec68f03ea
h5/pages/polling/detail.vue
@@ -42,13 +42,13 @@
               <template v-if="item.status == 1">
                  <view class="line">
                     <view class="la">巡检结果:</view>
                     <view class="val" :class="{ red: item.dealStatus == 1 }">{{ item.dealStatus == 0 ? '正常' : '异常' }}</view>
                     <view class="val" :class="{ red: item.dealStatus == 1 }">{{ item.dealStatus == 0 ? '正常' : item.dealStatus == 1 ? '异常' : '-' }}</view>
                  </view>
                  <view class="line">
                     <view class="la">巡检时间:</view>
                     <view class="val">
                        <text>{{item.dealDate}}</text>
                        <text v-if="item.status == 1" class="detail">查看详情</text>
                        <text @click="detailClick(item)" v-if="item.status == 1" class="detail">查看详情</text>
                     </view>
                  </view>
               </template>
@@ -60,6 +60,7 @@
         <view class="sub_btn">扫码巡检</view>
      </view>
      <!--  -->
      <view class="reader-box" @click="stopScan" v-if="isScaning">
         <view class="reader" id="reader"></view>
      </view>
@@ -82,7 +83,8 @@
            id: '',
            info: {},
            list: [],
            flag: false,
            flag: false,
            userInfo: uni.getStorageSync('userInfo') || {},
            statusM: [{
                  color: '#4593f7',
                  name: '待开始'
@@ -101,7 +103,9 @@
               },
            ],
            html5Qrcode: null,
            isScaning: false,
            isScaning: false,
         };
      },
      onLoad(option) {
@@ -126,10 +130,12 @@
                     },
                     (decodeText, decodeResult) => {
                        if (decodeText) { //这里decodeText就是通过扫描二维码得到的内容
                           this.stopScan(); //关闭扫码功能
                           this.stopScan(); //关闭扫码功能
                           const index = decodeText.indexOf('ywid')
                           let pointCode = decodeText.slice(index + 5)
                           getPointRecordByCode({
                              taskId: this.id,
                              pointCode: decodeText
                              pointCode
                           }).then(ress => {
                              if (ress.data) {
                                 uni.navigateTo({
@@ -155,12 +161,18 @@
            if (this.html5Qrcode) {
               this.html5Qrcode.stop();
            }
         },
         },
         itemClick(item) {
            if (!this.flag) return
            uni.navigateTo({
               url: '/pages/polling/point?id=' + item.id
            })
         },
         detailClick(item) {
            uni.navigateTo({
               url: '/pages/polling/point?id=' + item.id
            })
         },
         getDetail() {
            const {
@@ -169,8 +181,10 @@
            ywPatrolDetail(id).then(res => {
               this.info = res.data
               let time = new Date(res.data.startDate).getTime()
               console.log('res.data.startDate', new Date().getTime());
               this.flag = new Date().getTime() > time && (this.info.status == 0 || this.info.status == 1)
               console.log('res.data.startDate', new Date().getTime());
               if(res.data.userIds.indexOf(this.userInfo.id) > -1){
                  this.flag = new Date().getTime() > time && (this.info.status == 0 || this.info.status == 1 || this.info.status == 2)
               }
            })
            ywPatrolTaskRecord({
               capacity: 999,