From 8fc09566cc3ee8d0dae10992de31d0f09f257bb4 Mon Sep 17 00:00:00 2001
From: zhang_12370 <z2864490065@outlook.com>
Date: 星期二, 08 七月 2025 17:58:04 +0800
Subject: [PATCH] 1、删除通过审核进入正式库存的采购记录,页面弹出报错信息 2、开发首页模块 3、开发设备领用记录 4、调整生产明细不能为负数 5、修复采购登记人匹配问题

---
 src/store/modules/user.js |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 2c6398f..1ef23e6 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -2,6 +2,7 @@
 import { getToken, setToken, removeToken } from '@/utils/auth'
 import { isHttp, isEmpty } from "@/utils/validate"
 import defAva from '@/assets/images/profile.jpg'
+import {userListAll} from '@/api/publicApi/index.js'
 
 const useUserStore = defineStore(
   'user',
@@ -13,7 +14,8 @@
       nickName: '',
       avatar: '',
       roles: [],
-      permissions: []
+      permissions: [],
+      userList: []
     }),
     actions: {
       // 鐧诲綍
@@ -70,6 +72,20 @@
             reject(error)
           })
         })
+      },
+
+      // 鑾峰彇鐢ㄦ埛鍒楄〃锛堝鏋滃凡缂撳瓨鍒欑洿鎺ヨ繑鍥烇紝鍚﹀垯閲嶆柊鑾峰彇锛�
+      async getUserList () {
+        if (Array.isArray(this.userList) && this.userList.length > 0) {
+          return this.userList;
+        }
+        // 涓虹┖鏃堕噸鏂拌幏鍙�
+        return userListAll().then(res => {
+          this.userList = res.data;
+          return this.userList;
+        }).catch(error => {
+          throw error;
+        });
       }
     }
   })

--
Gitblit v1.9.3