王恒
2025-09-04 616e6be49d3f64f2397cb1b1c05d2c06df3db9a3
policy/applyRecord/applyRecord.vue
@@ -1,126 +1,159 @@
<template>
   <view class="page-box">
      <u-sticky bgColor="white">
         <view class="set-search">
            <u-search placeholder="请输入申请记录关键词 " @search="search" @blur="search" shape="square" :showAction="false"></u-search>
         </view>
         <view class="border"></view>
         <u-tabs :list="list1" @click="click" :current="current" :scrollable="false" bgColor="white"></u-tabs>
      </u-sticky>
      <view class="list">
         <view class="list-item" @click="goReport(item.orderId)" v-for="(item,index) in dataList" :key="index">
            <view class="top-title">
               <text>{{item.enforceReason}}</text>
               <text class="status">{{mapStatus[item.orderStatus]}}</text>
            </view>
            <view class="user-info">
               <text>{{item.applyUser}}</text>
               <view class="driver"></view>
               <text>{{item.applyDeptName}}</text>
            </view>
            <view class="set-line">
               <text>执法对象:</text>{{item.companyName}}
            </view>
            <view class="line"></view>
            <view class="set-flex set-start set-flex-content-between">
               <view>
                  <view class="set-line1">
                     <text>执法时间:</text>{{item.planTime}}
                  </view>
                  <view class="set-line1">
                     <text>申请时间:</text>{{item.applyTime}}
                  </view>
               </view>
            </view>
         </view>
          <u-empty v-if="!dataList.length"></u-empty>
      </view>
   </view>
</template>
<script>
   import { orderList } from '@/api/policy.js'
   export default {
      data() {
         return {
            current: 0,
            list1: [{
               name: '全部',
               value: ''
            }, {
               name: '待审批',
               value: 1
            }, {
               name: '待执行',
               value: 2
            }, {
               name: '待上报',
               value: 3
            }, {
               name: '已拒绝',
               value: -1
            }, {
               name: '已结束',
               value: 4
            }],
            queryParams: {
               pageNum: 1,
               pageSize: 10
            },
            total: 1,
            dataList: [],
            mapStatus: {
               1: '待审批',
               2: "待执行",
               3: "待上报",
               '-1':"已拒绝",
               4: "已结束"
            }
         }
      },
      onLoad() {
         this.orderList()
      },
      onReachBottom() {
         if(this.dataList.length == this.total) {
            return
         }
         this.queryParams.pageNum++
         this.orderList()
      },
      methods: {
         goReport(id) {
            uni.navigateTo({
               url: `/policy/applyRecordDetails/applyRecordDetails?id=${id}`
            })
         },
         click(e) {
            this.dataList = []
            this.queryParams.pageNum = 1
            this.current = e.index
            this.orderList()
         },
         orderList() {
            orderList({...this.queryParams, orderStatus: this.list1[this.current].value}).then(val => {
               this.total = val.data.total
               this.dataList = [...this.dataList,...val.data.rows]
            })
         },
         search(e){
            this.dataList = []
            this.queryParams.pageNum =1
            this.queryParams.companyName = e
            this.orderList()
         }
      }
   }
</script>
<style>
   page {
      background-color: #F4F4F4;
   }
</style>
<style lang="scss" scoped>
   @import "./applyRecord.scss";
<template>
  <view class="page-box">
    <u-sticky bgColor="white" :offsetTop="0" style="    position: -webkit-sticky;">
      <view class="set-search">
        <u-search placeholder="请输入申请记录关键词 " @search="search" @blur="search" shape="square"
          :showAction="false"></u-search>
      </view>
      <view class="border"></view>
      <u-tabs :list="list1" @click="click" :current="current" :scrollable="true" bgColor="white"></u-tabs>
    </u-sticky>
    <view class="list">
      <view class="list-item" @click="goReport(item.orderId)" v-for="(item,index) in dataList" :key="index">
        <view class="top-title">
          <text>{{item.enforceReason}}</text>
          <text class="status" v-if="item.checkStatus != -1"
            :class="{status1: item.orderStatus == 1,status2: item.orderStatus == 2,status3: item.orderStatus == 3,status4: item.orderStatus == 4}">{{mapStatus[item.orderStatus]}}</text>
          <text class="status status4" v-else>已拒绝</text>
        </view>
        <view class="user-info">
          <text>{{item.applyUser || ''}}</text>
          <!-- <view class="driver"></view> -->
        </view>
        <view class="user-info">
          <text>{{item.applyDeptName || item.applyDeptNames || ''}}</text>
        </view>
        <view class="set-line">
          <text>执法对象:</text>{{item.companyName}}
        </view>
        <view class="line"></view>
        <view class="set-flex set-start set-flex-content-between">
          <view>
            <view class="set-line1">
              <text>执法时间:</text>{{item.planTime || item.planMonth || ''}}
            </view>
            <view class="set-line1">
              <text>申请时间:</text>{{item.applyTime}}
            </view>
          </view>
        </view>
      </view>
      <u-empty v-if="!dataList.length"></u-empty>
    </view>
  </view>
</template>
<script>
  import {
    orderList
  } from '@/api/policy.js'
  export default {
    data() {
      return {
        current: 0,
        list1: [{
          name: '全部',
          value: {}
        }, {
          name: '待审批',
          value: {
            orderStatus: 1,
            checkStatus: 0
          }
        }, {
          name: '待执行',
          value: {
            orderStatus: 2
          }
        }, {
          name: '待上报',
          value: {
            orderStatus: 3
          }
        }, {
          name: '已拒绝',
          value: {
            checkStatus: -1
          }
        }, {
          name: '已上报',
          value: {
            orderStatus: 4
          }
        }, {
          name: '企业已确认',
          value: {
            orderStatus: 5
          }
        }],
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          isAsc: "desc",
          orderByColumn: "apply_time"
        },
        total: 1,
        dataList: [],
        mapStatus: {
          1: '待审批',
          2: "待执行",
          3: "待上报",
          '-1': "已拒绝",
          4: "已上报",
          5: "企业已确认"
        }
      }
    },
    onLoad() {
      this.orderList()
    },
    onReachBottom() {
      if (this.dataList.length == this.total) {
        return
      }
      this.queryParams.pageNum++
      this.orderList()
    },
    methods: {
      goReport(id) {
        uni.navigateTo({
          url: `/policy/applyRecordDetails/applyRecordDetails?id=${id}`
        })
      },
      click(e) {
        this.dataList = []
        this.queryParams.pageNum = 1
        this.current = e.index
        this.orderList()
      },
      orderList() {
        orderList({
          ...this.queryParams,
          ...this.list1[this.current].value
        }).then(val => {
          this.total = val.data.total
          this.dataList = [...this.dataList, ...val.data.rows]
        })
      },
      search(e) {
        this.dataList = []
        this.queryParams.pageNum = 1
        this.queryParams.companyName = e
        this.orderList()
      }
    }
  }
</script>
<style>
  page {
    background-color: #F4F4F4;
  }
</style>
<style lang="scss" scoped>
  @import "./applyRecord.scss";
  ::v-deep .u-sticky {
    position: -webkit-sticky;
  }
</style>