yusijie
2026-02-05 4569a6f1ac4e4bf1a0312cd9750c1246dca3ebbe
pages/index/mine.vue
@@ -26,22 +26,27 @@
</template>
<script>
   import { getUserInfo } from "@/utils/auth.js";
   import WebSocketServices from "../../utils/WebSocketServices";
import { getUserInfo } from "@/utils/auth.js";
   import {
       CommonUtils
   } from '@/utils/common'
   export default {
       data() {
           return {
            userInfo:getUserInfo(),
            serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
            vers:uni.getStorageSync('vers'),
            checkCount:0,
             itemData:[{
              img:'../../static/icon00.png',
              text:'待我审核',
              url:'',
              url:'/pages/ZLGL/checkFlowList/QC_CheckBillflowList',
              id:0
           },{
              img:'../../static/icon01.png',
              text:'已审核',
              url:'',
              url:'/pages/ZLGL/checkFlowList/QC_CheckedBillflowList',
              id:1
           },{
              img:'../../static/icon06.png',
@@ -59,12 +64,21 @@
              text:'修改密码',
              url:'/pages/xiugaimima/index',
              id:4
           },
           {
              img:'../../static/icon05.png',
              text:'我的工资(预估)',
              url:'/pages/gongxuOut/moneystatistics',
              id:4
           }
           ]
           }
       },
      onLoad() {
      async onLoad() {
         console.log(this.userInfo)
         await this.cmdSearchFirst()
         await this.cmdSearchLast()
         this.itemData[0].text = `待我审核(${this.checkCount})`
      },
       methods: {
         toUrl(item){
@@ -86,6 +100,10 @@
                success: function (res) {
                    if (res.confirm) {
                        console.log('用户点击确定');
                            // 断开Socket连接
                            // WebSocketServices.closeSocket();
                            // 销毁 userInfo 缓存
                            // uni.removeStorageSync("userinfo")
                     uni.reLaunch({
                        url:'/pages/index/login'
                     })
@@ -94,8 +112,84 @@
                    }
                }
            });
         },
         //获取待审批总数首件
         async cmdSearchFirst() {
             try {
                 let res = await CommonUtils.doRequest2Sync({
                     url: '/LEMS/CheckFlowList',
                     data: {
                         "sWhere": ' ',
                     "billType":8505,
                     "type":2,
                         "userid": getUserInfo()["Czybm"]
                     },
                 })
                 if (!res) {
                     return
                 }
                 let {
                     data,
                     count,
                     Message
                 } = res.data
                 if (count > 0) {
                     this.checkCount += res.data.data.length
                     console.log(res.data.data.length)
                 } else {
                     uni.showToast({
                         icon: 'none',
                         title: Message
                     })
                 }
             } catch (err) {
                 console.warn(err);
                 uni.showToast({
                     title: '接口请求失败:' + err,
                     icon: 'none'
                 })
             }
         },
         //末件全部
         async cmdSearchLast(){
            try {
                let res = await CommonUtils.doRequest2Sync({
                    url: '/LEMS/CheckFlowList',
                    data: {
                        "sWhere": ' ',
                     "billType":8507,
                     "type":2,
                        "userid": getUserInfo()["Czybm"]
                    },
                })
                if (!res) {
                    return
                }
                let {
                    data,
                    count,
                    Message
                } = res.data
                if (count > 0) {
                    this.checkCount += res.data.data.length
                } else {
                    uni.showToast({
                        icon: 'none',
                        title: Message
                    })
                }
            } catch (err) {
                console.warn(err);
                uni.showToast({
                    title: '接口请求失败:' + err,
                    icon: 'none'
                })
            }
         }
       }
      }
   }
</script>