zhouwenxuan
2023-08-02 9461caf2a459a7ed1eb16f8f439c02cfbcf1930b
pages/tabBar/responsivity/countyResponsivity.vue
@@ -13,26 +13,39 @@
         </view>
      </view>
      <view class="responseCard">
         <view class='title'>{{title}}</view>
         <table class="table">
           <thead class="head">
             <tr>
               <th></th>
               <th>叫应情况</th>
               <th>县市叫应率</th>
              <th>详情</th>
               <th>处理情况</th>
              <th v-if="unittype == 4">叫应时间</th>
               <th v-else>叫应率</th>
              <th v-if="unittype == 4">反馈</th>
              <th v-else>详情</th>
             </tr>
           </thead>
           <tbody class="tableBody">
             <tr v-for="(item, index) in tableData" :key="index" >
               <td align="center" width="90px">{{ item.unit }}</td>
               <td align="center">{{ item.response }}</td>
               <td align="center">{{ item.responsivity }}</td>
               <td align="center" width="90px">{{ item.receiveUnit }}</td>
              <td align="center">{{ item.response }}</td>
               <td align="center" v-if="unittype == 4" width="85px">{{ item.responseTime }}</td>
               <td align="center" v-else>{{ item.responsivity }}</td>
              <td>
                 <u-button
                  v-if="unittype == 4"
                  size="medium"
                    type="text"
                    style="color: blue"
                    @click="toDetail(item)"
                    >查看
                 </u-button>
               <u-button 
                  size="mini"
                  v-else
                  size="medium"
                  type="text" 
                  style="color: sandybrown"
                  @click="toCity(item)"
                  @click="toNext(item)"
                  >叫应详情
               </u-button>
            </td>
@@ -44,52 +57,81 @@
</template>
<script>
   import { getResponseDetail,getMeasureDetail } from '../../../api/notice.js'
   export default {
      data() {
         return {
            page: 'pages/tabBar/count/count',
            statusBarHeight: '',
            tableData: [
               {
                  unit:'伊犁州',
                  response: '1',
                  responsivity: '88.9%'
               },
               {
                  unit:'伊犁州1',
                  response: '1',
                  responsivity: '88.9%'
               },
               {
                  unit:'伊犁州2',
                  response: '1',
                  responsivity: '88.9%'
               },
               {
                  unit:'伊犁州3',
                  response: '1',
                  responsivity: '88.9%'
               }
            ]
            tableData: [],
            unittype: null,
            title: ''
         }
         
      },
      onLoad() {
         //获取手机状态栏高度
      onLoad(options) {
         let test = options.data && JSON.parse(decodeURIComponent(options.data));
         console.log("data",test)
         this.title = test.title;
         this.tableData = test.appPageResponseByIdRespDTOS;
         this.unittype = test.unittype;
         this.tableData.forEach((item,index) => {
            this.tableData[index].response = item.responseStatus ==1 ? '待叫应' :item.responseStatus == 2 ? '已叫应' :'超时未叫应'
            this.tableData[index].responsivity = item.forwardRate ? item.forwardRate :'--';
            this.tableData[index].responseTime = item.responseTime ? item.responseTime :'--';
         })
         this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
         uni.hideTabBar();
      },
      methods: {
         goBack() {
            console.log("1111")
            uni.switchTab({
                url:'/pages/tabBar/current/current'
            });
         },
         toCity(item) {
            console.log("item",item)
            uni.navigateTo({
              url: `/pages/tabBar/responsivity/cityResponsivity?data=` + encodeURIComponent(JSON.stringify(item))
         toNext(item) {
            if(item.forwardWarnInfoId != null){
               const param = {
                  pageIndex: 1,
                  pageSize: 100,
                  searchParams: {
                     warnInfoId: item.forwardWarnInfoId
                  }
               }
               getResponseDetail(param).then(res => {
                  if(res.code == 100){
                     this.tableData = res.data.appPageResponseByIdRespDTOS;
                     this.unittype = this.tableData[0].unittype;
                     this.tableData.forEach((item,index) => {
                        this.tableData[index].response = item.responseStatus ==1 ? '待叫应' :item.responseStatus == 2 ? '已叫应' :'超时未叫应'
                        this.tableData[index].responsivity = item.forwardRate ? item.forwardRate :'--'
                     })
                  }
               })
            }else {
               // uni.showToast({
               //    icon: 'none',
               //    title: '无转发',
               //    duration: 3000
               // })
            }
         },
         toDetail(item){
            console.log("d",item)
            getMeasureDetail({id: item.id}).then(res => {
               if(res.code == 100){
                  if(res.data.baseMeasures && res.data.baseMeasures.length>0 ){
                     uni.navigateTo({
                       url: `/pages/tabBar/responsivity/showMeasures?data=` + encodeURIComponent(JSON.stringify(res.data))
                     })
                  }else{
                     uni.showToast({
                        icon: 'none',
                        title: '该记录暂无响应措施',
                        duration: 3000
                  })
                  }
               }
            })
         }
      }
@@ -138,7 +180,7 @@
   box-shadow: 0 3px 12px rgba(0,0,0,0.05);
   margin: 12px 12px 20px;
   border-radius: 5px;
   padding: 30px 12px;
   padding: 20px 12px;
}
.table{
   .head{
@@ -158,4 +200,10 @@
      background-color: rgb(233, 239, 248); /* 设置偶数行颜色 */
   }
}
.title{
   text-align: center;
   font-size: 16px;
   font-weight: 600;
   margin-bottom: 20px;
}
</style>