Houjie
2025-06-03 2fda34643bc22e25f6c569415da5f955c81536bf
pages/checkList/checkList.vue
@@ -131,7 +131,8 @@
            announcement1: [],
            msg1Count: 0,
            msg2Count: 0,
            msg1Title: ""
            msg1Title: "",
            equipmentId: ''
         }
      },
      computed: {
@@ -152,7 +153,11 @@
            this.mescroll.resetUpScroll()
         }
      },
      onLoad: function(options) {
         this.equipmentId = options.equipmentId ?
            decodeURIComponent(options.equipmentId) :
            '';
      },
      created() {
         this.getEquipment()
      },
@@ -164,6 +169,7 @@
                  pageSize: 9999,
                  order: 'desc',
                  column: 'createTime'
               },
            
            }).then(res => {
@@ -240,44 +246,83 @@
         search() {
            this.$refs.popup.open();
         },
         upCallback(page) {
            this.$http.get(this.url.stallList, {
               params: {
            // 确保 equipmentId 始终作为参数传递,值为有效字符串或空字符串
            const params = {
                  pageNo: page.num,
                  pageSize: page.size,
                  order: 'desc',
                  column: 'createTime',
                  inspectionStatus: 'WAIT_INSPECTION'
               },
               inspectionStatus: 'WAIT_INSPECTION',
               equipmentId: this.equipmentId || ''
            };
            }).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); //追加新数据
               }
            }).catch(() => {
               //联网失败, 结束加载
               this.mescroll.endErr();
            this.$http.get(this.url.stallList, {
                  params
            })
               .then(res => {
                  if (!res.data.success) {
                     throw new Error('获取数据失败: ' + res.data.message);
                  }
                  const records = res.data.result.records || [];
                  const total = res.data.result.total || 0;
                  // 更新消息计数和标题
                  this.msg1Count = total;
                  this.msg1Title = `通知(${total})`;
                  // 更新列表数据
                  this.msgList = page.num === 1 ? [...records] : [...this.msgList, ...records];
                  // 结束加载状态
                  this.mescroll.endSuccess(records.length);
                  console.log('请求成功', res.data);
               })
               .catch(error => {
                  console.error('请求失败', error);
                  this.mescroll.endErr();
               });
         },
         // upCallback(page) {
         //    this.$http.get(this.url.stallList, {
         //       params: {
         //          pageNo: page.num,
         //          pageSize: page.size,
         //          order: 'desc',
         //          column: 'createTime',
         //          inspectionStatus: 'WAIT_INSPECTION',
         //          equipmentId:this.equipmentId || ''
         //       },
         //    }).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); //追加新数据
         //       }
         //    }).catch(() => {
         //       //联网失败, 结束加载
         //       this.mescroll.endErr();
         //    })
         // },
         resetTask() {
            this.formData.orderNum = ''
            this.formData.num = ''