Houjie
2025-06-03 2fda34643bc22e25f6c569415da5f955c81536bf
pages/device/device.vue
@@ -1,13 +1,12 @@
<template>
   <view class="container">
      <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask">
         <block slot="backText">返回</block>
      <cu-custom :bgColor="NavBarColor">
         <block slot="content">设备</block>
      </cu-custom>
      <view class="container">
         <uni-search-bar @confirm="search" :focus="true" v-model="searchValue" @blur="blur" @focus="focus"
            @input="input" @cancel="cancel" @clear="clear">
         <uni-search-bar @confirm="search" :focus="true" v-model="searchValue"  placeholder="请通过名称检索"
             @input="input" @cancel="cancel()"  cancelButton="always">
         </uni-search-bar>
         <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback">
            <!-- 列表信息开始 -->
@@ -28,36 +27,11 @@
                     </view>
                  </view>
                  <view class="flex">
                     <view class="flex-sub text-light bg-white padding-xs margin-xs radius">维修状态::</view>
                     <view class="flex-sub text-light bg-white padding-xs margin-xs radius">维修状态:</view>
                     <view class="flex-sub bg-white padding-xs margin-xs   text-orange   radius text-right">
                        {{item.assetStatus_dictText}}
                     </view>
                  </view>
                  <!-- <view class="flex">
                     <view class="flex-sub text-light bg-white padding-xs margin-xs radius">保养状态::</view>
                     <view class="flex-sub bg-white padding-xs margin-xs   text-orange   radius text-right">
                        {{item.maintenanceStatus_dictText}}
                     </view>
                  </view>
                  <view class="flex">
                     <view class="flex-sub text-light bg-white padding-xs margin-xs radius">使用车间:</view>
                     <view class="flex-sub bg-white padding-xs margin-xs     radius text-right">
                        {{item.orgId_dictText}}
                     </view>
                  </view>
                  <view class="flex">
                     <view class="flex-sub text-light bg-white padding-xs margin-xs radius">设备管理员:</view>
                     <view class="flex-sub bg-white padding-xs margin-xs     radius text-right">
                        {{item.equipmentManager_dictText}}
                     </view>
                  </view>
                  <view class="flex">
                     <view class="flex-sub text-light bg-white padding-xs margin-xs radius">设备分类:</view>
                     <view class="flex-sub bg-white padding-xs margin-xs  text-bold    radius text-right">
                        {{item.equipmentCategory_dictText}}
                     </view>
                  </view> -->
               </uni-card>
            </view>
@@ -72,6 +46,7 @@
      mixins: [MescrollMixin], // 使用mixin
      data() {
         return {
            scrollLeft: 0,
            searchValue: '',
            formData: {
@@ -106,12 +81,13 @@
            announcement1: [],
            msg1Count: 0,
            msg2Count: 0,
            msg1Title: ""
            msg1Title: "",
            name: ''
         }
      },
      computed: {
         top() {
            return this.CustomBar * 2 + 160
            return this.CustomBar * 2 + 100
         },
         style() {
            var StatusBar = this.StatusBar;
@@ -134,15 +110,20 @@
      },
      created() {},
      methods: {
         cancel() {
            this.mescroll.resetUpScroll()
         },
         search(res) {
            console.log(res)
            this.getSera(res)
            this.name = res
            this.getSera()
         },
         /**
          * @param {Object} item
          * 详情页面
          */
         onClickProductionTask(item) {
            uni.navigateTo({
               url: '/pages/device/deviceDeils/deviceDeils?item=' + encodeURIComponent(JSON.stringify(item))
@@ -187,40 +168,40 @@
         /* 检索 */
         getSera(res) {
            this.msgList = [];
            if (keyword == 0) {
               this.$http.get(this.url.stallList, {
                  params: {
                     pageNo: 1,
                     pageSize: 999,
                     order: "desc",
                     column: "createTime",
                     equipmentCode: res
                  }
               }).then(res => {
                  //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
                  this.announcement1 = res.data.result.records
                  this.mescroll.endSuccess(this.announcement1.length);
                  console.log("url", res)
                  //设置列表数据
                  if (res.data.success) {
                     console.log("res", res.data)
                     this.msg1Count = res.data.result.total
                     this.msg1Title = "通知(" + res.data.result.total + ")";
                     for (let annItem of this.announcement1) {
                        this.msgList.push(annItem)
                     }
                  }
                  if (page.num == 1) {
                     this.msgList = []; //如果是第一页需手动制空列表
                     this.msgList = this.msgList.concat(this.announcement1); //追加新数据
                  }
            this.$http.get(this.url.stallList, {
               params: {
                  pageNo: 1,
                  pageSize: 999,
                  order: "desc",
                  column: "createTime",
                  equipmentCode: this.name.value
               }
            }).then(res => {
               //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
               }).catch(() => {
                  //联网失败, 结束加载
                  this.mescroll.endErr();
               })
            }
               this.announcement1 = res.data.result.records
               this.mescroll.endSuccess(this.announcement1.length);
               console.log("url", res)
               //设置列表数据
               if (res.data.success) {
                  console.log("res", res.data)
                  this.msg1Count = res.data.result.total
                  this.msg1Title = "通知(" + res.data.result.total + ")";
                  for (let annItem of this.announcement1) {
                     this.msgList.push(annItem)
                  }
               }
               if (page.num == 1) {
                  this.msgList = []; //如果是第一页需手动制空列表
                  this.msgList = this.msgList.concat(this.announcement1); //追加新数据
               }
            }).catch(() => {
               //联网失败, 结束加载
               this.mescroll.endErr();
            })
         },
         mescrollInit(mescroll) {