Houjie
2025-05-15 1833dd6d7cac01c35840af52fadc1199821e5805
pages/ToDoList/ToDoList.vue
@@ -3,6 +3,11 @@
      <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask">
         <block slot="backText">返回</block>
         <block slot="content">待办</block>
         <block slot="right">
            <view @click="search">
               <image class="search" src="/static/icon/sear.png" style="width: 25px; height: 25px;" alt="" />
            </view>
         </block>
      </cu-custom>
      <view style="width: 100%;">
@@ -11,11 +16,14 @@
               <!-- 基础表单校验 -->
               <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext">
                  <uni-group title="" top="0">
                     <uni-forms-item name="numbers" label="领料申请单号:">
                        <uni-easyinput type="text" v-model="formData.num" placeholder="请输入领料申请单号检索" />
                     <uni-forms-item name="num" :labelWidth="80" label="流程分类:">
                        <uni-data-select v-model="formData.type" :localdata="typeList" @change="changetypeList"
                           placeholder="请选择流程" />
                     </uni-forms-item>
                     <uni-forms-item name="name" label="领料产品:">
                        <uni-easyinput v-model="formData.partNumNameModel" placeholder="请输入领料产品" />
                     <uni-forms-item name="name" :labelWidth="80" label="设备编号:">
                        <uni-easyinput v-model="formData.num" placeholder="请输入设备编号" />
                     </uni-forms-item>
                  </uni-group>
               </uni-forms>
@@ -91,12 +99,12 @@
            scrollLeft: 0,
            formData: {
               num: '',
               partNumNameModel: ''
               type: ''
            },
            NavBarColor: this.NavBarColor,
            activeColor: '#5277A6',
            url: {
               flowType: "/sys/dict/getDictItems/flow_type",
               stallList: "/assign/flow/toTaskBySelf"
            },
@@ -118,6 +126,7 @@
               color: '#2979FF',
               borderColor: '#2979FF'
            },
            typeList: [],
            msgList: [], //列表数据
            announcement1: [],
            msg1Count: 0,
@@ -144,9 +153,28 @@
         }
      },
      created() {},
      created() {
         this.getTypeList()
      },
      methods: {
         /**
          * 流程分类列表事件
          */
         getTypeList() {
            this.$http.get(this.url.flowType).then(res => {
               //设置列表数据
               if (res.data.success) {
                  console.log(res)
                  this.typeList = res.data.result
               }
            }).catch(() => {
               //联网失败, 结束加载
            })
         },
         changetypeList(e) {
            this.formData.type = e;
         },
         /**
          * @param {Object} item
          * 详情页面
@@ -196,100 +224,23 @@
           }
         
           if (url) {
             uni.navigateTo({
               uni.redirectTo({
               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',
                  order: 'desc',
                  column: 'createTime'
               },
@@ -321,7 +272,7 @@
         resetTask() {
            this.formData.num = ''
            this.formData.partNumNameModel = ''
            this.formData.type = ''
            this.$refs.popup.close();
            this.mescroll.resetUpScroll()
@@ -329,19 +280,16 @@
         /* 检索 */
         getSera() {
            this.$refs.popup.close();
            let keyword = this.TabCur
            this.msgList = [];
            if (keyword == 0) {
               this.$http.get(this.url.stallList, {
                  params: {
                     pageNo: 1,
                     pageSize: 999,
                  pageSize: 9999,
                     order: "desc",
                     column: "createTime",
                     num: '*' + this.formData.num + '*',
                     partNumNameModel: '*' + this.formData.partNumNameModel + '*',
                     status: 'published'
                  title: this.formData.num,
                  category: this.formData.type
                  }
               }).then(res => {
                  //联网成功的回调,隐藏下拉刷新和上拉加载的状态;
@@ -367,87 +315,6 @@
                  //联网失败, 结束加载
                  this.mescroll.endErr();
               })
            } else if (keyword == 1) {
               this.$http.get(this.url.stallList, {
                  params: {
                     pageNo: 1,
                     pageSize: 999,
                     order: "desc",
                     column: "createTime",
                     status: 'training',
                     num: '*' + this.formData.num + '*',
                     partNumNameModel: '*' + this.formData.partNumNameModel + '*'
                  }
               }).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.msg2Title = "通知(" + 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();
               })
            } else if (keyword == 2) {
               this.$http.get(this.url.stallList, {
                  params: {
                     pageNo: 1,
                     pageSize: 999,
                     order: "desc",
                     column: "createTime",
                     status: 'completed',
                     num: '*' + this.formData.num + '*',
                     partNumNameModel: '*' + this.formData.partNumNameModel + '*'
                  }
               }).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.msg3Count = 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();
               })
            }
         },