From c586e23d7f75fbfbff0a3114956c721c8b6ebb43 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期五, 11 七月 2025 09:31:42 +0800 Subject: [PATCH] 1.库存管理、销售出库-前端分页修改 2.销售出库,必填优化 --- 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