Lou
2023-12-27 3a3eacecf7cff294b6567f67bfd6dab7191d9883
subPackage/workbench/views/audit.vue
@@ -2,10 +2,17 @@
   <view>
      <view class="tab">
         <u-tabs :list="tabList" :current="tabIndex" @click="changeTab" :inactiveStyle="{color:'#999999'}"
            :activeStyle="{color:'#017BFC'}"></u-tabs>
            :activeStyle="{color:'#017BFC'}">
            <view class="tab-filter flex j-c-c a-i-c" slot="right" @click="showDateModal">
               <text class="f-28">时间筛选</text>
               <u-icon name="arrow-down"></u-icon>
            </view>
         </u-tabs>
      </view>
      <view class="list">
         <view class="list-item bgc-ff mb-20" v-for="(i,k) in list" :key="k" @click="navTo(i.name,i.id,i.reportType)">
         <view class="list-item bgc-ff mb-20" v-for="(i,k) in list" :key="k"
            @click="navTo(i.name,i.id,i.reportType)">
            <view class="item-title flex a-i-c j-c-s-b mb-20">
               <text class="f-32 fw">{{i.name}}</text>
               <u-tag v-if="i.status == 1" text="待审批" type="warning" plain plainFill></u-tag>
@@ -22,7 +29,10 @@
            </view>
         </view>
      </view>
      <u-toast ref="uToast"></u-toast>
      <u-loadmore :status="loadingStatus" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="没有更多了" line />
      <date-range-modal ref="dateRane" @comfirm="handleComfirmDate" @rest="handleRestDate" />
   </view>
</template>
@@ -30,10 +40,20 @@
   import {
      getAuditReportingList
   } from "@/api/reporting/reporting"
   import dateRangeModal from '@/components/dateRangeModal/modal.vue';
   export default {
      components: {
         dateRangeModal
      },
      data() {
         return {
            tabList: [{
            tabList: [
               {
                  name: "全部",
                  status: "",
               },
               {
                  name: "待审核",
                  status: 1
               },
@@ -47,38 +67,31 @@
               },
            ],
            tabIndex: 0,
            currentStatus: 1,
            currentStatus: "",
            list: [],
            loadingStatus: 'nomore',
            currentPage: 1,
            frequency: '',
            reportType:""
            reportType: "",
            selectDate: [],
         }
      },
      onLoad(option) {
         // if (option.type == 1) {
         //    uni.setNavigationBarTitle({
         //       title: "一次性"
         //    })
         //    this.frequency = 1
         // }
         // if (option.type == 2) {
         //    uni.setNavigationBarTitle({
         //       title: "周期性"
         //    })
         //    this.frequency = 2
         // }
         if(option.reportType){
         console.log(option);
         if (option.reportType) {
            this.reportType = option.reportType;
            uni.setNavigationBarTitle({
               title:"取保候审"
               title: "取保候审"
            })
         }
         if (option.from) {
            this.tabIndex = 1;
            this.currentStatus = 1;
         }
         this.getList()
      },
      onReachBottom() {
         this.currentPage++
@@ -89,22 +102,37 @@
         changeTab(e) {
            this.tabIndex = e.index;
            this.currentStatus = e.status;
            this.list = [];
            this.currentPage = 1;
            this.resetParams();
            this.getList();
         },
         resetParams() {
            this.list = [];
            this.currentPage = 1;
         },
         getList() {
            this.$nextTick(() => {
               this.loadingStatus = 'loadmore'
               this.$refs.uToast.show({
                  type: 'loading',
                  message: '正在加载',
                  duration: 9999999
               })
            })
            let params = {
               page: this.currentPage,
               size: 20,
               status: this.currentStatus,
               frequency: this.frequency,
            }
            if(this.reportType){
            if (this.selectDate.length) {
               params.startTime = this.selectDate[0],
                  params.endTime = this.selectDate[1]
            }
            if (this.reportType) {
               params.reportType = this.reportType
            }
            getAuditReportingList(params).then(res => {
               if (res.code != 200) {
                  uni.showToast({
@@ -115,20 +143,39 @@
               }
               let records = res.data.records;
               this.list = [...this.list, ...records]
               this.$nextTick(() => {
                  this.$refs.uToast.isShow = false
               })
               this.loadingStatus = 'nomore'
            })
         },
         navTo(name,id,type) {
            if(type == 1){
         navTo(name, id, type) {
            if (type == 1) {
               this.$u.func.globalNavigator(`bailReportDetail?id=${id}`)
            }else if (type == 2){
            } else if (type == 2) {
               this.$u.func.globalNavigator(`hotelReportDetail?id=${id}`)
            }else if (type == 3 || type == 4 || type == 5){
            } else if (type == 3 || type == 4 || type == 5) {
               this.$u.func.globalNavigator(`labelReportDetail?id=${id}`)
            }else if(type == 6){
            } else if (type == 6) {
               this.$u.func.globalNavigator(`schoolReportDetail?id=${id}`)
            }
         },
         showDateModal() {
            this.$refs.dateRane.open();
         },
         handleRestDate() {
            this.selectDate = [];
            this.resetParams();
            this.getList()
         },
         handleComfirmDate(val) {
            this.selectDate = val;
            this.resetParams();
            this.getList()
         }
      }
   }
</script>
@@ -156,8 +203,11 @@
   }
   .tab /deep/.u-tabs__wrapper__nav__item {
      flex: 1;
   // .tab /deep/.u-tabs__wrapper__nav__item {
   //    flex: 1;
   // }
   .tab-filter {
      padding: 0 20rpx;
   }
   .list {
@@ -182,4 +232,4 @@
         }
      }
   }
</style>
</style>