renkang
2024-11-30 be52942b0100d9b8f4323a22175786683e82b3bd
h5/pages/workOrder/list.vue
@@ -3,7 +3,8 @@
      <view class="head_wrap">
         <view class="search_wrap">
            <image class="mr12 search" src="@/static/home/ic_search@2x.png" mode="widthFix"></image>
            <input v-model="param.keyword" @confirm="getList()" type="text" placeholder="搜索楼宇/房间名称" placeholder-class="placeholder9" />
            <input v-model="param.roomName" @confirm="handleQuery" type="text" placeholder="搜索楼宇/房间名称"
               placeholder-class="placeholder9" />
         </view>
      </view>
      <!--  -->
@@ -28,11 +29,11 @@
      <!--  -->
      <view class="list">
         <view class="item" v-for="item in list" @click="itemClick(item)">
            <image v-if="item.stats == 1" src="@/static/side/workordered.png" class="icon"></image>
            <image v-if="item.dealStatus == 0" src="@/static/side/workordered.png" class="icon"></image>
            <image v-else src="@/static/side/workorder.png" class="icon"></image>
            <view class="content">
               <view class="name_wrap line">
                  <view class="name">{{item.buildingName}}/{{item.roomNum}}</view>
                  <view class="name">{{item.buildingName}}/{{item.roomNum || item.floorName}}</view>
                  <view class="status gray" v-if="item.dealStatus == 2">已处理</view>
                  <view class="status" v-if="item.dealStatus == 0">待处理</view>
                  <view class="status" v-if="item.dealStatus == 1">待处理</view>
@@ -49,7 +50,9 @@
</template>
<script>
   import { ywWorkorder } from '@/api'
   import {
      ywWorkorder
   } from '@/api'
   export default {
      data() {
         return {
@@ -66,7 +69,13 @@
         this.getList()
      },
      onReachBottom() {
         const {total,list} = this
         if (list.length < total) {
            this.page = this.page + 1
            this.getList()
         } else {
            this.showToast('暂无更多数据')
         }
      },
      methods: {
         tabsClick(val) {
@@ -77,20 +86,39 @@
         },
         allClick() {
            this.selectAll = !this.selectAll
            this.list = []
            this.page = 1
            this.getList()
         },
         itemClick(item) {
            uni.navigateTo({
               url: `/pages/workOrder/detail?id=${item.id}`
            })
         },
         handleQuery() {
            this.list = []
            this.page = 1
            this.getList()
         },
         getList() {
            const { page, total, list, activeTab } = this
            const {
               page,
               total,
               list,
               activeTab,
               param,
               selectAll
            } = this
            ywWorkorder({
               page,
               capacity: 10,
               model: {  }
               model: {
                  ...param,
                  dispatchUserId: selectAll ? '' : uni.getStorageSync('userInfo').id,
               }
            }).then(res => {
               this.list = res.data.records || []
               this.list = [...this.list, ...res.data.records]
               this.total = res.data.total
            })
         }
      }
@@ -101,11 +129,13 @@
   .main_app{
      padding: 0 30rpx;
   }
   .tabs{
      display: flex;
      width: 750rpx;
      margin: 12rpx -30rpx 0;
      border-bottom: 1rpx solid #E5E5E5;
      .tab{
         font-size: 30rpx;
         color: #666666;
@@ -115,15 +145,18 @@
         align-items: center;
         justify-content: flex-end;
         height: 88rpx;
         .name{
            display: flex;
            align-items: center;
         }
         .icon{
            width: 28rpx;
            height: 28rpx;
            margin-right: 10rpx;
         }
         .border{
            width: 54rpx;
            height: 6rpx;
@@ -132,10 +165,12 @@
            margin-top: 24rpx;
         }
      }
      .active{
         font-weight: 600;
         font-size: 32rpx;
         color: #222222;
         .border{
            background-color: $primaryColor;
         }
@@ -143,6 +178,7 @@
      }
      
   }
   .head_wrap {
      display: flex;
      align-items: center;
@@ -155,9 +191,11 @@
         background: #F7F7F7;
         border-radius: 38rpx;
         padding-left: 30rpx;
         input{
            flex: 1;
         }
         .search {
            width: 28rpx;
            height: 28rpx;
@@ -172,6 +210,7 @@
         // height: 290rpx;
         padding: 30rpx 0;
         border-bottom: 2rpx solid #E5E5E5;
         .icon {
            width: 80rpx;
            height: 80rpx;
@@ -184,16 +223,20 @@
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            .line{
               margin-bottom: 20rpx;
               &:nth-last-child(1){
                  margin-bottom: 0;
               }
            }
            .name_wrap{
               display: flex;
               justify-content: space-between;
               align-items: center;
               .name{
                  display: flex;
                  align-items: flex-end;
@@ -201,9 +244,11 @@
                  font-size: 34rpx;
                  color: #222222;
               }
               .status{
                  color: $primaryColor;
               }
               .gray{
                  color: #999999;
               }