From b114f42bd50a6c971a0cfe6f7b390d7065e98fe2 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期五, 11 七月 2025 15:54:40 +0800
Subject: [PATCH] 添加新增离职时,页面新增入职字段改为新增离职。员工编号改为下拉选择框,选择员工编号后带出人员入职填的信息
---
src/store/modules/user.js | 33 +++++++++++++++++++++++++++++++--
1 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 4b8734c..2dd2797 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -1,4 +1,4 @@
-import { login, logout, getInfo } from '@/api/login'
+import {login, logout, getInfo, loginCheck, loginCheckFactory} from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth'
import { isHttp, isEmpty } from "@/utils/validate"
import defAva from '@/assets/images/profile.jpg'
@@ -50,7 +50,9 @@
this.id = user.userId
this.name = user.userName
this.avatar = avatar
+ this.currentFactoryName = user.currentFactoryName
this.nickName = user.nickName
+ this.currentDeptId = user.currentDeptId
resolve(res)
}).catch(error => {
reject(error)
@@ -70,7 +72,34 @@
reject(error)
})
})
- }
+ },
+ // 鐧诲綍鏍¢獙
+ loginCheck(userInfo) {
+ const username = userInfo.username.trim()
+ const password = userInfo.password
+ return new Promise((resolve, reject) => {
+ loginCheck(username, password).then(res => {
+ resolve(res)
+ }).catch(error => {
+ reject(error)
+ })
+ })
+ },
+ // 閮ㄩ棬鐧诲綍
+ loginCheckFactory(userInfo) {
+ const username = userInfo.username.trim()
+ const password = userInfo.password
+ const factoryId = userInfo.currentFatoryId
+ return new Promise((resolve, reject) => {
+ loginCheckFactory(username, password, factoryId).then(res => {
+ setToken(res.token)
+ this.token = res.token
+ resolve()
+ }).catch(error => {
+ reject(error)
+ })
+ })
+ },
}
})
--
Gitblit v1.9.3