Lou
2024-01-28 d46a4b1d0f71b5e60a38da891bb7fe2064633cf7
subPackage/workbench/views/auditList.vue
@@ -3,9 +3,9 @@
      <u-sticky>
         <view class="bgc-ff">
            <view class="tab">
               <!-- <u-tabs :list="tabList" :current="tabIndex" @click="changeTab" :inactiveStyle="{color:'#999999'}"
                  :activeStyle="{color:'#017BFC'}">
               </u-tabs> -->
               <u-tabs :list="tabList" :current="tabIndex" @click="changeTab" :scrollable="false"
                  :inactiveStyle="{color:'#999999'}" :activeStyle="{color:'#017BFC'}">
               </u-tabs>
               <view class="search flex j-c-s-b a-i-c">
                  <view class="tab-filter flex j-c-c a-i-c" @click="showDateModal">
                     <text class="f-28">时间筛选</text>
@@ -20,9 +20,10 @@
      <view class="list">
         <view class="list-item bgc-ff mb-20" v-for="(i,k) in list" :key="k"
            @click="navTo(i.id,i.reportType,i.status)">
            <view class="item-title flex a-i-c j-c-s-b mb-20">
               <text class="f-32 fw">{{i.name}}</text>
            @click="navTo(i.id,i.reportType,i.status,i.type)">
            <view class="item-title flex a-i-c j-c-s-b mb-20" v-if="tabIndex == 0">
               <text class="f-32 fw" v-if="i.type == 7">消防检查</text>
               <text class="f-32 fw" v-else>{{i.name}}</text>
               <u-tag v-if="i.status == 4" text="待接收" type="warning" plain plainFill></u-tag>
               <u-tag v-if="i.status == 1" text="待审批" type="warning" plain plainFill></u-tag>
               <u-tag v-if="i.status == 2" text="审核通过" type="success" plain plainFill></u-tag>
@@ -32,9 +33,13 @@
               <text class="f-28">时间</text>
               <text class="f-28 c-66">{{i.createTime}}</text>
            </view>
            <view class="item-row flex a-i-c j-c-s-b">
            <view class="item-row flex a-i-c j-c-s-b" v-if="ftabIndex == 0">
               <text class="f-28">地址</text>
               <text class="address f-28 c-66">{{i.addressName || ""}}</text>
            </view>
            <view class="item-row flex a-i-c j-c-s-b" v-if="tabIndex == 1">
               <text class="f-28">整改内容</text>
               <text class="address f-28 c-66">{{i.remark}}</text>
            </view>
         </view>
      </view>
@@ -49,6 +54,11 @@
   import {
      getAuditReportingList
   } from "@/api/reporting/reporting"
   import {
      getPlaceCheckList
   } from "@/api/place/place.js"
   import dateRangeModal from '@/components/dateRangeModal/modal.vue';
   export default {
      components: {
@@ -56,28 +66,12 @@
      },
      data() {
         return {
            tabList: [
               {
                  name: "全部",
                  status: "",
            tabList: [{
                  name: "标签报事"
               },
               {
                  name: "待接收",
                  status: 4,
                  name: "场所检查"
               },
               {
                  name: "待审核",
                  status: 1
               },
               {
                  name: "审核通过",
                  status: 2
               },
               {
                  name: "已拒绝",
                  status: 3
               }
            ],
            tabIndex: 0,
            currentStatus: 2,
@@ -94,17 +88,20 @@
      onLoad(option) {
         console.log(option);
         if (option.reportType) {
            this.reportType = option.reportType;
            uni.setNavigationBarTitle({
               title: "取保候审"
            })
         }
         if (option.from == "index") {
            uni.setNavigationBarTitle({
               title: "场所任务"
            })
         }
         uni.setNavigationBarTitle({
            title: "历史事件"
         })
         // if (option.reportType) {
         //    this.reportType = option.reportType;
         //    uni.setNavigationBarTitle({
         //       title: "取保候审"
         //    })
         // }
         // if (option.from == "index") {
         //    uni.setNavigationBarTitle({
         //       title: "场所任务"
         //    })
         // }
         if (option.from == "task") {
            this.tabIndex = 1;
            this.currentStatus = 1;
@@ -116,12 +113,15 @@
      },
      onReachBottom() {
         this.currentPage++
         this.getList()
         if (this.tabIndex == 0) {
            this.getList()
         } else {
            this.getCheckList();
         }
      },
      methods: {
         searchConfirm() {
            this.resetParams()
            this.getList()
@@ -134,7 +134,11 @@
            this.tabIndex = e.index;
            this.currentStatus = e.status;
            this.resetParams();
            this.getList();
            if (e.index == 0) {
               this.getList()
            } else {
               this.getCheckList();
            }
         },
         resetParams() {
            this.list = [];
@@ -186,38 +190,85 @@
               this.loadingStatus = 'nomore'
            })
         },
         navTo(id, type, status) {
            if (status == 4) {
               if (uni.getStorageSync("activeRole").roleName == "民警") {
                  this.navToDetail(type, id)
         getCheckList() {
            this.$nextTick(() => {
               this.loadingStatus = 'loadingmore'
               this.$refs.uToast.show({
                  type: 'loading',
                  message: '正在加载',
                  duration: 9999999
               })
            })
            let params = {
               page: this.currentPage,
               size: 20,
            }
            if (this.selectDate.length) {
               params.startTime = this.selectDate[0]
               params.endTime = this.selectDate[1]
            }
            if (this.houseCode) {
               params.houseCode = this.houseCode;
            }
            if (this.keyword) {
               params.name = this.keyword;
            }
            getPlaceCheckList(params).then(res => {
               if (res.code != 200) {
                  uni.showToast({
                     title: '数据请求失败',
                     icon: 'error'
                  })
                  return
               }
               let records = res.data.records;
               this.list = [...this.list, ...records]
               this.$nextTick(() => {
                  this.$refs.uToast.isShow = false
               })
               this.loadingStatus = 'nomore'
            })
         },
         navTo(id, reportType, status, type) {
            if (this.tabIndex == 0) {
               if (status == 4) {
                  if (uni.getStorageSync("activeRole").roleName == "民警") {
                     this.navToDetail(reportType, id, type)
                  } else {
                     this.navToEdit(reportType, id, type);
                  }
               } else {
                  this.navToEdit(type, id);
                  this.navToDetail(reportType, id, type)
               }
            } else {
               this.navToDetail(type, id)
               uni.navigateTo({
                  url: `checkDetail?id=${id}`
               })
            }
         },
         navToEdit(type, id) {
            if (type == 1) {
         navToEdit(reportType, id, type) {
            if (reportType == 1) {
               this.$u.func.globalNavigator(`/subPackage/label/bail?id=${id}`)
            } else if (type == 2) {
            } else if (reportType == 2 || type == 7) {
               this.$u.func.globalNavigator(`/subPackage/label/hotel?id=${id}`)
            } else if (type == 3 || type == 4 || type == 5) {
            } else if (reportType == 3 || reportType == 4 || reportType == 5) {
               this.$u.func.globalNavigator(`/subPackage/label/form?id=${id}`)
            } else if (type == 6) {
            } else if (reportType == 6) {
               this.$u.func.globalNavigator(`/subPackage/label/school?id=${id}`)
            }
         },
         navToDetail(type, id) {
            if (type == 1) {
         navToDetail(reportType, id, type) {
            if (reportType == 1) {
               this.$u.func.globalNavigator(`bailReportDetail?id=${id}`)
            } else if (type == 2) {
            } else if (reportType == 2 || type == 7) {
               this.$u.func.globalNavigator(`hotelReportDetail?id=${id}`)
            } else if (type == 3 || type == 4 || type == 5) {
            } else if (reportType == 3 || reportType == 4 || reportType == 5) {
               this.$u.func.globalNavigator(`labelReportDetail?id=${id}`)
            } else if (type == 6) {
            } else if (reportType == 6) {
               this.$u.func.globalNavigator(`schoolReportDetail?id=${id}`)
            }
         },
@@ -229,14 +280,24 @@
         handleRestDate() {
            this.selectDate = [];
            this.resetParams();
            this.getList()
            if (this.tabIndex == 0) {
               this.getList()
            } else {
               this.getCheckList()
            }
         },
         handleComfirmDate(val) {
            this.selectDate = val;
            this.resetParams();
            this.getList()
            if (this.tabIndex == 0) {
               this.getList()
            } else {
               this.getCheckList()
            }
         }
      }
   }
</script>