Houjie
2025-06-03 2fda34643bc22e25f6c569415da5f955c81536bf
pages/checkList/checkList.vue
@@ -95,7 +95,7 @@
      mixins: [MescrollMixin], // 使用mixin
      data() {
         return {
            equipmentList:[],
            equipmentList: [],
            type: 'top',
            scrollLeft: 0,
            formData: {
@@ -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,8 +169,9 @@
                  pageSize: 9999,
                  order: 'desc',
                  column: 'createTime'
               },
            }).then(res => {
               //设置列表数据
               if (res.data.success) {
@@ -176,7 +182,7 @@
                     title: res.data.message,
                     duration: 2000
                  });
               }
            }).catch(() => {
               this.$tip.error("联网失败")
@@ -240,19 +246,108 @@
         search() {
            this.$refs.popup.open();
         },
         upCallback(page) {
            // 确保 equipmentId 始终作为参数传递,值为有效字符串或空字符串
            const params = {
               pageNo: page.num,
               pageSize: page.size,
               order: 'desc',
               column: 'createTime',
               inspectionStatus: 'WAIT_INSPECTION',
               equipmentId: this.equipmentId || ''
            };
            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 = ''
            this.$refs.popup.close();
            this.mescroll.resetUpScroll()
         },
         /* 检索 */
         getSera() {
            this.$refs.popup.close();
            this.msgList = [];
            this.$http.get(this.url.stallList, {
               params: {
                  pageNo: page.num,
                  pageSize: page.size,
                  order: 'desc',
                  column: 'createTime',
                  inspectionStatus: 'WAIT_INSPECTION'
               },
                  pageNo: 1,
                  pageSize: 999,
                  order: "desc",
                  column: "createTime",
                  inspectionStatus: 'WAIT_INSPECTION',
                  equipmentId: this.formData.num,
                  orderNum: this.formData.orderNum
               }
            }).then(res => {
               //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
               this.announcement1 = res.data.result.records
               this.mescroll.endSuccess(this.announcement1.length);
               console.log("url", res)
@@ -274,56 +369,6 @@
               //联网失败, 结束加载
               this.mescroll.endErr();
            })
         },
         resetTask() {
            this.formData.orderNum = ''
            this.formData.num = ''
            this.$refs.popup.close();
            this.mescroll.resetUpScroll()
         },
         /* 检索 */
         getSera() {
            this.$refs.popup.close();
            this.msgList = [];
               this.$http.get(this.url.stallList, {
                  params: {
                     pageNo: 1,
                     pageSize: 999,
                     order: "desc",
                     column: "createTime",
                     inspectionStatus: 'WAIT_INSPECTION',
                     equipmentId: this.formData.num,
                     orderNum: this.formData.orderNum
                  }
               }).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();
               })
         },