Lou
2024-01-03 a89e8fb29a2a9d3cbaa532ed1ca3ecfac190151d
subPackage/workbench/views/csjl.vue
@@ -1,15 +1,21 @@
<template>
   <view class="container">
      <u-sticky  v-if="from == 'home'">
      <u-sticky v-if="from == 'home'">
         <view class="tabsAndSearch">
            <view class="tabs">
               <u-tabs :list="tabsList" @click="tabClick"  :inactiveStyle="{color:'#999999'}"
            :activeStyle="{color:'#017BFC'}" :scrollable="false"></u-tabs>
               <u-tabs :list="tabsList" @click="tabClick" :inactiveStyle="{color:'#999999'}"
                  :activeStyle="{color:'#017BFC'}" :scrollable="false"></u-tabs>
            </view>
            <view class="search">
            <view class="search flex j-c-s-b a-i-c f-28">
               <view class="filter-box flex a-i-c" @click="isShowPopup = true">
                  <text class="f-28 " style="margin-right:5rpx;">筛选</text>
                  <u-icon name="arrow-down"></u-icon>
               </view>
               <u-search placeholder="请输入场所名称" v-model="iptContext" :clearabled="true" :showAction="true"
                  :animation="true" @change="keyWordChange" @search="searchConfirm"
                  @clear="clearConfirm"   @custom="searchConfirm"></u-search>
                  :animation="true" @change="keyWordChange" @search="searchConfirm" @clear="clearConfirm"
                  @custom="searchConfirm"></u-search>
            </view>
         </view>
      </u-sticky>
@@ -34,6 +40,25 @@
      </view>
      <u-toast ref="uToast"></u-toast>
      <u-loadmore :status="status" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="没有更多了" line />
      <u-popup :show="isShowPopup" @close="closePopup()" mode="top" :safeAreaInsetTop="true">
         <view class="popup">
            <view class="popup-title f-30">
               是否有二维码
            </view>
            <view class="popup-select flex">
               <block v-for="(i,k) in filterList" :key="k">
                  <view :class="['popup-cell',tempFilterIndex == k?'bgc-main c-ff':'cell-before c-main']"
                     @click="selectItem(i,k)">
                     {{i.name}}
                  </view>
               </block>
            </view>
            <view class="popup-btn flex j-c-s-b a-i-c">
               <button class="popup-btn-item f-30 c-main" @click="restSelect()">重置</button>
               <button class="popup-btn-item bgc-main c-ff f-30" @click="comfirmSelect()">确定</button>
            </view>
         </view>
      </u-popup>
   </view>
</template>
@@ -66,25 +91,43 @@
            tabsType: 0,
            status: 'nomore',
            currentRole: {},
            from:"home"   ,//页面跳入来源
            houseCode:""
            from: "home", //页面跳入来源
            houseCode: "",
            isShowPopup: false,
            filterList: [{
                  name: "全部",
                  type: ""
               },
               {
                  name: "有",
                  type: 1
               },
               {
                  name: "无",
                  type: 2
               },
            ],
            filterIndex: 0,
            selectType: "",
            tempFilterIndex: 0
         }
      },
      onLoad(option){
         if(option.from){
      onLoad(option) {
         if (option.from) {
            this.from = option.from;
            // this.iptContext = option.name;
            // this.getrRecordList(option.name);
         }
         if(option.stdId){
         if (option.stdId) {
            this.houseCode = option.stdId
         }
      },
      onShow() {
         this.recordsData = []
         this.currentRole = uni.getStorageSync('activeRole')
         this.getrRecordList()
      },
      onReachBottom() {
@@ -114,7 +157,7 @@
               isPerfect,
               roleName,
               ...this.pagingParams,
               houseCode:this.houseCode
               houseCode: this.houseCode
            })
            if (code !== 200) {
               this.$u.func.showToast({
@@ -164,7 +207,45 @@
            }
            let url = "/subPackage/workbench/views/cscj?id=" + id + "&type=1"
            this.$u.func.globalNavigator(url)
         },
         selectItem(item, index) {
            this.tempFilterIndex = index;
            this.selectType = item.type;
         },
         comfirmSelect() {
            this.filterIndex = this.tempFilterIndex;
            this.pagingParams = {
               current: 1,
               size: 10,
               source: this.selectType
            }
            this.recordsData = []
            this.getrRecordList(this.iptContext, this.tabsType)
            this.isShowPopup = false;
         },
         restSelect() {
            this.filterIndex = 0;
            this.tempFilterIndex = 0;
            this.pagingParams = {
               current: 1,
               size: 10,
               source: ""
            }
            this.recordsData = []
            this.getrRecordList(this.iptContext, this.tabsType)
            this.isShowPopup = false;
         },
         closePopup() {
            this.selectType = this.pagingParams.source || "";
            this.tempFilterIndex = this.filterIndex;
            this.isShowPopup = false;
         }
      }
   }
</script>
@@ -180,7 +261,12 @@
      .tabs {}
      .search {
         padding: 20rpx 70rpx;
         padding: 20rpx 50rpx;
         .filter-box {
            padding: 0 20rpx;
            margin-right: 20rpx;
         }
         .search-ipt {
            border: 0;
@@ -202,14 +288,14 @@
         margin-bottom: 20rpx;
         .title {
            padding:20rpx 0;
            padding: 20rpx 0;
            font-size: 35rpx;
            border-bottom: 1rpx solid #f6f6f6;
            text {
               &:nth-child(1) {
                  font-weight: 700;
                  width:50%;
                  width: 50%;
               }
               &:nth-child(2) {
@@ -234,4 +320,45 @@
         }
      }
   }
   .popup-title {
      padding: 20rpx 30rpx;
   }
   .popup-select {
      padding: 20rpx 30rpx;
   }
   .popup-cell {
      padding: 6rpx 30rpx;
      margin-right: 30rpx;
      font-size: 28rpx;
      border-radius: 6rpx;
   }
   .cell-before {
      border: 1px solid currentColor;
   }
   .popup-btn {
      padding: 30rpx;
      .popup-btn-item {
         width: 310rpx;
         height: 78rpx;
         line-height: 78rpx;
         border-radius: 10rpx;
         border: none;
         margin: 0;
      }
      .popup-btn-item:first-child {
         border: 1px solid currentColor;
         background-color: rgb(236, 244, 255);
      }
      .popup-btn-item::after {
         border: none;
      }
   }
</style>