Houjie
2025-04-25 1d18ff904468e4a864312bdcf6d7c6a7c0477721
pages/ToDoList/ToDoList.vue
@@ -35,7 +35,7 @@
      </view>
      <view class="container">
         <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback">
            <!-- 列表信息开始 -->
            <view class="content">
@@ -47,12 +47,7 @@
                        {{item.flowName}}
                     </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.title}}
                     </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-blue   radius text-right">
@@ -61,17 +56,23 @@
                  </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-blue   radius text-right">
                     <view class="flex-sub bg-white padding-xs margin-xs   text-yellow   radius text-right">
                        {{item.preNode}}
                     </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">
                     <view class="flex-sub bg-white padding-xs margin-xs   text-olive  radius text-right">
                        {{item.name}}
                     </view>
                  </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.title}}
                     </view>
                  </view>
               </uni-card>
            </view>
@@ -87,7 +88,7 @@
      data() {
         return {
            type: 'top',
            scrollLeft:0,
            scrollLeft: 0,
            formData: {
               num: '',
               partNumNameModel: ''
@@ -95,7 +96,7 @@
            NavBarColor: this.NavBarColor,
            activeColor: '#5277A6',
            url: {
               stallList: "/assign/flow/toTaskBySelf"
            },
@@ -126,7 +127,7 @@
      },
      computed: {
         top() {
            return this.CustomBar * 2 + 130
            return this.CustomBar * 2 + 50
         },
         style() {
            var StatusBar = this.StatusBar;
@@ -145,58 +146,176 @@
      created() {},
      methods: {
         /**
          * @param {Object} item
          * 详情页面
          */
         onClickProductionTask(item) {
         uni.navigateTo({
            url: '/pages/ToDoList/ToDoListDeils/ToDoListDeils?item=' +
               encodeURIComponent(JSON.stringify(item))
           const name = item.name;
           const type = item.category_dictText;
           let url = '';
         
         })
           switch (true) {
             case (name === '是否需要领用备件' && type === '设备维修'):
               url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts';
               break;
             case (name === '点检执行' && type === '设备点检'):
               url = '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils';
               break;
             case (name === '周保执行' && type === '设备周保'):
               url = '/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou';
               break;
             case (name === '班组长确认' && type === '设备点检'):
               url = '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure';
               break;
             case (name === '班组长确认' && type === '设备周保'):
               url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure';
               break;
             case (name === '设管员初验' && type === '设备周保'):
               url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure';
               break;
             case (name === '设能部终验' && type === '设备周保'):
               url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure';
               break;
             case (name === '管理员领用备件' && type === '设备维修'):
               url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts';
               break;
             case (name === '操作工确认' && type === '设备维修'):
               url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts';
               break;
             case (name === '维修执行' && type === '设备维修'):
               url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts';
               break;
             case (name === '点检工单' && type === '设备点检'):
               url = '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils';
               break;
             default:
               console.warn(`No URL found for name: ${name} and type: ${type}`);
               return;
           }
           if (url) {
             uni.navigateTo({
               url: `${url}?item=${encodeURIComponent(JSON.stringify(item))}`
             });
           }
         },
         
         // onClickProductionTask(item) {
         //    const name = item.name
         //    const  type=item.category_dictText
         //    if (name == '是否需要领用备件' && type=='设备维修') {
         //       uni.navigateTo({
         //          url: '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts?item=' +
         //             encodeURIComponent(JSON.stringify(item))
         //       })
         //    } else if (name == '点检执行' && type=='设备点检') {
         //       uni.navigateTo({
         //          url: '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils?item=' +
         //             encodeURIComponent(JSON.stringify(item))
         //       })
         //    } else if (name == '周保执行' && type=='设备周保') {
         //       uni.navigateTo({
         //          url: '/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou?item=' +
         //             encodeURIComponent(JSON.stringify(item))
         //       })
         //    }else if (name == '班组长确认' && type=='设备点检') {
         //       uni.navigateTo({
         //          url: '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure?item=' +
         //             encodeURIComponent(JSON.stringify(item))
         //       })
         //    }else if (name == '班组长确认' && type=='设备周保') {
         //       uni.navigateTo({
         //          url: '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure?item=' +
         //             encodeURIComponent(JSON.stringify(item))
         //       })
         //    }else if (name == '设管员初验' && type=='设备周保') {
         //       uni.navigateTo({
         //          url: '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure?item=' +
         //             encodeURIComponent(JSON.stringify(item))
         //       })
         //    }else if (name == '设能部终验' && type=='设备周保') {
         //       uni.navigateTo({
         //          url: '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure?item=' +
         //             encodeURIComponent(JSON.stringify(item))
         //       })
         //    }else if (name == '管理员领用备件' && type=='设备维修') {
         //       uni.navigateTo({
         //          url: '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts?item=' +
         //             encodeURIComponent(JSON.stringify(item))
         //       })
         //    }else if (name == '操作工确认' && type=='设备维修') {
         //       uni.navigateTo({
         //          url: '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts?item=' +
         //             encodeURIComponent(JSON.stringify(item))
         //       })
         //    }else if (name == '维修执行' && type=='设备维修') {
         //       uni.navigateTo({
         //          url: '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts?item=' +
         //             encodeURIComponent(JSON.stringify(item))
         //       })
         //    }else if (name == '点检工单' && type=='设备点检') {
         //       uni.navigateTo({
         //          url: '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils?item=' +
         //             encodeURIComponent(JSON.stringify(item))
         //       })
         //    }
         // },
         search() {
            this.$refs.popup.open();
         },
         upCallback(page) {
               this.$http.get(this.url.stallList, {
                  params: {
                     pageNo: page.num,
                     pageSize: page.size,
                     order: 'asc',
                     column: 'createTime'
                  },
            this.$http.get(this.url.stallList, {
               params: {
                  pageNo: page.num,
                  pageSize: page.size,
                  order: 'asc',
                  column: 'createTime'
               },
               }).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)
                     }
            }).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); //追加新数据
                  }
               }
               if (page.num == 1) {
                  this.msgList = []; //如果是第一页需手动制空列表
                  this.msgList = this.msgList.concat(this.announcement1); //追加新数据
               }
               }).catch(() => {
                  //联网失败, 结束加载
                  this.mescroll.endErr();
               })
            }).catch(() => {
               //联网失败, 结束加载
               this.mescroll.endErr();
            })
         },
@@ -342,7 +461,6 @@
</script>
<style>
   .is-hover {
      color: rgba(255, 255, 255, 0.6);
      background-color: #55aaff;
@@ -350,7 +468,7 @@
   }
   .content {
      margin-top: 5px;
   }